60IDNLMaterial :: IDNLMaterial(
int n,
Domain *d) :
118IDNLMaterial :: giveNonlocalMetricModifierAt(
GaussPoint *gp)
const
122 if ( damage == 0. ) {
123 damage = status->giveDamage();
129IDNLMaterial :: computeAngleAndSigmaRatio(
double &nx,
double &ny,
double &ratio,
GaussPoint *gp,
bool &flag)
const
133 if ( matMode != _PlaneStress ) {
134 OOFEM_ERROR(
"Stress-based nonlocal averaging is implemented for plane stress only");
138 FloatArray strainFloatArray = status->giveTempStrainVector();
175 double epsx = strainFloatArray.
at(1);
176 double epsy = strainFloatArray.
at(2);
177 double gamxy = strainFloatArray.
at(3);
179 if ( epsx == 0. && epsy == 0. && gamxy == 0. ) {
183 double aux = sqrt( ( epsx - epsy ) * ( epsx - epsy ) + gamxy * gamxy );
184 double e1 = epsx + epsy + aux;
185 double e2 = epsx + epsy - aux;
188 double s2 =
e2 + nu *
e1;
194 }
else if ( s2 <= 0. ) {
203 aux = nx * nx + ny * ny;
207 aux = nx * nx + ny * ny;
220IDNLMaterial :: computeStressBasedWeight(
double cl,
double &nx,
double &ny,
double &ratio,
GaussPoint *gp,
GaussPoint *jGp,
double weight)
const
223 if ( this->
px > 0. ) {
241 double gamma = this->
beta + ( 1. -
beta ) * ratio * ratio;
243 double modDistance = sqrt(x1 * x1 + x2 * x2);
248 return updatedWeight;
254IDNLMaterial :: computeStressBasedWeightForPeriodicCell(
double cl,
double &nx,
double &ny,
double &ratio,
GaussPoint *gp,
GaussPoint *jGp)
const
256 double updatedWeight = 0.;
261 for ( ix = -nper; ix <= nper; ix++ ) {
270 double gamma = this->
beta + ( 1. -
beta ) * ratio * ratio;
272 double modDistance = sqrt(x1 * x1 + x2 * x2);
276 if ( updatedWeightContribution > 0. ) {
278 updatedWeight += updatedWeightContribution;
281 return updatedWeight;
287 double nonlocalContribution, nonlocalEquivalentStrain = 0.0;
298 double sigmaRatio = 0.;
300 double updatedIntegrationVolume = 0.;
311 for (
auto &lir : *list ) {
318 updatedIntegrationVolume += stressBasedWeight;
319 nonlocalContribution *= stressBasedWeight;
321 nonlocalContribution *= lir.weight;
324 nonlocalEquivalentStrain += nonlocalContribution;
329 nonlocalEquivalentStrain /= updatedIntegrationVolume;
335 nonlocalEquivalentStrain *= 1. / scale;
346 if ( localEquivalentStrain > 0. && nonlocalEquivalentStrain > 0. ) {
347 nonlocalEquivalentStrain = 1. / (
mm / nonlocalEquivalentStrain + ( 1. -
mm ) / localEquivalentStrain );
349 nonlocalEquivalentStrain = 0.;
352 nonlocalEquivalentStrain = -
mm * nonlocalEquivalentStrain + ( 1. +
mm ) * localEquivalentStrain;
358 return nonlocalEquivalentStrain;
379 IsotropicDamageMaterial1 :: initializeFrom(ir);
380 StructuralNonlocalMaterialExtensionInterface :: initializeFrom(ir);
387 IsotropicDamageMaterial1 :: giveInputRecord(input);
388 StructuralNonlocalMaterialExtensionInterface :: giveInputRecord(input);
396 return kappa / ( 1. + kappa );
423 for (
auto &lir : *list ) {
424 rmat =
dynamic_cast< IDNLMaterial *
>( lir.nearGp->giveMaterial() );
451std :: vector< localIntegrationRecord > *
452IDNLMaterial :: NonlocalMaterialStiffnessInterface_giveIntegrationDomainList(
GaussPoint *gp)
465 if ( type == IST_LocalEquivalentStrain ) {
470 return IsotropicDamageMaterial1 :: giveIPValue(answer, gp, type, tStep);
483 double f, equivStrain;
495 if ( ( equivStrain <=
e0 ) || ( f < 0.0 ) ) {
500 EASValsSetColor(
gc.getExtendedSparseProfileColor() );
502 EASValsSetFillStyle(FILL_SOLID);
511 for (
auto &lir : *list ) {
512 rmat =
dynamic_cast< IDNLMaterial *
>( lir.nearGp->giveMaterial() );
521 for (
int i = 1; i <= n; i++ ) {
522 if ( loc.
at(i) == 0 ) {
526 for (
int j = 1; j <= m; j++ ) {
527 if ( rloc.
at(j) == 0 ) {
531 if (
gc.getSparseProfileMode() == 0 ) {
532 p [ 0 ].x = ( FPNum ) loc.
at(i) - 0.5;
533 p [ 0 ].y = ( FPNum ) rloc.
at(j) - 0.5;
535 p [ 1 ].x = ( FPNum ) loc.
at(i) + 0.5;
536 p [ 1 ].y = ( FPNum ) rloc.
at(j) - 0.5;
538 p [ 2 ].x = ( FPNum ) loc.
at(i) + 0.5;
539 p [ 2 ].y = ( FPNum ) rloc.
at(j) + 0.5;
541 p [ 3 ].x = ( FPNum ) loc.
at(i) - 0.5;
542 p [ 3 ].y = ( FPNum ) rloc.
at(j) + 0.5;
544 go = CreateQuad3D(p);
545 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
546 EMAddGraphicsToModel(ESIModel(), go);
548 p [ 0 ].x = ( FPNum ) loc.
at(i);
549 p [ 0 ].y = ( FPNum ) rloc.
at(j);
552 EASValsSetMType(SQUARE_MARKER);
553 go = CreateMarker3D(p);
554 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
555 EMAddGraphicsToModel(ESIModel(), go);
571 double sum, f, equivStrain;
587 strain = status->giveTempStrainVector();
591 f = equivStrain - status->giveTempKappa();
593 if ( ( equivStrain <=
e0 ) || ( f < 0.0 ) ) {
603 if ( status->giveDamage() >= 1.00 ) {
616 elem->computeBmatrixAt(gp, b);
622 f = (
e0 / ( equivStrain * equivStrain ) ) * exp( -( equivStrain -
e0 ) / (
ef -
e0 ) )
623 + (
e0 / equivStrain ) * exp( -( equivStrain -
e0 ) / (
ef -
e0 ) ) * 1.0 / (
ef -
e0 );
628 for (
int i = 1; i <= nrows; i++ ) {
630 for (
int j = 1; j <= nsize; j++ ) {
631 sum += b.
at(j, i) * stress.
at(j);
634 lcontrib.
at(i) =
sum * f;
639 elem->giveLocationArray(loc, s);
650 double coeff = 0.0,
sum;
654 FloatArray stress, fullStress, strain, principalStress, help, nu;
667 StructuralMaterial :: giveFullSymVectorForm( fullStress, stress, gp->
giveMaterialMode() );
669 principalStress = fullStress;
676 int indx = 0, zeroFlag = 1;
678 for (
int i = 1; i <= 3; i++ ) {
679 if ( fabs( principalStress.
at(i) ) > 1.e-10 ) {
683 if ( princDir.at(3, i) > 0.90 ) {
689 for (
int i = 1; i <= 3; i++ ) {
690 swap = princDir.at(i, indx);
691 princDir.at(i, indx) = princDir.at(i, 3);
692 princDir.at(i, 3) = swap;
695 swap = principalStress.
at(indx);
696 principalStress.
at(indx) = principalStress.
at(3);
697 principalStress.
at(3) = swap;
698 }
else if ( zeroFlag == 0 ) {
707 for (
int i = 1; i <= 3; i++ ) {
708 if ( principalStress.
at(i) > 0.0 ) {
709 sum += principalStress.
at(i) * principalStress.
at(i);
713 if (
sum > 1.e-15 ) {
714 coeff = 1. / ( lmat->
give(
'E', gp) * sqrt(
sum) );
728 for (
int i = 1; i <= principalStress.
giveSize(); i++ ) {
729 principalStress.
at(i) =
max(principalStress.
at(i), 0.0);
736 for ( i = 1; i <= 3; i++ ) {
737 fullHelp.
at(i) = help.
at(i);
741 fullNu.beProductOf(t, fullHelp);
743 crossSection->giveReducedCharacteristicVector(nu, gp, fullNu);
761 fullPrincStress.
zero();
762 for (
int i = 1; i <= 3; i++ ) {
763 fullPrincStress.
at(i) = principalStress.
at(i);
767 StructuralMaterial :: giveReducedSymVectorForm( help, fullHelp, gp->
giveMaterialMode() );
780 coeff = 1.0 / ( lmat->
give(
'E', gp) * equivStrain );
789 for (
int i = 1; i <= ncols; i++ ) {
791 for (
int j = 1; j <= nsize; j++ ) {
795 rcontrib.
at(i) =
sum * coeff;
801IDNLMaterial :: giveNormalElasticStiffnessMatrix(
FloatMatrix &answer,
802 MatResponseMode rMode,
814 for (
int i = 1; i <= 3; i++ ) {
815 for (
int j = 1; j <= 3; j++ ) {
816 answer.
at(i, j) = de.at(i, j);
830IDNLMaterialStatus :: printOutputAt(FILE *file,
TimeStep *tStep)
const
832 StructuralMaterialStatus :: printOutputAt(file, tStep);
833 fprintf(file,
"status { ");
834 if ( this->
damage > 0.0 ) {
835 fprintf(file,
"nonloc-kappa %f, damage %f ", this->
kappa, this->
damage);
837#ifdef keep_track_of_dissipated_energy
840 fprintf(file,
"stressW %f ", this->
stressWork);
844 fprintf(file,
"}\n");
848IDNLMaterialStatus :: initTempStatus()
854 IsotropicDamageMaterial1Status :: initTempStatus();
860IDNLMaterialStatus :: updateYourself(
TimeStep *tStep)
867 IsotropicDamageMaterial1Status :: updateYourself(tStep);
875 IsotropicDamageMaterial1Status :: saveContext(stream, mode);
882 IsotropicDamageMaterial1Status :: restoreContext(stream, mode);
892 return IsotropicDamageMaterial1Status :: giveInterface(type);
913 double localEquivalentStrainForAverage;
915 result = buff.
read(localEquivalentStrainForAverage);
934IDNLMaterial :: predictRelativeComputationalCost(
GaussPoint *gp)
951 cost *= ( 1.0 + size / 15.0 );
#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 givePackSizeOfDouble(std::size_t count)=0
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
virtual double computeVolumeAround(GaussPoint *gp)
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void resize(Index rows, Index cols)
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
int giveNumberOfColumns() const
Returns number of columns of receiver.
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
double at(std::size_t i, std::size_t j) const
double weight
Integration weight.
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Element * giveElement()
Returns corresponding element to receiver.
double giveLocalEquivalentStrainForAverage()
Returns the local equivalent strain to be averaged.
double localEquivalentStrainForAverage
Equivalent strain for averaging.
void setLocalEquivalentStrainForAverage(double ls)
Sets the localEquivalentStrainForAverage to given value.
int giveLocalNonlocalStiffnessContribution(GaussPoint *gp, IntArray &loc, const UnknownNumberingScheme &s, FloatArray &lcontrib, TimeStep *tStep)
double computeLocalEquivalentStrain(const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) const
double computeStressBasedWeight(double cl, double &nx, double &ny, double &ratio, GaussPoint *gp, GaussPoint *jGp, double weight) const
void giveRemoteNonlocalStiffnessContribution(GaussPoint *gp, IntArray &rloc, const UnknownNumberingScheme &s, FloatArray &rcontrib, TimeStep *tStep)
double computeStressBasedWeightForPeriodicCell(double cl, double &nx, double &ny, double &ratio, GaussPoint *gp, GaussPoint *jGp) const
void computeAngleAndSigmaRatio(double &nx, double &ny, double &ratio, GaussPoint *gp, bool &flag) const
void giveNormalElasticStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
IDNLMaterial(int n, Domain *d)
Constructor.
double computeEquivalentStrain(const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) const override
IsotropicDamageMaterial1Status(GaussPoint *g)
Constructor.
double e0
Equivalent strain at stress peak (or a similar parameter).
IsotropicDamageMaterial1(int n, Domain *d)
Constructor.
MaterialStatus * giveStatus(GaussPoint *gp) const override
EquivStrainType equivStrainType
Parameter specifying the definition of equivalent strain.
double ef
Determines ductility -> corresponds to fracturing strain.
double give(int aProperty, GaussPoint *gp) const override
double damageFunction(double kappa, GaussPoint *gp) const
double e1
Parameters used if softType = 7 (extended smooth damage law).
double complianceFunction(double kappa, GaussPoint *gp) const
double stressWork
Density of total work done by stresses on strain increments.
double damage
Damage level of material.
double kappa
Scalar measure of the largest strain level ever reached in material.
double giveTempKappa() const
Returns the temp. scalar measure of the largest strain level.
double giveTempDamage() const
Returns the temp. damage level.
double dissWork
Density of dissipated work.
LinearElasticMaterial * linearElasticMaterial
Reference to bulk (undamaged) material.
LinearElasticMaterial * giveLinearElasticMaterial() const
Returns reference to undamaged (bulk) material.
virtual double give(int aProperty, GaussPoint *gp) const
virtual void initTempStatus(GaussPoint *gp) const
virtual double computeWeightFunction(const double cl, const double distance) const
int averType
Parameter specifying how the weight function should be adjusted due to damage.
NlVariationType nlvar
Parameter specifying the type of nonlocal variation.
void buildNonlocalPointTable(GaussPoint *gp) const
ScalingType scaling
Parameter specifying the type of scaling of nonlocal weight function.
void endIPNonlocalAverage(GaussPoint *gp) const
double mm
For "undernonlocal" or "overnonlocal" formulation.
void updateDomainBeforeNonlocAverage(TimeStep *tStep) const
AveragedVarType averagedVar
Parameter specifying the type of averaged (nonlocal) variable.
void modifyNonlocalWeightFunctionAround(GaussPoint *gp) const
std ::vector< localIntegrationRecord > * giveIPIntegrationList(GaussPoint *gp) const
std ::vector< localIntegrationRecord > * giveIntegrationDomainList()
double giveIntegrationScale()
Returns associated integration scale.
NonlocalMaterialStiffnessInterface()
Constructor.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)=0
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
static FloatMatrixF< 6, 6 > giveStressVectorTranformationMtrx(const FloatMatrixF< 3, 3 > &base, bool transpose=false)
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
static void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir, const FloatArray &s, stressStrainPrincMode mode)
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode) const
StructuralNonlocalMaterialExtensionInterface(Domain *d)
StructuralNonlocalMaterialStatusExtensionInterface()
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
@ principal_stress
For computing principal stresses.
double sum(const FloatArray &x)
@ NonlocalMaterialStiffnessInterfaceType
@ MaterialModelMapperInterfaceType
@ NonlocalMaterialStatusExtensionInterfaceType
@ NonlocalMaterialExtensionInterfaceType
double distance(const FloatArray &x, const FloatArray &y)
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_SPARSE_PROFILE_WIDTH
#define OOFEG_SPARSE_PROFILE_LAYER