MPMBase::MPMBase(int elem,int theMatl,double angin) { int i; inElem=elem; mp=-1.; // calculated in PreliminaryCalcs, unless set in input file matnum=theMatl; SetAnglez0InDegrees(angin); SetAngley0InDegrees(0.0); SetAnglex0InDegrees(0.0); // space to hold velocity fields // these only change if there are cracks vfld = (char *)malloc(maxShapeNodes*sizeof(char)); for(i=1; i<maxShapeNodes; i++) vfld[i]=NO_CRACK; // zero stresses and strains ZeroTensor(&sp); pressure = 0.; ZeroTensor(&ep); ZeroTensor(&eplast); ZeroTensorAntisym(&wrot); ZeroVector(&acc); // zero energies plastEnergy=0.; dispEnergy=0.; workEnergy=0.; resEnergy=0.; heatEnergy=0.; entropy=0; // for J integral if needed (on non-rigid only) velGrad=NULL; // material data is needed matData=NULL; // concentration (c units) and gradient (c units/mm) pConcentration=0.; pDiffusion=NULL; // temperature (degrees) and gradient (degrees/mm) SetTemperature(0.,0.); pTemp=NULL; // CPDI data cpdi = NULL; faceArea = NULL; // PS - when point created, velocity and position and ext force should be set too ZeroVector(&vel); // counts crossing and sign is whether or not left the grid elementCrossings=0; // rotation matrix (when tracked) Rtot = NULL; }
// Set intial particle Left Cauchy strain tensor to identity void HyperElastic::SetInitialParticleState(MPMBase *mptr,int np) const { // get previous particle B Tensor *pB = mptr->GetAltStrainTensor(); ZeroTensor(pB); pB->xx = pB->yy = pB->zz = 1.; MaterialBase::SetInitialParticleState(mptr,np); }
// When becomes active update J, set B elastic, set pressure, and zero deviatorix stress void TaitLiquid::BeginActivePhase(MPMBase *mptr,int np,int historyOffset) const { double J = mptr->GetRelativeVolume(); mptr->SetHistoryDble(J_History,J,historyOffset); #ifdef ELASTIC_B_MODEL double Jres = mptr->GetHistoryDble(J_History+1,historyOffset); double Jeff = J/Jres; // store pressure strain as elastic B // no need here, will happen in next time step // new Kirchhoff pressure (over rho0) from Tait equation double pressure = J*TAIT_C*Ksp*(exp((1.-Jeff)/TAIT_C)-1.); mptr->SetPressure(pressure); // set deviatoric stress to zero ZeroTensor(mptr->GetStressTensor()); #endif }