OOFEM 3.0
Loading...
Searching...
No Matches
isoasymm1d.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "isoasymm1d.h"
37#include "floatmatrix.h"
38#include "gausspoint.h"
39#include "classfactory.h"
40#include "dynamicinputrecord.h"
41#include "contextioerr.h"
42
43namespace oofem {
45
46IsotropicAsymmetric1DMaterial :: IsotropicAsymmetric1DMaterial(int n, Domain *d) :
48{ }
49
50IsotropicAsymmetric1DMaterial :: IsotropicAsymmetric1DMaterial(int n, Domain *d,
51 double _Ec, double _Et,
52 double _efc, double _eft) :
54 Et(_Et),
55 Ec(_Ec),
56 efc(_efc),
57 eft(_eft),
58 a(0.),
59 m(15.)
60{}
61
62
63void
76
77
78void
79IsotropicAsymmetric1DMaterial :: giveInputRecord(DynamicInputRecord &input)
80{
81 StructuralMaterial :: giveInputRecord(input);
82
89
90}
91
92
93void IsotropicAsymmetric1DMaterial :: saveContext(DataStream &stream, ContextMode mode)
94{
95 StructuralMaterial :: saveContext(stream, mode);
96
97 if ( ( mode & CM_Definition ) ) {
98 if ( !stream.write(Ec) ) {
100 }
101 if ( !stream.write(Et) ) {
103 }
104 if ( !stream.write(efc) ) {
106 }
107 if ( !stream.write(eft) ) {
109 }
110 if ( !stream.write(a) ) {
112 }
113 if ( !stream.write(m) ) {
115 }
116 }
117}
118
119
120void IsotropicAsymmetric1DMaterial :: restoreContext(DataStream &stream, ContextMode mode)
121{
122 StructuralMaterial :: restoreContext(stream, mode);
123
124 if ( mode & CM_Definition ) {
125 if ( !stream.read(Ec) ) {
127 }
128 if ( !stream.read(Et) ) {
130 }
131 if ( !stream.read(efc) ) {
133 }
134 if ( !stream.read(eft) ) {
136 }
137 if ( !stream.read(a) ) {
139 }
140 if ( !stream.read(m) ) {
142 }
143
144 }
145}
146
147
148
149double
150IsotropicAsymmetric1DMaterial :: give(int aProperty, GaussPoint *gp) const
151{
152 return this->StructuralMaterial :: give(aProperty, gp);
153}
154
155
156bool
158{
159 if (mode == _1dMat)
160 return true;
161 else
162 return false;
163}
164
165
167IsotropicAsymmetric1DMaterial :: give1dStressStiffMtrx(MatResponseMode mode,
168 GaussPoint *gp,
169 TimeStep *tStep) const
170{
171 StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
172
173 double E;
174 double eps = status->giveTempStrainVector().at(1);
175 if ((eps >0.0) && (this->eft>0.) && (eps>this->eft)) { // check for tension failure
176 E = 1.e-6* this->Et;
177 } else if ((eps<0.0) && (this->efc<0) && (eps <this->efc)) { // check for compression failure
178 E = 1.e-6* this->Ec;
179 } else {
180 // elastic
181 E = this->Ec+0.5*(1+tanh(this->m*eps))*(this->Et-this->Ec);
182 }
183
184 return {E};
185}
186
189{
190 StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
191
192 double s;
193 double eps = reducedE.at(1);
194
195 if ((eps >0.0) && (this->eft>0.) && (eps>this->eft)) { // check for tension failure
196 s = 0.0;
197 } else if ((eps<0.0) && (this->efc<0) && (eps <this->efc)) { // check for compression failure
198 s = 0.0;
199 } else {
200 s=(0.5*this->Et-0.5*this->Ec)*((log(cosh(this->m*eps)))/(this->m))+eps*(0.5*this->Ec+0.5*this->Et);
201 }
202
203 status->letTempStressVectorBe({s});
204 status->letTempStrainVectorBe(reducedE);
205
206 return {s};
207}
208
209} // end namespace oofem
#define E(a, b)
#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.
void setField(int item, InputFieldType id)
double & at(std::size_t i)
double & at(Index i)
Definition floatarray.h:202
bool hasMaterialModeCapability(MaterialMode mode) const override
Definition isoasymm1d.C:157
double m
Regularization parameter.
Definition isoasymm1d.h:88
double Et
Young's modulus in tension.
Definition isoasymm1d.h:78
virtual FloatArrayF< 1 > giveRealStressVector_1d(const FloatArrayF< 1 > &reducedE, GaussPoint *gp, TimeStep *tStep) const override
Default implementation relies on giveRealStressVector_StressControl.
Definition isoasymm1d.C:188
double Ec
Young's modulus in compression.
Definition isoasymm1d.h:80
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
StructuralMaterial(int n, Domain *d)
#define THROW_CIOERR(e)
#define CM_Definition
Definition contextmode.h:47
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_IsotropicAsymmetric1DMaterial_ec
Definition isoasymm1d.h:49
#define _IFT_IsotropicAsymmetric1DMaterial_efc
Definition isoasymm1d.h:51
#define _IFT_IsotropicAsymmetric1DMaterial_talpha
Definition isoasymm1d.h:53
#define _IFT_IsotropicAsymmetric1DMaterial_et
Definition isoasymm1d.h:50
#define _IFT_IsotropicAsymmetric1DMaterial_m
Definition isoasymm1d.h:54
#define _IFT_IsotropicAsymmetric1DMaterial_eft
Definition isoasymm1d.h:52
long ContextMode
Definition contextmode.h:43
@ CIO_IOERR
General IO error.

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011