45 #define rcm_STRESSRELERROR 1.e-5 46 #define rcm_RESIDUALSTIFFFACTOR 1.e-3 72 return mode == _3dMat || mode == _PlaneStress ||
73 mode == _PlaneStrain || mode == _1dMat ||
74 mode == _PlateLayer || mode == _2dBeamLayer;
126 FloatArray princStress, reducedStressVector, reducedAnswer;
127 FloatArray reducedTotalStrainVector, principalStrain, strainVector;
158 answer = reducedAnswer;
177 FloatArray strainIncrement, crackStrainIterativeIncrement;
182 IntArray activatedCracks, crackMapping;
210 & tempCrackDirs, & crackDirs);
219 strainIncrement.
beDifferenceOf(principalStrain, prevPrincipalStrain);
223 gp, tStep, tempCrackDirs);
235 for (
int iter = 1; iter <= 20; iter++ ) {
246 decr.
assemble(fullDecr, crackMapping, crackMapping);
252 dSigma.
assemble(fullDSigma, crackMapping);
256 decr.
solveForRhs(dSigma, crackStrainIterativeIncrement);
257 for (
int i = 1; i <= 3; i++ ) {
258 if ( ( ind = crackMapping.
at(i) ) ) {
259 crackStrainVector.
at(i) += crackStrainIterativeIncrement.
at(ind);
271 for (
int i = 1; i <= 3; i++ ) {
272 if ( crackMapping.
at(i) ) {
293 sigmaEl, sigmaCr, principalStrain);
304 fullDSigma = sigmaEl;
311 dSigma.
assemble(fullDSigma, crackMapping);
326 for (
int i = 1; i <= dSigma.
giveSize(); i++ ) {
327 if ( fabs( dSigma.
at(i) ) > maxErr ) {
328 maxErr = fabs( dSigma.
at(i) );
332 if ( maxErr < rcm_STRESSRELERROR * this->
give(
pscm_Ft, gp) ) {
358 double initStress, Le = 0.0;
359 int upd, activationFlag = 0;
367 localStress = princStressVector;
371 for (
int i = 1; i <= 3; i++ ) {
376 if ( crackMap.
at(i) == 0 && indx.
contains(i) ) {
390 for (
int j = 1; j <= 3; j++ ) {
391 crackPlaneNormal.
at(j) = tempCrackDirs.
at(j, i);
399 if ( localStress.
at(i) > initStress ) {
400 crackStressVector.
at(i) = initStress;
410 if ( activationFlag ) {
458 double minCrackStrainsForFullyOpenCrack;
476 for (
int i = 1; i <= 3; i++ ) {
477 if ( crackMap.
at(i) != 0 && indx.
contains(i) ) {
484 if ( ( crackStrain.
at(i) >= minCrackStrainsForFullyOpenCrack ) &&
496 }
else if ( crackStrain.
at(i) <= 0. ) {
523 for (
int i = 1; i <= 3; i++ ) {
524 if ( crackMap.
at(i) ) {
525 if ( crackStrainVector.
at(i) < 0. ) {
527 crackStrainVector.
at(i) = 0.;
565 for (
int i = 1; i <= 3; i++ ) {
566 for (
int j = 1; j <= 3; j++ ) {
567 fullAnswer.
at(i, j) = de.
at(i, j);
582 for (
int i = 1; i <= 3; i++ ) {
593 for (
int i = 1; i <= sd; i++ ) {
595 for (
int j = 1; j <= sd; j++ ) {
597 if ( iidx && jidx ) {
598 answer.
at(i, j) = fullAnswer.
at(iidx, jidx);
618 int indi, indj, ii, jj;
619 double G, princStressDis, princStrainDis;
620 FloatMatrix de, invDe, compliance, dcr, d, df, t, tempCrackDirs;
621 FloatArray principalStressVector, principalStrainVector;
624 if ( ( rMode == ElasticStiffness ) || ( numberOfActiveCracks == 0 ) ) {
642 for (
int i = 1; i <= 3; i++ ) {
646 for (
int j = 1; j <= 3; j++ ) {
648 compliance.
at(indi, indj) += invDe.
at(i, j);
653 if ( dcr.
at(i, i) <= 1.e-8 ) {
656 compliance.
at(indi, indi) += 1. / dcr.
at(i, i);
670 for (
int i = 4; i <= 6; i++ ) {
675 }
else if ( i == 5 ) {
683 princStressDis = principalStressVector.
at(ii) -
684 principalStressVector.
at(jj);
685 princStrainDis = principalStrainVector.
at(ii) -
686 principalStrainVector.
at(jj);
688 compliance.
at(indi, indi) = 1. / G;
689 }
else if ( fabs(princStressDis) < 1.e-8 ) {
692 compliance.
at(indi, indi) = 2 * princStrainDis / princStressDis;
745 if ( numberOfActiveCracks == 0 ) {
754 for (
int i = 1; i <= 3; i++ ) {
755 if ( crackMap.
at(i) ) {
778 for (
int i = 1; i <= 3; i++ ) {
780 crackMap.
at(i) = indx++;
781 }
else if ( activatedCracks ) {
782 if ( ( activatedCracks->
at(i) != 0 ) ) {
783 crackMap.
at(i) = indx++;
826 if ( aProperty ==
pscm_G ) {
848 if ( type == IST_CrackedFlag ) {
852 }
else if ( type == IST_CrackDirs ) {
855 for (
int i = 1; i <= 3; i++ ) {
856 answer.
at(i) = help.
at(1, i);
857 answer.
at(i + 3) = help.
at(2, i);
858 answer.
at(i + 6) = help.
at(3, i);
862 }
else if ( type == IST_CrackStatuses ) {
865 for (
int i = 1; i <= 3; i++ ) {
866 answer.
at(i) = crackStatus.
at(i);
974 maxCrackStrains(3), tempMaxCrackStrains(3), crackStrainVector(3),
975 oldCrackStrainVector(3), crackDirs(3, 3), tempCrackDirs(3, 3), charLengths(3),
977 principalStrain(3), oldPrincipalStrain(3),
978 principalStress(3), oldPrincipalStress(3), crackMap(3)
980 for (
int i = 1; i <= 3; i++ ) {
1016 fprintf(file,
"status { ");
1018 for ( i = 1; i <= 3; i++ ) {
1027 strcpy(s,
"SOFTENING");
1030 strcpy(s,
"RELOADING");
1033 strcpy(s,
"UNLOADING");
1036 strcpy(s,
"UNKNOWN");
1040 fprintf( file,
"crack %d {status %s, normal to crackplane { %f %f %f }} ",
1045 fprintf(file,
"}\n");
1056 for (
int i = 1; i <= 3; i++ ) {
1074 for (
int i = 1; i <= 3; i++ ) {
1102 for (
int i = 1; i <= 3; i++ ) {
bool contains(int value) const
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
const FloatArray & getPrincipalStrainVector() const
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
static int giveVoigtSymVectorMask(IntArray &answer, MaterialMode mmode)
The same as giveVoigtVectorMask but returns a mask corresponding to a symmetric second order tensor...
void giveNormalElasticStiffnessMatrix(FloatMatrix &answer, bool reduce, MatResponseMode, GaussPoint *, TimeStep *tStep, const FloatMatrix &)
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
For computing principal strains from engineering strains.
virtual double computeStrength(GaussPoint *gp, double)=0
#define _IFT_RCM2Material_gf
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
void letTempCrackDirsBe(FloatMatrix a)
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
double & at(int aKey)
Returns the value of the pair which key is aKey.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
FloatMatrix tempCrackDirs
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.
const IntArray & giveCrackStatus()
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
LinearElasticMaterial * linearElasticMaterial
virtual void giveEffectiveMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
virtual double giveCharacteristicElementLength(GaussPoint *gp, const FloatArray &crackPlaneNormal)
LinearElasticMaterial * giveLinearElasticMaterial()
This class implements a structural material status information.
void clear()
Clears receiver (zero size).
bool includes(int aKey)
Checks if dictionary includes given key.
static void giveFullSymMatrixForm(FloatMatrix &answer, const FloatMatrix &red, MaterialMode matMode)
Converts the full unsymmetric Voigt matrix (4th order tensor) to reduced form.
const IntArray & giveTempCrackStatus()
double giveCrackStrain(int icrack) const
static void sortPrincDirAndValCloseTo(FloatArray *pVal, FloatMatrix *pDir, FloatMatrix *toPDir)
Method for sorting newly computed principal values (pVal) and corresponding principal directions (pDi...
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
#define _IFT_RCM2Material_ft
FloatArray oldCrackStrainVector
Dictionary propertyDictionary
Property dictionary.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void setTempCrackStatus(int icrack, int val)
Element * giveElement()
Returns corresponding element to receiver.
void letCrackMapBe(IntArray map)
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 givePlateLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d plate layer stiffness matrix of receiver.
const FloatArray & givePrevPrincStrainVector() const
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
static void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir, const FloatArray &s, stressStrainPrincMode mode)
Computes principal values and directions of stress or strain vector.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
const FloatMatrix & giveCrackDirs()
contextIOResultType storeYourself(DataStream &stream) const
int giveAlreadyCrack() const
void updateActiveCrackMap(GaussPoint *gp, const IntArray *activatedCracks=NULL)
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.
RCM2MaterialStatus(int n, Domain *d, GaussPoint *g)
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
const FloatArray & getPrincipalStressVector() const
virtual int giveNumberOfActiveCracks() const
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
void setCharLength(int icrack, double val)
FloatArray maxCrackStrains
Max crack strain reached.
void giveCrackedStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
void clear()
Clears the array (zero size).
const IntArray & giveCrackMap() const
FloatArray crackStrainVector
Components of crack strain vector.
This class implements associated Material Status to SmearedCrackingMaterail.
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver 'a' transformed using give transformation matrix r.
contextIOResultType restoreYourself(DataStream &stream)
int maximum() const
Finds the maximum component in the array.
virtual void give2dBeamLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d beam layer stiffness matrix of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
const FloatArray & giveCrackStrainVector() const
virtual void giveMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void resizeWithValues(int s, int allocChunk=0)
Checks size of receiver towards requested bounds.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
int giveTempAlreadyCrack() const
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
virtual ~RCM2MaterialStatus()
void letCrackStrainVectorBe(FloatArray a)
contextIOResultType restoreYourself(DataStream &stream)
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void checkIfClosedCracks(GaussPoint *gp, FloatArray &crackStrainVector, IntArray &)
static void giveStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 3d stress vector transformation matrix from standard vector transformation matrix...
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
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 ...
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
virtual double giveMinCrackStrainsForFullyOpenCrack(GaussPoint *gp, int i)=0
virtual int giveNumberOfTempActiveCracks() const
void giveRealPrincipalStressVector3d(FloatArray &answer, GaussPoint *, FloatArray &, FloatMatrix &, TimeStep *)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void checkForNewActiveCracks(IntArray &answer, GaussPoint *gp, const FloatArray &, const FloatArray &, FloatArray &, const FloatArray &)
void setTempMaxCrackStrain(int icrack, double val)
void add(const FloatMatrix &a)
Adds matrix to the receiver.
RCM2Material(int n, Domain *d)
IntArray tempCrackStatuses
void letPrincipalStressVectorBe(FloatArray pv)
void zero()
Zeroes all coefficients of receiver.
virtual double giveCharacteristicLength(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction, in some cases adjusted (e.g.
FloatArray principalStrain
FloatArray principalStress
FloatArray tempMaxCrackStrains
FloatArray oldPrincipalStrain
FloatArray oldPrincipalStress
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Abstract base class for all "structural" constitutive models.
static void giveInvertedVoigtVectorMask(IntArray &answer, MaterialMode mmode)
Gives the inverted version of giveVoigtVectorMask.
FloatMatrix crackDirs
Storing direction of cracks in columwise format.
void zero()
Zeroes all coefficient of receiver.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
const FloatMatrix & giveTempCrackDirs()
int giveSize() const
Returns the size of receiver.
bool containsOnlyZeroes() const
Returns nonzero if all coefficients of the receiver are 0, else returns zero.
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.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual int isCrackActive(int i) const
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
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...
double giveTempMaxCrackStrain(int icrack)
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
virtual double giveNormalCrackingStress(GaussPoint *gp, double eps_cr, int i)=0
static void transformStressVectorTo(FloatArray &answer, const FloatMatrix &base, const FloatArray &stressVector, bool transpose=false)
Transforms 3d stress vector into another coordinate system.
IntArray crackStatuses
One value from (pscm_NONE, pscm_OPEN, pscm_SOFTENING, pscm_RELOADING, pscm_UNLOADING, pscm_CLOSED.
Class representing integration point in finite element program.
Class representing solution step.
virtual double giveCrackingModulus(MatResponseMode rMode, GaussPoint *gp, double effStrain, int i)
virtual void updateCrackStatus(GaussPoint *gp, const FloatArray &crackStrain)
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
void letPrincipalStrainVectorBe(FloatArray pv)
static void giveReducedSymMatrixForm(FloatMatrix &answer, const FloatMatrix &full, MaterialMode matMode)
Converts the full unsymmetric Voigt matrix (4th order tensor) to reduced form.
void resize(int s)
Resizes receiver towards requested size.
virtual void updateStatusForNewCrack(GaussPoint *, int, double)