xc
DampingVector.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 // under the terms of the GNU General Public License 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 //DampingVector.h
29 
30 #ifndef DampingVector_h
31 #define DampingVector_h
32 
33 #include <vector>
34 #include "utility/kernel/CommandEntity.h"
35 #include "utility/actor/actor/MovableID.h"
36 
37 
38 namespace XC {
39 class Damping;
40 class Domain;
41 
44 class DampingVector: public std::vector<Damping *>, public CommandEntity, public MovableObject
45  {
46  protected:
47  void clearAll(void);
48  void alloc(const std::vector<Damping *> &);
49 
50 
51  DbTagData &getDbTagData(void) const;
52  int sendData(Communicator &);
53  int recvData(const Communicator &);
54  public:
55  typedef typename std::vector<Damping *> damping_vector;
56  typedef typename damping_vector::iterator iterator;
57  typedef typename damping_vector::const_iterator const_iterator;
58  typedef typename damping_vector::reference reference;
59  typedef typename damping_vector::const_reference const_reference;
60 
61  DampingVector(const size_t &n, const Damping *matModel= nullptr);
64  ~DampingVector(void)
65  { clearAll(); }
66 
67  void clearDampings(void);
68  void setDamping(const Damping *);
69  void setDamping(size_t i,Damping *);
70  void setDamping(size_t i, const Damping &);
71  void copyPropsFrom(const EntityWithProperties *);
72 
73  void setDomain(Domain *domain, int nComp);
74 
75  bool empty(void) const;
76  int commitState(void);
77  int revertToLastCommit(void);
78  int revertToStart(void);
79 
80  std::set<int> getTags(void) const;
81  boost::python::list getTagsPy(void) const;
82 
83  int sendSelf(Communicator &);
84  int recvSelf(const Communicator &);
85  };
86 
87 
88 } // end of XC namespace
89 
90 #endif
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: DampingVector.cc:225
Communication parameters between processes.
Definition: Communicator.h:66
int revertToLastCommit(void)
Returns dampings to its last committed state.
Definition: DampingVector.cc:176
Object that can return properties as Python objects.
Definition: EntityWithProperties.h:32
Object that can move between processes.
Definition: MovableObject.h:100
void copyPropsFrom(const EntityWithProperties *)
copy the user defined properties of the given object on each of the dampings.
Definition: DampingVector.cc:113
DampingVector(const size_t &n, const Damping *matModel=nullptr)
Default constructor.
Definition: DampingVector.cc:38
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
void alloc(const std::vector< Damping *> &)
Copy dampings from another vector.
Definition: DampingVector.cc:54
int revertToStart(void)
Return dampings to its initial state.
Definition: DampingVector.cc:187
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: DampingVector.cc:239
int commitState(void)
Commits dampings state (normally after convergence).
Definition: DampingVector.cc:166
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: DampingVector.cc:253
Damping pointer container.
Definition: DampingVector.h:44
bool empty(void) const
Returns true if no damping assigned.
Definition: DampingVector.cc:138
Objet that can execute python scripts.
Definition: CommandEntity.h:40
int recvData(const Communicator &)
Receives object through the communicator argument.
Definition: DampingVector.cc:232
boost::python::list getTagsPy(void) const
Return the identifiers of the materials in a python list.
Definition: DampingVector.cc:207
DampingVector & operator=(const DampingVector &)
Assignment operator.
Definition: DampingVector.cc:79
Definition: Damping.h:83
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
std::set< int > getTags(void) const
Return the identifiers of the materials.
Definition: DampingVector.cc:198
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: DampingVector.cc:218