xc
NDMaterial.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 ** 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 ** Additions and changes by: **
47 ** Boris Jeremic (@ucdavis.edu) **
48 ** **
49 ** **
50 ** ****************************************************************** */
51 
52 // $Revision: 1.16 $
53 // $Date: 2004/07/20 22:39:02 $
54 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/NDMaterial.h,v $
55 
56 
57 #ifndef NDMaterial_h
58 #define NDMaterial_h
59 
60 // File: ~/material/NDMaterial.h
61 //
62 // Written: MHS
63 // Created: Feb 2000
64 // Revision: A
65 //
66 // Description: This file contains the class definition for NDMaterial.
67 // NDMaterial is an abstract base class and thus no objects of it's type
68 // can be instantiated. It has pure virtual functions which must be
69 // implemented in it's derived classes.
70 //
71 // What: "@(#) NDMaterial.h, revA"
72 
73 #include <material/Material.h>
74 #include <utility/matrix/nDarray/stresst.h>
75 
76 namespace XC {
77 class Matrix;
78 class ID;
79 class Vector;
80 class Tensor;
81 class Information;
82 class Response;
83 
87 //
89 //
97 class NDMaterial: public Material
98  {
99  private:
100  static Matrix errMatrix;
101  static Vector errVector;
102  static Tensor errTensor;
103  static stresstensor errstresstensor;
104  static straintensor errstraintensor;
105  protected:
106  int sendData(CommParameters &);
107  int recvData(const CommParameters &);
108  public:
109  NDMaterial();
110  NDMaterial(int tag, int classTag);
111 
112  // methods to set state and retrieve state using Matrix and Vector classes
113  virtual double getRho(void) const;
114 // BJ added 19June2002
115  virtual double getE(void);
116  virtual double getnu(void);
117  virtual double getpsi(void);
118 
119 
120  virtual int setTrialStrain(const Vector &v);
121  virtual int setTrialStrain(const Vector &v, const Vector &r);
122  virtual int setTrialStrainIncr(const Vector &v);
123  virtual int setTrialStrainIncr(const Vector &v, const Vector &r);
124  virtual const Matrix &getTangent(void) const;
125  inline virtual const Matrix &getInitialTangent(void) const
126  {return this->getTangent();};
127 
128  virtual const Vector &getStress(void) const;
129  virtual const Vector &getStrain(void) const;
130  inline const Vector &getGeneralizedStress(void) const
131  { return getStress(); }
132  inline const Vector &getGeneralizedStrain(void) const
133  { return getStrain(); }
134 
135  virtual void setInitialGeneralizedStrain(const Vector &);
136  const Vector &getInitialGeneralizedStrain(void) const;
137 
138  virtual const Vector &getCommittedStress(void);
139  virtual const Vector &getCommittedStrain(void);
140 
141  // methods to set and retrieve state using the Tensor class
142  virtual int setTrialStrain(const Tensor &v);
143  virtual int setTrialStrain(const Tensor &v, const Tensor &r);
144  virtual int setTrialStrainIncr(const Tensor &v);
145  virtual int setTrialStrainIncr(const Tensor &v, const Tensor &r);
146  virtual const Tensor &getTangentTensor(void) const;
147  virtual const stresstensor &getStressTensor(void) const;
148  virtual const straintensor &getStrainTensor(void) const;
149  virtual const straintensor &getPlasticStrainTensor(void) const; //Added Joey Aug. 13, 2001
150 
151 //Zhao (zcheng@ucdavis.edu)
152 // added Sept 22 2003 for Large Deformation, F is the Deformation Gradient
153  virtual int setTrialF(const straintensor &f);
154  virtual int setTrialFIncr(const straintensor &df);
155  virtual int setTrialC(const straintensor &c);
156  virtual int setTrialCIncr(const straintensor &dc);
157  virtual const stresstensor getPK1StressTensor(void);
158  virtual const stresstensor getCauchyStressTensor(void);
159  virtual const straintensor &getF(void) const;
160  virtual const straintensor &getC(void) const;
161  virtual const straintensor getFp(void);
162 // Only For Large Deformation, END////////////////////////////////////////
163 
165  virtual NDMaterial *getCopy(void) const= 0;
166  virtual NDMaterial *getCopy(const std::string &) const= 0;
167 
168  virtual const std::string &getType(void) const = 0;
169  virtual int getOrder(void) const = 0;
170 
171  virtual Response *setResponse(const std::vector<std::string> &argv, Information &matInformation);
172  virtual int getResponse (int responseID, Information &matInformation);
173 
174 // AddingSensitivity:BEGIN //////////////////////////////////////////
175  virtual int setParameter(const std::vector<std::string> &argv, Parameter &param);
176  virtual int updateParameter (int parameterID, Information &info);
177  virtual int activateParameter (int parameterID);
178  virtual const Vector & getStressSensitivity (int gradNumber, bool conditional);
179  virtual const Vector & getStrainSensitivity (int gradNumber);
180  virtual const Matrix & getTangentSensitivity (int gradNumber);
181  virtual const Matrix & getDampTangentSensitivity(int gradNumber);
182  virtual double getRhoSensitivity (int gradNumber);
183  virtual int commitSensitivity (Vector & strainGradient, int gradNumber, int numGrads);
184 // AddingSensitivity:END ///////////////////////////////////////////
185 
186  };
187 
189 
190 } // end of XC namespace
191 
192 
193 #endif
virtual int setTrialStrain(const Vector &v)
Sets the value of the trial strain vector, that value used by {getStress()} and getTangent(), to be strain.
Definition: NDMaterial.cpp:124
virtual void setInitialGeneralizedStrain(const Vector &)
Asigna el initial strain value.
Definition: NDMaterial.cpp:156
Float vector abstraction.
Definition: Vector.h:93
virtual const Matrix & getTangent(void) const
Return the tangent stiffness matrix at the current trial strain.
Definition: NDMaterial.cpp:164
Definition: stresst.h:68
Information about an element.
Definition: Information.h:80
virtual int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: NDMaterial.cpp:367
NDMaterial * receiveNDMaterialPtr(NDMaterial *, DbTagData &, const CommParameters &, const BrokedPtrCommMetaData &)
Recibe a pointer a material through the channel being passed as parameter.
Definition: NDMaterial.cpp:405
Definition: Response.h:71
virtual const Vector & getStrain(void) const
Returns strain.
Definition: NDMaterial.cpp:180
NDMaterial()
Constructor.
Definition: NDMaterial.cpp:92
int sendData(CommParameters &)
Send object members through the channel being passed as parameter.
Definition: NDMaterial.cpp:350
Base class for materials.
Definition: Material.h:91
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Base class for 2D and 3D materials.
Definition: NDMaterial.h:97
int recvData(const CommParameters &)
Receives object members through the channel being passed as parameter.
Definition: NDMaterial.cpp:357
Data to transmit for a pointer «broked».
Definition: BrokedPtrCommMetaData.h:39
virtual NDMaterial * getCopy(void) const =0
Virtual constructor.
virtual int getResponse(int responseID, Information &matInformation)
Returns material response.
Definition: NDMaterial.cpp:334
const Vector & getInitialGeneralizedStrain(void) const
Return the initial strain.
Definition: NDMaterial.cpp:188
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
virtual int setTrialStrainIncr(const Vector &v)
Set trial strain increment.
Definition: NDMaterial.cpp:140
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
Definition: Parameter.h:65
virtual const Vector & getCommittedStrain(void)
Returns commited strains.
Definition: NDMaterial.cpp:116
virtual int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: NDMaterial.cpp:370
Strain tensor.
Definition: straint.h:67
virtual int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: NDMaterial.cpp:364
virtual const Vector & getCommittedStress(void)
Returns commited stresses.
Definition: NDMaterial.cpp:112
virtual const Vector & getStress(void) const
Returns the material stress vector at the current trial strain.
Definition: NDMaterial.cpp:172