39 #include "../sm/Materials/structuralms.h" 42 #include "../sm/Materials/structuralmaterial.h" 54 plasticStrainDeviator( 6 ),
55 tempPlasticStrainDeviator( 6 )
101 fprintf(file,
"\tstatus { ");
106 fprintf(file,
" Elastic, ");
109 fprintf(file,
" Yielding, ");
112 fprintf(file,
" Vertex_return, ");
115 fprintf(file,
" Unloading, ");
123 fprintf(file,
"plasticStrains ");
124 for (
auto &val : plasticStrainVector ) {
125 fprintf( file,
" %.4e", val );
128 fprintf(file,
"}\n");
130 fprintf(file,
"\t\thardening_parameter ");
132 fprintf(file,
" %.4e\n",
kappa);
222 if ( result !=
IRRT_OK )
return result;
226 if ( result !=
IRRT_OK )
return result;
252 OOFEM_WARNING(
"Choose hardeningType 1 (linear hardening/softening), 2 (exponential hardening/softening) in input file!");
303 double volumetricStrain;
307 double gM = eM / ( 2. * ( 1. + nu ) );
308 double kM = eM / ( 3. * ( 1. - 2. * nu ) );
313 double volumetricElasticTrialStrain =
316 FloatArray elasticStrainDeviator = strainDeviator;
317 elasticStrainDeviator.
subtract(plasticStrainDeviator);
321 double volumetricStress = 3. * kM * volumetricElasticTrialStrain;
328 double tempKappa = kappa;
336 tempKappa, volumetricElasticTrialStrain, kappa);
361 plasticStrainDeviator = strainDeviator;
362 plasticStrainDeviator.
subtract(elasticStrainDeviator);
373 double deltaLambdaMax = sqrt(trialStressJTwo) / gM;
377 double volConstant = 3. * kM *
alphaPsi;
380 0., tempKappa +
kFactor * deltaLambdaMax, eM);
381 if ( yieldValue / eM > -
yieldTol ) {
393 double deltaLambdaMax = sqrt(trialStressJTwo) / gM;
396 double volConstant = 3. * kM *
alphaPsi;
397 double devConstant = sqrt(2.) * gM;
399 double yieldValuePrimeZero = -9. *
alpha * alphaPsi * kM - gM;
402 flowDir.
times( 1. / sqrt(2. * trialStressJTwo) );
406 double yieldValuePrime;
411 int iterationCount = 0;
412 double deltaLambda = 0.;
413 double deltaLambdaIncrement = 0.;
414 double yieldValue =
computeYieldValue(volumetricStress, trialStressJTwo, tempKappa, eM);
415 double newtonError = fabs(yieldValue / eM);
420 OOFEM_ERROR(
"Newton iteration for deltaLambda (regular stress return) did not converge after newtonIter iterations. You might want to try increasing the optional parameter newtoniter or yieldtol in the material record of your input file.");
424 deltaLambdaIncrement = -yieldValue / yieldValuePrime;
430 if ( deltaLambda + deltaLambdaIncrement > deltaLambdaMax ) {
431 OOFEM_LOG_DEBUG(
"Special case in Newton-iteration for regular return. This may cause loss of quadratic convergence.\n");
432 deltaLambdaIncrement = deltaLambdaMax - deltaLambda;
435 deltaLambda += deltaLambdaIncrement;
436 tempKappa +=
kFactor * deltaLambdaIncrement;
437 volumetricStress -= volConstant * deltaLambdaIncrement;
443 stressDeviator.
add(-devConstant * deltaLambdaIncrement, flowDir);
446 newtonError = fabs(yieldValue / eM);
450 OOFEM_LOG_DEBUG(
"IterationCount in regular return = %d\n", iterationCount);
452 if ( deltaLambda < 0. ) {
453 OOFEM_ERROR(
"Fatal error in the Newton iteration for regular stress return. deltaLambda is evaluated as negative, but should always be positive. This is most likely due to a softening law with local snapback, which is physically inadmissible.n");
462 double yieldValuePrimeZero = 3. *
alpha;
464 double deviatorContribution = trialStressJTwo / 3. / gM / gM;
466 stressDeviator.
zero();
467 volumetricStress = 3. * kM * volumetricElasticTrialStrain;
470 double yieldValuePrime;
473 int iterationCount = 0;
474 double deltaVolumetricStress = 0.;
475 double deltaVolumetricStressIncrement = 0.;
476 double deltaKappa = sqrt(deviatorContribution);
477 tempKappa = kappa + deltaKappa;
479 double newtonError = fabs(yieldValue / eM);
484 OOFEM_ERROR(
"Newton iteration for deltaLambda (vertex stress return) did not converge after newtonIter iterations. You might want to try increasing the optional parameter newtoniter or yieldtol in the material record of your input file.");
488 if ( deltaKappa == 0. ) {
489 yieldValuePrime = yieldValuePrimeZero
492 yieldValuePrime = yieldValuePrimeZero
494 * deltaVolumetricStress / deltaKappa;
497 deltaVolumetricStressIncrement = -yieldValue / yieldValuePrime;
498 deltaVolumetricStress += deltaVolumetricStressIncrement;
499 volumetricStress += deltaVolumetricStressIncrement;
500 deltaKappa = sqrt(2. / 9. / kM / kM * deltaVolumetricStress * deltaVolumetricStress
501 + deviatorContribution);
502 tempKappa = kappa + deltaKappa;
504 newtonError = fabs(yieldValue / eM);
505 OOFEM_LOG_DEBUG(
"NewtonError in iteration %d in vertex return = %e\n", iterationCount, newtonError);
508 OOFEM_LOG_DEBUG(
"Done iteration in vertex return, after %d\n", iterationCount);
510 if ( deltaKappa < 0. ) {
511 OOFEM_ERROR(
"Fatal error in the Newton iteration for vertex stress return. deltaKappa is evaluated as negative, but should always be positive. This is most likely due to a softening law with a local snapback, which is physically inadmissible.");
531 if ( yieldStress < 0. ) {
543 OOFEM_ERROR(
"Case failed: choose linear hardening/softening (1), exponential hardening/softening (2) in input file.");
571 OOFEM_ERROR(
"Case failed: choose linear hardening/softening (1), exponential hardening/softening (2) in input file.");
585 case ElasticStiffness:
589 case SecantStiffness:
594 case TangentStiffness:
595 switch ( ( static_cast< DruckerPragerPlasticitySMStatus * >( this->
giveStatus(gp) ) )
596 ->giveTempStateFlag() ) {
619 OOFEM_ERROR(
"Switch failed: Only elastic and tangent stiffness are supported.");
641 double gM = eM / ( 2. * ( 1. + nu ) );
642 double kM = eM / ( 3. * ( 1. - 2. * nu ) );
647 flowDir.
times(1. / normOfStress);
651 double deltaKappa = tempKappa - kappa;
652 double deltaLambdaStar = sqrt(2.) * gM * deltaKappa /
kFactor / normOfStress;
657 OOFEM_ERROR(
"computeYieldStressPrime is zero. This happens mainly due to excessive softening.");
660 double a_const = 1. + deltaLambdaStar;
661 double b_const = 3. *
alpha *
alphaPsi * kM / hStar - deltaLambdaStar / 3.;
662 double c_const = 3. * sqrt(2.) *
alphaPsi * kM / 2. / hStar;
663 double d_const = sqrt(2.) *
alpha * gM / hStar;
664 double e_const = gM / hStar - deltaLambdaStar;
668 for ( i = 1; i < 7; i++ ) {
669 A_Matrix.
at(i, i) = a_const;
672 for ( i = 1; i < 4; i++ ) {
673 for ( j = 1; j < 4; j++ ) {
674 A_Matrix.
at(i, j) += b_const;
678 for ( i = 1; i < 4; i++ ) {
679 for ( j = 1; j < 4; j++ ) {
680 A_Matrix.
at(i, j) += c_const * flowDir.
at(j);
683 for ( j = 4; j < 7; j++ ) {
684 A_Matrix.
at(i, j) += 2. *c_const *flowDir.
at(j);
688 for ( i = 1; i < 7; i++ ) {
689 for ( j = 1; j < 4; j++ ) {
690 A_Matrix.
at(i, j) += d_const * flowDir.
at(i);
694 for ( i = 1; i < 7; i++ ) {
695 for ( j = 1; j < 4; j++ ) {
696 A_Matrix.
at(i, j) += e_const * flowDir.
at(i) * flowDir.
at(j);
700 for ( j = 4; j < 7; j++ ) {
701 A_Matrix.
at(i, j) += 2. *e_const *flowDir.
at(i) * flowDir.
at(j);
722 double deltaKappa = tempKappa - status->
giveKappa();
727 double kM = eM / ( 3. * ( 1. - 2. * nu ) );
729 if ( deltaKappa <= 0. ) {
735 double deltaVolumetricPlasticStrain =
743 FloatArray elasticStrainDeviator = strainDeviator;
747 kM * HBar / ( HBar * deltaVolumetricPlasticStrain + 9. / 2. *
alpha * kM * deltaKappa );
749 if ( ( HBar * deltaVolumetricPlasticStrain + 9. / 2. *
alpha * kM * deltaKappa ) == 0. ) {
756 for (
int i = 1; i < 4; i++ ) {
757 for (
int j = 1; j < 4; j++ ) {
758 answer.
at(i, j) = deltaVolumetricPlasticStrain;
762 for (
int i = 1; i < 4; i++ ) {
763 for (
int j = 1; j < 4; j++ ) {
764 answer.
at(i, j) += elasticStrainDeviator.at(j);
767 for (
int j = 4; j < 7; j++ ) {
768 answer.
at(i, j) += .5 * elasticStrainDeviator.at(j);
772 answer.
times(a_const);
785 case IST_PlasticStrainTensor:
789 case IST_DamageTensor:
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
#define _IFT_DruckerPragerPlasticitySM_alphapsi
Dilatancy coefficient.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
double yieldTol
Yield tolerance.
static void applyDeviatoricElasticCompliance(FloatArray &strain, const FloatArray &stress, double EModulus, double nu)
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
int newtonIter
Maximum number of iterations for stress return.
FloatArray tempStrainVector
Temporary strain vector in reduced form (to find balanced state)
static void computeDeviatoricVolumetricSum(FloatArray &s, const FloatArray &dev, double mean)
const FloatArray & givePlasticStrainDeviator() const
Get the plastic strain deviator from the material status.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
double & at(int i)
Coefficient access function.
FloatArray tempPlasticStrainDeviator
This class implements a structural material status information.
#define _IFT_DruckerPragerPlasticitySM_hm
FloatArray stressVector
Equilibrated stress vector in reduced form.
#define _IFT_DruckerPragerPlasticitySM_newtoniter
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
DruckerPragerPlasticitySM(int n, Domain *d)
Constructor.
void giveRegAlgorithmicStiffMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Compute and give back algorithmic stiffness matrix for the regular case (no vertex).
void performRegularReturn(double eM, double gM, double kM, double trialStressJTwo, FloatArray &stressDeviator, double &volumetricStress, double &tempKappa)
Perform stress return for regular case, i.e.
virtual ~DruckerPragerPlasticitySMStatus()
Destructor.
virtual double computeYieldStressPrime(double kappa, double eM) const
Compute derivative of yield stress with respect to the hardening variable kappa.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
double tempVolumetricPlasticStrain
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
#define OOFEM_LOG_DEBUG(...)
double giveTempVolumetricPlasticStrain() const
Get the temp value of the volumetric strain deviator from the material status.
MatResponseMode
Describes the character of characteristic material matrix.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
double limitYieldStress
Parameter of the exponential hardening law.
virtual ~DruckerPragerPlasticitySM()
Destructor.
double giveVolumetricPlasticStrain() const
Get the volumetric plastic strain from the material status.
double kappa
Hardening variable.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_DruckerPragerPlasticitySM_iys
Initial yield stress under pure shear.
double computeYieldValue(double meanStress, double JTwo, double kappa, double eM) const
Compute the yield value based on stress and hardening variable.
double kappaC
Parameter of the exponential laws.
#define _IFT_DruckerPragerPlasticitySM_ht
This class implements an isotropic linear elastic material in a finite element problem.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
FloatArray plasticStrainDeviator
Deviatoric of plastic strain.
void letTempPlasticStrainDeviatorBe(const FloatArray &v)
Assign the temp value of deviatoric plastic strain.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
virtual double computeYieldStressInShear(double kappa, double eM) const
Compute the current yield stress in pure shear of the Drucker-Prager model according to the used hard...
void times(double f)
Multiplies receiver by factor f.
#define _IFT_DruckerPragerPlasticitySM_lys
void performLocalStressReturn(GaussPoint *gp, const FloatArray &strain)
Perform a standard local stress return using the function computeYieldValue at the specified Gauss po...
contextIOResultType restoreYourself(DataStream &stream)
void giveStressDependentPartOfStrainVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
#define _IFT_DruckerPragerPlasticitySM_alpha
Friction coefficient.
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
double giveTempKappa() const
Get the temp value of the hardening variable from the material status.
void giveVertexAlgorithmicStiffMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Compute consistent stiffness matrix for the vertex case.
double at(int i, int j) const
Coefficient access function.
This class implements the material status associated to DruckerPragerPlasticitySM.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
void givePlasticStrainVector(FloatArray &answer) const
Get the full plastic strain vector from the material status.
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &strainVector, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
Abstract base class representing a material status information.
Class representing vector of real numbers.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
IsotropicLinearElasticMaterial * LEMaterial
Associated linear elastic material.
double hardeningModulus
Hardening modulus normalized with the elastic modulus, parameter of the linear hardening/softening la...
void letTempStateFlagBe(int v)
Assign the temp value of the state flag.
FloatArray strainVector
Equilibrated strain vector in reduced form.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void performVertexReturn(double eM, double gM, double kM, double trialStressJTwo, FloatArray &stressDeviator, double &volumetricStress, double &tempKappa, double volumetricElasticTrialStrain, double kappa)
Perform stress return for vertex case, i.e.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
int hardeningType
Controls the hardening function in the yield stress: 1: linear hardening/softening with cutoff at zer...
double alpha
Friction coefficient, parameter of the yield criterion.
double kFactor
Scalar factor between rate of plastic multiplier and rate of hardening variable.
static void applyDeviatoricElasticStiffness(FloatArray &stress, const FloatArray &strain, double EModulus, double nu)
DruckerPragerPlasticitySMStatus(int n, Domain *d, GaussPoint *gp)
Constructor.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
static double computeSecondStressInvariant(const FloatArray &s)
int giveStateFlag() const
Get the state flag from the material status.
bool checkForVertexCase(double eM, double gM, double kM, double trialStressJTwo, double volumetricStress, double tempKappa)
Check if the trial stress state falls within the vertex region.
virtual double predictRelativeComputationalCost(GaussPoint *gp)
Returns the weight representing relative computational cost of receiver The reference material model ...
void letTempKappaBe(double v)
Assign the temp value of the hardening variable.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
static double computeDeviatoricVolumetricSplit(FloatArray &dev, const FloatArray &s)
Computes split of receiver into deviatoric and volumetric part.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Abstract base class for all "structural" constitutive models.
double volumetricPlasticStrain
Volumetric plastic strain.
void zero()
Zeroes all coefficient of receiver.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Domain * giveDomain() const
double alphaPsi
Dilatancy coefficient, parameter of the flow rule.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
#define _IFT_DruckerPragerPlasticitySM_yieldtol
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
REGISTER_Material(DummyMaterial)
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver's temporary stress vector.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void letTempVolumetricPlasticStrainBe(double v)
Assign the temp value of volumetric plastic strain.
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatArray tempStressVector
Temporary stress vector in reduced form (increments are used mainly in nonlinear analysis) ...
double initialYieldStress
Parameter of all three laws, this is the initial value of the yield stress in pure shear...
#define _IFT_DruckerPragerPlasticitySM_kc
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
double giveKappa() const
Get the hardening variable from the material status.
int state_flag
Indicates the state (i.e. elastic, yielding, vertex, unloading) of the Gauss point.
void resize(int s)
Resizes receiver towards requested size.
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.