xc
Domain.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.16 $
48 // $Date: 2005/11/30 23:32:32 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/domain/Domain.h,v $
50 
51 // Written: fmk
52 // Created: Fri Sep 20 15:27:47: 1996
53 // Revision: A
54 //
55 // Description: This file contains the class definition for Domain.
56 // Domain is a container class. The class is responsible for holding
57 // and providing access to the Elements, Nodes, SFreedom_Constraints
58 // MFreedom_Constraints, and LoadPatterns.
59 //
60 // What: "@(#) Domain.h, revA"
61 
62 #ifndef Domain_h
63 #define Domain_h
64 
65 #include "utility/recorder/ObjWithRecorders.h"
66 #include "PseudoTimeTracker.h"
67 #include "../mesh/Mesh.h"
68 #include "../constraints/ConstrContainer.h"
69 #include "utility/matrix/Vector.h"
70 
71 namespace XC {
72 class Element;
73 class Node;
74 class Preprocessor;
75 
76 class ElementIter;
77 class NodeIter;
78 
79 class SingleDomEleIter;
80 class SingleDomNodIter;
81 
82 class LoadCombination;
83 
84 class MeshRegion;
85 class DqMeshRegion;
86 class Recorder;
87 class Graph;
88 class NodeGraph;
89 class ElementGraph;
90 class FEM_ObjectBroker;
91 class RayleighDampingFactors;
92 
94 //
96 //
117  {
118  private:
119  PseudoTimeTracker timeTracker;
120  std::string CallbackCommit;
121 
122  int dbTag;
123  int currentGeoTag;
124  bool hasDomainChangedFlag;
125  int commitTag;
126  Mesh mesh;
127  ConstrContainer constraints;
128  Vector theEigenvalues;
129  Vector modalParticipationFactors;
130  DqMeshRegion *theRegions;
131  std::string nmbCombActual;
132 
133  int lastChannel;
134  int lastGeoSendTag;
135 
136  protected:
137  virtual int buildEleGraph(Graph &theEleGraph);
138  virtual int buildNodeGraph(Graph &theNodeGraph);
139  inline virtual Domain *get_domain_ptr(void)
140  { return this; }
141 
142  void free_mem(void);
143  DbTagData &getDbTagData(void) const;
144  int sendData(CommParameters &cp);
145  int recvData(const CommParameters &cp);
146  public:
147  Domain(CommandEntity *owr,DataOutputHandler::map_output_handlers *oh);
148  Domain(CommandEntity *owr,int numNods, int numElements, int numSPs, int numMPs,int numLPatterns,int numNLockers,DataOutputHandler::map_output_handlers *oh);
149 
150  virtual ~Domain(void);
151 
152  // methods to populate a domain
153  virtual bool addElement(Element *);
154  virtual bool addNode(Node *);
158  virtual bool addLoadPattern(LoadPattern *);
159  virtual bool addNodeLocker(NodeLocker *);
160  virtual bool addLoadCombination(LoadCombination *);
161 
162  void setNodeReactionException(const int &);
163  bool checkNodalReactions(const double &);
164 
165  // methods to add components to a LoadPattern object
166  virtual bool addSFreedom_Constraint(SFreedom_Constraint *, int loadPatternTag);
167  virtual bool addNodalLoad(NodalLoad *, int loadPatternTag);
168  virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag);
169 
170  // methods to remove the components
171  virtual void clearAll(void);
172  virtual bool removeElement(int tag);
173  virtual bool removeNode(int tag);
174  virtual bool removeSFreedom_Constraint(int theNode, int theDOF, int loadPatternTag);
175  virtual bool removeSFreedom_Constraint(int tag);
176  virtual bool removeMFreedom_Constraint(int tag);
177  virtual bool removeMRMFreedom_Constraint(int tag);
178  virtual bool removeLoadPattern(int loadTag);
179  virtual bool removeNodeLocker(int nlTag);
180  bool removeLoadPattern(LoadPattern *lp);
181  bool removeNodeLocker(NodeLocker *lp);
183  void removeLPs(void);
184  void removeNLs(void);
185 
186  virtual bool removeNodalLoad(int tag, int loadPattern);
187  virtual bool removeElementalLoad(int tag, int loadPattern);
188  virtual bool removeSFreedom_Constraint(int tag, int loadPattern);
189 
190  virtual void clearDOF_GroupPtr(void);
191 
192  // methods to access the components of a domain
193  virtual ElementIter &getElements(void);
194  virtual NodeIter &getNodes(void);
195  virtual Mesh &getMesh(void);
196  virtual const Mesh &getMesh(void) const;
197  virtual ConstrContainer &getConstraints(void);
198  virtual const ConstrContainer &getConstraints(void) const;
199 
200  const std::string &getCurrentCombinationName(void) const;
201 
202  bool existElement(int tag);
203  virtual Element *getElement(int tag);
204  virtual const Element *getElement(int tag) const;
205  bool existNode(int tag);
206  virtual Node *getNode(int tag);
207  virtual const Node *getNode(int tag) const;
208 
209 
210  // methods to query the state of the domain
211  inline const PseudoTimeTracker &getTimeTracker(void) const
212  { return timeTracker; }
213  inline int getCurrentGeoTag(void) const
214  { return currentGeoTag; }
215  virtual int getCommitTag(void) const;
216  virtual int getNumElements(void) const;
217  virtual int getNumNodes(void) const;
218  virtual const Vector &getPhysicalBounds(void);
219 
220 
221  // methods to get element and node graphs
222  virtual Graph &getElementGraph(void);
223  virtual Graph &getNodeGraph(void);
224 
225  // methods to update the domain
226  virtual void setCommitTag(int newTag);
227  virtual void setCurrentTime(double newTime);
228  virtual void setCommittedTime(double newTime);
229  virtual void setTime(double newTime);
230  virtual void applyLoad(double pseudoTime);
231  virtual void setLoadConstant(void);
232  virtual int initialize(void);
233  virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF);
234 
235  virtual int commit(void);
236  virtual int revertToLastCommit(void);
237  virtual int revertToStart(void);
238  virtual int update(void);
239  virtual int update(double newTime, double dT);
240  virtual int newStep(double dT);
241 
242  void resetLoadCase(void);
243 
244  // methods for eigenvalue analysis
245  int getNumModes(void) const;
246  virtual int setEigenvalues(const Vector &);
247  virtual const double &getEigenvalue(int) const;
248  double getAngularFrequency(int) const;
249  double getPeriodo(int) const;
250  double getFrecuencia(int) const;
251  virtual const Vector &getEigenvalues(void) const;
252  Vector getAngularFrequencies(void) const;
253  Vector getPeriodos(void) const;
254  Vector getFrecuencias(void) const;
255  virtual int setModalParticipationFactors(const Vector &);
256  virtual const double &getModalParticipationFactor(int mode) const;
257  virtual const Vector &getModalParticipationFactors(void) const;
258  const double getEffectiveModalMass(int mode) const;
259  Vector getEffectiveModalMasses(void) const;
260  double getTotalMass(void) const;
261 
262  // methods for other objects to determine if model has changed
263  virtual void domainChange(void);
264  virtual int hasDomainChanged(void);
265  virtual void setDomainChangeStamp(int newStamp);
266 
267  virtual int addRegion(MeshRegion &theRegion);
268  virtual MeshRegion *getRegion(int region);
269 
270  virtual void Print(std::ostream &s, int flag =0);
271  friend std::ostream &operator<<(std::ostream &, Domain &);
272 
273  virtual int sendSelf(CommParameters &);
274  virtual int recvSelf(const CommParameters &);
275  friend int sendDomain(Domain &, int posDbTag,DbTagData &,CommParameters &cp);
276  friend int receiveDomain(Domain &, int posDbTag,DbTagData &,const CommParameters &cp);
277 
278  const Preprocessor *getPreprocessor(void) const;
280 
281  // nodal methods required in domain interface for parallel interprter
282  virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag);
283  virtual int setMass(const Matrix &mass, int nodeTag);
284 
285  virtual int calculateNodalReactions(bool inclInertia,const double &);
286  virtual int addRecorder(Recorder &theRecorder);
287 
288  static void setDeadSRF(const double &);
289  };
290 
291 std::ostream &operator<<(std::ostream &, Domain &);
292 int sendDomain(Domain &,int posDbTag,DbTagData &,CommParameters &cp);
293 int receiveDomain(Domain &, int posDbTag,DbTagData &,const CommParameters &cp);
294 
295 
296 } // end of XC namespace
297 
298 #endif
299 
300 
virtual double getNodeDisp(int nodeTag, int dof, int &errorFlag)
Return the value of the dof component of displacement for the node with the tag being passed as param...
Definition: Domain.cpp:1214
virtual int calculateNodalReactions(bool inclInertia, const double &)
Calculate nodal reaction forces and moments.
Definition: Domain.cpp:1230
virtual void clearDOF_GroupPtr(void)
Clears the pointers to DOF groups.
Definition: Domain.cpp:609
virtual void domainChange(void)
Sets a flag indicating that the integer returned in the next call to hasDomainChanged() must be incre...
Definition: Domain.cpp:999
virtual bool addNode(Node *)
Adds to the domain the node being passed as parameter.
Definition: Domain.cpp:214
virtual const Vector & getPhysicalBounds(void)
Definition: Domain.cpp:700
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags de los miembros of the clase.
Definition: Domain.cpp:1104
virtual int addRegion(MeshRegion &theRegion)
Adds a region.
Definition: Domain.cpp:1067
virtual bool addSFreedom_Constraint(SFreedom_Constraint *)
Adds a single freedom constraint to the domain.
Definition: Domain.cpp:224
Float vector abstraction.
Definition: Vector.h:93
virtual int setMass(const Matrix &mass, int nodeTag)
Set the mass matrix for the node identified by the argument.
Definition: Domain.cpp:1218
virtual int setModalParticipationFactors(const Vector &)
Sets the values of the modal participation factors.
Definition: Domain.cpp:950
virtual bool addNodeLocker(NodeLocker *)
Appends the node locker object to the domain.
Definition: Domain.cpp:448
virtual Mesh & getMesh(void)
Returns a reference to the domain mesh.
Definition: Domain.cpp:625
virtual void clearAll(void)
Removes all components from domain (nodes, elements, loads & constraints).
Definition: Domain.cpp:159
virtual int revertToStart(void)
Return the domain to its initial state and triggers the "restart" method for all the recorders...
Definition: Domain.cpp:838
void removeNLs(void)
Remove all node lockers from domain.
Definition: Domain.cpp:575
virtual bool removeNodalLoad(int tag, int loadPattern)
Removes from domain the nodal load being passed as parameter.
Definition: Domain.cpp:587
virtual bool removeMRMFreedom_Constraint(int tag)
Removes from domain the multi-freedom multi-retained node constraint identified by the argument...
Definition: Domain.cpp:413
int getNumModes(void) const
Return the number of computed eigenvalues.
Definition: Domain.cpp:946
virtual const double & getModalParticipationFactor(int mode) const
Return the modal participation factor of the i-th mode.
Definition: Domain.cpp:957
virtual Graph & getNodeGraph(void)
Builds (if necessary) the domain node graph and returns a reference to it.
Definition: Domain.cpp:724
virtual bool addMFreedom_Constraint(MFreedom_Constraint *)
Adds to the domain a multi-freedom constraint.
Definition: Domain.cpp:247
Finite element model generation tools.
Definition: Preprocessor.h:58
virtual int setRayleighDampingFactors(const RayleighDampingFactors &rF)
Set Rayleigh damping factors.
Definition: Domain.cpp:782
An Recorder object is used in the program to store/restore information at each commit().
Definition: Recorder.h:86
virtual int revertToLastCommit(void)
Return the domain to its last commited state.
Definition: Domain.cpp:820
Iterator over an element container.
Definition: ElementIter.h:73
virtual ElementIter & getElements(void)
Returns an iterator to the element container.
Definition: Domain.cpp:613
int sendData(CommParameters &cp)
Send data through the channel being passed as parameter.
Definition: Domain.cpp:1111
virtual bool removeLoadPattern(int loadTag)
Remove from domain el load pattern identified by the argument.
Definition: Domain.cpp:492
static void setDeadSRF(const double &)
Assigns Stress Reduction Factor for element deactivation.
Definition: Domain.cpp:205
virtual int buildNodeGraph(Graph &theNodeGraph)
Builds the node graph.
Definition: Domain.cpp:1099
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Base class for distributed processing.
Definition: DistributedBase.h:40
virtual Node * getNode(int tag)
Return a pointer to the node identified by the argument.
Definition: Domain.cpp:673
virtual int addRecorder(Recorder &theRecorder)
Adds a recorder to the model.
Definition: Domain.cpp:1053
virtual bool removeElementalLoad(int tag, int loadPattern)
Removes from domain the elemental load being passed as parameter.
Definition: Domain.cpp:594
virtual int hasDomainChanged(void)
Returns true if the model has changed.
Definition: Domain.cpp:1009
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:93
virtual int commit(void)
Commits domain state and triggers "record" method for all defined recorders.
Definition: Domain.cpp:795
virtual ~Domain(void)
Destructor.
Definition: Domain.cpp:192
bool existElement(int tag)
Returns true if the element identified by the tag being passed as parameter already exists en el doma...
Definition: Domain.cpp:645
void setNodeReactionException(const int &)
Sets the exception for node reactions checking (see Domain::checkNodalReactions). ...
Definition: Domain.cpp:1222
const Preprocessor * getPreprocessor(void) const
Returns (if possible) a pointer to the preprocessor.
Definition: Domain.cpp:1238
const double getEffectiveModalMass(int mode) const
Return the effective modal mass of the i-th mode.
Definition: Domain.cpp:965
virtual bool addElement(Element *)
Adds to the domain the element being passed as parameter.
Definition: Domain.cpp:210
virtual int initialize(void)
Inicializa.
Definition: Domain.cpp:778
virtual int setEigenvalues(const Vector &)
Sets eigenvalues.
Definition: Domain.cpp:885
Base class for the finite elements.
Definition: Element.h:109
virtual bool addNodalLoad(NodalLoad *, int loadPatternTag)
Appends a nodal load to the pattern being passed as parameter.
Definition: Domain.cpp:301
virtual const double & getEigenvalue(int) const
Return the eigenvalue of the i-th mode.
Definition: Domain.cpp:896
void resetLoadCase(void)
Prepares the domain to solve for a new load pattern.
Definition: Domain.cpp:196
virtual void setLoadConstant(void)
Set all the loads as constant.
Definition: Domain.cpp:774
const std::string & getCurrentCombinationName(void) const
Return the name of the current load combination.
Definition: Domain.cpp:542
virtual bool addLoadPattern(LoadPattern *)
Appends the load pattern to the domain.
Definition: Domain.cpp:429
virtual void setCommitTag(int newTag)
Set the committed tag to newTag.
Definition: Domain.cpp:728
virtual int getNumNodes(void) const
Return the number of nodes.
Definition: Domain.cpp:690
Vector getEffectiveModalMasses(void) const
Return the effective modal masses for each mode.
Definition: Domain.cpp:969
Registro del tiempo.
Definition: PseudoTimeTracker.h:40
double getTotalMass(void) const
Return the total effective modal mass.
Definition: Domain.cpp:976
virtual MeshRegion * getRegion(int region)
Returns a pointer to the region identified by the argument.
Definition: Domain.cpp:1076
virtual bool removeElement(int tag)
Remove the element identified by the argument.
Definition: Domain.cpp:345
Single freedom constraint.
Definition: SFreedom_Constraint.h:84
Vector getFrecuencias(void) const
Returns a vector with the computed frequencies (for each mode).
Definition: Domain.cpp:936
Domain(CommandEntity *owr, DataOutputHandler::map_output_handlers *oh)
Constructor.
Definition: Domain.cpp:119
virtual Element * getElement(int tag)
Return a pointer to the element identified by the argument.
Definition: Domain.cpp:652
virtual void Print(std::ostream &s, int flag=0)
Print stuff.
Definition: Domain.cpp:1030
The Graph class provides the abstraction of a graph.
Definition: Graph.h:93
virtual bool addLoadCombination(LoadCombination *)
Adds to the domain the load combination being passed as parameter.
Definition: Domain.cpp:460
virtual int update(void)
Updates the state of the domain.
Definition: Domain.cpp:865
virtual bool removeNodeLocker(int nlTag)
Remove from domain el.
Definition: Domain.cpp:508
Object that can manage Recorders.
Definition: ObjWithRecorders.h:44
virtual ConstrContainer & getConstraints(void)
Returns domain constraints.
Definition: Domain.cpp:633
virtual const Vector & getModalParticipationFactors(void) const
Return the modal participation factors.
Definition: Domain.cpp:961
virtual bool removeNode(int tag)
Remove the node identified by the argument.
Definition: Domain.cpp:349
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:58
double getFrecuencia(int) const
Return the frequency of the i-th mode.
Definition: Domain.cpp:908
bool checkNodalReactions(const double &)
Check that al free nodes have zero reaction.
Definition: Domain.cpp:1226
virtual bool removeMFreedom_Constraint(int tag)
Removes from domain the multi-freedom constraint identified by the argument.
Definition: Domain.cpp:400
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: Domain.cpp:1189
virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag)
Adds a load over element to the pattern.
Definition: Domain.cpp:326
int recvData(const CommParameters &cp)
Receive data through the channel being passed as parameter.
Definition: Domain.cpp:1134
void removeLPs(void)
Remove from domain todos los load patterns.
Definition: Domain.cpp:565
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
bool existNode(int tag)
Return true if the mesh has a node with this tag.
Definition: Domain.cpp:666
virtual void setCurrentTime(double newTime)
Set the current time to newTime.
Definition: Domain.cpp:732
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: Domain.cpp:1169
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:44
virtual void setDomainChangeStamp(int newStamp)
Set the domain stamp to be newStamp.
Definition: Domain.cpp:988
Vector getAngularFrequencies(void) const
Returns a vector with the computed angular frequencies (for each mode).
Definition: Domain.cpp:916
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
double getAngularFrequency(int) const
Return the angular frequency of the i-th mode.
Definition: Domain.cpp:900
Iterator over the nodes.
Definition: NodeIter.h:73
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
Multi-freedom constraint.
Definition: MFreedom_Constraint.h:110
virtual int getNumElements(void) const
Return the number of elements.
Definition: Domain.cpp:686
Vector de celdas.
Definition: DqMeshRegion.h:40
virtual void setCommittedTime(double newTime)
Set the committed time to newTime.
Definition: Domain.cpp:736
Base class for loads over elements.
Definition: ElementalLoad.h:77
Vector getPeriodos(void) const
Returns a vector with the computed periods (for each mode).
Definition: Domain.cpp:926
Load pattern combination (1.5*PP+1.0*CP+1.6*SC ...).
Definition: LoadCombination.h:43
virtual void applyLoad(double pseudoTime)
Apply the loads for the given time pseudoTime.
Definition: Domain.cpp:756
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
Mesh node.
Definition: Node.h:110
Constraint (essential and natural boundary conditions) container.
Definition: ConstrContainer.h:62
Definition: MeshRegion.h:74
double getPeriodo(int) const
Return the period of the i-th mode.
Definition: Domain.cpp:904
virtual bool removeSFreedom_Constraint(int theNode, int theDOF, int loadPatternTag)
Remove the single freedom constraint from the load pattern identified by the argument.
Definition: Domain.cpp:368
Load over a node.
Definition: NodalLoad.h:82
virtual const Vector & getEigenvalues(void) const
Return the eigenvalues vector.
Definition: Domain.cpp:912
Finite element mesh.
Definition: Mesh.h:64
virtual Graph & getElementGraph(void)
Builds (if necessary) the domain elements graph and returns a reference to it.
Definition: Domain.cpp:712
void removeLoadCombination(LoadCombination *comb)
Removes from the domain the load combination being passed as parameter.
Definition: Domain.cpp:547
virtual bool addMRMFreedom_Constraint(MRMFreedom_Constraint *)
Adds to the domain a multi-freedom multi-retained node constraint.
Definition: Domain.cpp:259
virtual NodeIter & getNodes(void)
Returns an iterator to the node container.
Definition: Domain.cpp:617
virtual int buildEleGraph(Graph &theEleGraph)
Builds the element graph.
Definition: Domain.cpp:1090