xc
LoadPattern.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/LoadPattern.h,v $
51 
52 
53 #ifndef LoadPattern_h
54 #define LoadPattern_h
55 
56 // Written: fmk
57 // Created: 07/99
58 // Revision: A
59 //
60 // Purpose: This file contains the class definition for LoadPattern.
61 // LoadPattern is a concrete class
62 //
63 // What: "@(#) LoadPattern.h, revA"
64 
65 #include "NodeLocker.h"
66 #include "LoadContainer.h"
67 #include <utility/matrix/Vector.h>
68 
69 namespace XC {
70 class NodalLoad;
71 class TimeSeries;
72 class ElementalLoad;
73 class NodalLoadIter;
74 class ElementalLoadIter;
75 class GroundMotion;
76 class Vector;
77 class MapLoadPatterns;
78 
83 //
85 //
97 class LoadPattern: public NodeLocker
98  {
99  private:
100  std::string description;
101  double loadFactor;
102  double gamma_f;
103 
104  TimeSeries *theSeries;
105 
106  // storage objects for the loads.
107  LoadContainer theLoads;
108 
109  // AddingSensitivity:BEGIN //////////////////////////////////////
110  Vector randomLoads;
111  bool RVisRandomProcessDiscretizer;
112  // AddingSensitivity:END ////////////////////////////////////////
113 
114  void free(void);
115  protected:
116  bool isConstant;
117  DbTagData &getDbTagData(void) const;
118  int sendData(Communicator &comm);
119  int recvData(const Communicator &comm);
120  public:
121  LoadPattern(int tag= 0);
122  LoadPattern(int tag, int classTag); // for subclasses
123  virtual ~LoadPattern(void);
124 
125  // method to set the associated TimeSeries and Domain
126  const TimeSeries *getTimeSeries(void) const;
127  TimeSeries *getTimeSeries(void);
128  virtual void setTimeSeries(TimeSeries *theSeries);
129  virtual void setDomain(Domain *theDomain);
130  bool addToDomain(void);
131  void removeFromDomain(void);
132  virtual bool isActive(void) const;
133 
134  // methods to add loads
135  virtual bool addNodalLoad(NodalLoad *);
136  NodalLoad *newNodalLoad(const int &,const Vector &);
137  virtual bool addElementalLoad(ElementalLoad *);
139  ElementalLoad *newElementalLoad(const std::string &);
140  virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp);
141 
143  inline LoadContainer &getLoads(void)
144  { return theLoads; }
146  inline const LoadContainer &getLoads(void) const
147  { return theLoads; }
149  inline int getNumNodalLoads(void) const
150  { return theLoads.getNumNodalLoads(); }
152  inline int getNumElementalLoads(void) const
153  { return theLoads.getNumElementalLoads(); }
155  inline int getNumLoads(void) const
156  { return theLoads.getNumLoads(); }
157 
158  // methods to remove things (loads, time_series,...)
159  virtual void clearAll(void);
160  virtual void clearLoads(void);
161  virtual bool removeNodalLoad(int tag);
162  virtual bool removeElementalLoad(int tag);
163 
164  bool actsOn(const Node *) const;
165  void removeLoadsOn(const Node *);
166  void copyLoads(const Node *, const Node *);
167  bool actsOn(const Element *) const;
168  void removeLoadsOn(const Element *);
169  void copyLoads(const Element *, const Element *);
170 
171  // methods to apply loads
172  virtual void applyLoad(double pseudoTime = 0.0);
173  virtual void setLoadConstant(void);
174  inline void setIsConstant(const bool &b)
175  { isConstant= b; }
176  inline bool getIsConstant(void) const
177  { return isConstant; }
178 
179  const MapLoadPatterns *getMapLoadPatterns(void) const;
181  const std::string &getName(void) const;
182  std::string getFactoredName(void) const;
183  inline const std::string &getDescription(void) const
184  { return description; }
185  inline void setDescription(const std::string &d)
186  { description= d; }
187  virtual const double &getLoadFactor(void) const;
188  const double &GammaF(void) const;
189  double &GammaF(void);
190  void setGammaF(const double &);
191  LoadPattern &operator*=(const double &fact);
192  LoadPattern &operator/=(const double &fact);
193  // methods for o/p
194  virtual int sendSelf(Communicator &);
195  virtual int recvSelf(const Communicator &);
196 
197  virtual void Print(std::ostream &s, int flag =0) const;
198 
199  virtual LoadPattern *getCopy(void);
200 
201  virtual int addMotion(GroundMotion &theMotion, int tag);
202  virtual GroundMotion *getMotion(int tag);
203 
204  // AddingSensitivity:BEGIN //////////////////////////////////////////
205  virtual void applyLoadSensitivity(double pseudoTime = 0.0);
206  virtual int setParameter(const std::vector<std::string> &argv, Parameter &param);
207  virtual int updateParameter(int parameterID, Information &info);
208  virtual int activateParameter(int parameterID);
209  virtual const Vector &getExternalForceSensitivity(int gradNumber);
210  // AddingSensitivity:END ///////////////////////////////////////////
211  };
212 
213 } // end of XC namespace
214 
215 #endif
216 
217 
218 
219 
220 
221 
222 
bool newElementalLoad(ElementalLoad *)
Appends the elemental load being passed as parameter.
Definition: LoadPattern.cpp:303
virtual int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: LoadPattern.cpp:616
Float vector abstraction.
Definition: Vector.h:94
LoadContainer & getLoads(void)
Return the load container.
Definition: LoadPattern.h:143
int getNumNodalLoads(void) const
Return the number of nodal loads.
Definition: LoadPattern.h:149
const LoadContainer & getLoads(void) const
Return the load container.
Definition: LoadPattern.h:146
const double & GammaF(void) const
Returns the partial safety factor according to the load combination.
Definition: LoadPattern.cpp:440
Information about an element.
Definition: Information.h:81
void setGammaF(const double &)
Sets the partial safety factor according to the load combination.
Definition: LoadPattern.cpp:448
virtual bool addNodalLoad(NodalLoad *)
Adds the nodal load being passed as parameter.
Definition: LoadPattern.cpp:224
Communication parameters between processes.
Definition: Communicator.h:66
virtual bool removeElementalLoad(int tag)
Remove the load over element which tag is being passed as parameter.
Definition: LoadPattern.cpp:364
virtual const double & getLoadFactor(void) const
Returns the weighting factor obtained from the TimeSeries object.
Definition: LoadPattern.cpp:436
virtual void setLoadConstant(void)
Marks the LoadPattern as being constant.
Definition: LoadPattern.cpp:432
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: LoadPattern.cpp:474
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: LoadPattern.cpp:487
int getNumLoads(void) const
Returns the total number of loads.
Definition: LoadContainer.cc:209
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 void setTimeSeries(TimeSeries *theSeries)
Set the time series for the pattern.
Definition: LoadPattern.cpp:165
virtual bool addElementalLoad(ElementalLoad *)
Adds the element load being passed as parameter.
Definition: LoadPattern.cpp:283
Base class for the finite elements.
Definition: Element.h:112
virtual void setDomain(Domain *theDomain)
Set the domain for the pattern loads.
Definition: LoadPattern.cpp:182
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: LoadPattern.cpp:467
virtual void clearLoads(void)
Deletes all loads.
Definition: LoadPattern.cpp:342
int getNumElementalLoads(void) const
Return the number of elemental loads.
Definition: LoadPattern.h:152
virtual void Print(std::ostream &s, int flag=0) const
Prints load pattern information.
Definition: LoadPattern.cpp:527
Single freedom constraint.
Definition: SFreedom_Constraint.h:85
Base class for ground motions.
Definition: GroundMotion.h:84
virtual LoadPattern * getCopy(void)
Virtual constructor.
Definition: LoadPattern.cpp:104
A LoadContainer object is used to to store loads on nodes and elements.
Definition: LoadContainer.h:78
int getNumLoads(void) const
Return the number of loads.
Definition: LoadPattern.h:155
void removeLoadsOn(const Node *)
Removes the given node from all the load patterns.
Definition: LoadPattern.cpp:376
const TimeSeries * getTimeSeries(void) const
Return the time series pointer (const version).
Definition: LoadPattern.cpp:157
LoadPattern(int tag=0)
Constructor.
Definition: LoadPattern.cpp:98
virtual int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: LoadPattern.cpp:499
virtual void clearAll(void)
Deletes all loads, constraints AND pointer to time series.
Definition: LoadPattern.cpp:348
std::string getFactoredName(void) const
Returns the name of this load pattern multiplied by its partial safety factor.
Definition: LoadPattern.cpp:144
int getNumNodalLoads(void) const
Returns the number of nodal loadss.
Definition: LoadContainer.cc:191
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:45
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
NodalLoad * newNodalLoad(const int &, const Vector &)
Creates a nodal load.
Definition: LoadPattern.cpp:247
Load pattern container.
Definition: MapLoadPatterns.h:46
Time variation of loads.
Definition: TimeSeries.h:85
virtual bool removeNodalLoad(int tag)
Remove the nodal load which tag is being passed as parameter.
Definition: LoadPattern.cpp:356
virtual ~LoadPattern(void)
Destructor.
Definition: LoadPattern.cpp:112
LoadPattern & operator/=(const double &fact)
Divides the partial safety factor.
Definition: LoadPattern.cpp:459
void removeFromDomain(void)
Removes load.
Definition: LoadPattern.cpp:202
virtual int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: LoadPattern.cpp:568
bool addToDomain(void)
Apply load.
Definition: LoadPattern.cpp:189
virtual void applyLoad(double pseudoTime=0.0)
Apply the load for pseudo-time being passed as parameter.
Definition: LoadPattern.cpp:412
virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp)
Adds the constraint being passed as parameter.
Definition: LoadPattern.cpp:338
Parameter.
Definition: Parameter.h:68
virtual int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: LoadPattern.cpp:513
Base class for loads over elements.
Definition: ElementalLoad.h:79
const MapLoadPatterns * getMapLoadPatterns(void) const
Returns a const pointer to the container of the load pattern.
Definition: LoadPattern.cpp:116
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
void copyLoads(const Node *, const Node *)
Copy the loads from the first node to the second one.
Definition: LoadPattern.cpp:382
bool actsOn(const Node *) const
Return true if the load pattern acts on the given node.
Definition: LoadPattern.cpp:372
virtual bool isActive(void) const
Return true if the load pattern is already added to the domain.
Definition: LoadPattern.cpp:214
LoadPattern & operator*=(const double &fact)
Multiplies the partial safety factor.
Definition: LoadPattern.cpp:452
Load over a node.
Definition: NodalLoad.h:83
const std::string & getName(void) const
Returns the name of this load pattern.
Definition: LoadPattern.cpp:136
virtual int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: LoadPattern.cpp:601
int getNumElementalLoads(void) const
Returns the number of elemental loadss.
Definition: LoadContainer.cc:200
bool isConstant
to indicate whether setConstant has been called
Definition: LoadPattern.h:116