xc
InitialStateAnalysisWrapper.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 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 #ifndef InitialStateAnalysisWrapper_h
48 #define InitialStateAnalysisWrapper_h
49 
50 // Written: Chris McGann
51 // February 2011
52 
53 // Description: This file contains the class definition for InitialStateAnalysisWrapper.
54 
55 #include <material/nD/NDMaterial.h>
56 #include "material/nD/NDMaterialWrapper.h"
57 #include <utility/matrix/Vector.h>
58 #include <utility/matrix/Matrix.h>
59 #include <utility/matrix/ID.h>
60 
61 namespace XC {
62 
66  {
67  protected:
68  static bool initialStateAnalysis;
69  NDMaterialWrapper theMainMaterial; // pointer to main material object
70 
71  // input variables
72  int mDIM;
73 
74  // member variables
77 
78  int sendData(Communicator &);
79  int recvData(const Communicator &);
80  public:
81 
82  InitialStateAnalysisWrapper(int tag= 0);
83  // full constructor
84  InitialStateAnalysisWrapper(int tag, NDMaterial &mainMat, int ndim);
85 
86  int commitState(void);
87  int revertToLastCommit(void);
88  int revertToStart(void);
89 
90  // set the strain to be sent to the main material
91  int setTrialStrain(const Vector &strain_from_element);
92 
93  const NDMaterial *getMaterial(void) const;
94  NDMaterial *getMaterial(void);
95  virtual void setMaterial(const NDMaterial &);
96  void setMaterial(const std::string &);
97  void setup(int ndim, const NDMaterial &);
98 
99  // get mass density from main material
100  double getRho(void) const;
101 
102  static bool getInitialStateAnalysisPhase(void);
103  static void setInitialStateAnalysisPhase(const bool &);
104 
105  const Vector &getInitialGeneralizedStrain(void) const;
106  void setInitialGeneralizedStrain(const Vector &);
107 
108  // send back strain
109  const Vector& getStrain() const;
110  // send back stress
111  const Vector& getStress() const;
112  // send back the tangent
113  const Matrix &getTangent() const;
114  const Matrix &getInitialTangent() const;
115 
116  NDMaterial *getCopy(const std::string &) const;
117  NDMaterial *getCopy(void) const;
118  const std::string &getType(void) const;
119  int getOrder(void) const;
120 
121  Response *setResponse(const std::vector<std::string> &argv, Information &matInfo);
122  int getResponse (int responseID, Information &matInformation);
123 
124  int sendSelf(Communicator &);
125  int recvSelf(const Communicator &);
126 
127  void Print(std::ostream &, int flag =0) const;
128 
129  int setParameter(const std::vector<std::string> &, Parameter &);
130  int updateParameter(int parameterID, Information &info);
131 
132  friend class PyLiq1;
133  friend class TzLiq1;
134  friend class QzLiq1; // Sumeet
135 
136  int getMainClassTag() const; // sends class tag of main material object
137  };
138 } // end XC namespace
139 #endif
void setInitialGeneralizedStrain(const Vector &)
Sets the initial strain value.
Definition: InitialStateAnalysisWrapper.cpp:139
int setTrialStrain(const Vector &strain_from_element)
Sets the value of the trial strain vector, that value used by {getStress()} and getTangent(), to be strain.
Definition: InitialStateAnalysisWrapper.cpp:153
Float vector abstraction.
Definition: Vector.h:94
Definition: setup.py:1
int sendSelf(Communicator &)
Send the object.
Definition: InitialStateAnalysisWrapper.cpp:215
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
int revertToStart(void)
Revert the material to its initial state.
Definition: InitialStateAnalysisWrapper.cpp:145
Base class response objects.
Definition: Response.h:81
virtual void setMaterial(const NDMaterial &)
Sets the encapsulated material.
Definition: InitialStateAnalysisWrapper.cpp:107
const Vector & getStrain() const
Returns strain.
Definition: InitialStateAnalysisWrapper.cpp:171
int setParameter(const std::vector< std::string > &, Parameter &)
Sets the value param to the parameter argv.
Definition: InitialStateAnalysisWrapper.cpp:248
const Vector & getStress() const
Returns the material stress vector at the current trial strain.
Definition: InitialStateAnalysisWrapper.cpp:175
const Matrix & getTangent() const
brief this function sends the tangent back to the element
Definition: InitialStateAnalysisWrapper.cpp:182
const NDMaterial * getMaterial(void) const
Return a pointer to the wrapped material.
Definition: InitialStateAnalysisWrapper.cpp:99
double getRho(void) const
Get material density.
Definition: InitialStateAnalysisWrapper.cpp:165
Uniaxial p-y material that incorporates liquefaction effects.
Definition: PyLiq1.h:61
Encapsulates a copy to an uniaxial material.
Definition: NDMaterialWrapper.h:40
Vector mStrain
strain sent to the main material
Definition: InitialStateAnalysisWrapper.h:76
Vector mEpsilon_o
initial strain stored here
Definition: InitialStateAnalysisWrapper.h:75
int sendData(Communicator &)
Send material.
Definition: InitialStateAnalysisWrapper.cpp:194
Uniaxial t-z material that incorporates liquefaction effects.
Definition: TzLiq1.h:61
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: InitialStateAnalysisWrapper.cpp:306
NDMaterial * getCopy(void) const
Virtual constructor.
Definition: InitialStateAnalysisWrapper.cpp:83
int mDIM
number of dimensions in problem
Definition: InitialStateAnalysisWrapper.h:72
Initial state analysis wrapper material.
Definition: InitialStateAnalysisWrapper.h:65
const Vector & getInitialGeneralizedStrain(void) const
Return the initial strain.
Definition: InitialStateAnalysisWrapper.cpp:136
Base class for 2D and 3D materials.
Definition: NDMaterial.h:101
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
Parameter.
Definition: Parameter.h:68
void Print(std::ostream &, int flag=0) const
Print stuff.
Definition: InitialStateAnalysisWrapper.cpp:240
int recvSelf(const Communicator &)
Receive the object.
Definition: InitialStateAnalysisWrapper.cpp:227
int recvData(const Communicator &)
Receive material.
Definition: InitialStateAnalysisWrapper.cpp:205
int getResponse(int responseID, Information &matInformation)
Returns material response.
Definition: InitialStateAnalysisWrapper.cpp:318