xc
DamageModelVector.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 // under the terms of the GNU General Public License 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 //DamageModelVector.h
28 
29 #ifndef DamageModelVector_h
30 #define DamageModelVector_h
31 
32 #include "material/MaterialVector.h"
33 #include "material/uniaxial/UniaxialMaterial.h"
34 #include "xc_utils/src/kernel/CommandEntity.h"
35 #include "utility/actor/actor/MovableID.h"
36 #include "utility/matrix/Vector.h"
37 
38 
39 namespace XC {
40 
41 class DamageModel;
42 
44 //
47 class DamageModelVector: public std::vector<DamageModel *>, public CommandEntity, public MovableObject
48  {
49  protected:
50  void borra_dmg_models(void);
51  void clearAll(void);
52  void alloc(const std::vector<DamageModel *> &);
53 
54  DbTagData &getDbTagData(void) const;
55  int sendData(CommParameters &);
56  int recvData(const CommParameters &);
57  public:
59  typedef typename std::vector<DamageModel *> dmg_model_vector;
60  typedef typename dmg_model_vector::iterator iterator;
61  typedef typename dmg_model_vector::reference reference;
62  typedef typename dmg_model_vector::const_reference const_reference;
63 
64  DamageModelVector(const size_t &nDamageModels,const DamageModel *dmgModel= nullptr);
67  ~DamageModelVector(void)
68  { clearAll(); }
69 
70  void setDamageModel(const DamageModel *);
71  void setDamageModel(size_t i,DamageModel *);
72  bool empty(void) const;
73  int commitState(const material_vector &);
74  int revertToLastCommit(void);
75  int revertToStart(void);
76 
77  int sendSelf(CommParameters &);
78  int recvSelf(const CommParameters &);
79  };
80 
81 
82 
83 } // end of XC namespace
84 
85 #endif
DamageModelVector(const size_t &nDamageModels, const DamageModel *dmgModel=nullptr)
Default constructor.
Definition: DamageModelVector.cc:33
int sendData(CommParameters &)
Send object members through the channel being passed as parameter.
Definition: DamageModelVector.cc:198
Object that can move between processes.
Definition: MovableObject.h:99
int recvData(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DamageModelVector.cc:206
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: DamageModelVector.cc:215
void alloc(const std::vector< DamageModel *> &)
Copy the damage models.
Definition: DamageModelVector.cc:48
int commitState(const material_vector &)
Consuma el estado de los dmg_models.
Definition: DamageModelVector.cc:127
int revertToStart(void)
Returns the estado de los dmg_models al inicial.
Definition: DamageModelVector.cc:174
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DamageModelVector.cc:228
int revertToLastCommit(void)
Returns the damage models to its last commited state.
Definition: DamageModelVector.cc:158
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Vector de pointers to damage models.
Definition: DamageModelVector.h:47
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: DamageModelVector.cc:190
Definition: DamageModel.h:86
bool empty(void) const
Returns true ifno se ha asignado damage model.
Definition: DamageModelVector.cc:111
DamageModelVector & operator=(const DamageModelVector &)
Assignment operator.
Definition: DamageModelVector.cc:71