XC Open source finite element analysis program
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 
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 
80 //
82 //
87 class LoadPattern: public NodeLocker
88  {
89  private:
90  std::string description;
91  double loadFactor;
92  double gamma_f;
93 
94  TimeSeries *theSeries;
95 
96  // storage objects for the loads.
97  TaggedObjectStorage *theNodalLoads;
98  TaggedObjectStorage *theElementalLoads;
99 
100  // iterator objects for the objects added to the storage objects
101  NodalLoadIter *theNodIter;
102  ElementalLoadIter *theEleIter;
103 
104  // AddingSensitivity:BEGIN //////////////////////////////////////
105  Vector *randomLoads;
106  bool RVisRandomProcessDiscretizer;
107  // AddingSensitivity:END ////////////////////////////////////////
108 
109  void libera_contenedores(void);
110  void libera_iteradores(void);
111  void alloc_contenedores(void);
112  void alloc_iteradores(void);
113  void libera(void);
114  protected:
115  int isConstant; // to indicate whether setConstant has been called
116  DbTagData &getDbTagData(void) const;
117  int sendData(CommParameters &cp);
118  int recvData(const CommParameters &cp);
119  public:
120  LoadPattern(int tag);
121  LoadPattern(void); // for FEM_ObjectBroker
122  LoadPattern(int tag, int classTag); // for subclasses
123  virtual ~LoadPattern(void);
124 
125  // method to set the associated TimeSeries and Domain
126  virtual void setTimeSeries(TimeSeries *theSeries);
127  virtual void setDomain(Domain *theDomain);
128  bool addToDomain(void);
129  void removeFromDomain(void);
130 
131  // methods to add loads
132  virtual bool addNodalLoad(NodalLoad *);
133  NodalLoad *newNodalLoad(const int &,const Vector &);
134  virtual bool addElementalLoad(ElementalLoad *);
136  ElementalLoad *newElementalLoad(const std::string &);
137  virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp);
138 
139  virtual NodalLoadIter &getNodalLoads(void);
140  virtual ElementalLoadIter &getElementalLoads(void);
141  int getNumNodalLoads(void) const;
142  int getNumElementalLoads(void) const;
143  int getNumLoads(void) const;
144 
145  // methods to remove things (loads, time_series,...)
146  virtual void clearAll(void);
147  virtual void clearLoads(void);
148  virtual bool removeNodalLoad(int tag);
149  virtual bool removeElementalLoad(int tag);
150 
151  // methods to apply loads
152  virtual void applyLoad(double pseudoTime = 0.0);
153  virtual void setLoadConstant(void);
154 
155 
156  inline const std::string &getDescription(void) const
157  { return description; }
158  inline void setDescription(const std::string &d)
159  { description= d; }
160  virtual const double &getLoadFactor(void) const;
161  const double &GammaF(void) const;
162  double &GammaF(void);
163  void setGammaF(const double &);
164 
165 
166  // methods for o/p
167  virtual int sendSelf(CommParameters &);
168  virtual int recvSelf(const CommParameters &);
169 
170  virtual void Print(std::ostream &s, int flag =0);
171 
172  virtual LoadPattern *getCopy(void);
173 
174  virtual int addMotion(GroundMotion &theMotion, int tag);
175  virtual GroundMotion *getMotion(int tag);
176 
177  // AddingSensitivity:BEGIN //////////////////////////////////////////
178  virtual void applyLoadSensitivity(double pseudoTime = 0.0);
179  virtual int setParameter(const std::vector<std::string> &argv, Parameter &param);
180  virtual int updateParameter(int parameterID, Information &info);
181  virtual int activateParameter(int parameterID);
182  virtual const Vector &getExternalForceSensitivity(int gradNumber);
183  // AddingSensitivity:END ///////////////////////////////////////////
184  };
185 
186 } // end of XC namespace
187 
188 #endif
189 
190 
191 
192 
193 
194 
195 
bool addToDomain(void)
Apply load.
Definition: LoadPattern.cpp:247
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:87
virtual void applyLoad(double pseudoTime=0.0)
Apply the load for pseudo-time being passed as parameter.
Definition: LoadPattern.cpp:434
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:44
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: LoadPattern.cpp:520
int getNumElementalLoads(void) const
Returns the número de elemental loadss.
Definition: LoadPattern.cpp:389
virtual ~LoadPattern(void)
Destructor.
Definition: LoadPattern.cpp:204
virtual void clearAll(void)
Deletes all loads, constraints AND pointer to time series.
Definition: LoadPattern.cpp:410
virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp)
Adds the constraint being passed as parameter.
Definition: LoadPattern.cpp:362
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
virtual ElementalLoadIter & getElementalLoads(void)
Returns an iterator a las elemental loads.
Definition: LoadPattern.cpp:373
Definition: Vector.h:82
Vector que almacena los dbTags de los miembros de la clase.
Definition: DbTagData.h:43
virtual bool removeNodalLoad(int tag)
Elimina the load sobre nodo cuyo tag being passed as parameter.
Definition: LoadPattern.cpp:418
int getNumLoads(void) const
Returns the total number of loads.
Definition: LoadPattern.cpp:398
void setGammaF(const double &)
Sets the weighting factor set by the load combination.
Definition: LoadPattern.cpp:475
virtual void setDomain(Domain *theDomain)
Set the domain for the pattern loads.
Definition: LoadPattern.cpp:225
LoadPattern(void)
Default constructor.
Definition: LoadPattern.cpp:169
Information about an element.
Definition: Information.h:80
Iterador sobre las nodal loads.
Definition: NodalLoadIter.h:74
bool newElementalLoad(ElementalLoad *)
Appends the elemental load being passed as parameter.
Definition: LoadPattern.cpp:333
virtual bool addElementalLoad(ElementalLoad *)
Adds the element load being passed as parameter.
Definition: LoadPattern.cpp:314
void removeFromDomain(void)
Removes load.
Definition: LoadPattern.cpp:259
virtual const double & getLoadFactor(void) const
Returns the factor de ponderación obtenido of the TimeSeries object.
Definition: LoadPattern.cpp:463
Base class for loads over elements.
Definition: ElementalLoad.h:73
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: LoadPattern.cpp:533
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: LoadPattern.cpp:502
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
virtual bool addNodalLoad(NodalLoad *)
Adds the nodal load being passed as parameter.
Definition: LoadPattern.cpp:269
virtual bool removeElementalLoad(int tag)
Elimina the load over element cuyo tag being passed as parameter.
Definition: LoadPattern.cpp:426
NodalLoad * newNodalLoad(const int &, const Vector &)
Creates a nodal load.
Definition: LoadPattern.cpp:290
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: LoadPattern.cpp:488
DbTagData & getDbTagData(void) const
Returns a vector para almacenar los dbTags de los miembros de la clase.
Definition: LoadPattern.cpp:481
virtual void Print(std::ostream &s, int flag=0)
Prints load pattern information.
Definition: LoadPattern.cpp:546
Definition: Parameter.h:65
virtual void clearLoads(void)
Deletes all loads.
Definition: LoadPattern.cpp:403
Base class for ground motions.
Definition: GroundMotion.h:83
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
Communication parameters between processes.
Definition: CommParameters.h:65
Load over a node.
Definition: NodalLoad.h:76
Iterador sobre las elemental loads.
Definition: ElementalLoadIter.h:75
================================================================================
Definition: ContinuaReprComponent.h:34
Time variation of loads.A TimeSeries object is used to determine the load factor to be applied to the...
Definition: TimeSeries.h:81
int getNumNodalLoads(void) const
Returns the número de nodal loadss.
Definition: LoadPattern.cpp:380
const double & GammaF(void) const
Returns the weighting factor set by the load combination.
Definition: LoadPattern.cpp:467
virtual NodalLoadIter & getNodalLoads(void)
Returns an iterator a las nodal loads.
Definition: LoadPattern.cpp:366