xc
LoadContainer.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 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.12 $
48 // $Date: 2005/11/22 19:44:22 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/load/pattern/LoadContainer.h,v $
50 
51 
52 #ifndef LoadContainer_h
53 #define LoadContainer_h
54 
55 #include "xc_utils/src/kernel/CommandEntity.h"
56 #include "utility/actor/actor/MovableObject.h"
57 
58 namespace XC {
59 class NodalLoad;
60 class ElementalLoad;
61 class NodalLoadIter;
62 class ElementalLoadIter;
63 class Vector;
64 class TaggedObjectStorage;
65 class Domain;
66 
71 //
73 //
76 class LoadContainer: public CommandEntity, public MovableObject
77  {
78  friend class LoadPattern;
79  private:
80  // storage objects for the loads.
81  TaggedObjectStorage *theNodalLoads;
82  TaggedObjectStorage *theElementalLoads;
83 
84  // iterator objects for the objects added to the storage objects
85  NodalLoadIter *theNodIter;
86  ElementalLoadIter *theEleIter;
87 
88  void free_containers(void);
89  void free_iterators(void);
90  void alloc_containers(void);
91  void alloc_iterators(void);
92  void free(void);
93  protected:
94  DbTagData &getDbTagData(void) const;
95  int sendData(CommParameters &cp);
96  int recvData(const CommParameters &cp);
97 
98  // methods to add loads
99  virtual bool addNodalLoad(NodalLoad *);
100  virtual bool addElementalLoad(ElementalLoad *);
101 
102  virtual bool removeNodalLoad(int tag);
103  virtual bool removeElementalLoad(int tag);
104  public:
105  LoadContainer(CommandEntity *);
106  virtual ~LoadContainer(void);
107 
108  virtual void setDomain(Domain *theDomain);
109 
110 
111  virtual NodalLoadIter &getNodalLoads(void);
112  virtual ElementalLoadIter &getElementalLoads(void);
113  int getNumNodalLoads(void) const;
114  int getNumElementalLoads(void) const;
115  int getNumLoads(void) const;
116 
117  // methods to remove things (loads, time_series,...)
118  virtual void clearAll(void);
119  virtual void clearLoads(void);
120 
121  // methods to apply loads
122  virtual void applyLoad(const double &);
123 
124 
125  // methods for o/p
126  virtual int sendSelf(CommParameters &);
127  virtual int recvSelf(const CommParameters &);
128 
129  virtual void Print(std::ostream &s, int flag =0);
130 
131  virtual LoadContainer *getCopy(void);
132 
133  // AddingSensitivity:BEGIN //////////////////////////////////////////
134  virtual void applyLoadSensitivity(const double &);
135  virtual int setParameter(const std::vector<std::string> &, Parameter &);
136  virtual int updateParameter(int parameterID, Information &);
137  virtual int activateParameter(int parameterID);
138  Vector getExternalForceSensitivity(int gradNumber);
139  // AddingSensitivity:END ///////////////////////////////////////////
140  };
141 
142 } // end of XC namespace
143 
144 #endif
145 
146 
147 
148 
149 
150 
151 
virtual int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: LoadContainer.cc:444
Float vector abstraction.
Definition: Vector.h:93
virtual void applyLoad(const double &)
Apply the load multiplied by the factor.
Definition: LoadContainer.cc:250
LoadContainer(CommandEntity *)
Default constructor.
Definition: LoadContainer.cc:114
Information about an element.
Definition: Information.h:80
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: LoadContainer.cc:265
Object that can move between processes.
Definition: MovableObject.h:99
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: LoadContainer.cc:280
int getNumLoads(void) const
Returns the total number of loads.
Definition: LoadContainer.cc:209
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:93
virtual int setParameter(const std::vector< std::string > &, Parameter &)
Sets the value param to the parameter argv.
Definition: LoadContainer.cc:344
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: LoadContainer.cc:289
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
virtual ~LoadContainer(void)
Destructor.
Definition: LoadContainer.cc:132
virtual bool addNodalLoad(NodalLoad *)
Adds the nodal load being passed as parameter.
Definition: LoadContainer.cc:157
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: LoadContainer.cc:272
virtual void clearAll(void)
Deletes all loads, constraints AND pointer to time series.
Definition: LoadContainer.cc:221
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:237
virtual void clearLoads(void)
Deletes all loads.
Definition: LoadContainer.cc:214
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:76
virtual int updateParameter(int parameterID, Information &)
Updates the parameter identified by parameterID with info.
Definition: LoadContainer.cc:397
Elemental loads iterator.
Definition: ElementalLoadIter.h:75
Nodal loads iterator.
Definition: NodalLoadIter.h:74
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:34
virtual ElementalLoadIter & getElementalLoads(void)
Returns an iterator to the elemental loads.
Definition: LoadContainer.cc:184
Communication parameters between processes.
Definition: CommParameters.h:65
Definition: Parameter.h:65
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: LoadContainer.cc:303
Base class for loads over elements.
Definition: ElementalLoad.h:77
virtual void Print(std::ostream &s, int flag=0)
Prints load pattern information.
Definition: LoadContainer.cc:317
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
virtual bool removeNodalLoad(int tag)
To remove the nodal load whose identifier is given by tag from the LoadPattern and sets the laods ass...
Definition: LoadContainer.cc:230
Load over a node.
Definition: NodalLoad.h:82
int getNumElementalLoads(void) const
Returns the number of elemental loadss.
Definition: LoadContainer.cc:200