XC Open source finite element analysis program
DqGroundMotions.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 //DqGroundMotions.h
28 
29 #ifndef DqGroundMotions_h
30 #define DqGroundMotions_h
31 
32 #include "xc_utils/src/nucleo/EntCmd.h"
33 #include <deque>
34 #include "utility/actor/actor/MovableObject.h"
35 
36 
37 namespace XC {
38 
39  class GroundMotion;
40 
42 //
44  class DqGroundMotions : public EntCmd, public MovableObject
45  {
46  protected:
47  typedef std::deque<GroundMotion *> dq_ptr_GroundMotions;
48  typedef dq_ptr_GroundMotions::const_reference const_reference;
49  typedef dq_ptr_GroundMotions::reference reference;
50  typedef dq_ptr_GroundMotions::iterator iterator;
51  typedef dq_ptr_GroundMotions::const_iterator const_iterator;
52 
53  dq_ptr_GroundMotions gMotions;
54 
55 
56 
57  int sendData(CommParameters &);
58  int recvData(const CommParameters &);
59 
60 
61  public:
62  DqGroundMotions(const size_t &num= 0);
63  DqGroundMotions(const DqGroundMotions &otro);
65  ~DqGroundMotions(void);
66 
67  inline bool empty(void) const
68  { return gMotions.empty(); }
69  inline size_t getNumGroundMotions(void) const
70  { return gMotions.size(); }
71 
72  inline iterator begin(void)
73  { return gMotions.begin(); }
74  inline const_iterator begin(void) const
75  { return gMotions.begin(); }
76  inline iterator end(void)
77  { return gMotions.end(); }
78  inline const_iterator end(void) const
79  { return gMotions.end(); }
80 
81  inline reference operator[](const size_t &n)
82  { return gMotions[n]; }
83  inline const_reference operator[](const size_t &n) const
84  { return gMotions[n]; }
85 
86  void addMotion(GroundMotion &f);
87 
88  void clear(void);
89 
90  int sendSelf(CommParameters &);
91  int recvSelf(const CommParameters &);
92 
93 
94  void Print(std::ostream &s,const int &flag);
95  };
96 } // end of XC namespace
97 
98 #endif
DqGroundMotions & operator=(const DqGroundMotions &otro)
Assignment operator.
Definition: DqGroundMotions.cc:44
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DqGroundMotions.cc:117
Object that can move between processes.
Definition: MovableObject.h:91
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: DqGroundMotions.cc:103
dq_ptr_GroundMotions gMotions
Cola de pointers to GroundMotion.
Definition: DqGroundMotions.h:53
int recvData(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DqGroundMotions.cc:85
DqGroundMotions(const size_t &num=0)
Constructor.
Definition: DqGroundMotions.cc:36
Base class for ground motions.
Definition: GroundMotion.h:83
Contenedor de definiciones de sismo.
Definition: DqGroundMotions.h:44
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
int sendData(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: DqGroundMotions.cc:72
~DqGroundMotions(void)
Destructor:
Definition: DqGroundMotions.cc:68