60 return mode == _3dLattice;
66 return exp( pow(kappa / this->
ef, 2.) );
72 return 2. * kappa / ( pow(this->
ef, 2.) ) * exp( pow(kappa / this->
ef, 2.) );
103std::unique_ptr<MaterialStatus>
116 double shift = this->
fc * hardening - paramA;
142 double dShiftDKappa = this->
fc * dHardeningDKappa - dParamADKappa;
157 double dParamADKappa = dA1DKappa / A2;
159 return dParamADKappa;
181 double tempKappa = status->giveTempKappaP();
184 auto tempPlasticStrain = status->giveTempPlasticLatticeStrain() [ { 0, 1, 2 } ];
189 auto stress =
mult(tangent, strain - tempPlasticStrain);
195 int transitionFlag = 0;
203 if ( yieldValue < this->
yieldTol && stress.at(1) < transition - this->yieldTol ) {
210 if ( transitionFlag == 0 ) {
211 error = yieldValue /
fc;
213 error = yieldValue / pow(
fc, 2.);
221 int subIncrementFlag = 0;
222 double subIncrementCounter = 1;
223 auto convergedStrain = oldStrain;
224 auto tempStrain = strain;
225 auto deltaStrain = strain - oldStrain;
229 stress =
mult(tangent, tempStrain - tempPlasticStrain);
230 tempKappa =
performRegularReturn(stress, returnResult, surfaceType, yieldValue, transitionFlag, gp);
233 subIncrementFlag = 1;
236 subIncrementCounter *= 2;
242 tempStrain = convergedStrain + deltaStrain;
243 }
else if ( returnResult ==
RR_Converged && subIncrementFlag == 1 ) {
244 tempPlasticStrain.at(1) = tempStrain.at(1) - stress.at(1) /
eNormalMean;
245 tempPlasticStrain.at(2) = tempStrain.at(2) - stress.at(2) / ( this->
alphaOne *
eNormalMean );
246 tempPlasticStrain.at(3) = tempStrain.at(3) - stress.at(3) / ( this->
alphaOne *
eNormalMean );
248 status->letTempPlasticLatticeStrainBe(
assemble< 6 >(tempPlasticStrain, { 0, 1, 2 }) );
250 status->setTempKappaP(tempKappa);
252 subIncrementCounter -= 1;
254 convergedStrain = tempStrain;
255 deltaStrain = strain - convergedStrain;
256 auto deltaStrainIncrement = deltaStrain * ( 1. / subIncrementCounter );
257 tempStrain = convergedStrain + deltaStrainIncrement;
258 if ( subIncrementCounter > 1 ) {
259 subIncrementFlag = 1;
261 subIncrementFlag = 0;
264 }
else if ( returnResult ==
RR_Elastic && subIncrementFlag == 1 ) {
265 convergedStrain = tempStrain;
266 deltaStrain = strain - convergedStrain;
267 auto deltaStrainIncrement = deltaStrain * ( 1. / subIncrementCounter );
268 tempStrain = convergedStrain + deltaStrainIncrement;
269 if ( subIncrementCounter > 1 ) {
270 subIncrementFlag = 1;
272 subIncrementFlag = 0;
275 }
else if ( returnResult ==
RR_Converged && subIncrementFlag == 0 ) {
276 status->setTempKappaP(tempKappa);
282 tempPlasticStrain.at(1) = strain.
at(1) - stress.at(1) /
eNormalMean;
286 status->letTempPlasticLatticeStrainBe(
assemble< 6 >(tempPlasticStrain, { 0, 1, 2 }) );
287 status->letTempLatticeStressBe(
assemble< 6 >(stress, { 0, 1, 2 }) );
288 status->setSurfaceValue(surfaceType);
301 if ( type == IST_PlasticLatticeStrain ) {
302 answer = status->givePlasticLatticeStrain();
319 double deltaLambda = 0.;
321 auto trialStress = stress;
322 auto tempStress = trialStress;
324 double trialShearStressNorm =
norm(trialStress [ { 1, 2 } ]);
325 double tempShearStressNorm = trialShearStressNorm;
327 auto plasticStrain = status->givePlasticLatticeStrain() [ { 0, 1, 2 } ];
328 auto tempPlasticStrain = plasticStrain;
330 double thetaTrial = atan2( stress.
at(3), stress.
at(2) );
333 double kappa = status->giveTempKappaP();
334 double tempKappa = kappa;
339 unknowns.
at(1) = trialStress.at(1);
340 unknowns.
at(2) = trialShearStressNorm;
341 unknowns.
at(3) = tempKappa;
348 residuals.
at(4) = yieldValue;
350 double normOfResiduals = this->
yieldTol * 2 + 1.;
352 int iterationCount = 0;
353 while ( normOfResiduals > this->
yieldTol ) {
361 residualsNorm.
at(1) = residuals.
at(1) / this->
fc;
362 residualsNorm.
at(2) = residuals.
at(2) / this->
fc;
363 residualsNorm.
at(3) = residuals.
at(3);
364 if ( transitionFlag == 0 ) {
365 residualsNorm.
at(4) = residuals.
at(4) / this->
fc;
367 residualsNorm.
at(4) = residuals.
at(4) / pow(this->
fc, 2.);
370 normOfResiduals =
norm(residualsNorm);
372 if ( std::isnan(normOfResiduals) ) {
377 if ( normOfResiduals > this->
yieldTol ) {
378 auto jacobian =
computeJacobian(tempStress, tempKappa, deltaLambda, transitionFlag, gp);
381 if ( solution.first ) {
382 unknowns -= solution.second;
388 unknowns.
at(2) =
max(unknowns.
at(2), 0.);
389 unknowns.
at(3) =
max(unknowns.
at(3), kappa);
390 unknowns.
at(4) =
max(unknowns.
at(4), 0.);
393 tempStress.at(1) = unknowns.
at(1);
394 tempShearStressNorm = unknowns.
at(2);
395 tempStress.at(2) = tempShearStressNorm * cos(thetaTrial);
396 tempStress.at(3) = tempShearStressNorm * sin(thetaTrial);
397 tempKappa = unknowns.
at(3);
398 deltaLambda = unknowns.
at(4);
401 auto mVector =
computeMVector(tempStress, tempKappa, transitionFlag, gp);
403 residuals.
at(1) = tempStress.at(1) - trialStress.at(1) + this->
eNormalMean * deltaLambda * mVector.at(1);
404 residuals.
at(2) = tempShearStressNorm - trialShearStressNorm + this->
alphaOne * this->
eNormalMean * deltaLambda * mVector.at(2);
405 residuals.
at(3) = -tempKappa + kappa + deltaLambda * mVector.at(3);
410 if ( transitionFlag == 0 ) {
412 if ( tempStress.at(1) < transition - this->yieldTol ) {
416 tempStress = trialStress;
417 tempShearStressNorm =
norm(trialStress [ { 1, 2 } ]);
419 unknowns.
at(1) = trialStress.at(1);
420 unknowns.
at(2) = trialShearStressNorm;
421 unknowns.
at(3) = tempKappa;
428 tempPlasticStrain = plasticStrain;
434 }
else if ( transitionFlag == 1 ) {
435 if ( tempStress.at(1) > transition + this->yieldTol ) {
455 const double deltaLambda,
465 jacobian.
at(1, 1) = 1. + this->
eNormalMean * deltaLambda * dMMatrix.at(1, 1);
466 jacobian.
at(1, 2) = this->
eNormalMean * deltaLambda * dMMatrix.at(1, 2);
467 jacobian.
at(1, 3) = this->
eNormalMean * deltaLambda * dMMatrix.at(1, 3);
475 jacobian.
at(3, 1) = deltaLambda * dMMatrix.at(3, 1);
476 jacobian.
at(3, 2) = deltaLambda * dMMatrix.at(3, 2);
477 jacobian.
at(3, 3) = deltaLambda * dMMatrix.at(3, 3) - 1.;
478 jacobian.
at(3, 4) = mVector.at(3);
480 jacobian.
at(4, 1) = fVector.at(1);
481 jacobian.
at(4, 2) = fVector.at(2);
482 jacobian.
at(4, 3) = fVector.at(3);
483 jacobian.
at(4, 4) = 0.;
492 const int transitionFlag,
498 double shearNorm =
norm(stress [ { 1, 2 } ]);
500 if ( transitionFlag == 0 ) {
524 const int transitionFlag,
527 double shearNorm =
norm(stress [ { 1, 2 } ]);
536 if ( transitionFlag == 0 ) {
542 f.
at(2) = 2. * shearNorm;
554 const int transitionFlag,
557 double shearNorm =
norm(stress [ { 1, 2 } ]);
562 if ( transitionFlag == 0 ) {
569 m.
at(2) = 2. * shearNorm;
570 if ( stress.
at(1) < -shift - this->yieldTol ) {
571 m.
at(3) = fabs( m.
at(1) );
584 const int transitionFlag,
591 if ( transitionFlag == 0 ) {
606 if ( stress.
at(1) < -shift - this->yieldTol ) {
607 dm.
at(3, 1) = 1. / mVector.at(3) * mVector.at(1) * dm.
at(1, 1);
609 dm.
at(3, 3) = 1. / mVector.at(3) * ( mVector.at(1) * dm.
at(1, 3) );
611 dm.
at(3, 1) = dm.
at(3, 2) = dm.
at(3, 3) = 0.;
621 const double deltaLambda,
622 const int transitionFlag,
628 a.
at(1, 1) = 1 / this->
eNormalMean + deltaLambda * dMMatrix.at(1, 1);
629 a.
at(1, 2) = deltaLambda * dMMatrix.at(1, 2);
630 a.
at(1, 3) = deltaLambda * dMMatrix.at(1, 3);
632 a.
at(2, 1) = deltaLambda * dMMatrix.at(2, 1);
634 a.
at(2, 3) = deltaLambda * dMMatrix.at(2, 3);
636 a.
at(3, 1) = deltaLambda * dMMatrix.at(3, 1);
637 a.
at(3, 2) = deltaLambda * dMMatrix.at(3, 2);
638 a.
at(3, 3) = deltaLambda * dMMatrix.at(3, 3) - 1.;
646 double shearNorm =
norm(stress [ { 1, 2 } ]);
651 ratio = this->
alphaOne * stress.
at(1) / shearNorm;
655 if ( stress.
at(1) > 0 && this->flowAngle < ratio ) {
668 double shearStressNorm =
norm(stress [ { 1, 2 } ]);
671 double deltaKappa = pow(stress.
at(1) / this->eNormalMean, 2.) + pow(shearStressNorm / ( this->
alphaOne * this->
eNormalMean ), 2.);
673 double tempKappa = kappa + deltaKappa;
677 status->setTempKappaP(tempKappa);
687 auto reducedStrain = originalStrain;
689 if ( thermalStrain.giveSize() ) {
697 stress.at(5) = reducedStrain.at(5) * this->
alphaTwo * this->eNormalMean;
698 stress.at(6) = reducedStrain.at(6) * this->
alphaTwo * this->eNormalMean;
700 status->letTempLatticeStrainBe(originalStrain);
701 status->letTempReducedLatticeStrainBe(reducedStrain);
702 status->letTempLatticeStressBe(stress);
724 fprintf(file,
"status { ");
725 fprintf(file,
"plasticStrains ");
727 fprintf(file,
"% .8e ", s);
730 fprintf(file,
"\n \t");
732 fprintf(file,
"}\n");
#define REGISTER_Material(class)
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double & at(std::size_t i)
double at(std::size_t i, std::size_t j) const
GaussPoint * gp
Associated integration point.
void printOutputAt(FILE *file, TimeStep *tStep) const override
Print receiver's output to given stream.
void saveContext(DataStream &stream, ContextMode mode) override
void initTempStatus() override
void restoreContext(DataStream &stream, ContextMode mode) override
double giveKappaP() const
Returns the last equilibrated scalar measure of the largest strain level.
void updateYourself(TimeStep *) override
LatticeBondPlasticityStatus(int n, Domain *d, GaussPoint *g)
Constructor.
bool hasMaterialModeCapability(MaterialMode mode) const override
double performRegularReturn(FloatArrayF< 3 > &stress, LatticeBondPlasticity_ReturnResult &returnResult, LatticeBondPlasticity_SurfaceType &surfaceType, double yieldValue, int transitionFlag, GaussPoint *gp) const
std::unique_ptr< MaterialStatus > CreateStatus(GaussPoint *gp) const override
FloatArrayF< 6 > giveLatticeStress3d(const FloatArrayF< 6 > &jump, GaussPoint *gp, TimeStep *tStep) override
double computeDHardeningDKappa(double kappa) const
FloatMatrixF< 3, 3 > computeAMatrix(const FloatArrayF< 3 > &sigma, const double tempKappa, const double deltaLambda, int transitionFlag, GaussPoint *gp) const
LatticeBondPlasticity(int n, Domain *d)
Constructor.
bool checkForVertexCase(FloatArrayF< 3 > &stress, GaussPoint *gp) const
LatticeBondPlasticity_ReturnResult
FloatArrayF< 3 > computeMVector(const FloatArrayF< 3 > &sigma, const double kappa, int transitionFlag, GaussPoint *gp) const
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *atTime) override
LatticeBondPlasticity_SurfaceType
double yieldTol
yield tolerance
FloatMatrixF< 3, 3 > computeDMMatrix(const FloatArrayF< 3 > &sigma, const double deltaLambda, int transitionFlag, GaussPoint *gp) const
virtual FloatArrayF< 6 > giveReducedStrain(GaussPoint *gp, TimeStep *tStep) const
void initializeFrom(InputRecord &ir) override
double computeDParamADKappa(const double kappa) const
FloatMatrixF< 4, 4 > computeJacobian(const FloatArrayF< 3 > &sigma, const double tempKappa, const double deltaLambda, int transitionFlag, GaussPoint *gp) const
double computeYieldValue(const FloatArrayF< 3 > &sigma, const double tempKappa, int transitionFlag, GaussPoint *gp) const
FloatArrayF< 3 > performPlasticityReturn(GaussPoint *gp, const FloatArrayF< 3 > &totalStrain, TimeStep *) const
double frictionAngleOne
frictional angle of the yield surface
double fc
compressive strength
FloatArrayF< 3 > computeFVector(const FloatArrayF< 3 > &sigma, const double kappa, int transitionFlag, GaussPoint *gp) const
double computeShift(const double kappa) const
double computeTransition(const double kappa, GaussPoint *gp) const
double computeParamA(const double kappa) const
int numberOfSubIncrements
maximum number of subincrements
int newtonIter
maximum number of iterations for stress return
double computeHardening(double kappa) const
double computeDShiftDKappa(const double kappa) const
void performVertexReturn(FloatArrayF< 3 > &stress, GaussPoint *gp) const
LatticeLinearElastic(int n, Domain *d)
double alphaOne
Ratio of shear and normal modulus.
double alphaTwo
Ratio of torsion and normal modulus.
void initializeFrom(InputRecord &ir) override
double eNormalMean
Normal modulus.
MaterialStatus * giveStatus(GaussPoint *gp) const override
void saveContext(DataStream &stream, ContextMode mode) override
FloatArrayF< 6 > plasticLatticeStrain
Equilibriated plastic lattice strain.
const FloatArrayF< 6 > & giveReducedLatticeStrain() const
Returns reduced lattice strain.
LatticeMaterialStatus(GaussPoint *g)
void initTempStatus() override
void updateYourself(TimeStep *) override
void restoreContext(DataStream &stream, ContextMode mode) override
void printOutputAt(FILE *file, TimeStep *tStep) const override
Print receiver's output to given stream.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
virtual FloatArray computeStressIndependentStrainVector(GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
#define _IFT_LatticeBondPlasticity_fc
#define _IFT_LatticeBondPlasticity_ef
#define _IFT_LatticeBondPlasticity_sub
#define _IFT_LatticeBondPlasticity_iter
#define _IFT_LatticeBondPlasticity_angle1
#define _IFT_LatticeBondPlasticity_tol
double norm(const FloatArray &x)
std::pair< bool, FloatArrayF< N > > solve_check(FloatMatrixF< N, N > mtrx, const FloatArrayF< N > &b, double zeropiv=1e-20)
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatArrayF< N > mult(const FloatArrayF< N > &x, const FloatArrayF< N > &y)
Element-wise multiplication.
FloatArrayF< N > zeros()
For more readable code.
@ CIO_IOERR
General IO error.