xc
Template3Dep.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 /*
29 ################################################################################
30 # COPYRIGHT (C): :-)) #
31 # PROJECT: Object Oriented Finite Element Program #
32 # PURPOSE: General platform for elaso-plastic constitutive model #
33 # implementation #
34 # CLASS: Template3Dep (the base class for all material point) #
35 # #
36 # VERSION: #
37 # LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.00, SUN C++ ver=2.1 ) #
38 # TARGET OS: DOS || UNIX || . . . #
39 # DESIGNER(S): Boris Jeremic, Zhaohui Yang #
40 # PROGRAMMER(S): Boris Jeremic, Zhaohui Yang #
41 # #
42 # #
43 # DATE: 08-03-2000 #
44 # UPDATE HISTORY: 09-12-2000 #
45 # May 2004, Zhao Cheng splitting the elastic part #
46 # #
47 # #
48 # SHORT EXPLANATION: The Template3Dep class is used to hold specific #
49 # yield surface, potential surface, Evolution law(s) #
50 # and EPState of a 3D elasto-plastic material model for one #
51 # gauss point!! It is worthwhile noting that one model may #
52 # have multiple evolution law. Each evlotuion law is #
53 # used to evolve one internal var. #
54 # #
55 # #
56 ################################################################################
57 */
58 
59 #ifndef Template3Dep_H
60 #define Template3Dep_H
61 
62 #include <material/nD/NDMaterial.h>
63 #include "EPState.h"
64 
65 namespace XC {
66 class YieldSurface;
67 class PotentialSurface;
68 class EvolutionLaw_S;
69 class EvolutionLaw_T;
70 class Tensor;
71 
84 class Template3Dep: public NDMaterial
85  {
86  private:
87  NDMaterial *theElasticMat;
88  YieldSurface *YS;
89  PotentialSurface *PS;
90  EPState EPS;
91 
92  //Scalar variable evolution laws (currently at most 4 allowed)
93  EvolutionLaw_S *ELS1;
94  EvolutionLaw_S *ELS2;
95  EvolutionLaw_S *ELS3;
96  EvolutionLaw_S *ELS4;
97  void allocELS(const EvolutionLaw_S *ELS1_= nullptr,
98  const EvolutionLaw_S *ELS2_= nullptr,
99  const EvolutionLaw_S *ELS3_= nullptr,
100  const EvolutionLaw_S *ELS4_= nullptr );
101  void freeELS1(void);
102  void freeELS2(void);
103  void freeELS3(void);
104  void freeELS4(void);
105  void freeELS(void);
106 
107  //Tensorial variable evolution laws (currently at most 4 allowed)
108  EvolutionLaw_T *ELT1;
109  EvolutionLaw_T *ELT2;
110  EvolutionLaw_T *ELT3;
111  EvolutionLaw_T *ELT4;
112  void allocELT(const EvolutionLaw_T *ELT1_= nullptr,
113  const EvolutionLaw_T *ELT2_= nullptr,
114  const EvolutionLaw_T *ELT3_= nullptr,
115  const EvolutionLaw_T *ELT4_= nullptr );
116  void freeELT1(void);
117  void freeELT2(void);
118  void freeELT3(void);
119  void freeELT4(void);
120  void freeELT(void);
121 
122  void alloc( const NDMaterial *,
123  const YieldSurface *,
124  const PotentialSurface *,
125  const EPState &,
126  const EvolutionLaw_S *ELS1_= nullptr,
127  const EvolutionLaw_S *ELS2_= nullptr,
128  const EvolutionLaw_S *ELS3_= nullptr,
129  const EvolutionLaw_S *ELS4_= nullptr,
130  const EvolutionLaw_T *ELT1_= nullptr,
131  const EvolutionLaw_T *ELT2_= nullptr,
132  const EvolutionLaw_T *ELT3_= nullptr,
133  const EvolutionLaw_T *ELT4_= nullptr );
134  void free(void);
135  public:
136  Template3Dep(int tag= 0);
137  // constructor
138  Template3Dep(int tag,
139  const NDMaterial &,
140  const YieldSurface &,
141  const PotentialSurface &PS,
142  const EPState &EPS_,
143  const EvolutionLaw_S &ELS1_,
144  const EvolutionLaw_S &ELS2_,
145  const EvolutionLaw_S &ELS3_,
146  const EvolutionLaw_S &ELS4_,
147  const EvolutionLaw_T &ELT1_,
148  const EvolutionLaw_T &ELT2_,
149  const EvolutionLaw_T &ELT3_,
150  const EvolutionLaw_T &ELT4_);
151 
152  // Constructor0
153  // If no evolution law is provided, then there will be no hardening or softening!
154  Template3Dep(int tag, const NDMaterial &, const YieldSurface &, const PotentialSurface &PS_, const EPState &EPS_);
155 
156  // Constructor1
157  // Only one scalar evolution law is provided!
158  Template3Dep(int tag, const NDMaterial &, const YieldSurface &,const PotentialSurface &, const EPState &, const EvolutionLaw_S &);
159 
160  // Constructor2
161  // Only one tensorial evolution law is provided!
162  Template3Dep(int tag, const NDMaterial &, const YieldSurface &,const PotentialSurface &, const EPState &, const EvolutionLaw_T &);
163 
164  // Constructor 3
165  // One scalar evolution law and one tensorial evolution law are provided!
166  Template3Dep(int tag, const NDMaterial &, const YieldSurface &,const PotentialSurface &, const EPState &, const EvolutionLaw_S &, const EvolutionLaw_T &);
167 
168  // Constructor 4
169  // Two scalar evolution laws and one tensorial evolution law are provided!
170  Template3Dep(int tag, const NDMaterial &, const YieldSurface &,const PotentialSurface &, const EPState &, const EvolutionLaw_S &, const EvolutionLaw_S &, const EvolutionLaw_T &);
171 
172  // Constructor 5
173  // Two scalar evolution laws and two tensorial evolution laws are provided!
174  Template3Dep(int tag, const NDMaterial &, const YieldSurface &,const PotentialSurface &, const EPState &, const EvolutionLaw_S &, const EvolutionLaw_S &, const EvolutionLaw_T &, const EvolutionLaw_T &);
175 
176  Template3Dep(const Template3Dep &);
178  // For parallel processing
179  virtual ~Template3Dep(void);
180 
181  // methods to set state and retrieve state using Matrix and Vector classes
182  int setTrialStrain(const Vector &v);
183  int setTrialStrain(const Vector &v, const Vector &r);
184  int setTrialStrainIncr(const Vector &v) ;
185  int setTrialStrainIncr(const Vector &v, const Vector &r) ;
186  const Matrix &getTangent(void) const;
187  const Matrix &getInitialTangent(void) const;
188 
189  const Vector &getStress(void) const;
190  const Vector &getStrain(void) const;
191 
192  // methods to set and retrieve state using the Tensor class
193  int setTrialStrain(const Tensor &v) ;
194  int setTrialStrain(const Tensor &v, const Tensor &r) ;
195  int setTrialStrainIncr(const Tensor &v) ;
196  int setTrialStrainIncr(const Tensor &v, const Tensor &r) ;
197  const Tensor &getTangentTensor(void) const;
198  const stresstensor &getStressTensor(void) const;
199  const straintensor &getStrainTensor(void) const;
200  const straintensor &getPlasticStrainTensor(void) const; //Added Joey Aug. 13, 2001
201  double getpsi(void); //Added Joey 02-18-03
202 
203  const EPState &getEPS() const;
204  void setEPS(const EPState &eps);
205 
206  int commitState(void);
207  int revertToLastCommit(void);
208  int revertToStart(void);
209 
210  NDMaterial *getCopy(void) const;
211  NDMaterial *getCopy(const std::string &) const;
212 
213  const std::string &getType(void) const;
214  int getOrder(void) const ;
215 
216  int sendSelf(Communicator &);
217  int recvSelf(const Communicator &);
218 
219  void Print(std::ostream &s, int flag =0) const;
220 
221  //Private Utility method
222  //private:
223 
224  //These are from formerly CDriver
225  EPState ForwardEulerEPState( const straintensor &strain_increment);
226 
227  EPState SemiBackwardEulerEPState( const straintensor &strain_increment);
228 
229  EPState FESubIncrementation( const straintensor &strain_increment,
230  int number_of_subincrements);
231 
232  EPState BackwardEulerEPState( const straintensor &strain_increment);
233 
234  EPState BESubIncrementation( const straintensor & strain_increment,
235  int number_of_subincrements);
236  private:
237 
238  //========================================================================
239  // this one is intended to shell the previous three and to decide
240  // ( according to the data stored in Material_Model object )
241  // which constitutive tensor to return ( forward ( non-constistent
242  // or backward ( consistent ) or . . .
243 
244  //virtual tensor ConstitutiveTensor(stresstensor & final_stress,
245  // stresstensor & start_stress,
246  // straintensor & strain_increment,
247  // Material_Model & Criterion,
248  // double just_this_PP );
249 
250 
251  //========================================================================
252  // trying to find intersection point
253  // according to M. Crisfield's book
254  // "Non-linear Finite Element Analysis of Solids and Structures "
255  // chapter 6.6.1 page 168.
256  //========================================================================
257  EPState PredictorEPState(const straintensor &strain_increment);
258 
259  stresstensor yield_surface_cross(const stresstensor & start_stress,
260  const stresstensor & end_stress);
261 
262  double zbrentstress(const stresstensor & start_stress,
263  const stresstensor & end_stress,
264  double x1, double x2, double tol);
265 
266  double func( const stresstensor &start_stress,
267  const stresstensor &end_stress,
268  double alfa );
269 
270  public:
271  BJtensor ElasticComplianceTensor(void) const;
272  BJtensor ElasticStiffnessTensor(void) const;
273 
274  void freeElMat(void);
275  NDMaterial *getElMat() const;
276  void setElMat(const NDMaterial &);
277 
278  void freeYS(void);
279  YieldSurface *getYS() const;
280  void setYS(const YieldSurface &);
281 
282  void freePS(void);
283  PotentialSurface *getPS() const;
284  void setPS(const PotentialSurface &);
285 
286  //EPState &getEPS(void);
287 
288  //get scalar evolution laws
289  EvolutionLaw_S *getELS1() const;
290  void setELS1(const EvolutionLaw_S &);
291  EvolutionLaw_S *getELS2() const;
292  void setELS2(const EvolutionLaw_S &);
293  EvolutionLaw_S *getELS3() const;
294  void setELS3(const EvolutionLaw_S &);
295  EvolutionLaw_S *getELS4() const;
296  void setELS4(const EvolutionLaw_S &);
297 
298  //get tensorial evolution laws
299  EvolutionLaw_T *getELT1() const;
300  void setELT1(const EvolutionLaw_T &);
301  EvolutionLaw_T *getELT2() const;
302  void setELT2(const EvolutionLaw_T &);
303  EvolutionLaw_T *getELT3() const;
304  void setELT3(const EvolutionLaw_T &);
305  EvolutionLaw_T *getELT4() const;
306  void setELT4(const EvolutionLaw_T &);
307 
308 
309  friend std::ostream& operator<<(std::ostream &os, const Template3Dep & MP);
310  };
311 
313 std::ostream& operator<<(std::ostream &os, const Template3Dep & MP);
314 } // end of XC namespace
315 
316 
317 #endif
318 
const Vector & getStress(void) const
Returns the material stress vector at the current trial strain.
Definition: Template3Dep.cpp:822
void setPS(const PotentialSurface &)
Set the potential surface.
Definition: Template3Dep.cpp:1121
EvolutionLaw_S * getELS1() const
Get the 1st scalar evolution law.
Definition: Template3Dep.cpp:1136
void setELT2(const EvolutionLaw_T &)
Assing the second tensorial evolution law.
Definition: Template3Dep.cpp:1200
void setELS2(const EvolutionLaw_S &)
Assing ELS2.
Definition: Template3Dep.cpp:1152
int revertToStart(void)
Revert the material to its initial state.
Definition: Template3Dep.cpp:1001
void setELS4(const EvolutionLaw_S &)
Assing the fourth scalar evolution law.
Definition: Template3Dep.cpp:1176
EPState FESubIncrementation(const straintensor &strain_increment, int number_of_subincrements)
New EPState using Forward Euler Subincrement Euler Algorithm.
Definition: Template3Dep.cpp:2898
Float vector abstraction.
Definition: Vector.h:94
EPState ForwardEulerEPState(const straintensor &strain_increment)
New EPState using Forward Euler Algorithm.
Definition: Template3Dep.cpp:1243
int setTrialStrainIncr(const Vector &v)
Set trial strain increment.
Definition: Template3Dep.cpp:796
Template3Dep & operator=(const Template3Dep &)
Assignment operator.
Definition: Template3Dep.cpp:419
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:782
const EPState & getEPS() const
the EPState
Definition: Template3Dep.cpp:1128
Stress tensor.
Definition: stresst.h:70
Communication parameters between processes.
Definition: Communicator.h:66
PotentialSurface * getPS() const
Get the Potential Surface.
Definition: Template3Dep.cpp:1116
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: Template3Dep.cpp:1053
EvolutionLaw_S * getELS2() const
Get the 2nd scalar evolution law.
Definition: Template3Dep.cpp:1148
EvolutionLaw_T * getELT2() const
Get the second tensorial evolution law.
Definition: Template3Dep.cpp:1196
BJtensor ElasticComplianceTensor(void) const
Routine used to generate elastic compliance BJtensor D for this material point.
Definition: Template3Dep.cpp:429
NDMaterial * getElMat() const
Get the Elastic material //ZC05/2004.
Definition: Template3Dep.cpp:1073
void freeElMat(void)
Free elastic material memory.
Definition: Template3Dep.cpp:1063
const Matrix & getInitialTangent(void) const
Return the material initial stiffness.
Definition: Template3Dep.cpp:818
Boris Jeremic tensor class.
Definition: BJtensor.h:112
int recvSelf(const Communicator &)
Receive the object.
Definition: Template3Dep.cpp:1046
friend std::ostream & operator<<(std::ostream &os, const Template3Dep &MP)
Printing stuff.
EvolutionLaw_T * getELT4() const
Get the 4th tensorial evolution law.
Definition: Template3Dep.cpp:1220
int revertToLastCommit(void)
Revert the material to its last commited state.
Definition: Template3Dep.cpp:992
Template3Dep(int tag=0)
Default constructor.
Definition: Template3Dep.cpp:264
Definition: PotentialSurface.h:76
YieldSurface * getYS() const
Get the Yield Surface.
Definition: Template3Dep.cpp:1095
void setELS3(const EvolutionLaw_S &)
Assing the third scalar evolution law.
Definition: Template3Dep.cpp:1164
EPState BESubIncrementation(const straintensor &strain_increment, int number_of_subincrements)
New EPState using Backward Euler Subincrement Euler Algorithm.
Definition: Template3Dep.cpp:2967
void setELT3(const EvolutionLaw_T &)
Assing the third tensorial evolution law.
Definition: Template3Dep.cpp:1212
int sendSelf(Communicator &)
Send the object.
Definition: Template3Dep.cpp:1039
void setELS1(const EvolutionLaw_S &)
Assing ELS1.
Definition: Template3Dep.cpp:1140
Base class for yield surfaces.
Definition: YieldSurface.h:69
Base class for scalar evolution laws.
Definition: EvolutionLaw_S.h:70
void setElMat(const NDMaterial &)
Set the elastic material.
Definition: Template3Dep.cpp:1077
Base class for all elasto-plastic states.
Definition: EPState.h:151
int commitState(void)
Commit material state.
Definition: Template3Dep.cpp:983
EPState BackwardEulerEPState(const straintensor &strain_increment)
New EPState using Backward Euler Algorithm.
Definition: Template3Dep.cpp:1969
EvolutionLaw_S * getELS4() const
Get the fourth scalar evolution law.
Definition: Template3Dep.cpp:1172
Definition: Template3Dep.h:84
EvolutionLaw_T * getELT3() const
Get the third tensorial evolution law.
Definition: Template3Dep.cpp:1208
void freePS(void)
Free potential surface memory.
Definition: Template3Dep.cpp:1106
const Matrix & getTangent(void) const
Return the material tangent stiffness.
Definition: Template3Dep.cpp:811
Base class for 2D and 3D materials.
Definition: NDMaterial.h:101
void setELT1(const EvolutionLaw_T &)
Assing the first tensorial evolution law.
Definition: Template3Dep.cpp:1188
void setELT4(const EvolutionLaw_T &)
Assing the 4th tensorial evolution law.
Definition: Template3Dep.cpp:1224
Base class for tensorial evolution laws.
Definition: EvolutionLaw_T.h:72
EvolutionLaw_T * getELT1() const
Get the first tensorial evolution law.
Definition: Template3Dep.cpp:1184
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
EvolutionLaw_S * getELS3() const
Get the third scalar evolution law.
Definition: Template3Dep.cpp:1160
Matrix of floats.
Definition: Matrix.h:111
NDMaterial * getCopy(void) const
Virtual constructor.
Definition: Template3Dep.cpp:1010
void freeYS(void)
Free yield surface memory.
Definition: Template3Dep.cpp:1085
void setYS(const YieldSurface &)
Set the yield surface.
Definition: Template3Dep.cpp:1099
EPState SemiBackwardEulerEPState(const straintensor &strain_increment)
Starting EPState using Semi Backward Euler Starting Point.
Definition: Template3Dep.cpp:1757
Strain tensor.
Definition: straint.h:68
const Vector & getStrain(void) const
Returns strain.
Definition: Template3Dep.cpp:830