xc
PressureDependMultiYieldBase.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 //PressureDependMultiYieldBase.h
29 
30 #ifndef PressureDependMultiYieldBase_h
31 #define PressureDependMultiYieldBase_h
32 
33 #include "PressureMultiYieldBase.h"
34 #include "T2Vector.h"
35 
36 
37 namespace XC {
38 
39 class MultiYieldSurface;
40 
42 //
45  {
46  protected:
47  // user supplied
48  static std::vector<double> refShearModulusx;
49  static std::vector<double> refBulkModulusx;
50  static std::vector<double> phaseTransfAnglex;
51  static std::vector<double> contractParam1x;
52  static std::vector<double> dilateParam1x;
53  static std::vector<double> dilateParam2x;
54  static std::vector<double> einitx; //initial void ratio
55  static std::vector<double> liquefyParam1x;
56  static std::vector<double> liquefyParam2x;
57  static std::vector<double> volLimit1x;
58  static std::vector<double> volLimit2x;
59  static std::vector<double> volLimit3x;
60  static double pAtm;
61  static std::vector<double> Hvx;
62  static std::vector<double> Pvx;
63 
64  // internal
65 
66  mutable double modulusFactor;
67  mutable double initPress;
68 
69  mutable double pressureD;
70  double pressureDCommitted;
71  mutable int onPPZ; //=-1 never reach PPZ before; =0 below PPZ; =1 on PPZ; =2 above PPZ
72  int onPPZCommitted;
73  double strainPTOcta;
74  mutable double PPZSize;
75  double PPZSizeCommitted;
76  mutable double cumuDilateStrainOcta;
77  mutable double maxCumuDilateStrainOcta;
78  mutable double cumuTranslateStrainOcta;
79  mutable double prePPZStrainOcta;
80  mutable double oppoPrePPZStrainOcta;
81  static T2Vector trialStrain;
82  mutable T2Vector PPZPivot;
83  mutable T2Vector PPZCenter;
84 
85  double cumuDilateStrainOctaCommitted;
86  double maxCumuDilateStrainOctaCommitted;
87  double cumuTranslateStrainOctaCommitted;
88  double prePPZStrainOctaCommitted;
89  double oppoPrePPZStrainOctaCommitted;
90  T2Vector PPZPivotCommitted;
91  T2Vector PPZCenterCommitted;
92 
93  static Vector workV6;
94  static T2Vector workT2V;
95  double maxPress;
96 
97  void setupLocalMembers(int nd,
98  double rho,
99  double refShearModul,
100  double refBulkModul,
101  double frictionAng,
102  double peakShearStra,
103  double refPress,
104  double pressDependCoe,
105  double phaseTransformAngle,
106  double contractionParam1,
107  double dilationParam1,
108  double dilationParam2,
109  double liquefactionParam1,
110  double liquefactionParam2,
111  int numberOfYieldSurf,
112  const std::vector<double> &gredu,
113  double e,
114  double volLimit1,
115  double volLimit2,
116  double volLimit3,
117  double atm,
118  double cohesi,
119  double hv,
120  double pv);
121 
122  void elast2Plast(void) const;
123  // Called by constructor
124  double yieldFunc(const T2Vector & stress,const std::vector<MultiYieldSurface> &surfaces, int surface_num) const;
125  void deviatorScaling(T2Vector & stress,const std::vector<MultiYieldSurface> &surfaces, int surfaceNum) const;
126  void initSurfaceUpdate(void) const;
127 
128  // Return num_strain_subincre
129  int setSubStrainRate(void) const;
130  int isLoadReversal(const T2Vector &) const;
131  void getContactStress(T2Vector &contactStress) const;
132  void getSurfaceNormal(const T2Vector & stress, T2Vector &normal) const;
133  double getModulusFactor(const T2Vector &stress) const;
134  void setTrialStress(const T2Vector &stress) const;
135  double getLoadingFunc(const T2Vector & contact, const T2Vector & surfaceNormal,
136  double plasticPotential,int crossedSurface) const;
137  //return 1 if stress locked; o/w return 0.
138  void updateActiveSurface(void) const;
139  void updateInnerSurface(void) const;
140 
141  // Return 1 if crossing the active surface; return 0 o/w
142  int isCrossingNextSurface(void) const;
143  protected:
144  int sendData(Communicator &);
145  int recvData(const Communicator &);
146  public:
147  // Initialization constructor
148  PressureDependMultiYieldBase(int tag, int classTag,
149  int nd,
150  double rho,
151  double refShearModul,
152  double refBulkModul,
153  double frictionAng,
154  double peakShearStra,
155  double refPress,
156  double pressDependCoe,
157  double phaseTransformAngle,
158  double contractionParam1,
159  double dilationParam1,
160  double dilationParam2,
161  double liquefactionParam1,
162  double liquefactionParam2,
163  int numberOfYieldSurf = 20,
164  const std::vector<double> &gredu= std::vector<double>(),
165  double e = 0.6,
166  double volLimit1 = 0.9,
167  double volLimit2 = 0.02,
168  double volLimit3 = 0.7,
169  double atm = 101.,
170  double cohesi = 0.1,
171  double hv = 0.,
172  double pv = 1.);
173 
174  PressureDependMultiYieldBase(int tag, int classTag);
175 
176  // Copy constructor
178 
179  void setup(int nd,
180  double rho,
181  double refShearModul,
182  double refBulkModul,
183  double frictionAng,
184  double peakShearStra,
185  double refPress,
186  double pressDependCoe,
187  double phaseTransformAngle,
188  double contractionParam1,
189  double dilationParam1,
190  double dilationParam2,
191  double liquefactionParam1,
192  double liquefactionParam2,
193  int numberOfYieldSurf,
194  const std::vector<double> &gredu,
195  double e,
196  double volLimit1,
197  double volLimit2,
198  double volLimit3,
199  double atm,
200  double cohesi,
201  double hv,
202  double pv);
203  double getRho(void) const
204  {return rhox[matN];} ;
205 
206  // Sets the values of the trial strain tensor.
207  int setTrialStrain(const Vector &strain);
208 
209  // Sets the values of the trial strain and strain rate tensors.
210  int setTrialStrain(const Vector &v, const Vector &r);
211 
212  int setTrialStrainIncr(const Vector &v);
213  int setTrialStrainIncr(const Vector &v, const Vector &r);
214 
215  // Calculates current tangent stiffness.
216  const Matrix &getInitialTangent(void);
217 
218  void getBackbone(Matrix &);
219 
220  // Calculates the corresponding stress increment (rate), for a given strain increment.
221  const Vector &getStrain (void);
222  const Vector &getCommittedStress (void);
223  const Vector &getCommittedStrain (void);
224 
225  // Accepts the current trial strain values as being on the solution path, and updates
226  // all model parameters related to stress/strain states. Return 0 on success.
227  int commitState(void);
228 
229  // Revert the stress/strain states to the last committed states. Return 0 on success.
230  int revertToLastCommit (void);
231 
232  int revertToStart(void) {return 0;}
233 
234  // Return ndm.
235  int getOrder(void) const;
236 
237  int sendSelf(Communicator &);
238  int recvSelf(const Communicator &);
239  Response *setResponse(const std::vector<std::string> &argv, Information &matInfo);
240  int getResponse (int responseID, Information &matInformation);
241  void Print(std::ostream &s, int flag =0) const;
242  //void setCurrentStress(const Vector stress) { currentStress=T2Vector(stress); }
243  int updateParameter(int responseID, Information &eleInformation);
244  };
245 } // end of XC namespace
246 
247 #endif
int commitState(void)
Commit the state of the material.
Definition: PressureDependMultiYieldBase.cc:397
int getResponse(int responseID, Information &matInformation)
Returns material response.
Definition: PressureDependMultiYieldBase.cc:594
Float vector abstraction.
Definition: Vector.h:94
static std::vector< double > rhox
mass density
Definition: PressureMultiYieldBase.h:48
Definition: setup.py:1
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
const Vector & getCommittedStress(void)
Returns committed stresses.
Definition: PressureDependMultiYieldBase.cc:627
int updateParameter(int responseID, Information &eleInformation)
Updates the parameter identified by parameterID with info.
Definition: PressureDependMultiYieldBase.cc:443
int recvData(const Communicator &)
Receives object members through the communicator argument.
Definition: PressureDependMultiYieldBase.cc:476
double getRho(void) const
Get material density.
Definition: PressureDependMultiYieldBase.h:203
int revertToStart(void)
Revert the material to its initial state.
Definition: PressureDependMultiYieldBase.h:232
int setTrialStrainIncr(const Vector &v)
Set trial strain increment.
Definition: PressureDependMultiYieldBase.cc:303
const Vector & getCommittedStrain(void)
Returns committed strains.
Definition: PressureDependMultiYieldBase.cc:669
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: PressureDependMultiYieldBase.cc:495
int setTrialStrain(const Vector &strain)
Sets the value of the trial strain vector, that value used by {getStress()} and getTangent(), to be strain.
Definition: PressureDependMultiYieldBase.cc:269
??.
Definition: PressureDependMultiYieldBase.h:44
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: PressureDependMultiYieldBase.cc:621
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: PressureDependMultiYieldBase.cc:457
Matrix of floats.
Definition: Matrix.h:111
Second order tensor vector class.
Definition: T2Vector.h:65
??.
Definition: PressureMultiYieldBase.h:44
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: PressureDependMultiYieldBase.cc:510