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