XC Open source finite element analysis program
EPState.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /*
28 ################################################################################
29 # COPYRIGHT (C): :-)) #
30 # PROJECT: Object Oriented Finite Element Program #
31 # PURPOSE: General platform for elaso-plastic constitutive model #
32 # implementation #
33 # CLASS: DPEPState (the base class for all Elasto-plastic state) #
34 # #
35 # VERSION: #
36 # LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.00, SUN C++ ver=2.1 ) #
37 # TARGET OS: DOS || UNIX || . . . #
38 # DESIGNER(S): Boris Jeremic, Zhaohui Yang #
39 # PROGRAMMER(S): Boris Jeremic, Zhaohui Yang #
40 # #
41 # #
42 # DATE: 08-03-2000 #
43 # UPDATE HISTORY: #
44 # May 2004, Zhao Cheng spliting the elastic part #
45 # #
46 # #
47 # #
48 # #
49 # SHORT EXPLANATION: This class is used to hold all state parameters and #
50 # internal variables in an elasto-plastic constitutive #
51 # model. #
52 ################################################################################
53 */
54 
55 #ifndef EPState_H
56 #define EPState_H
57 
58 #include "utility/matrix/nDarray/stresst.h"
59 #include "utility/matrix/nDarray/straint.h"
60 #include "utility/matrix/nDarray/BJtensor.h"
61 
62 // Constants
63 #define MaxNScalarVar 4
64 #define MaxNTensorVar 4
65 #define FALSE 0
66 #define TRUE 1
67 
68 namespace XC {
70 //
73 class EPState
74  {
75  public:
76 //ZC05/2004 // Elastic parameters
77 //ZC05/2004 double Eo; // Young's modulus when p = p_atmosphere -- [in-plane] in terms of cross-anisotropic material
78 //ZC05/2004 double E_Young; // Young's modulus -- [in-plane] in terms of cross-anisotropic material
79 //ZC05/2004 double nu_Poisson; // Poisson's ratio -- [in-plane] in terms of cross-anisotropic materi
80 //ZC05/2004 double rho_mass_density; // Mass density
81 
82  // Trial state
83  stresstensor CurrentStress; // Current trial stress --total
84  straintensor CurrentStrain; // Current trial strain --total
85  stresstensor IterativeStress; // Iterative Stress
86  straintensor ElasticStrain; // Current cumulative elastic strain
87  straintensor PlasticStrain; // Current cumulative plastic strain
88  straintensor dElasticStrain; // Current elastic strain increment
89  straintensor dPlasticStrain; // Current plastic strain increment
90  BJtensor Eep; // Current Elastic plastic stifness tensor
91  int NScalarVar; //Actual Number of internal scalar vars
92  int NTensorVar; //Actual Number of internal tensor vars
93 
94  double ScalarVar[ MaxNScalarVar ]; // scalar variable array for scalar hardening vars
95  //static stresstensor TensorVar[ MaxNTensorVar ]; // tensor variable array for tensor hardening vars
96  stresstensor TensorVar[ MaxNTensorVar ]; // tensor variable array for tensor hardening vars
97  //straintensor TensorVar[ MaxNTensorVar ]; // tensor variable array for tensor hardening vars
98 
99  // Commited state
100  stresstensor Stress_commit; // Commited stress --total
101  straintensor Strain_commit; // Commited strain --total
102  straintensor ElasticStrain_commit; //GZ Mar2005
103  //straintensor PlasticStrain
104 
105 
106  double ScalarVar_commit[ MaxNScalarVar ]; // Commited scalar variable array for scalar hardening vars
107  //static stresstensor TensorVar_commit[ MaxNTensorVar ]; // Commited tensor variable array for tensor hardening vars
108  stresstensor TensorVar_commit[ MaxNTensorVar ]; // Commited tensor variable array for tensor hardening vars
109  BJtensor Eep_commit; // Current Elastic plastic stifness tensor
110 
111  //Initial state
112  stresstensor Stress_init; // Initial stress --total
113  straintensor Strain_init; // Initial strain --total
114 
115  double ScalarVar_init[ MaxNScalarVar ]; // initial scalar variable array for scalar hardening vars
116  //static stresstensor TensorVar_init[ MaxNTensorVar ]; // initial tensor variable array for tensor hardening vars
117  stresstensor TensorVar_init[ MaxNTensorVar ]; // initial tensor variable array for tensor hardening vars
118  BJtensor Eep_init; // initial Elastic plastic stifness tensor
119 
120  bool Converged; // Bool to indicate whether this is the converged EPState by current CDriver
121 
122  double Delta_lambda; //Guanzhou Mar2005
123 
124 //ZC05/2004 // Flag to indicate if elastic portion is pressure dependent isotropic, pressure independent isotropic, pressure
125 //ZC05/2004 // independent cross-anisotropic or pressure dependentcross-anisotropic
126 //ZC05/2004 // 1 == pressure dependent isotropic (default case, for soil)
127 //ZC05/2004 // 2 == pressure independent isotropic
128 //ZC05/2004 // 3 == pressure independent cross-anisotropic
129 //ZC05/2004 // 4 == pressure dependent cross-anisotropic
130 //ZC05/2004
131 //ZC05/2004 int Elasticflag;
132 //ZC05/2004
133 //ZC05/2004 //Parameters for elastic cross-anistropic material
134 //ZC05/2004 double Ev; // Ev: Young's modulus in a vertical direction -- [out-of-plane]
135 //ZC05/2004 double nuhv; // nuhv: Poisson's ratio for strain in the vertical direction due to a horizontal direct stress -- [out-of-plane]
136 //ZC05/2004 double Ghv; // Ghv: Modulus of shear deformation in a vertical plane -- [out-of-plane]
137 //ZC05/2004
138 //ZC05/2004 double eo; // Initial void ratio Joey 02-11-03
139 //ZC05/2004 double ec; // Void ratio at critical state at po Joey 02-11-03
140 //ZC05/2004 double Lambda; // Slope of critical state line Joey 02-11-03
141 //ZC05/2004 double po; // Reference pressure (100 kPa by default) Joey 02-11-03
142  double e; // Void ratio Joey 02-11-03
143  double psi; // State parameter Joey 02-18-03
144  int integratorFlag; //Guanzhou Mar2005
145 //ZC05/2004 double a; // Exponent in E = Eo (p/p_atm)^a for nonlinear elastic model Joey 02-11-03
146 
147  public:
148  //Normal Constructor--no parameters
149  EPState();
150  ~EPState();
151 
152 //ZC05/2004 //Normal Constructor1
153 //ZC05/2004 EPState(double Eod,
154 //ZC05/2004 double Ed,
155 //ZC05/2004 double nu,
156 //ZC05/2004 double rho,
157 //ZC05/2004 const stresstensor &stressp,
158 //ZC05/2004 const straintensor &strainp,
159 //ZC05/2004 const straintensor &Estrainp,
160 //ZC05/2004 const straintensor &Pstrainp,
161 //ZC05/2004 const straintensor &dEstrainp,
162 //ZC05/2004 const straintensor &dPstrainp,
163 //ZC05/2004 int NScalarp,
164 //ZC05/2004 const double *Scalarp,
165 //ZC05/2004 int NTensorp,
166 //ZC05/2004 const stresstensor *Tensorp,
167 //ZC05/2004 const tensor &Eepp,
168 //ZC05/2004 const stresstensor &Stress_commitp,
169 //ZC05/2004 const straintensor &Strain_commitp,
170 //ZC05/2004 const double *Scalar_commitp,
171 //ZC05/2004 const stresstensor *Tensor_commitp,
172 //ZC05/2004 const tensor &Eep_commitp,
173 //ZC05/2004 const stresstensor &Stress_initp,
174 //ZC05/2004 const straintensor &Strain_initp,
175 //ZC05/2004 const double *Scalar_initp,
176 //ZC05/2004 const stresstensor *Tensor_initp,
177 //ZC05/2004 const tensor &Eep_initp,
178 //ZC05/2004 bool Convergedp,
179 //ZC05/2004 int Elasticflagp = 0,
180 //ZC05/2004 double Evp = 0.0,
181 //ZC05/2004 double nuhvp = 0.0,
182 //ZC05/2004 double Ghvp = 0.0,
183 //ZC05/2004 double eop = 0.85,
184 //ZC05/2004 double ecp = 0.80,
185 //ZC05/2004 double Lam = 0.025,
186 //ZC05/2004 double pop = 100.0,
187 //ZC05/2004 double ep = 0.85,
188 //ZC05/2004 double psip = 0.05,
189 //ZC05/2004 double ap = 0.5
190 //ZC05/2004 );
191 //ZC05/2004
192 //ZC05/2004
193 //ZC05/2004 //Normal Constructor11
194 //ZC05/2004 EPState(double Eod,
195 //ZC05/2004 double Ed,
196 //ZC05/2004 double nu,
197 //ZC05/2004 double rho,
198 //ZC05/2004 const stresstensor stressp,
199 //ZC05/2004 const straintensor strainp,
200 //ZC05/2004 const straintensor Estrainp,
201 //ZC05/2004 const straintensor Pstrainp,
202 //ZC05/2004 int NScalarp,
203 //ZC05/2004 const double *Scalarp,
204 //ZC05/2004 int NTensorp,
205 //ZC05/2004 const stresstensor *Tensorp,
206 //ZC05/2004 int Elasticflagp = 0,
207 //ZC05/2004 double Evp = 0.0,
208 //ZC05/2004 double nuhvp = 0.0,
209 //ZC05/2004 double Ghvp = 0.0,
210 //ZC05/2004 double eop = 0.85,
211 //ZC05/2004 double ecp = 0.80,
212 //ZC05/2004 double Lam = 0.025,
213 //ZC05/2004 double pop = 100.0,
214 //ZC05/2004 double ap = 0.5
215 //ZC05/2004 );
216 //ZC05/2004
217 //ZC05/2004 //Normal Constructor2
218 //ZC05/2004 EPState(double Eod,
219 //ZC05/2004 double Ed,
220 //ZC05/2004 double nu,
221 //ZC05/2004 double rho,
222 //ZC05/2004 int NScalarp,
223 //ZC05/2004 const double *Scalarp,
224 //ZC05/2004 int NTensorp,
225 //ZC05/2004 const stresstensor *Tensorp,
226 //ZC05/2004 int Elasticflagp = 0,
227 //ZC05/2004 double Evp = 0.0,
228 //ZC05/2004 double nuhvp = 0.0,
229 //ZC05/2004 double Ghvp = 0.0,
230 //ZC05/2004 double eop = 0.85,
231 //ZC05/2004 double ecp = 0.80,
232 //ZC05/2004 double Lam = 0.025,
233 //ZC05/2004 double pop = 100.0,
234 //ZC05/2004 double ap = 0.5
235 //ZC05/2004 );
236 
237  //Normal Constructor1
238  EPState(const stresstensor &stressp,
239  const straintensor &strainp,
240  const straintensor &Estrainp,
241  const straintensor &Pstrainp,
242  const straintensor &dEstrainp,
243  const straintensor &dPstrainp,
244  int NScalarp,
245  const double *Scalarp,
246  int NTensorp,
247  const stresstensor *Tensorp,
248  const BJtensor &Eepp,
249  const stresstensor &Stress_commitp,
250  const straintensor &Strain_commitp,
251  const straintensor & ElasticStrain_commitp,
252  const double *Scalar_commitp,
253  const stresstensor *Tensor_commitp,
254  const BJtensor &Eep_commitp,
255  const stresstensor &Stress_initp,
256  const straintensor &Strain_initp,
257  const double *Scalar_initp,
258  const stresstensor *Tensor_initp,
259  const BJtensor &Eep_initp,
260  bool Convergedp,
261  double ep = 0.85,
262  double psip = 0.05,
263  int flag = 0 );
264 
265  //Normal Constructor11
266  EPState(const stresstensor stressp,
267  const straintensor strainp,
268  const straintensor Estrainp,
269  const straintensor Pstrainp,
270  int NScalarp,
271  const double *Scalarp,
272  int NTensorp,
273  const stresstensor *Tensorp,
274  double ep = 0.85,
275  double psip = 0.05,
276  int flag = 0); //Guanzhou
277 
278  //Normal Constructor2
279  EPState(int NScalarp,
280  const double *Scalarp,
281  int NTensorp,
282  const stresstensor *Tensorp );
283 
284  EPState *newObj(); //create a clone of itself
285  EPState( const EPState &rhs ); // Copy constructor
286  const EPState &operator=(const EPState &rhs ); //Overloading assignment
287 
288 //ZC05/2004 int getElasticflag() const;
289 
290 //ZC05/2004 double getE() const;
291 //ZC05/2004 double getEo() const;
292 //ZC05/2004 double getEv() const;
293 //ZC05/2004 double getnu() const;
294 //ZC05/2004 double getnuhv() const;
295 //ZC05/2004 double getGhv() const;
296 //ZC05/2004 double getrho() const;
297 
298  int getNScalarVar() const;
299  int getNTensorVar() const;
300  bool getConverged() const;
301 
302 //ZC05/2004 // Added Joey 02-12-03
303 //ZC05/2004 double geteo() const;
304 //ZC05/2004 double getec() const;
305 //ZC05/2004 double getLam() const;
306  double gete() const;
307  double getpsi() const; //state parameter
308  int getIntegratorFlag() const; //Guanzhou Mar 2005
309 //ZC05/2004 double getpo() const;
310 //ZC05/2004 double geta() const;
311 
312  const stresstensor &getStress(void) const;
313  const stresstensor &getIterativeStress() const;
314  const straintensor &getStrain() const;
315  const straintensor &getElasticStrain() const;
316  const straintensor &getPlasticStrain() const;
317  const straintensor &getdElasticStrain() const;
318  const straintensor &getdPlasticStrain() const;
319  const BJtensor &getEep(void) const;
320 
321  //Get commited state vars
322  const stresstensor &getStress_commit() const;
323  const straintensor &getStrain_commit() const;
324  const straintensor &getElasticStrain_commit() const;
325  double *getScalarVar_commit();
326  double getScalarVar_commit(int i);
327  stresstensor *getTensorVar_commit();
328  stresstensor getTensorVar_commit(int i);
329  const BJtensor &getEep_commit() const;
330 
331  //Get initial state vars
332  const stresstensor &getStress_init() const;
333  const straintensor &getStrain_init() const;
334  double * getScalarVar_init();
335  double getScalarVar_init(int i);
336  stresstensor *getTensorVar_init();
337  stresstensor getTensorVar_init(int i);
338  const BJtensor &getEep_init() const;
339 
340 //ZC05/2004 void setElasticflag( int efd );
341 //ZC05/2004 void setEo( double Eod );
342 //ZC05/2004 void setE( double Ey );
343 //ZC05/2004 void setnu( double nud );
344 
345 //ZC05/2004 void setEv( double Evd );
346 //ZC05/2004 void setGhv( double Ghvd );
347 //ZC05/2004 void setnuhv( double nud );
348 
349  void setStress( const stresstensor &newstress );
350  void setIterativeStress( const stresstensor &newstress );
351  void setStrain( const straintensor &newstrain );
352 
353  void setStress_commit( const stresstensor &newstress );
354  void setStrain_commit( const straintensor &newstrain );
355  void setElasticStrain_commit( const straintensor &newstrain );
356 
357  void setStress_init( const stresstensor &newstress );
358  void setStrain_init( const straintensor &newstrain );
359 
360  void setElasticStrain( const straintensor &newstrain );
361  void setPlasticStrain( const straintensor &newstrain );
362  void setdElasticStrain( const straintensor &newstrain );
363  void setdPlasticStrain( const straintensor &newstrain );
364  void setEep(const BJtensor &);
365  void setConverged( bool b);
366 
367 //ZC05/2004 // Added Joey 02-12-03
368 //ZC05/2004 void seteo( double eod );
369 //ZC05/2004 void setec( double ecd );
370 //ZC05/2004 void setLam( double Lamd );
371  void sete( double ed );
372  void setpsi( double psid );
373 //ZC05/2004 void setpo( double pod );
374 //ZC05/2004 void seta( double ad );
375 
376  // WhichOne starts from 1 and ends up to NScalarVar
377  double getScalarVar( int WhichOne) const;
378  stresstensor getTensorVar(int WhichOne) const;
379 
380  // return the pointers
381  double *getScalarVar();
382  stresstensor *getTensorVar();
383 
384  // WhichOne starts from 1 and ends up to NTensorVar
385  void setNScalarVar(int rval);
386  void setScalarVar(int WhichOne, double rval);
387  void setScalarVar_commit(int WhichOne, double rval);
388  void setScalarVar_init(int WhichOne, double rval);
389 
390  void setNTensorVar(int rval);
391  void setTensorVar(int WhichOne, const stresstensor &rval);
392  void setTensorVar_commit(int WhichOne, const stresstensor &rval);
393  void setTensorVar_init(int WhichOne, const stresstensor &rval);
394 
395  void setScalarVar(double *rval);
396  void setTensorVar(const stresstensor *rval);
397  void setInit();
398 
399  //added for OpenSees _Zhaohui 02-10-2000
400  int commitState ();
401  int revertToLastCommit ();
402  int revertToStart ();
403 
404  void print();
405 
406  //================================================================================
407  // Overloaded Insertion Operator
408  // prints an EPState's contents
409  //================================================================================
410  friend std::ostream & operator<< (std::ostream& os, const EPState & EPS);
411  //friend ostream & operator<< (ostream& os, const EPState & EPS);
412 
413 };
414 } // end of XC namespace
415 
416 
417 #endif
418 
Definition: BJtensor.h:110
Definition: stresst.h:68
Strain tensor.
Definition: straint.h:67
3
Definition: EPState.h:73
================================================================================
Definition: ContinuaReprComponent.h:34