OOFEM 3.0
Loading...
Searching...
No Matches
structuralms.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
37#include "contextioerr.h"
39#include "gausspoint.h"
40
41namespace oofem {
42StructuralMaterialStatus :: StructuralMaterialStatus(GaussPoint *g) :
45{
46 int rsize = StructuralMaterial :: giveSizeOfVoigtSymVector( gp->giveMaterialMode() );
47 strainVector.resize(rsize);
48 stressVector.resize(rsize);
49
50 // reset temp vars.
53
55 if ( gp->giveIntegrationRule() == NULL ) {
56 return;
57 }
58 if ( NLStructuralElement * el = dynamic_cast< NLStructuralElement * >( gp->giveElement() ) ) {
59 if ( el->giveGeometryMode() == 1 ) { // if large def, initialize F and P
60 PVector.resize(9);
61 FVector.resize(9);
62 FVector.at(1) = FVector.at(2) = FVector.at(3) = 1.;
65
66 }
67 }
68
69}
70
71
72void StructuralMaterialStatus :: printOutputAt(FILE *File, TimeStep *tStep) const
73// Prints the strains and stresses on the data file.
74{
75 FloatArray helpVec;
76
77 MaterialStatus :: printOutputAt(File, tStep);
78 NLStructuralElement * el = static_cast< NLStructuralElement * >( gp->giveElement());
79 if ( el->giveGeometryMode() == 1) {
80 fprintf(File, " F ");
81 StructuralMaterial :: giveFullVectorFormF( helpVec, FVector, gp->giveMaterialMode() );
82 for ( auto &var : helpVec ) {
83 fprintf( File, " %+.4e", var );
84 }
85
86 fprintf(File, "\n P");
87 StructuralMaterial :: giveFullVectorForm( helpVec, PVector, gp->giveMaterialMode() );
88 for ( auto &var : helpVec ) {
89 fprintf( File, " %+.4e", var );
90 }
91 } else {
92 fprintf(File, " strains ");
93 StructuralMaterial :: giveFullSymVectorForm( helpVec, strainVector, gp->giveMaterialMode() );
94 for ( auto &var : helpVec ) {
95 fprintf( File, " %+.4e", var );
96 }
97
98 fprintf(File, "\n stresses");
99 StructuralMaterial :: giveFullSymVectorForm( helpVec, stressVector, gp->giveMaterialMode() );
100
101 for ( auto &var : helpVec ) {
102 fprintf( File, " %+.4e", var );
103 }
104 }
105 fprintf(File, "\n");
106}
107
108
109void StructuralMaterialStatus :: updateYourself(TimeStep *tStep)
110// Performs end-of-step updates.
111{
112 MaterialStatus :: updateYourself(tStep);
113
118}
119
120
121void StructuralMaterialStatus :: initTempStatus()
122//
123// initialize record at the begining of new load step
124//
125{
126 MaterialStatus :: initTempStatus();
127
128 // see if vectors describing reached equilibrium are defined
129 if ( this->giveStrainVector().giveSize() == 0 ) {
130 strainVector.resize( StructuralMaterial :: giveSizeOfVoigtSymVector( gp->giveMaterialMode() ) );
131 }
132
133 if ( this->giveStressVector().giveSize() == 0 ) {
134 stressVector.resize( StructuralMaterial :: giveSizeOfVoigtSymVector( gp->giveMaterialMode() ) );
135 }
136
137 // reset temp vars.
142}
143
144
145void
146StructuralMaterialStatus :: saveContext(DataStream &stream, ContextMode mode)
147{
148 MaterialStatus :: saveContext(stream, mode);
149
151 if ( ( iores = strainVector.storeYourself(stream) ) != CIO_OK ) {
152 THROW_CIOERR(iores);
153 }
154
155 if ( ( iores = stressVector.storeYourself(stream) ) != CIO_OK ) {
156 THROW_CIOERR(iores);
157 }
158}
159
160
161void
162StructuralMaterialStatus :: restoreContext(DataStream &stream, ContextMode mode)
163{
164 MaterialStatus :: restoreContext(stream, mode);
165
167 if ( ( iores = strainVector.restoreYourself(stream) ) != CIO_OK ) {
168 THROW_CIOERR(iores);
169 }
170
171 if ( ( iores = stressVector.restoreYourself(stream) ) != CIO_OK ) {
172 THROW_CIOERR(iores);
173 }
174}
175
176void StructuralMaterialStatus :: copyStateVariables(const MaterialStatus &iStatus)
177{
178 const StructuralMaterialStatus &structStatus = static_cast< const StructuralMaterialStatus & >(iStatus);
179
180 strainVector = structStatus.giveStrainVector();
181 stressVector = structStatus.giveStressVector();
182 tempStressVector = structStatus.giveTempStressVector();
183 tempStrainVector = structStatus.giveTempStrainVector();
184
185 PVector = structStatus.givePVector();
186 tempPVector = structStatus.giveTempPVector();
187 CVector = structStatus.giveCVector();
188 tempCVector = structStatus.giveTempCVector();
189 FVector = structStatus.giveFVector();
190 tempFVector = structStatus.giveTempFVector();
191}
192
193void StructuralMaterialStatus :: addStateVariables(const MaterialStatus &iStatus)
194{
195 printf("Entering StructuralMaterialStatus :: addStateVariables().\n");
196}
197} // end namespace oofem
GaussPoint * gp
Associated integration point.
MaterialStatus(GaussPoint *g)
Definition matstatus.h:91
FloatArray tempPVector
Temporary first Piola-Kirchhoff stress vector (to find balanced state).
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver's strain vector.
FloatArray tempFVector
Temporary deformation gradient in reduced form (to find balanced state).
const FloatArray & giveFVector() const
Returns the const pointer to receiver's deformation gradient vector.
const FloatArray & giveTempFVector() const
Returns the const pointer to receiver's temporary deformation gradient vector.
FloatArray tempCVector
Temporary Cauchy stress vector (to find balanced state).
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver's temporary stress vector.
StructuralMaterialStatus(GaussPoint *g)
Constructor. Creates new StructuralMaterialStatus with IntegrationPoint g.
const FloatArray & givePVector() const
Returns the const pointer to receiver's first Piola-Kirchhoff stress vector.
FloatArray tempStrainVector
Temporary strain vector in reduced form (to find balanced state).
FloatArray tempStressVector
Temporary stress vector in reduced form (increments are used mainly in nonlinear analysis).
const FloatArray & giveTempPVector() const
Returns the const pointer to receiver's temporary first Piola-Kirchhoff stress vector.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
const FloatArray & giveCVector() const
Returns the const pointer to receiver's Cauchy stress vector.
FloatArray stressVector
Equilibrated stress vector in reduced form.
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
FloatArray PVector
Equilibrated first Piola-Kirchhoff stress vector.
FloatArray strainVector
Equilibrated strain vector in reduced form.
const FloatArray & giveTempCVector() const
Returns the const pointer to receiver's temporary Cauchy stress vector.
FloatArray CVector
Equilibrated Cauchy stress vector.
FloatArray FVector
Equilibrated deformation gradient in reduced form.
#define THROW_CIOERR(e)
long ContextMode
Definition contextmode.h:43

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