40 #include "../sm/CrossSections/structuralcrosssection.h" 45 #define YIELD_TOL 1.e-5 47 #define PLASTIC_MATERIAL_MAX_ITERATIONS 40 73 return mode == _3dMat ||
76 mode == _PlaneStress ||
78 mode == _PlaneStrain ||
79 mode == _PlateLayer ||
80 mode == _2dBeamLayer ||
105 FloatArray fullStressVector, *fullStressSpaceHardeningVars, *residualVectorR;
107 FloatArray strainVectorR, plasticStrainVectorR, *gradientVectorR;
109 double yieldValue, Gamma, dGamma, helpVal1, helpVal2;
110 int strSize, totSize, nIterations = 0;
111 FloatMatrix elasticModuli, hardeningModuli, consistentModuli;
112 FloatMatrix elasticModuliInverse, hardeningModuliInverse;
133 totSize = strSize + strainSpaceHardeningVariables.
giveSize();
140 elasticStrainVectorR.
beDifferenceOf(strainVectorR, plasticStrainVectorR);
144 yieldValue = this->
computeYieldValueAt(gp, & fullStressVector, fullStressSpaceHardeningVars);
147 & strainSpaceHardeningVariables,
152 delete fullStressSpaceHardeningVars;
153 delete gradientVectorR;
154 delete residualVectorR;
161 hardeningModuliInverse.
beInverseOf(hardeningModuli);
163 hardeningModuliInverse.
clear();
167 hardeningModuliInverse, Gamma,
168 fullStressVector, * fullStressSpaceHardeningVars);
174 helpVal1 = helpVec.
at(1);
176 helpVal2 = helpVec.
at(1);
177 dGamma = ( yieldValue - helpVal2 ) / helpVal1;
182 gradientVectorR->
times(dGamma);
183 residualVectorR->
add(* gradientVectorR);
184 helpVec.
beProductOf(consistentModuli, * residualVectorR);
186 this->
computeDiagModuli(helpMtrx, gp, elasticModuliInverse, hardeningModuliInverse);
190 for (
int i = 1; i <= strSize; i++ ) {
191 plasticStrainVectorR.
at(i) += helpVec2.
at(i);
194 for (
int i = strSize + 1; i <= totSize; i++ ) {
195 strainSpaceHardeningVariables.
at(i - strSize) += helpVec2.
at(i);
204 delete fullStressSpaceHardeningVars;
205 delete gradientVectorR;
206 delete residualVectorR;
209 OOFEM_WARNING(
"local equlibrium not reached in %d iterations\nElement %d, gp %d, continuing",
258 FloatArray *stressSpaceHardVarGradient, *answer;
262 fullStressSpaceHardeningVars);
269 if ( stressSpaceHardVarGradient ) {
270 size = isize + stressSpaceHardVarGradient->giveSize();
276 for (
int i = 1; i <= isize; i++ ) {
277 answer->
at(i) = stressGradientR.
at(i);
280 for (
int i = isize + 1; i <= size; i++ ) {
281 answer->
at(i) = stressSpaceHardVarGradient->at(i - isize);
284 delete stressSpaceHardVarGradient;
285 delete stressGradient;
299 FloatArray oldPlasticStrainVectorR, oldStrainSpaceHardeningVariables;
304 isize = plasticStrainVectorR->
giveSize();
311 for (
int i = 1; i <= isize; i++ ) {
312 answer->
at(i) = oldPlasticStrainVectorR.
at(i) - plasticStrainVectorR->
at(i) + Gamma *gradientVectorR->
at(i);
315 for (
int i = isize + 1; i <= size; i++ ) {
316 answer->
at(i) = oldStrainSpaceHardeningVariables.
at(i - isize) - strainSpaceHardeningVariables->
at(i - isize) + Gamma *gradientVectorR->
at(i);
330 OOFEM_ERROR(
"Unable to compute trial stress increment");
341 const FloatArray &fullStressSpaceHardeningVars)
361 fullStressSpaceHardeningVars);
364 helpInverse.
resize(size, size);
366 for (
int i = 1; i <= isize; i++ ) {
367 for (
int j = 1; j <= isize; j++ ) {
368 helpInverse.
at(i, j) = elasticModuliInverse.
at(i, j) + Gamma *gradientMatrix.
at(i, j);
371 for (
int j = isize + 1; j <= size; j++ ) {
372 helpInverse.
at(i, j) = Gamma * gradientMatrix.
at(i, j);
376 for (
int i = isize + 1; i <= size; i++ ) {
377 for (
int j = 1; j <= isize; j++ ) {
378 helpInverse.
at(i, j) = Gamma * gradientMatrix.
at(i, j);
381 for (
int j = isize + 1; j <= size; j++ ) {
382 helpInverse.
at(i, j) = hardeningModuliInverse.
at(i - isize, j - isize) + Gamma *gradientMatrix.
at(i, j);
402 FloatMatrix consistentModuli, elasticModuli, hardeningModuli;
403 FloatMatrix elasticModuliInverse, hardeningModuliInverse;
405 FloatArray *gradientVector, stressVector, fullStressVector;
407 FloatArray strainSpaceHardeningVariables, helpVector;
418 answer = elasticModuli;
433 hardeningModuliInverse.
beInverseOf(hardeningModuli);
435 hardeningModuliInverse.
clear();
444 elasticModuliInverse,
445 hardeningModuliInverse,
448 * stressSpaceHardeningVars);
451 helpVector.
beProductOf(consistentModuli, * gradientVector);
452 s = ( -1. ) * gradientVector->
dotProduct(helpVector);
457 helpVector.
beProductOf(consistentSubModuli, * gradientVector);
459 for (
int i = 1; i <= sizeR; i++ ) {
460 for (
int j = 1; j <= sizeR; j++ ) {
461 answerR.
at(i, j) += ( 1. / s ) * helpVector.
at(i) * helpVector.
at(j);
465 delete gradientVector;
466 delete stressSpaceHardeningVars;
488 answer.
resize(size2, size2);
491 for (
int i = 1; i <= size1; i++ ) {
492 for (
int j = 1; j <= size1; j++ ) {
493 answer.
at(i, j) = elasticModuliInverse.
at(i, j);
497 for (
int i = size1 + 1; i <= size2; i++ ) {
498 for (
int j = size1 + 1; j <= size2; j++ ) {
499 answer.
at(i, j) = hardeningModuliInverse.
at(i - size1, j - size1);
540 if ( originalMode != _3dMat ) {
541 OOFEM_ERROR(
"Different stressStrain mode encountered");
552 if ( mode == ElasticStiffness ) {
574 if ( mode == ElasticStiffness ) {
594 if ( mode == ElasticStiffness ) {
612 if ( mode == ElasticStiffness ) {
633 if ( mode == ElasticStiffness ) {
654 if ( mode == ElasticStiffness ) {
675 if ( mode == ElasticStiffness ) {
687 if ( type == IST_PlasticStrainTensor ) {
692 }
else if ( type == IST_PrincipalPlasticStrainTensor ) {
709 strainSpaceHardeningVarsVector(statusSize), tempStrainSpaceHardeningVarsVector(statusSize)
724 fprintf(file,
"status { ");
727 fprintf(file,
" Yielding, ");
729 fprintf(file,
" Unloading, ");
732 fprintf(file,
" plastic strains ");
734 fprintf( file,
" %.4e", val );
738 fprintf(file,
", strain space hardening vars ");
740 fprintf( file,
" %.4e", val );
745 fprintf(file,
"}\n");
877 printf(
"Entering PlasticMaterialStatus :: copyAddVariables().\n");
882 printf(
"I am a PlasticMaterialStatus. plasticStrainVector: \n");
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
static void computePrincipalValues(FloatArray &answer, const FloatArray &s, stressStrainPrincMode mode)
Common functions for convenience.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
void initFromVector(const FloatArray &vector, bool transposed)
Assigns to receiver one column or one row matrix containing vector.
virtual int hasHardening()
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
GaussPoint * gp
Associated integration point.
virtual FloatArray * ComputeStressSpaceHardeningVars(GaussPoint *gp, FloatArray *strainSpaceHardeningVariables)
For computing principal strains from engineering strains.
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual ~PlasticMaterial()
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.
void beSubMatrixOf(const FloatMatrix &src, int topRow, int bottomRow, int topCol, int bottomCol)
Assigns to the receiver the sub-matrix of another matrix.
This class implements a structural material status information.
PlasticMaterialStatus(int n, Domain *d, GaussPoint *g, int statusSize)
virtual void computeTrialStressIncrement(FloatArray &answer, GaussPoint *gp, const FloatArray &strainIncrement, TimeStep *tStep)
void computeDiagModuli(FloatMatrix &answer, GaussPoint *gp, FloatMatrix &elasticModuliInverse, FloatMatrix &hardeningModuliInverse)
Element * giveElement()
Returns corresponding element to receiver.
void letTempStateFlagBe(int v)
FloatArray plasticStrainVector
Plastic strain vector (reduced form).
virtual double computeYieldValueAt(GaussPoint *gp, FloatArray *stressVector, FloatArray *stressSpaceHardeningVars)
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
Method for subtracting from reduced space strain vector its stress-independent parts (caused by tempe...
MaterialMode
Type representing material mode of integration point.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
virtual ~PlasticMaterialStatus()
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
static void giveFullSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the reduced unsymmetric Voigt vector (2nd order tensor) to full form.
FloatArray * ComputeGradientVector(GaussPoint *gp, FloatArray *fullStressVector, FloatArray *fullStressSpaceHardeningVars)
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
virtual FloatArray * ComputeStressSpaceHardeningVarsReducedGradient(GaussPoint *gp, FloatArray *stressVector, FloatArray *stressSpaceHardeningVars)
virtual FloatArray * ComputeStressGradient(GaussPoint *gp, FloatArray *stressVector, FloatArray *stressSpaceHardeningVars)
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
PlasticMaterial(int n, Domain *d)
LinearElasticMaterial * linearElasticMaterial
Reference to bulk (undamaged) material.
FloatArray tempStrainSpaceHardeningVarsVector
int giveNumber()
Returns number of receiver.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
contextIOResultType restoreYourself(DataStream &stream)
virtual void giveFiberStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d fiber stiffness matrix of receiver.
FloatArray * ComputeResidualVector(GaussPoint *gp, double Gamma, FloatArray *plasticStrainVectorR, FloatArray *strainSpaceHardeningVariables, FloatArray *gradientVectorR)
virtual void computeReducedElasticModuli(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
void computeConsistentModuli(FloatMatrix &answer, GaussPoint *gp, FloatMatrix &elasticModuliInverse, FloatMatrix &hardeningModuliInverse, double Gamma, const FloatArray &fullStressVector, const FloatArray &fullStressSpaceHardeningVars)
#define PLASTIC_MATERIAL_MAX_ITERATIONS
FloatArray tempPlasticStrainVector
double at(int i, int j) const
Coefficient access function.
double gamma
Plastic consistency parameter.
LinearElasticMaterial * giveLinearElasticMaterial()
Returns reference to undamaged (bulk) material.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
void letTempStrainSpaceHardeningVarsVectorBe(FloatArray v)
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
const FloatArray & giveTempPlasticStrainVector() const
double giveTempPlasticConsistencyPrameter() const
Abstract base class representing a material status information.
double givePlasticConsistencyPrameter() const
void letTempPlasticStrainVectorBe(FloatArray v)
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
void letTempPlasticConsistencyPrameterBe(double v)
virtual void giveConsistentStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
virtual void givePlateLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d plate layer stiffness matrix of receiver.
friend class PlasticMaterialStatus
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void computeReducedGradientMatrix(FloatMatrix &answer, GaussPoint *gp, const FloatArray &stressVector, const FloatArray &stressSpaceHardeningVars)=0
virtual void printYourself() const
Print receiver on stdout.
const FloatArray & givePlasticStrainVector() const
void zero()
Zeroes all coefficients of receiver.
virtual int giveSizeOfReducedHardeningVarsVector(GaussPoint *) const
void times(double s)
Multiplies receiver with scalar.
FloatArray strainSpaceHardeningVarsVector
Strain space hardening variables.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Abstract base class for all "structural" constitutive models.
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
virtual void give2dBeamLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d beam layer stiffness matrix of receiver.
This class implements associated Material Status to PlasticMaterial.
virtual void addStateVariables(const MaterialStatus &iStatus)
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver's temporary stress vector.
int giveSize() const
Returns the size of receiver.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
int state_flag
Yield function status indicator.
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.
const FloatArray & givetempStrainSpaceHardeningVarsVector() const
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
int giveTempStateFlag() const
const FloatArray & giveStrainSpaceHardeningVars() const
virtual void printYourself()
Prints receiver state on stdout. Useful for debugging.
int giveNumberOfRows() const
Returns number of rows of receiver.
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
int giveStateFlag() const
virtual void computeHardeningReducedModuli(FloatMatrix &answer, GaussPoint *gp, FloatArray *strainSpaceHardeningVariables, TimeStep *tStep)=0
void resize(int s)
Resizes receiver towards requested size.