xc
Template3Dep.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: Template3Dep (the base class for all material point) #
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: 09-12-2000 #
44 # May 2004, Zhao Cheng spliting the elastic part #
45 # #
46 # #
47 # SHORT EXPLANATION: The Template3Dep class is used to hold specific #
48 # yield surface, potential surface, Evolution law(s) #
49 # and EPState of a 3D elasto-plastic material model for one #
50 # gauss point!! It is worthwhile noting that one model may #
51 # have multiple evolution law. Each evlotuion law is #
52 # used to evolve one internal var. #
53 # #
54 # #
55 ################################################################################
56 */
57 
58 #ifndef Template3Dep_H
59 #define Template3Dep_H
60 
61 #include <material/nD/NDMaterial.h>
62 
63 namespace XC {
64 class YieldSurface;
65 class PotentialSurface;
66 class EvolutionLaw_S;
67 class EvolutionLaw_T;
68 class EPState;
69 
73 //
75 //
82 class Template3Dep : public NDMaterial
83  {
84  private:
85 
86  NDMaterial *theElasticMat;
87 
88  YieldSurface *YS;
89 
90  PotentialSurface *PS;
91 
92  EPState *EPS;
93 
94  //Scalar variable evolution laws (currently at most 4 allowed)
95  EvolutionLaw_S *ELS1;
96  EvolutionLaw_S *ELS2;
97  EvolutionLaw_S *ELS3;
98  EvolutionLaw_S *ELS4;
99  void allocELS(EvolutionLaw_S *ELS1_= nullptr,
100  EvolutionLaw_S *ELS2_= nullptr,
101  EvolutionLaw_S *ELS3_= nullptr,
102  EvolutionLaw_S *ELS4_= nullptr );
103  void freeELS(void);
104 
105  //Tensorial variable evolution laws (currently at most 4 allowed)
106  EvolutionLaw_T *ELT1;
107  EvolutionLaw_T *ELT2;
108  EvolutionLaw_T *ELT3;
109  EvolutionLaw_T *ELT4;
110  void allocELT(EvolutionLaw_T *ELT1_= nullptr,
111  EvolutionLaw_T *ELT2_= nullptr,
112  EvolutionLaw_T *ELT3_= nullptr,
113  EvolutionLaw_T *ELT4_= nullptr );
114  void freeELT(void);
115 
116  void alloc( NDMaterial &theElMat,
117  YieldSurface *YS_= nullptr,
118  PotentialSurface *PS_= nullptr,
119  EPState *EPS_= nullptr,
120  EvolutionLaw_S *ELS1_= nullptr,
121  EvolutionLaw_S *ELS2_= nullptr,
122  EvolutionLaw_S *ELS3_= nullptr,
123  EvolutionLaw_S *ELS4_= nullptr,
124  EvolutionLaw_T *ELT1_= nullptr,
125  EvolutionLaw_T *ELT2_= nullptr,
126  EvolutionLaw_T *ELT3_= nullptr,
127  EvolutionLaw_T *ELT4_= nullptr );
128  void free(void);
129  public:
130  // constructor
131  Template3Dep( int tag ,
132  NDMaterial &theElMat,
133  YieldSurface *YS_ ,
134  PotentialSurface *PS_ ,
135  EPState *EPS_,
136  EvolutionLaw_S *ELS1_ ,
137  EvolutionLaw_S *ELS2_ ,
138  EvolutionLaw_S *ELS3_ ,
139  EvolutionLaw_S *ELS4_ ,
140  EvolutionLaw_T *ELT1_ ,
141  EvolutionLaw_T *ELT2_ ,
142  EvolutionLaw_T *ELT3_ ,
143  EvolutionLaw_T *ELT4_ );
144 
145  // Constructor0
146  // If no evolution law is provided, then there will be no hardening or softening!
147  Template3Dep( int tag ,
148  NDMaterial &theElMat,
149  YieldSurface *YS_ ,
150  PotentialSurface *PS_ ,
151  EPState *EPS_);
152 
153  // Constructor1
154  // Only one scalar evolution law is provided!
155  Template3Dep( int tag ,
156  NDMaterial &theElMat,
157  YieldSurface *YS_ ,
158  PotentialSurface *PS_ ,
159  EPState *EPS_,
160  EvolutionLaw_S *ELS1_ );
161 
162  // Constructor2
163  // Only one tensorial evolution law is provided!
164  Template3Dep( int tag ,
165  NDMaterial &theElMat,
166  YieldSurface *YS_ ,
167  PotentialSurface *PS_ ,
168  EPState *EPS_,
169  EvolutionLaw_T *ELT1_ );
170 
171  // Constructor 3
172  // One scalar evolution law and one tensorial evolution law are provided!
173  Template3Dep( int tag ,
174  NDMaterial &theElMat,
175  YieldSurface *YS_ ,
176  PotentialSurface *PS_ ,
177  EPState *EPS_,
178  EvolutionLaw_S *ELS1_,
179  EvolutionLaw_T *ELT1_ );
180 
181  // Constructor 4
182  // Two scalar evolution laws and one tensorial evolution law are provided!
183  Template3Dep( int tag ,
184  NDMaterial &theElMat,
185  YieldSurface *YS_ ,
186  PotentialSurface *PS_ ,
187  EPState *EPS_,
188  EvolutionLaw_S *ELS1_,
189  EvolutionLaw_S *ELS2_,
190  EvolutionLaw_T *ELT1_ );
191 
192  // Constructor 5
193  // Two scalar evolution laws and two tensorial evolution laws are provided!
194  Template3Dep( int tag ,
195  NDMaterial &theElMat,
196  YieldSurface *YS_ ,
197  PotentialSurface *PS_ ,
198  EPState *EPS_,
199  EvolutionLaw_S *ELS1_,
200  EvolutionLaw_S *ELS2_,
201  EvolutionLaw_T *ELT1_,
202  EvolutionLaw_T *ELT2_ );
203 
204  Template3Dep(int tag= 0);
205  Template3Dep(const Template3Dep &);
207  // For parallel processing
208  virtual ~Template3Dep(void);
209 
210  // methods to set state and retrieve state using Matrix and Vector classes
211  int setTrialStrain(const Vector &v);
212  int setTrialStrain(const Vector &v, const Vector &r);
213  int setTrialStrainIncr(const Vector &v) ;
214  int setTrialStrainIncr(const Vector &v, const Vector &r) ;
215  const Matrix &getTangent(void) const;
216  const Matrix &getInitialTangent(void) const;
217 
218  const Vector &getStress(void) const;
219  const Vector &getStrain(void) const;
220 
221  // methods to set and retrieve state using the Tensor class
222  int setTrialStrain(const Tensor &v) ;
223  int setTrialStrain(const Tensor &v, const Tensor &r) ;
224  int setTrialStrainIncr(const Tensor &v) ;
225  int setTrialStrainIncr(const Tensor &v, const Tensor &r) ;
226  const Tensor &getTangentTensor(void) const;
227  const stresstensor &getStressTensor(void) const;
228  const straintensor &getStrainTensor(void) const;
229  const straintensor &getPlasticStrainTensor(void) const; //Added Joey Aug. 13, 2001
230  double getpsi(void); //Added Joey 02-18-03
231 
232  EPState * getEPS() const;
233  void setEPS( EPState &eps);
234 
235  int commitState(void);
236  int revertToLastCommit(void);
237  int revertToStart(void);
238 
239  NDMaterial *getCopy(void) const;
240  NDMaterial *getCopy(const std::string &) const;
241 
242  const std::string &getType(void) const;
243  int getOrder(void) const ;
244 
245  int sendSelf(CommParameters &);
246  int recvSelf(const CommParameters &);
247 
248  void Print(std::ostream &s, int flag =0);
249 
250  //Private Utility method
251  //private:
252 
253  //These are from formerly CDriver
254  EPState ForwardEulerEPState( const straintensor &strain_increment);
255 
256  EPState SemiBackwardEulerEPState( const straintensor &strain_increment);
257 
258  EPState FESubIncrementation( const straintensor &strain_increment,
259  int number_of_subincrements);
260 
261  EPState BackwardEulerEPState( const straintensor &strain_increment);
262 
263  EPState BESubIncrementation( const straintensor & strain_increment,
264  int number_of_subincrements);
265  private:
266 
267  //================================================================================
268  // this one is intended to shell the previous three and to decide
269  // ( according to the data stored in Material_Model object )
270  // which constitutive tensor to return ( forward ( non-constistent
271  // or backward ( consistent ) or . . .
272 
273  //virtual tensor ConstitutiveTensor(stresstensor & final_stress,
274  // stresstensor & start_stress,
275  // straintensor & strain_increment,
276  // Material_Model & Criterion,
277  // double just_this_PP );
278 
279 
280  //================================================================================
281  // trying to find intersection point
282  // according to M. Crisfield's book
283  // "Non-linear Finite Element Analysis of Solids and Structures "
284  // chapter 6.6.1 page 168.
285  //================================================================================
286  EPState PredictorEPState(straintensor & strain_increment);
287 
288  stresstensor yield_surface_cross(const stresstensor & start_stress,
289  const stresstensor & end_stress);
290 
291  double zbrentstress(const stresstensor & start_stress,
292  const stresstensor & end_stress,
293  double x1, double x2, double tol);
294 
295  double func( const stresstensor &start_stress,
296  const stresstensor &end_stress,
297  double alfa );
298 
299  public:
300  BJtensor ElasticComplianceTensor(void) const;
301  BJtensor ElasticStiffnessTensor(void) const;
302 
303  private:
304  NDMaterial * getElMat() const;
305  YieldSurface * getYS() const;
306  PotentialSurface * getPS() const;
307 
308  //EPState &getEPS(void);
309 
310  //get scalar evolution laws
311  EvolutionLaw_S * getELS1() const;
312  EvolutionLaw_S * getELS2() const;
313  EvolutionLaw_S * getELS3() const;
314  EvolutionLaw_S * getELS4() const;
315 
316  //get tensorial evolution laws
317  EvolutionLaw_T * getELT1() const;
318  EvolutionLaw_T * getELT2() const;
319  EvolutionLaw_T * getELT3() const;
320  EvolutionLaw_T * getELT4() const;
321 
322 
323  friend std::ostream& operator<<(std::ostream &os, const Template3Dep & MP);
324  };
325 
327 std::ostream& operator<<(std::ostream &os, const Template3Dep & MP);
328 } // end of XC namespace
329 
330 
331 #endif
332 
const Vector & getStress(void) const
Returns the material stress vector at the current trial strain.
Definition: Template3Dep.cpp:847
Float vector abstraction.
Definition: Vector.h:93
int setTrialStrainIncr(const Vector &v)
Set trial strain increment.
Definition: Template3Dep.cpp:820
Template3Dep & operator=(const Template3Dep &)
Assignment operator.
Definition: Template3Dep.cpp:443
int setTrialStrain(const Vector &v)
Sets the value of the trial strain vector, that value used by {getStress()} and getTangent(), to be strain.
Definition: Template3Dep.cpp:806
Definition: stresst.h:68
int sendSelf(CommParameters &)
Send the object.
Definition: Template3Dep.cpp:1069
BJtensor ElasticComplianceTensor(void) const
Routine used to generate elastic compliance BJtensor D for this material point.
Definition: Template3Dep.cpp:453
Definition: BJtensor.h:110
int recvSelf(const CommParameters &)
Receive the object.
Definition: Template3Dep.cpp:1076
friend std::ostream & operator<<(std::ostream &os, const Template3Dep &MP)
Printing stuff.
The goal is to create a platform for efficient and easy implemetation of any elasto-plastic constitut...
Definition: PS.h:71
The goal is to create a platform for efficient and easy implemetation of any elasto-plastic constitut...
Definition: YS.h:70
??.
Definition: EL_S.h:71
3
Definition: EPState.h:73
EPState BackwardEulerEPState(const straintensor &strain_increment)
Definition: Template3Dep.cpp:2028
3
Definition: Template3Dep.h:82
const Matrix & getTangent(void) const
Return the tangent stiffness matrix at the current trial strain.
Definition: Template3Dep.cpp:835
Base class for 2D and 3D materials.
Definition: NDMaterial.h:97
void Print(std::ostream &s, int flag=0)
Print stuff.
Definition: Template3Dep.cpp:1084
??.
Definition: EL_T.h:69
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
NDMaterial * getCopy(void) const
Virtual constructor.
Definition: Template3Dep.cpp:1040
Template3Dep(int tag, NDMaterial &theElMat, YieldSurface *YS_, PotentialSurface *PS_, EPState *EPS_, EvolutionLaw_S *ELS1_, EvolutionLaw_S *ELS2_, EvolutionLaw_S *ELS3_, EvolutionLaw_S *ELS4_, EvolutionLaw_T *ELT1_, EvolutionLaw_T *ELT2_, EvolutionLaw_T *ELT3_, EvolutionLaw_T *ELT4_)
Constructor.
Definition: Template3Dep.cpp:285
Strain tensor.
Definition: straint.h:67
const Vector & getStrain(void) const
Returns strain.
Definition: Template3Dep.cpp:855