xc
LoadPattern.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/LoadPattern.h,v $
50 
51 
52 #ifndef LoadPattern_h
53 #define LoadPattern_h
54 
55 // Written: fmk
56 // Created: 07/99
57 // Revision: A
58 //
59 // Purpose: This file contains the class definition for LoadPattern.
60 // LoadPattern is a concrete class
61 //
62 // What: "@(#) LoadPattern.h, revA"
63 
64 #include "NodeLocker.h"
65 #include "LoadContainer.h"
66 
67 namespace XC {
68 class NodalLoad;
69 class TimeSeries;
70 class ElementalLoad;
71 class NodalLoadIter;
72 class ElementalLoadIter;
73 class GroundMotion;
74 class Vector;
75 class MapLoadPatterns;
76 
81 //
83 //
93 class LoadPattern: public NodeLocker
94  {
95  private:
96  std::string description;
97  double loadFactor;
98  double gamma_f;
99 
100  TimeSeries *theSeries;
101 
102  // storage objects for the loads.
103  LoadContainer theLoads;
104 
105  // AddingSensitivity:BEGIN //////////////////////////////////////
106  Vector *randomLoads;
107  bool RVisRandomProcessDiscretizer;
108  // AddingSensitivity:END ////////////////////////////////////////
109 
110  void free(void);
111  protected:
112  bool isConstant;
113  DbTagData &getDbTagData(void) const;
114  int sendData(CommParameters &cp);
115  int recvData(const CommParameters &cp);
116  public:
117  LoadPattern(int tag= 0);
118  LoadPattern(int tag, int classTag); // for subclasses
119  virtual ~LoadPattern(void);
120 
121  // method to set the associated TimeSeries and Domain
122  virtual void setTimeSeries(TimeSeries *theSeries);
123  virtual void setDomain(Domain *theDomain);
124  bool addToDomain(void);
125  void removeFromDomain(void);
126 
127  // methods to add loads
128  virtual bool addNodalLoad(NodalLoad *);
129  NodalLoad *newNodalLoad(const int &,const Vector &);
130  virtual bool addElementalLoad(ElementalLoad *);
132  ElementalLoad *newElementalLoad(const std::string &);
133  virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp);
134 
136  inline LoadContainer &getLoads(void)
137  { return theLoads; }
139  inline const LoadContainer &getLoads(void) const
140  { return theLoads; }
142  inline int getNumNodalLoads(void) const
143  { return theLoads.getNumNodalLoads(); }
145  inline int getNumElementalLoads(void) const
146  { return theLoads.getNumElementalLoads(); }
148  inline int getNumLoads(void) const
149  { return theLoads.getNumLoads(); }
150 
151  // methods to remove things (loads, time_series,...)
152  virtual void clearAll(void);
153  virtual void clearLoads(void);
154  virtual bool removeNodalLoad(int tag);
155  virtual bool removeElementalLoad(int tag);
156 
157  // methods to apply loads
158  virtual void applyLoad(double pseudoTime = 0.0);
159  virtual void setLoadConstant(void);
160  inline void setIsConstant(const bool &b)
161  { isConstant= b; }
162  inline bool getIsConstant(void) const
163  { return isConstant; }
164 
165 
166  const MapLoadPatterns *getMapLoadPatterns(void) const;
168  const std::string &getName(void) const;
169  inline const std::string &getDescription(void) const
170  { return description; }
171  inline void setDescription(const std::string &d)
172  { description= d; }
173  virtual const double &getLoadFactor(void) const;
174  const double &GammaF(void) const;
175  double &GammaF(void);
176  void setGammaF(const double &);
177  LoadPattern &operator*=(const double &fact);
178  LoadPattern &operator/=(const double &fact);
179 
180  // methods for o/p
181  virtual int sendSelf(CommParameters &);
182  virtual int recvSelf(const CommParameters &);
183 
184  virtual void Print(std::ostream &s, int flag =0);
185 
186  virtual LoadPattern *getCopy(void);
187 
188  virtual int addMotion(GroundMotion &theMotion, int tag);
189  virtual GroundMotion *getMotion(int tag);
190 
191  // AddingSensitivity:BEGIN //////////////////////////////////////////
192  virtual void applyLoadSensitivity(double pseudoTime = 0.0);
193  virtual int setParameter(const std::vector<std::string> &argv, Parameter &param);
194  virtual int updateParameter(int parameterID, Information &info);
195  virtual int activateParameter(int parameterID);
196  virtual const Vector &getExternalForceSensitivity(int gradNumber);
197  // AddingSensitivity:END ///////////////////////////////////////////
198  };
199 
200 } // end of XC namespace
201 
202 #endif
203 
204 
205 
206 
207 
208 
209 
bool newElementalLoad(ElementalLoad *)
Appends the elemental load being passed as parameter.
Definition: LoadPattern.cpp:260
virtual int activateParameter(int parameterID)
Activates the parameter identified by parameterID.
Definition: LoadPattern.cpp:526
Float vector abstraction.
Definition: Vector.h:93
LoadContainer & getLoads(void)
Return the load container.
Definition: LoadPattern.h:136
int getNumNodalLoads(void) const
Return the number of nodal loads.
Definition: LoadPattern.h:142
const LoadContainer & getLoads(void) const
Return the load container.
Definition: LoadPattern.h:139
const double & GammaF(void) const
Returns the weighting factor set by the load combination.
Definition: LoadPattern.cpp:352
Information about an element.
Definition: Information.h:80
void setGammaF(const double &)
Sets the weighting factor set by the load combination.
Definition: LoadPattern.cpp:360
virtual bool addNodalLoad(NodalLoad *)
Adds the nodal load being passed as parameter.
Definition: LoadPattern.cpp:194
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: LoadPattern.cpp:409
virtual bool removeElementalLoad(int tag)
Remove the load over element which tag is being passed as parameter.
Definition: LoadPattern.cpp:316
virtual const double & getLoadFactor(void) const
Returns the weighting factor obtained from the TimeSeries object.
Definition: LoadPattern.cpp:348
virtual void setLoadConstant(void)
Marks the LoadPattern as being constant.
Definition: LoadPattern.cpp:344
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
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 void setTimeSeries(TimeSeries *theSeries)
Set the time series for the pattern.
Definition: LoadPattern.cpp:146
virtual bool addElementalLoad(ElementalLoad *)
Adds the element load being passed as parameter.
Definition: LoadPattern.cpp:240
virtual void setDomain(Domain *theDomain)
Set the domain for the pattern loads.
Definition: LoadPattern.cpp:163
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: LoadPattern.cpp:377
virtual void clearLoads(void)
Deletes all loads.
Definition: LoadPattern.cpp:294
int getNumElementalLoads(void) const
Return the number of elemental loads.
Definition: LoadPattern.h:145
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: LoadPattern.cpp:423
Single freedom constraint.
Definition: SFreedom_Constraint.h:84
Base class for ground motions.
Definition: GroundMotion.h:83
virtual LoadPattern * getCopy(void)
Virtual constructor.
Definition: LoadPattern.cpp:107
A LoadContainer object is used to to store loads on nodes and elements.
Definition: LoadContainer.h:76
int getNumLoads(void) const
Return the number of loads.
Definition: LoadPattern.h:148
LoadPattern(int tag=0)
Constructor.
Definition: LoadPattern.cpp:101
virtual void clearAll(void)
Deletes all loads, constraints AND pointer to time series.
Definition: LoadPattern.cpp:300
virtual void Print(std::ostream &s, int flag=0)
Prints load pattern information.
Definition: LoadPattern.cpp:437
int getNumNodalLoads(void) const
Returns the number of nodal loadss.
Definition: LoadContainer.cc:191
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: LoadPattern.cpp:384
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
NodalLoad * newNodalLoad(const int &, const Vector &)
Creates a nodal load.
Definition: LoadPattern.cpp:216
Load pattern container.
Definition: MapLoadPatterns.h:45
Time variation of loads.
Definition: TimeSeries.h:81
virtual bool removeNodalLoad(int tag)
Remove the nodal load which tag is being passed as parameter.
Definition: LoadPattern.cpp:308
Communication parameters between processes.
Definition: CommParameters.h:65
virtual ~LoadPattern(void)
Destructor.
Definition: LoadPattern.cpp:115
void removeFromDomain(void)
Removes load.
Definition: LoadPattern.cpp:183
virtual int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: LoadPattern.cpp:478
bool addToDomain(void)
Apply load.
Definition: LoadPattern.cpp:170
virtual void applyLoad(double pseudoTime=0.0)
Apply the load for pseudo-time being passed as parameter.
Definition: LoadPattern.cpp:324
virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp)
Adds the constraint being passed as parameter.
Definition: LoadPattern.cpp:290
Definition: Parameter.h:65
Base class for loads over elements.
Definition: ElementalLoad.h:77
const MapLoadPatterns * getMapLoadPatterns(void) const
Returns a const pointer to the container of the load pattern.
Definition: LoadPattern.cpp:119
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: LoadPattern.cpp:397
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
Load over a node.
Definition: NodalLoad.h:82
const std::string & getName(void) const
Returns the name of this load pattern.
Definition: LoadPattern.cpp:139
virtual int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: LoadPattern.cpp:511
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:112