xc
LoadHandler.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 //LoadHandler.h
29 
30 #ifndef LOADLOADER_H
31 #define LOADLOADER_H
32 
33 #include "PrepHandler.h"
34 #include "domain/load/pattern/MapLoadPatterns.h"
35 #include "domain/load/pattern/LoadCombinationGroup.h"
36 #include <list>
37 
38 namespace XC {
39 class GroundMotion;
40 class LoadCombination;
41 
45 class LoadHandler: public PrepHandler
46  {
47  typedef std::map<std::string,GroundMotion *> map_ground_motions;
48  map_ground_motions ground_motions;
49 
50  MapLoadPatterns lpatterns;
51  int tag_lp;
52 
53  LoadCombinationGroup combinations;
54 
55  protected:
56  friend class LoadCombination;
57  friend class Domain;
58 
59  DbTagData &getDbTagData(void) const;
60  int sendData(Communicator &);
61  int recvData(const Communicator &);
62  public:
64  ~LoadHandler(void);
65 
66  void addToDomain(const std::string &);
67  void removeFromDomain(const std::string &);
68  void removeAllFromDomain(void);
69 
70  inline int &getTagLP(void)
71  { return tag_lp; }
72  inline const int &getTagLP(void) const
73  { return tag_lp; }
74  inline void setTagLP(const int &tlp)
75  { tag_lp= tlp; }
76 
77  MapLoadPatterns &getLoadPatterns(void)
78  { return lpatterns; }
79  const MapLoadPatterns &getLoadPatterns(void) const
80  { return lpatterns; }
81  map_ground_motions &getGroundMotions(void)
82  { return ground_motions; }
83  const map_ground_motions &getGroundMotions(void) const
84  { return ground_motions; }
85 
86  std::list<LoadPattern *> getLoadPatternsActingOn(const Node *);
87  boost::python::list getLoadPatternsActingOnPy(const Node *);
88  void removeLoadsOn(const Node *);
89  void copyLoads(const Node *, const Node *);
90  std::list<LoadPattern *> getLoadPatternsActingOn(const Element *);
91  boost::python::list getLoadPatternsActingOnPy(const Element *);
92  void removeLoadsOn(const Element *);
93  void copyLoads(const Element *, const Element *);
94 
95  LoadCombinationGroup &getLoadCombinations(void)
96  { return combinations; }
97  const LoadCombinationGroup &getLoadCombinations(void) const
98  { return combinations; }
99 
100  void clearAll(void);
101 
102  int sendSelf(Communicator &);
103  int recvSelf(const Communicator &);
104  boost::python::dict getPyDict(void) const;
105  void setPyDict(const boost::python::dict &);
106 
107  };
108 
109 } // end of XC namespace
110 
111 #endif
void removeLoadsOn(const Node *)
Removes the given node from all the load patterns.
Definition: LoadHandler.cc:100
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: LoadHandler.cc:195
void addToDomain(const std::string &)
Adds the load pattern to the domain.
Definition: LoadHandler.cc:44
void copyLoads(const Node *, const Node *)
Copy the loads from the first node to the second one.
Definition: LoadHandler.cc:108
Load combination container.
Definition: LoadCombinationGroup.h:47
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: LoadHandler.cc:168
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: LoadHandler.cc:253
Communication parameters between processes.
Definition: Communicator.h:66
LoadHandler(Preprocessor *owr)
Default constructor.
Definition: LoadHandler.cc:40
Finite element model generation tools.
Definition: Preprocessor.h:59
~LoadHandler(void)
Destructor.
Definition: LoadHandler.cc:84
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
void clearAll(void)
Clears all the objects.
Definition: LoadHandler.cc:77
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: LoadHandler.cc:235
Base class for the preprocessor objects that create model entities: nodes, elements, loads, etc.
Definition: PrepHandler.h:47
int recvData(const Communicator &)
Send members through the communicator argument.
Definition: LoadHandler.cc:158
Base class for the finite elements.
Definition: Element.h:112
void removeFromDomain(const std::string &)
Remove load pattern from domain.
Definition: LoadHandler.cc:61
boost::python::list getLoadPatternsActingOnPy(const Node *)
Return the load patterns that act on the given node.
Definition: LoadHandler.cc:94
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Load pattern container.
Definition: MapLoadPatterns.h:46
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: LoadHandler.cc:141
Load definition manager.
Definition: LoadHandler.h:45
Base class for load pattern combinations (1.5*selfWeight+1.0*permanentLoad+1.6*trafficLoad ...
Definition: LoadCombination.h:45
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
std::list< LoadPattern * > getLoadPatternsActingOn(const Node *)
Return the load patterns that act on the given node.
Definition: LoadHandler.cc:88
int sendData(Communicator &)
Send members through the communicator argument.
Definition: LoadHandler.cc:148