xc
Material.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 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.3 $
49 // $Date: 2003/02/25 23:33:21 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/material/Material.h,v $
51 
52 
53 #ifndef Material_h
54 #define Material_h
55 
56 // File: Material.h
57 //
58 // Written: fmk
59 // Created: 05/98
60 // Revision: A
61 //
62 // Description: This file contains the class definition for Material.
63 // Material is an abstract base class and thus no objects of it's type
64 // can be instantiated. It has pure virtual functions which must be
65 // implemented in it's derived classes.
66 //
67 // What: "@(#) Material.h, revA"
68 
69 #include "utility/tagged/TaggedObject.h"
70 #include "utility/actor/actor/MovableObject.h"
71 #include "utility/actor/objectBroker/FEM_ObjectBroker.h"
72 #include "utility/matrix/ID.h"
73 #include "utility/actor/actor/BrokedPtrCommMetaData.h"
74 
75 namespace XC {
76 class Information;
77 class Response;
78 class MaterialHandler;
79 class Domain;
80 class ID;
81 
83 
85 //
93 class Material: public TaggedObject, public MovableObject
94  {
95  protected:
96  bool isEqual(const Material &) const;
97  public:
98  Material(int tag, int classTag);
99 
100  const MaterialHandler *getMaterialHandler(void) const;
102  const Domain *getDomain(void) const;
103  Domain *getDomain(void);
104  std::string getName(void) const;
105  const Material *getMaterialByName(const std::string &) const;
106 
107  virtual int setVariable(const std::string &argv);
108  virtual int getVariable(int variableID, double &info);
109 
110  // methods for sensitivity studies
111  virtual int setParameter(const std::vector<std::string> &argv, Parameter &param);
112  virtual int updateParameter(int responseID, Information &eleInformation);
113 
114  virtual Response *setResponse(const std::vector<std::string> &argv, Information &eleInformation);
115  virtual int getResponse(int responseID, Information &info);
116  virtual Matrix getValues(const std::string &, bool silent= false) const;
117 
118  virtual void update(void);
119 
120  virtual const Vector &getGeneralizedStress(void) const= 0;
121  virtual const Vector &getGeneralizedStrain(void) const= 0;
122  virtual const Vector &getInitialGeneralizedStrain(void) const= 0;
123 
124  virtual void setInitialGeneralizedStrain(const Vector &)= 0;
125  virtual void incrementInitialGeneralizedStrain(const Vector &);
126  virtual void zeroInitialGeneralizedStrain(void);
127 
128  virtual int commitState(void) = 0;
129  virtual int revertToLastCommit(void) = 0;
130  virtual int revertToStart(void) = 0;
131 
132  boost::python::dict getPyDict(void) const;
133  void setPyDict(const boost::python::dict &);
134  };
135 
138 
139 } // end of XC namespace
140 
141 
142 #endif
143 
Float vector abstraction.
Definition: Vector.h:94
virtual Matrix getValues(const std::string &, bool silent=false) const
Returns material response.
Definition: Material.cpp:198
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
Material(int tag, int classTag)
Constructor.
Definition: Material.cpp:96
Object that can move between processes.
Definition: MovableObject.h:100
std::string getName(void) const
Returns the name of the material.
Definition: Material.cpp:167
const Domain * getDomain(void) const
Returns (if possible) a pointer to the material handler (owner).
Definition: Material.cpp:139
virtual int getResponse(int responseID, Information &info)
Returns material response.
Definition: Material.cpp:192
virtual void update(void)
Update state variables for the material according to the new values of the parameters.
Definition: Material.cpp:226
const Material * getMaterialByName(const std::string &) const
Definition: Material.cpp:71
Base class for materials.
Definition: Material.h:93
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Material.cpp:299
virtual int updateParameter(int responseID, Information &eleInformation)
Updates the parameter identified by parameterID with info.
Definition: Material.cpp:185
virtual void incrementInitialGeneralizedStrain(const Vector &)
Increments generalized strain.
Definition: Material.cpp:231
virtual void zeroInitialGeneralizedStrain(void)
zeroes initial generalized strain
Definition: Material.cpp:249
bool isEqual(const Material &) const
Return true if both objects are equal.
Definition: Material.cpp:100
int sendMaterialPtr(Material *, DbTagData &, Communicator &comm, const BrokedPtrCommMetaData &)
Sends a pointer to material through the communicator being passed as parameter.
Definition: Material.cpp:260
Material handler (definition, searching,...).
Definition: MaterialHandler.h:46
Data to transmit for a pointer «broked».
Definition: BrokedPtrCommMetaData.h:40
virtual int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: Material.cpp:182
Object idenfied by an integer (tag).
Definition: TaggedObject.h:92
const MaterialHandler * getMaterialHandler(void) const
Returns (if possible) a pointer to the material handler (owner).
Definition: Material.cpp:117
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
Material * receiveMaterialPtr(Material *, DbTagData &, const Communicator &comm, const BrokedPtrCommMetaData &)
Receives a pointer to material through the communicator being passed as parameter.
Definition: Material.cpp:278
Parameter.
Definition: Parameter.h:68
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Material.cpp:307
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117