void FAGeneral::initializeEvents(){ Groups::iterator g_it,g_it_next; Group *g=0,*g_next; Event e; Action a; Events::iterator e_it; double lambda; if(verbose){ Rprintf("Started initializing Events.\n"); } // generate the first list of events for(g_it=myGroups.begin(),g_it_next=myGroups.begin(),g_it_next++; g_it_next!=myGroups.end(); g_it++,g_it_next++){ g = *g_it; g_next=*g_it_next; // calculate initial events list from intersection of all adjacent lambda= getlambda(g, g_next); if(lambda>0){ a = Action(g_it,'F'); e = Event(lambda,a); e_it = events.insert(e); g->nextFusionUp = e_it; } // check split only if group size > 1, size groupe < maxsizegroup and not last group. if (((int)g->grps.size()>1)&&((int)g->grps.size() <= mxSplitSize)&&((int)myGroups.size() !=1)){ MxFlowCheck(0, g_it,true); // mxflow for split checking } } }
double CC_Ev::H(const PlasticFlow& plastic_flow, const stresstensor& Stre, const straintensor& Stra, const MaterialParameter& material_parameter) { // this is \bar{p_0} // Make sure f = Q = q*q - M*M*p*(po - p) = 0 double p0 = getp0(material_parameter); double lambda = getlambda(material_parameter); double kappa = getkappa(material_parameter); double e0 = gete0(material_parameter); double e = e0 + (1.0 + e0) *Stra.Iinvariant1(); //// One way //straintensor PF = plastic_flow.PlasticFlowTensor(Stre, Stra, material_parameter); //double d_Ev = - PF.Iinvariant1(); // note "minus" // Another way double M = getM(material_parameter); double p = Stre.p_hydrostatic(); // double d_Ev = -M*M*(p0-2.0*p); // Zhao's version // double d_Ev = (-1.0)*M*M*(p0 - 2.0*p); // Mahdi and Boris 27April2007 double d_Ev = M*M*(2.0*p - p0); return (1.0 + e) * p0 * d_Ev / (lambda - kappa); }
double CC_Ev::DH_Diso(const PlasticFlow& plastic_flow, const stresstensor& Stre, const straintensor& Stra, const MaterialParameter& material_parameter) { // this is d \bar{p_0} / d p_0 double M = getM(material_parameter); double p0 = getp0(material_parameter); double lambda = getlambda(material_parameter); double kappa = getkappa(material_parameter); double e0 = gete0(material_parameter); double e = e0 + (1.0 + e0) *Stra.Iinvariant1(); double p = Stre.p_hydrostatic(); // double scalar1 = (1.0+e)*p0*M*M*(p0-p)/(lambda-kappa); // Zhao's version double scalar1 = (-2.0)*(1.0+e)*p0*M*M*(p0-p)/(lambda-kappa); // Mahdi return scalar1; }
const tensor& CC_Ev::DH_Ds(const PlasticFlow& plastic_flow, const stresstensor& Stre, const straintensor& Stra, const MaterialParameter& material_parameter) { // this is d \bar{p_0} / d sigma_ij tensor I2("I", 2, def_dim_2); double M = getM(material_parameter); double p0 = getp0(material_parameter); double lambda = getlambda(material_parameter); double kappa = getkappa(material_parameter); double e0 = gete0(material_parameter); double e = e0 + (1.0 + e0) *Stra.Iinvariant1(); double scalar1 = (1.0+e)*p0*M*M*(-2.0/3.0)/(lambda-kappa); ScalarEvolution::SE_tensorR2 = I2 * scalar1; return ScalarEvolution::SE_tensorR2; }
double XC::EvolutionLaw_NL_Ep::h_s( EPState *EPS, PotentialSurface *PS){ //========================================================================= // Getting de_eq / dLambda XC::stresstensor dQods = PS->dQods( EPS ); //dQods.reportshort("dQods"); //Evaluate the norm of the deviator of dQods //temp1 = dQods("ij")*dQods("ij"); double dQods_p = dQods.p_hydrostatic(); double de_podL = dQods_p; //Evaluating dSodeeq double po = EPS->getScalarVar( 1 ); double dSodep = (1.0+geteo())*po/( getlambda()-getkappa() ); double h = dSodep * de_podL; return h; }
// used for adding/deleting previous and next joining events void FAGeneral::insert_new_merge_event(Group *newg, Group *neighbor_group,Groups::iterator g_it_down, Group *g_down){ // print_events(); if(g_down->nextFusionUp != NullEvent){ events.erase(g_down->nextFusionUp); // erase the event that will not happen } Group *g_up = *g_it_down; Events::iterator new_event; Action a = Action(g_it_down,'F'); Event e=Event(getlambda(neighbor_group,newg),a); if(newg->lambda - e.first <= epsilon){ // 2 things : new lambda >= old lambda and add a treshold to prevent round up errors new_event = events.insert(e); }else{ new_event=NullEvent; } g_up->nextFusionUp = new_event; // contains the lambda for which the group is fusing the one on top of him }
const straintensor& SANISAND_alpha_Eij::Hij(const PlasticFlow& plastic_flow, const stresstensor& Stre, const straintensor& Stra, const MaterialParameter& material_parameter) { // const double rt23 = sqrt(2.0/3.0); // stresstensor a_a_in; // double a_in = 0.0; double e0 = gete0(material_parameter); double e_r = gete_r(material_parameter); double lambda = getlambda(material_parameter); double xi = getxi(material_parameter); double Pat = getPat(material_parameter); double alpha_cc = getalpha_cc(material_parameter); double c = getc(material_parameter); double nb = getnb(material_parameter); double h0 = geth0(material_parameter); double ch = getch(material_parameter); double G0 = getG0(material_parameter); double m = getm(material_parameter); stresstensor alpha = getalpha(material_parameter); stresstensor n; stresstensor s_bar; double norm_s = 0.0; double r_ef = 0.0; double cos3theta = 0.0; double g = 0.0; double ec = e_r; double e = e0; double psi = 0.0; double alpha_b_c = 0.0; stresstensor alpha_b_tensor; stresstensor b_ref; stresstensor temp_tensor; double lower = 0.0; double h = G0*h0; double p = Stre.p_hydrostatic(); stresstensor s = Stre.deviator(); s_bar = s - (alpha *p); norm_s = sqrt( (s_bar("ij")*s_bar("ij")).trace() ); if (p > 0.0 && norm_s > 0.0) { n = s_bar * (1.0/norm_s); r_ef = rt32 * norm_s / p; cos3theta = -3.0 * sqrt(6.0) * n.Jinvariant3(); } if (p <= 0.0) cos3theta = 1.0; if (cos3theta > 1.0) cos3theta = 1.0; if (cos3theta < -1.0) cos3theta = -1.0; g = getg(c, cos3theta); if ( p >= 0.0 ) ec = getec(e_r, lambda, xi, Pat, p); e = e0 + (1.0 + e0) * Stra.Iinvariant1(); psi = e - ec; alpha_b_c = alpha_cc * exp(-nb*psi); alpha_b_tensor = n * (rt23 * g * alpha_b_c); b_ref = n * rt23 * alpha_b_c * (1.0+c); // b_ref = n * rt23 * alpha_cc * (1.0+c); // Method 1 temp_tensor = b_ref - (alpha_b_tensor - alpha); //// Method 2, better to use this when "p" is small //temp_tensor = b_ref - (alpha_b_tensor - s*(1.0/p)); lower = rt32*(temp_tensor("ij")*n("ij")).trace(); if ( lower>0 ) h = G0 * h0 * (1-ch*e) * sqrt(Pat/p) / (lower*lower); // h = G0 * h0 * (1-ch*e) * sqrt(Pat/p); // h = h0; // Method 1 temp_tensor = alpha_b_tensor - alpha; // Method 2 //temp_tensor = alpha_b_tensor+n*m - s*(1.0/p); TensorEvolution::TensorEvolutionHij = temp_tensor * (h*r_ef); return TensorEvolution::TensorEvolutionHij; }