40 #include "../sm/Elements/structuralelement.h" 128 if ( damage == 0. ) {
139 if ( matMode != _PlaneStress ) {
140 OOFEM_ERROR(
"Stress-based nonlocal averaging is implemented for plane stress only");
181 double epsx = strainFloatArray.
at(1);
182 double epsy = strainFloatArray.
at(2);
183 double gamxy = strainFloatArray.
at(3);
185 if ( epsx == 0. && epsy == 0. && gamxy == 0. ) {
189 double aux = sqrt( ( epsx - epsy ) * ( epsx - epsy ) + gamxy * gamxy );
190 double e1 = epsx + epsy + aux;
191 double e2 = epsx + epsy - aux;
193 double s1 = e1 + nu *
e2;
194 double s2 = e2 + nu *
e1;
200 }
else if ( s2 <= 0. ) {
209 aux = nx * nx + ny * ny;
213 aux = nx * nx + ny * ny;
229 if ( this->
px > 0. ) {
244 double x1 = nx * distance.
at(1) + ny *distance.
at(2);
245 double x2 = -ny *distance.
at(1) + nx *distance.
at(2);
247 double gamma = this->
beta + ( 1. -
beta ) * ratio * ratio;
249 double modDistance = sqrt(x1 * x1 + x2 * x2);
254 return updatedWeight;
262 double updatedWeight = 0.;
267 for ( ix = -nper; ix <= nper; ix++ ) {
269 distance.
at(1) += ix *
px;
273 double x1 = nx * distance.
at(1) + ny *distance.
at(2);
274 double x2 = -ny *distance.
at(1) + nx *distance.
at(2);
276 double gamma = this->
beta + ( 1. -
beta ) * ratio * ratio;
278 double modDistance = sqrt(x1 * x1 + x2 * x2);
282 if ( updatedWeightContribution > 0. ) {
284 updatedWeight += updatedWeightContribution;
287 return updatedWeight;
293 double nonlocalContribution, nonlocalEquivalentStrain = 0.0;
304 double sigmaRatio = 0.;
306 double updatedIntegrationVolume = 0.;
317 for (
auto &lir : *list ) {
323 updatedIntegrationVolume += stressBasedWeight;
324 nonlocalContribution *= stressBasedWeight;
326 nonlocalContribution *= lir.weight;
329 nonlocalEquivalentStrain += nonlocalContribution;
334 nonlocalEquivalentStrain /= updatedIntegrationVolume;
340 nonlocalEquivalentStrain *= 1. / scale;
351 if ( localEquivalentStrain > 0. && nonlocalEquivalentStrain > 0. ) {
352 nonlocalEquivalentStrain = 1. / (
mm / nonlocalEquivalentStrain + ( 1. -
mm ) / localEquivalentStrain );
354 nonlocalEquivalentStrain = 0.;
357 nonlocalEquivalentStrain = -
mm * nonlocalEquivalentStrain + ( 1. +
mm ) * localEquivalentStrain;
363 kappa = nonlocalEquivalentStrain;
411 omega = kappa / ( 1. + kappa );
438 for (
auto &lir : *list ) {
439 rmat =
dynamic_cast< IDNLMaterial *
>( lir.nearGp->giveMaterial() );
466 std :: vector< localIntegrationRecord > *
480 if ( type == IST_LocalEquivalentStrain ) {
498 double f, equivStrain;
510 if ( ( equivStrain <= e0 ) || ( f < 0.0 ) ) {
517 EASValsSetFillStyle(FILL_SOLID);
526 for (
auto &lir : *list ) {
527 rmat =
dynamic_cast< IDNLMaterial *
>( lir.nearGp->giveMaterial() );
536 for (
int i = 1; i <= n; i++ ) {
537 if ( loc.
at(i) == 0 ) {
541 for (
int j = 1; j <= m; j++ ) {
542 if ( rloc.
at(j) == 0 ) {
547 p [ 0 ].x = ( FPNum ) loc.
at(i) - 0.5;
548 p [ 0 ].y = ( FPNum ) rloc.
at(j) - 0.5;
550 p [ 1 ].x = ( FPNum ) loc.
at(i) + 0.5;
551 p [ 1 ].y = ( FPNum ) rloc.
at(j) - 0.5;
553 p [ 2 ].x = ( FPNum ) loc.
at(i) + 0.5;
554 p [ 2 ].y = ( FPNum ) rloc.
at(j) + 0.5;
556 p [ 3 ].x = ( FPNum ) loc.
at(i) - 0.5;
557 p [ 3 ].y = ( FPNum ) rloc.
at(j) + 0.5;
559 go = CreateQuad3D(p);
560 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
561 EMAddGraphicsToModel(ESIModel(), go);
563 p [ 0 ].x = ( FPNum ) loc.
at(i);
564 p [ 0 ].y = ( FPNum ) rloc.
at(j);
567 EASValsSetMType(SQUARE_MARKER);
568 go = CreateMarker3D(p);
569 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
570 EMAddGraphicsToModel(ESIModel(), go);
586 double sum, f, equivStrain;
608 if ( ( equivStrain <= e0 ) || ( f < 0.0 ) ) {
637 f = ( e0 / ( equivStrain * equivStrain ) ) * exp( -( equivStrain - e0 ) / ( ef - e0 ) )
638 + ( e0 / equivStrain ) * exp( -( equivStrain - e0 ) / ( ef -
e0 ) ) * 1.0 / ( ef -
e0 );
643 for (
int i = 1; i <= nrows; i++ ) {
645 for (
int j = 1; j <= nsize; j++ ) {
646 sum += b.
at(j, i) * stress.
at(j);
649 lcontrib.
at(i) = sum * f;
665 double coeff = 0.0, sum;
669 FloatArray stress, fullStress, strain, principalStress, help, nu;
684 principalStress = fullStress;
691 int indx = 0, zeroFlag = 1;
693 for (
int i = 1; i <= 3; i++ ) {
694 if ( fabs( principalStress.
at(i) ) > 1.e-10 ) {
698 if ( princDir.at(3, i) > 0.90 ) {
704 for (
int i = 1; i <= 3; i++ ) {
705 swap = princDir.at(i, indx);
706 princDir.at(i, indx) = princDir.at(i, 3);
707 princDir.at(i, 3) = swap;
710 swap = principalStress.
at(indx);
711 principalStress.
at(indx) = principalStress.
at(3);
712 principalStress.
at(3) = swap;
713 }
else if ( zeroFlag == 0 ) {
722 for (
int i = 1; i <= 3; i++ ) {
723 if ( principalStress.
at(i) > 0.0 ) {
724 sum += principalStress.
at(i) * principalStress.
at(i);
728 if ( sum > 1.e-15 ) {
729 coeff = 1. / ( lmat->
give(
'E', gp) * sqrt(sum) );
743 for (
int i = 1; i <= principalStress.
giveSize(); i++ ) {
744 principalStress.
at(i) =
max(principalStress.
at(i), 0.0);
751 for ( i = 1; i <= 3; i++ ) {
752 fullHelp.
at(i) = help.
at(i);
756 fullNu.beProductOf(t, fullHelp);
758 crossSection->giveReducedCharacteristicVector(nu, gp, fullNu);
776 fullPrincStress.
zero();
777 for (
int i = 1; i <= 3; i++ ) {
778 fullPrincStress.
at(i) = principalStress.
at(i);
795 coeff = 1.0 / ( lmat->
give(
'E', gp) * equivStrain );
804 for (
int i = 1; i <= ncols; i++ ) {
806 for (
int j = 1; j <= nsize; j++ ) {
807 sum += nu.
at(j) * b.
at(j, i);
810 rcontrib.
at(i) = sum * coeff;
832 for (
int i = 1; i <= 3; i++ ) {
833 for (
int j = 1; j <= 3; j++ ) {
834 answer.
at(i, j) = de.
at(i, j);
855 fprintf(file,
"status { ");
856 if ( this->
damage > 0.0 ) {
857 fprintf(file,
"nonloc-kappa %f, damage %f ", this->
kappa, this->
damage);
859 #ifdef keep_track_of_dissipated_energy 862 fprintf(file,
"stressW %f ", this->
stressWork);
866 fprintf(file,
"}\n");
945 this->buildNonlocalPointTable(ip);
946 this->updateDomainBeforeNonlocAverage(tStep);
958 result = buff.
read(localEquivalentStrainForAverage);
994 cost *= ( 1.0 + size / 15.0 );
double damageFunction(double kappa, GaussPoint *gp)
Returns the value of damage parameter corresponding to a given value of the damage-driving variable k...
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Abstract base class for all nonlocal structural materials.
double giveDamage()
Returns the last equilibrated damage level.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
int giveNumberOfColumns() const
Returns number of columns of receiver.
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
double beta
Parameter which multiplied with the interaction radius cl0 gives its minimum allowed value...
void updateDomainBeforeNonlocAverage(TimeStep *tStep)
Updates data in all integration points before nonlocal average takes place.
This class implements associated Material Status to IDNLMaterial (Nonlocal isotropic damage)...
#define OOFEG_SPARSE_PROFILE_WIDTH
void modifyNonlocalWeightFunctionAround(GaussPoint *gp)
Recompute the nonlocal interaction weights based on the current solution (e.g., on the damage field)...
GaussPoint * gp
Associated integration point.
void endIPNonlocalAverage(GaussPoint *gp)
Notifies the receiver, that the nonlocal averaging has been finished for given ip.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
Assembles sparse matrix from contribution of local elements.
void setLocalEquivalentStrainForAverage(double ls)
Sets the localEquivalentStrainForAverage to given value.
For computing principal stresses.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Base class for all matrices stored in sparse format.
double kappa
Scalar measure of the largest strain level ever reached in material.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
AveragedVarType averagedVar
Parameter specifying the type of averaged (nonlocal) variable.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
double damage
Damage level of material.
virtual int unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip)
Unpack and updates all necessary data of given integration point (according to element parallel_mode)...
The class representing the general material model adaptive mapping interface.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
double computeStressBasedWeightForPeriodicCell(double &nx, double &ny, double &ratio, GaussPoint *gp, GaussPoint *jGp)
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
NlVariationType nlvar
Parameter specifying the type of nonlocal variation.
#define OOFEG_SPARSE_PROFILE_LAYER
virtual Interface * giveInterface(InterfaceType)
Interface requesting service.
void buildNonlocalPointTable(GaussPoint *gp)
Builds list of integration points which take part in nonlocal average in given integration point...
Element * giveElement()
Returns corresponding element to receiver.
ScalingType scaling
Parameter specifying the type of scaling of nonlocal weight function.
std::vector< localIntegrationRecord > * giveIntegrationDomainList()
Returns integration list of receiver.
double complianceFunction(double kappa, GaussPoint *gp)
Returns the value of compliance parameter corresponding to a given value of the damage-driving variab...
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
This class implements associated Material Status to IsotropicDamageMaterial1.
MaterialMode
Type representing material mode of integration point.
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...
virtual int packUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *ip)
Pack all necessary data of integration point (according to element parallel_mode) into given communic...
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
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.
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.
double ef
Determines ductility -> corresponds to fracturing strain.
void giveRemoteNonlocalStiffnessContribution(GaussPoint *gp, IntArray &rloc, const UnknownNumberingScheme &s, FloatArray &rcontrib, TimeStep *tStep)
Computes the "remote" part of nonlocal stiffness contribution assembled for given integration point...
double weight
Integration weight.
This class is a abstract base class for all linear elastic material models in a finite element proble...
virtual int estimatePackSize(DataStream &buff, GaussPoint *ip)
Estimates the necessary pack size to hold all packed data of receiver.
double giveLocalEquivalentStrainForAverage()
Returns the local equivalent strain to be averaged.
static void giveFullSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the reduced unsymmetric Voigt vector (2nd order tensor) to full form.
EquivStrainType equivStrainType
Parameter specifying the definition of equivalent strain.
IRResultType initializeFrom(InputRecord *ir)
int averType
Parameter specifying how the weight function should be adjusted due to damage.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
virtual void NonlocalMaterialStiffnessInterface_showSparseMtrxStructure(GaussPoint *gp, oofegGraphicContext &gc, TimeStep *tStep)
Plots the sparse structure of stiffness contribution.
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
Abstract base class for all "structural" finite elements.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
double localEquivalentStrainForAverage
Equivalent strain for averaging.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
double computeStressBasedWeight(double &nx, double &ny, double &ratio, GaussPoint *gp, GaussPoint *jGp, double weight)
Function used to compute the new weight based on stress-based averaging.
double stressWork
Density of total work done by stresses on strain increments.
double px
Parameter specifying the periodic shift in x-direction.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void clear()
Clears the array (zero size).
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Class Nonlocal Material Stiffness Interface.
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 ...
int giveLocalNonlocalStiffnessContribution(GaussPoint *gp, IntArray &loc, const UnknownNumberingScheme &s, FloatArray &lcontrib, TimeStep *tStep)
Computes the "local" part of nonlocal stiffness contribution assembled for given integration point...
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
std::vector< localIntegrationRecord > * giveIPIntegrationList(GaussPoint *gp)
Returns integration list corresponding to given integration point.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
IDNLMaterial(int n, Domain *d)
Constructor.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
void computeAngleAndSigmaRatio(double &nx, double &ny, double &ratio, GaussPoint *gp, bool &flag)
Function used in the Stress based nonlocal variation.In this function the ratio of the first two eige...
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
virtual void computeEquivalentStrain(double &kappa, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
Computes the equivalent strain measure from given strain vector (full form).
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
LinearElasticMaterial * giveLinearElasticMaterial()
Returns reference to undamaged (bulk) material.
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.
void computeLocalEquivalentStrain(double &kappa, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
double giveTempKappa()
Returns the temp. scalar measure of the largest strain level.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual std::vector< localIntegrationRecord > * NonlocalMaterialStiffnessInterface_giveIntegrationDomainList(GaussPoint *gp)
Returns integration list of receiver.
Class representing vector of real numbers.
double e1
Parameters used if softType = 7 (extended smooth damage law)
Implementation of matrix containing floating point numbers.
virtual double giveNonlocalMetricModifierAt(GaussPoint *gp)
Compute the factor that specifies how the interaction length should be modified (by eikonal nonlocal ...
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual int givePackSizeOfDouble(int count)=0
virtual void NonlocalMaterialStiffnessInterface_addIPContribution(SparseMtrx &dest, const UnknownNumberingScheme &s, GaussPoint *gp, TimeStep *tStep)
Computes and adds IP contributions to destination matrix.
static void giveStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 3d stress vector transformation matrix from standard vector transformation matrix...
double mm
For "undernonlocal" or "overnonlocal" formulation.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
virtual ~IDNLMaterial()
Destructor.
double giveTempDamage()
Returns the temp. damage level.
double e0
Equivalent strain at stress peak (or a similar parameter).
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Base class for all nonlocal structural material statuses.
int getSparseProfileMode()
void zero()
Zeroes all coefficients of receiver.
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)=0
Computes the geometrical matrix of receiver in given integration point.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
This class implements a Nonlocal Isotropic Damage Model for Concrete in Tension Model based on nonloc...
This class implements a simple local isotropic damage model for concrete in tension.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
InterfaceType
Enumerative type, used to identify interface type.
double giveIntegrationScale()
Returns associated integration scale.
REGISTER_Material(DummyMaterial)
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void giveNormalElasticStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes elastic stiffness for normal stress components.
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...
virtual void updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep)
Declares the service updating local variables in given integration points, which take part in nonloca...
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
EPixel getExtendedSparseProfileColor()
virtual void computeDamageParam(double &omega, double kappa, const FloatArray &strain, GaussPoint *gp)
Computes the value of damage parameter omega, based on given value of equivalent strain.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
double dissWork
Density of dissipated work.
virtual double predictRelativeComputationalCost(GaussPoint *gp)
Returns the weight representing relative computational cost of receiver The reference material model ...
Class representing integration point in finite element program.
Class representing solution step.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
virtual ~IDNLMaterialStatus()
Destructor.
virtual double computeWeightFunction(double distance)
Evaluates the basic nonlocal weight function for a given distance between interacting points...
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
void giveInputRecord(DynamicInputRecord &input)
Stores receiver in an input record.
void resize(int s)
Resizes receiver towards requested size.
IDNLMaterialStatus(int n, Domain *d, GaussPoint *g)
Constructor.