OOFEM 3.0
Loading...
Searching...
No Matches
latticematstatus.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 "latticematstatus.h"
37#include "contextioerr.h"
38#include "datastream.h"
39#include "gausspoint.h"
40
41namespace oofem {
42LatticeMaterialStatus :: LatticeMaterialStatus(GaussPoint *g) : MaterialStatus(g), RandomMaterialStatusExtensionInterface()
43{ }
44
45
46void
47LatticeMaterialStatus :: initTempStatus()
48//
49// initializes temp variables according to variables form previous equlibrium state.
50// builds new crackMap
51//
52{
53 MaterialStatus :: initTempStatus();
54
55 this->tempLatticeStrain = this->latticeStrain;
56
57 this->tempLatticeStress = this->latticeStress;
58
60
62
64
65 this->tempDissipation = this->dissipation;
67 this->tempCrackFlag = this->crackFlag;
68 this->tempCrackWidth = this->crackWidth;
69
71
72 this->updateFlag = 0;
73}
74
75
76void
77LatticeMaterialStatus :: updateYourself(TimeStep *atTime)
78{
79 MaterialStatus :: updateYourself(atTime);
80
81 this->latticeStress = this->tempLatticeStress;
82
83 this->latticeStrain = this->tempLatticeStrain;
84
86
88
90
91 this->dissipation = this->tempDissipation;
92
94
95 this->crackFlag = this->tempCrackFlag;
96
97 this->crackWidth = this->tempCrackWidth;
98
99 this->updateFlag = 1;
100}
101
102
103void
104LatticeMaterialStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
105{
106 MaterialStatus :: printOutputAt(file, tStep);
107
108 fprintf(file, " latticestrain ");
109 for ( double s : this->latticeStrain ) {
110 fprintf(file, "% .4e ", s);
111 }
112 fprintf(file, " latticestress ");
113 for ( double s : this->latticeStress ) {
114 fprintf(file, "% .4e ", s);
115 }
116 fprintf(file, " reducedlatticestrain ");
117 for ( double s : this->reducedLatticeStrain ) {
118 fprintf(file, "% .4e ", s);
119 }
120}
121
122
123Interface *
124LatticeMaterialStatus :: giveInterface(InterfaceType type)
125{
128 } else {
129 return nullptr;
130 }
131}
132
133
134void
135LatticeMaterialStatus :: saveContext(DataStream &stream, ContextMode mode)
136//
137// saves full information stored in this Status
138// no temp variables stored
139//
140{
141 MaterialStatus :: saveContext(stream, mode);
142
144
145 if ( ( iores = latticeStress.storeYourself(stream) ) != CIO_OK ) {
146 THROW_CIOERR(iores);
147 }
148
149 if ( ( iores = latticeStrain.storeYourself(stream) ) != CIO_OK ) {
150 THROW_CIOERR(iores);
151 }
152
153 if ( ( iores = reducedLatticeStrain.storeYourself(stream) ) != CIO_OK ) {
154 THROW_CIOERR(iores);
155 }
156
157 if ( ( iores = plasticLatticeStrain.storeYourself(stream) ) != CIO_OK ) {
158 THROW_CIOERR(iores);
159 }
160
161 if ( ( iores = damageLatticeStrain.storeYourself(stream) ) != CIO_OK ) {
162 THROW_CIOERR(iores);
163 }
164
165 if ( !stream.write(le) ) {
167 }
168
169 if ( !stream.write(dissipation) ) {
171 }
172
173 if ( !stream.write(deltaDissipation) ) {
175 }
176
177 if ( !stream.write(crackFlag) ) {
179 }
180}
181
182
183void
184LatticeMaterialStatus :: restoreContext(DataStream &stream, ContextMode mode)
185//
186// restores full information stored in stream to this Status
187//
188{
189 MaterialStatus :: saveContext(stream, mode);
190
192
193 if ( ( iores = damageLatticeStrain.restoreYourself(stream) ) != CIO_OK ) {
194 THROW_CIOERR(iores);
195 }
196
197 if ( ( iores = latticeStress.restoreYourself(stream) ) != CIO_OK ) {
198 THROW_CIOERR(iores);
199 }
200
201 if ( ( iores = latticeStrain.restoreYourself(stream) ) != CIO_OK ) {
202 THROW_CIOERR(iores);
203 }
204
205 if ( ( iores = reducedLatticeStrain.restoreYourself(stream) ) != CIO_OK ) {
206 THROW_CIOERR(iores);
207 }
208
209 if ( ( iores = plasticLatticeStrain.restoreYourself(stream) ) != CIO_OK ) {
210 THROW_CIOERR(iores);
211 }
212
213 if ( !stream.read(le) ) {
215 }
216
217 if ( !stream.read(dissipation) ) {
219 }
220
221 if ( !stream.read(deltaDissipation) ) {
223 }
224
225 if ( !stream.read(crackFlag) ) {
227 }
228}
229} // end namespace oofem
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.
FloatArrayF< 6 > latticeStrain
Equilibriated lattice strain.
double tempNormalLatticeStress
Non-equilibrated normal stress.
FloatArrayF< 6 > plasticLatticeStrain
Equilibriated plastic lattice strain.
double le
Characteristic length.
FloatArrayF< 6 > tempPlasticLatticeStrain
Non-equilibrated plastic lattice strain.
int tempCrackFlag
Non-equilibrated temp flag.
FloatArrayF< 6 > tempDamageLatticeStrain
Non-equilibriated damage lattice strain.
FloatArrayF< 6 > tempLatticeStress
Non-equilibriated lattice stress.
FloatArrayF< 6 > tempReducedLatticeStrain
Non-equilibrated reduced lattice strain, which is free of thermal strain.
double tempDeltaDissipation
Non-equilibrated increment of dissipation.
double deltaDissipation
Increment of dissipation.
FloatArrayF< 6 > reducedLatticeStrain
Equilibriated reduced lattice strain, which is free of thermal strain.
double tempDissipation
Non-equilibrated increment of dissipation.
FloatArrayF< 6 > tempLatticeStrain
Non-equilibriated lattice strain.
FloatArrayF< 6 > damageLatticeStrain
Equilibriated damage lattice strain.
FloatArrayF< 6 > latticeStress
Equilibriated lattice stress.
double normalLatticeStress
Equilibrated normal stress.
double tempCrackWidth
Non-equilibrated crack width.
MaterialStatus(GaussPoint *g)
Definition matstatus.h:91
#define THROW_CIOERR(e)
long ContextMode
Definition contextmode.h:43
@ RandomMaterialStatusExtensionInterfaceType
@ 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