xc
LoadContainer.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 /* ****************************************************************** **
29 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.12 $
49 // $Date: 2005/11/22 19:44:22 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/domain/load/pattern/LoadContainer.h,v $
51 
52 
53 #ifndef LoadContainer_h
54 #define LoadContainer_h
55 
56 #include <list>
57 #include "utility/kernel/CommandEntity.h"
58 #include "utility/actor/actor/MovableObject.h"
59 
60 namespace XC {
61 class NodalLoad;
62 class ElementalLoad;
63 class NodalLoadIter;
64 class ElementalLoadIter;
65 class Vector;
66 class TaggedObjectStorage;
67 class Domain;
68 
73 //
75 //
79  {
80  friend class LoadPattern;
81  private:
82  // storage objects for the loads.
83  TaggedObjectStorage *theNodalLoads;
84  TaggedObjectStorage *theElementalLoads;
85 
86  // iterator objects for the objects added to the storage objects
87  NodalLoadIter *theNodIter;
88  ElementalLoadIter *theEleIter;
89 
90  void free_containers(void);
91  void free_iterators(void);
92  void alloc_containers(void);
93  void alloc_iterators(void);
94  void free(void);
95  protected:
96  DbTagData &getDbTagData(void) const;
97  int sendData(Communicator &comm);
98  int recvData(const Communicator &comm);
99 
100  // methods to add loads
101  virtual bool addNodalLoad(NodalLoad *);
102  virtual bool addElementalLoad(ElementalLoad *);
103 
104  virtual bool removeNodalLoad(int tag);
105  virtual bool removeElementalLoad(int tag);
106  public:
108  virtual ~LoadContainer(void);
109 
110  virtual void setDomain(Domain *theDomain);
111 
112 
113  virtual NodalLoadIter &getNodalLoads(void);
114  virtual ElementalLoadIter &getElementalLoads(void);
115  int getNumNodalLoads(void) const;
116  int getNumElementalLoads(void) const;
117  int getNumLoads(void) const;
118  bool empty(void) const;
119 
120  bool actsOn(const Node *) const;
121  void removeLoadsOn(const Node *);
122  std::list<NodalLoad *> getLoadsOn(const Node *);
123  bool actsOn(const Element *) const;
124  void removeLoadsOn(const Element *);
125  void copyLoads(const Element *, const Element *);
126 
127  // methods to remove things (loads, time_series,...)
128  virtual void clearAll(void);
129  virtual void clearLoads(void);
130 
131  // methods to apply loads
132  virtual void applyLoad(const double &);
133 
134  // methods for o/p
135  virtual int sendSelf(Communicator &);
136  virtual int recvSelf(const Communicator &);
137 
138  virtual void Print(std::ostream &s, int flag =0) const;
139 
140  virtual LoadContainer *getCopy(void);
141 
142  // AddingSensitivity:BEGIN //////////////////////////////////////////
143  virtual void applyLoadSensitivity(const double &);
144  virtual int setParameter(const std::vector<std::string> &, Parameter &);
145  virtual int updateParameter(int parameterID, Information &);
146  virtual int activateParameter(int parameterID);
147  Vector getExternalForceSensitivity(int gradNumber);
148  // AddingSensitivity:END ///////////////////////////////////////////
149  };
150 
151 } // end of XC namespace
152 
153 #endif
154 
155 
156 
157 
158 
159 
160 
virtual int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: LoadContainer.cc:400
virtual int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: LoadContainer.cc:555
Float vector abstraction.
Definition: Vector.h:94
virtual void applyLoad(const double &)
Apply the load multiplied by the factor.
Definition: LoadContainer.cc:360
LoadContainer(CommandEntity *)
Default constructor.
Definition: LoadContainer.cc:114
Information about an element.
Definition: Information.h:81
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: LoadContainer.cc:376
Communication parameters between processes.
Definition: Communicator.h:66
bool empty(void) const
Returns true if there is no loads.
Definition: LoadContainer.cc:214
Object that can move between processes.
Definition: MovableObject.h:100
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
void copyLoads(const Element *, const Element *)
Copy the loads from the first element to the second one.
Definition: LoadContainer.cc:339
int getNumLoads(void) const
Returns the total number of loads.
Definition: LoadContainer.cc:209
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: LoadContainer.cc:383
A load pattern is the spatial distribution as well as its variation in time of a specific set of forc...
Definition: LoadPattern.h:97
virtual int setParameter(const std::vector< std::string > &, Parameter &)
Sets the value param to the parameter argv.
Definition: LoadContainer.cc:455
Base class for the finite elements.
Definition: Element.h:112
virtual NodalLoadIter & getNodalLoads(void)
Returns an iterator to the nodal loads.
Definition: LoadContainer.cc:177
virtual void setDomain(Domain *theDomain)
Set the domain for the pattern loads.
Definition: LoadContainer.cc:137
std::list< NodalLoad * > getLoadsOn(const Node *)
Return the loads acting on the given node.
Definition: LoadContainer.cc:283
virtual int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: LoadContainer.cc:414
virtual ~LoadContainer(void)
Destructor.
Definition: LoadContainer.cc:132
virtual bool addNodalLoad(NodalLoad *)
Adds the nodal load being passed as parameter.
Definition: LoadContainer.cc:157
virtual void clearAll(void)
Deletes all loads, constraints AND pointer to time series.
Definition: LoadContainer.cc:226
virtual bool removeElementalLoad(int tag)
To remove the elemental load whose identifier is given by tag from the LoadPattern and set the loads ...
Definition: LoadContainer.cc:242
virtual void clearLoads(void)
Deletes all loads.
Definition: LoadContainer.cc:219
Objet that can execute python scripts.
Definition: CommandEntity.h:40
virtual LoadContainer * getCopy(void)
Virtual constructor.
Definition: LoadContainer.cc:124
A LoadContainer object is used to to store loads on nodes and elements.
Definition: LoadContainer.h:78
virtual int updateParameter(int parameterID, Information &)
Updates the parameter identified by parameterID with info.
Definition: LoadContainer.cc:508
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: LoadContainer.cc:391
Elemental loads iterator.
Definition: ElementalLoadIter.h:76
Nodal loads iterator.
Definition: NodalLoadIter.h:75
void removeLoadsOn(const Node *)
Remove the loads acting on the given node.
Definition: LoadContainer.cc:267
virtual bool addElementalLoad(ElementalLoad *)
Adds the element load being passed as parameter.
Definition: LoadContainer.cc:167
int getNumNodalLoads(void) const
Returns the number of nodal loadss.
Definition: LoadContainer.cc:191
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual ElementalLoadIter & getElementalLoads(void)
Returns an iterator to the elemental loads.
Definition: LoadContainer.cc:184
bool actsOn(const Node *) const
Return true if the load pattern acts on the given node.
Definition: LoadContainer.cc:246
Parameter.
Definition: Parameter.h:68
Base class for loads over elements.
Definition: ElementalLoad.h:79
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
virtual bool removeNodalLoad(int tag)
To remove the nodal load whose identifier is given by tag from the LoadPattern and sets the loads ass...
Definition: LoadContainer.cc:235
virtual void Print(std::ostream &s, int flag=0) const
Prints load pattern information.
Definition: LoadContainer.cc:428
Load over a node.
Definition: NodalLoad.h:83
int getNumElementalLoads(void) const
Returns the number of elemental loadss.
Definition: LoadContainer.cc:200