OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralcrosssection.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 - 2013 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 "../sm/CrossSections/structuralcrosssection.h"
36 #include "../sm/Materials/structuralmaterial.h"
37 #include "../sm/Materials/structuralms.h"
38 #include "gausspoint.h"
39 #include "element.h"
40 #include "floatarray.h"
41 
42 namespace oofem {
43 void
45 {
46  MaterialMode mode = gp->giveMaterialMode();
47  if ( mode == _2dBeam ) {
48  this->giveGeneralizedStress_Beam2d(answer, gp, strain, tStep);
49  } else if ( mode == _3dBeam ) {
50  this->giveGeneralizedStress_Beam3d(answer, gp, strain, tStep);
51  } else if ( mode == _2dPlate ) {
52  this->giveGeneralizedStress_Plate(answer, gp, strain, tStep);
53  } else if ( mode == _3dShell ) {
54  this->giveGeneralizedStress_Shell(answer, gp, strain, tStep);
55  } else if ( mode == _3dMat ) {
56  this->giveRealStress_3d(answer, gp, strain, tStep);
57  } else if ( mode == _PlaneStrain ) {
58  this->giveRealStress_PlaneStrain(answer, gp, strain, tStep);
59  } else if ( mode == _PlaneStress ) {
60  this->giveRealStress_PlaneStress(answer, gp, strain, tStep);
61  } else if ( mode == _1dMat ) {
62  this->giveRealStress_1d(answer, gp, strain, tStep);
63  } else if ( mode == _Warping ) {
64  this->giveRealStress_Warping(answer, gp, strain, tStep);
65  } else {
66  // This should never happen ?
68  StructuralMaterial *mat = dynamic_cast< StructuralMaterial * >( this->giveMaterial(gp) );
69  if ( mat->hasMaterialModeCapability( gp->giveMaterialMode() ) ) {
70  mat->giveRealStressVector(answer, gp, strain, tStep);
71  } else {
72  OOFEM_ERROR("unsupported mode");
73  }
74  }
75 }
76 
77 
78 FloatArray *
80  FloatArray *gradientStressVector3d)
81 //
82 // returns modified gradient of stress vector, which is used to
83 // bring stresses back to yield surface.
84 //
85 // imposes zeros on places, where zero stress occurs. if energetically connected
86 // strain is zero, we do not impose zero there, because stress exist and
87 // must be taken into account when computing yeld function. In such case
88 // a problem is assumed to be full 3d with some explicit strain equal to 0.
89 //
90 // On the other hand, if some stress is imposed to be zero, we understand
91 // such case as subspace of 3d case (like a classical plane stess problem, with no
92 // tracing of ez, sigma_z)
93 //
94 {
95  MaterialMode mode = gp->giveMaterialMode();
96  if ( gradientStressVector3d->giveSize() != 6 ) {
97  OOFEM_ERROR("gradientStressVector3d size mismatch");
98  }
99 
100  if ( mode == _3dMat ) {
101  return gradientStressVector3d;
102  }
103 
104 
105  switch ( mode ) {
106  case _PlaneStress:
107  gradientStressVector3d->at(3) = 0.;
108  gradientStressVector3d->at(4) = 0.;
109  gradientStressVector3d->at(5) = 0.;
110  break;
111  case _PlaneStrain:
112  // gradientStressVector3d ->at(3) = 0.;
113  gradientStressVector3d->at(4) = 0.;
114  gradientStressVector3d->at(5) = 0.;
115  break;
116  case _1dMat:
117  for ( int i = 2; i <= 6; i++ ) {
118  gradientStressVector3d->at(i) = 0.;
119  }
120 
121  break;
122  default:
123  OOFEM_ERROR("unknown mode (%s)", __MaterialModeToString(mode) );
124  break;
125  }
126 
127  return gradientStressVector3d;
128 }
129 
130 void
132 {
133  StructuralMaterial *mat = static_cast< StructuralMaterial * >( this->giveMaterial(gp) );
134  return mat->giveRealStressVector_3dBeamSubSoil(answer, gp, generalizedStrain, tStep);
135 }
136 
137 void
139 {
140  StructuralMaterial *mat;
141  mat = dynamic_cast< StructuralMaterial * >( this->giveMaterial(gp) );
142  mat->give3dBeamSubSoilStiffMtrx(answer, ElasticStiffness, gp, tStep);
143 }
144 
145 
146 
147 FloatArray *
149  FloatArray *gradientStrainVector3d)
150 //
151 // returns modified gradient of strain vector, which is used to
152 // compute plastic strain increment.
153 //
154 // imposes zeros on places, where zero strain occurs or energetically connected stress
155 // is prescribed to be zero.
156 //
157 {
158  MaterialMode mode = gp->giveMaterialMode();
159  if ( gradientStrainVector3d->giveSize() != 6 ) {
160  OOFEM_ERROR("gradientStrainVector3d size mismatch");
161  }
162 
163  if ( mode == _3dMat ) {
164  return gradientStrainVector3d;
165  }
166 
167 
168  switch ( mode ) {
169  case _PlaneStress:
170  gradientStrainVector3d->at(3) = 0.;
171  gradientStrainVector3d->at(4) = 0.;
172  gradientStrainVector3d->at(5) = 0.;
173  break;
174  case _PlaneStrain:
175  gradientStrainVector3d->at(3) = 0.;
176  gradientStrainVector3d->at(4) = 0.;
177  gradientStrainVector3d->at(5) = 0.;
178  break;
179  case _1dMat:
180  for ( int i = 2; i <= 6; i++ ) {
181  gradientStrainVector3d->at(i) = 0.;
182  }
183 
184  break;
185  default:
186  OOFEM_ERROR("unknown mode (%s)", __MaterialModeToString(mode) );
187  break;
188  }
189 
190  return gradientStrainVector3d;
191 }
192 
193 } // end namespace oofem
virtual FloatArray * imposeStressConstrainsOnGradient(GaussPoint *gp, FloatArray *gradientStressVector3d)
Returns modified gradient of stress vector, which is used to bring stresses back to yield surface...
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual void giveRealStress_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
virtual void giveGeneralizedStress_Beam2d(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
Computes the generalized stress vector for given strain and integration point.
virtual void giveGeneralizedStress_3dBeamSubSoil(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)
virtual FloatArray * imposeStrainConstrainsOnGradient(GaussPoint *gp, FloatArray *gradientStressVector3d)
Returns modified gradient of strain vector, which is used to compute plastic strain increment...
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void giveGeneralizedStress_Beam3d(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual void giveRealStressVector_3dBeamSubSoil(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual void giveRealStress_Warping(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void giveRealStress_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
virtual void giveGeneralizedStress_Plate(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
void giveRealStresses(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given strain and integration point.
virtual void giveRealStress_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
virtual void giveRealStress_1d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
virtual void give3dBeamSubSoilStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing stiffness matrix of beam3d subsoil model.
Abstract base class for all "structural" constitutive models.
virtual void giveGeneralizedStress_Shell(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual Material * giveMaterial(IntegrationPoint *ip)
Returns the material associated with the GP.
virtual void give3dBeamSubSoilStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing subsoil stiffness matrix for 2d beams.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011