60 double equivStrain =
macbra( jump.
at(1) );
63 double f = equivStrain - status->
giveKappa();
65 double tempKappa = 0.0, omega = 0.0;
72 tempKappa = equivStrain;
78 auto answer =
dot(de, jump);
80 if ( equivStrain >= 0.0 ) {
81 answer *= 1.0 - omega;
95IsoInterfaceDamageMaterial_2 :: give3dStiffnessMatrix_Eng(MatResponseMode rMode,
GaussPoint *gp,
TimeStep *tStep)
const
102 if ( rMode == ElasticStiffness ) {
108 if ( rMode == SecantStiffness ) {
121 double dom = -( -
e0 / un / un * exp( -(
ft / gf ) * ( un -
e0 ) ) +
e0 / un * exp( -(
ft / gf ) * ( un -
e0 ) ) * ( -(
ft / gf ) ) );
124 auto se =
dot(answer, e);
125 answer.at(1, 1) -= se.at(1) * dom;
126 answer.at(2, 1) -= se.at(2) * dom;
139 if ( type == IST_DamageTensor ) {
144 }
else if ( type == IST_DamageTensorTemp ) {
149 }
else if ( type == IST_PrincipalDamageTensor ) {
153 }
else if ( type == IST_PrincipalDamageTempTensor ) {
157 }
else if ( type == IST_MaxEquivalentStrainLevel ) {
162 return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
170 StructuralInterfaceMaterial :: initializeFrom(ir);
173 int nbrOfLinesToRead;
189 is.open(
tablename.c_str(), std :: ifstream :: in);
190 if ( !is.is_open() ) {
195 if ( is >> nbrOfLinesToRead ) {
196 printf(
"NumberofLinestoRead: %d\n", nbrOfLinesToRead);
198 OOFEM_ERROR(
"Error reading table file, first line should be "
199 "an integer stating how many strain damage pairs that exist in the file.");
202 damages.resize(nbrOfLinesToRead + 1);
203 strains.resize(nbrOfLinesToRead + 1);
208 for (
int i = 0; i < nbrOfLinesToRead; i++ ) {
210 OOFEM_ERROR(
"Error reading table file at line %d, expected a "
211 "strain damage pair.", i + 2);
215 OOFEM_ERROR(
"Error reading table file at line %d, strain "
216 "and damage must be given in an increasing order and be positive.", i + 2);
229 StructuralInterfaceMaterial :: giveInputRecord(input);
248 if ( kappa > this->
e0 ) {
256 int index = (int)(std :: lower_bound(
strains.givePointer(),
strains.givePointer() +
strains.giveSize(), kappa) -
strains.givePointer());
259 printf(
"e0 %lf\n",
e0);
260 printf(
"sizeof %d\n",
sizeof(
strains.givePointer() ) );
261 printf(
"pointer: %d\n", index);
262 printf(
"value: %lf\n", * index);
263 printf(
"Index found: %d\n", index -
strains.givePointer() );
264 printf(
"First index: %d\n",
strains.givePointer() );
265 printf(
"Last index: %d\n",
strains.givePointer() +
strains.giveSize() );
269 double x0 =
strains(index - 1);
271 double y0 =
damages(index - 1);
275 return y0 + ( y1 - y0 ) * ( kappa - x0 ) / ( x1 - x0 );
283IsoInterfaceDamageMaterialStatus_2 :: IsoInterfaceDamageMaterialStatus_2(
GaussPoint *g) :
292IsoInterfaceDamageMaterialStatus_2 :: printOutputAt(FILE *file,
TimeStep *tStep)
const
294 StructuralInterfaceMaterialStatus :: printOutputAt(file, tStep);
295 fprintf(file,
"status { ");
296 if ( this->
damage > 0.0 ) {
297 fprintf(file,
"kappa %f, damage %f ", this->
kappa, this->
damage);
300 fprintf(file,
"}\n");
305IsoInterfaceDamageMaterialStatus_2 :: initTempStatus()
307 StructuralInterfaceMaterialStatus :: initTempStatus();
313IsoInterfaceDamageMaterialStatus_2 :: updateYourself(
TimeStep *tStep)
315 StructuralInterfaceMaterialStatus :: updateYourself(tStep);
324 StructuralInterfaceMaterialStatus :: saveContext(stream, mode);
338 StructuralInterfaceMaterialStatus :: restoreContext(stream, mode);
#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 write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
double & at(std::size_t i)
void zero()
Zeroes all coefficients of receiver.
double kappa
Scalar measure of the largest equivalent displacement ever reached in material.
double giveTempKappa() const
Returns the temp. scalar measure of the largest strain level.
double tempDamage
Non-equilibrated damage level of material.
double damage
Damage level of material.
double tempKappa
Non-equilibrated scalar measure of the largest equivalent displacement.
void setTempKappa(double newKappa)
Sets the temp scalar measure of the largest strain level to given value.
double giveTempDamage() const override
Returns the temp. damage level.
double giveKappa() const
Returns the last equilibrated scalar measure of the largest strain level.
double giveDamage() const override
Returns the last equilibrated damage level.
void setTempDamage(double newDamage)
Sets the temp damage level to given value.
FloatArray damages
Damages read from the second column in the table file.
double e0
Limit elastic deformation.
double maxOmega
Maximum limit on omega. The purpose is elimination of a too compliant material which may cause conver...
virtual double computeDamageParam(double kappa, const FloatArrayF< 3 > &strain, GaussPoint *gp) const
FloatArray strains
Strains read from the first column in the table file.
double ft
Tension strength.
FloatMatrixF< 3, 3 > give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const override
std::string tablename
Name of table file.
double kn
Elastic properties (normal moduli).
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
StructuralInterfaceMaterialStatus(GaussPoint *g)
Constructor. Creates new StructuralInterfaceMaterialStatus with number n, belonging to domain d and I...
const FloatArrayF< 3 > & giveTempJump() const
Returns the const pointer to receiver's temporary jump.
void letTempTractionBe(const FloatArrayF< 3 > v)
Assigns tempTraction to given vector v.
void letTempJumpBe(const FloatArrayF< 3 > v)
Assigns tempJump to given vector v.
StructuralInterfaceMaterial(int n, Domain *d)
#define _IFT_IsoInterfaceDamageMaterial_2_ft
#define _IFT_IsoInterfaceDamageMaterial_2_maxOmega
#define _IFT_IsoInterfaceDamageMaterial_2_ks
#define _IFT_IsoInterfaceDamageMaterial_2_kn
#define _IFT_IsoInterfaceDamageMaterial_2_tablename
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
double macbra(double x)
Returns the positive part of given float.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatMatrixF< N, N > diag(const FloatArrayF< N > &v)
double dot(const FloatArray &x, const FloatArray &y)
@ CIO_IOERR
General IO error.