xc
AnalysisModel.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.9 $
48 // $Date: 2005/11/28 21:23:50 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/AnalysisModel.h,v $
50 
51 
52 #ifndef AnalysisModel_h
53 #define AnalysisModel_h
54 
55 // Written: fmk
56 // Created: 9/96
57 // Revision: A
58 //
59 // Description: This file contains the class definition for AnalysisModel.
60 // AnalysisModel is a container class. This class is responsible for holding
61 // and providing access to the FE_Element and DOF_Group objects that the
62 // ConstraintHandler creates. It is also responsible for updating the
63 // response quantities at the DOF_Groups and for triggering methods
64 // in the associated Domain.
65 //
66 // What: "@(#) AnalysisModel.h, revA"
67 
68 #include <utility/actor/actor/MovableObject.h>
69 #include "xc_utils/src/kernel/CommandEntity.h"
70 #include "solution/graph/graph/DOF_Graph.h"
71 #include "solution/graph/graph/DOF_GroupGraph.h"
72 #include "utility/tagged/storage/ArrayOfTaggedObjects.h"
73 #include "solution/analysis/model/FE_EleIter.h"
74 #include "solution/analysis/model/FE_EleConstIter.h"
75 #include "solution/analysis/model/DOF_GrpIter.h"
76 #include "solution/analysis/model/DOF_GrpConstIter.h"
77 
78 namespace XC {
79 class Domain;
80 class Graph;
81 class FE_Element;
82 class LagrangeSFreedom_FE;
83 class LagrangeMFreedom_FE;
84 class LagrangeMRMFreedom_FE;
85 class PenaltySFreedom_FE;
86 class PenaltyMFreedom_FE;
87 class PenaltyMRMFreedom_FE;
88 class MFreedom_ConstraintBase;
89 class TransformationFE;
90 class DOF_Group;
91 class LagrangeDOF_Group;
92 class TransformationDOF_Group;
93 class Vector;
94 class DOF_GroupGraph;
95 class FEM_ObjectBroker;
96 class ConstraintHandler;
97 class TransformationConstraintHandler;
98 class RayleighDampingFactors;
99 class ModelWrapper;
100 
104 //
108 //
110 //
133 class AnalysisModel: public MovableObject, public CommandEntity
134  {
135  private:
136  int numFE_Ele;
137  int numDOF_Grp;
138  int numEqn;
139 
140  ArrayOfTaggedObjects theFEs;
141  ArrayOfTaggedObjects theDOFGroups;
142  FE_EleIter theFEiter;
143  DOF_GrpIter theDOFGroupiter;
144  mutable FE_EleConstIter theFEconst_iter;
145  mutable DOF_GrpConstIter theDOFGroupconst_iter;
146 
147  mutable DOF_Graph myDOFGraph;
148  mutable DOF_GroupGraph myGroupGraph;
149  mutable bool updateGraphs;
150 
151  ModelWrapper *getModelWrapper(void);
152  const ModelWrapper *getModelWrapper(void) const;
153  protected:
154 
155 
156  friend class Integrator;
157  friend class Analysis;
158  virtual void applyLoadDomain(double newTime);
159  virtual int updateDomain(void);
160  virtual int updateDomain(double newTime, double dT);
161  virtual int newStepDomain(double dT =0.0);
162  virtual int commitDomain(void);
163  virtual int revertDomainToLastCommit(void);
164  virtual double getCurrentDomainTime(void);
165  virtual void setCurrentDomainTime(double newTime);
166  virtual void setRayleighDampingFactors(const RayleighDampingFactors &rF);
167 
168  virtual bool addDOF_Group(DOF_Group *theDOF_Grp);
169  virtual bool addFE_Element(FE_Element *theFE_Ele);
170 
171  friend class ModelWrapper;
172  friend class FEM_ObjectBroker;
173  AnalysisModel(ModelWrapper *owr= nullptr);
174  AnalysisModel(int classTag,CommandEntity *owr);
175  AnalysisModel(const AnalysisModel &);
177  AnalysisModel *getCopy(void) const;
178  public:
179  virtual ~AnalysisModel(void);
180 
181  // methods to populate/depopulate the AnalysisModel
182  virtual DOF_Group *createDOF_Group(const int &, Node *);
186  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MFreedom_ConstraintBase *, TransformationConstraintHandler*);
187  //virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MRMFreedom_Constraint *, TransformationConstraintHandler*);
188  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, TransformationConstraintHandler*);
189  virtual FE_Element *createFE_Element(const int &, Element *);
190  virtual LagrangeSFreedom_FE *createLagrangeSFreedom_FE(const int &, SFreedom_Constraint &, DOF_Group &,const double &);
191  virtual LagrangeMFreedom_FE *createLagrangeMFreedom_FE(const int &, MFreedom_Constraint &, DOF_Group &,const double &);
192  virtual LagrangeMRMFreedom_FE *createLagrangeMRMFreedom_FE(const int &,MRMFreedom_Constraint &,DOF_Group &,const double &);
193  virtual PenaltySFreedom_FE *createPenaltySFreedom_FE(const int &, SFreedom_Constraint &, const double &);
194  virtual PenaltyMFreedom_FE *createPenaltyMFreedom_FE(const int &, MFreedom_Constraint &, const double &);
195  virtual PenaltyMRMFreedom_FE *createPenaltyMRMFreedom_FE(const int &, MRMFreedom_Constraint &, const double &);
196  virtual FE_Element *createTransformationFE(const int &, Element *, const std::set<int> &,std::set<FE_Element *> &);
197  virtual void clearAll(void);
198 
199  // methods to access the FE_Elements and DOF_Groups and their numbers
200  virtual int getNumDOF_Groups(void) const;
201  virtual DOF_Group *getDOF_GroupPtr(int tag);
202  virtual const DOF_Group *getDOF_GroupPtr(int tag) const;
203  virtual FE_EleIter &getFEs();
204  virtual DOF_GrpIter &getDOFGroups();
205  virtual FE_EleConstIter &getConstFEs() const;
206  virtual DOF_GrpConstIter &getConstDOFs() const;
207 
208  // method to access the connectivity for SysOfEqn to size itself
209  virtual void setNumEqn(int) ;
210  virtual int getNumEqn(void) const ;
211  virtual Graph &getDOFGraph(void);
212  virtual Graph &getDOFGroupGraph(void);
213  virtual const Graph &getDOFGraph(void) const;
214  virtual const Graph &getDOFGroupGraph(void) const;
215 
216  // methods to update the response quantities at the DOF_Groups,
217  // which in turn set the new_ nodal trial response quantities.
218  virtual void setResponse(const Vector &, const Vector &, const Vector &);
219  virtual void setDisp(const Vector &disp);
220  virtual void setVel(const Vector &vel);
221  virtual void setAccel(const Vector &vel);
222 
223  virtual void incrDisp(const Vector &disp);
224  virtual void incrVel(const Vector &vel);
225  virtual void incrAccel(const Vector &vel);
226 
227  // methods added to store the modal analysis quantities in the domain
228  virtual void setNumEigenvectors(int numEigenvectors);
229  virtual void setEigenvector(int mode, const Vector &);
230  virtual void setEigenvalues(const Vector &);
231  virtual void setModalParticipationFactors(const Vector &);
232 
233  virtual int sendSelf(CommParameters &);
234  virtual int recvSelf(const CommParameters &);
235 
236  Domain *getDomainPtr(void);
237  const Domain *getDomainPtr(void) const;
238  ConstraintHandler *getHandlerPtr(void);
239  const ConstraintHandler *getHandlerPtr(void) const;
240  };
241 } // end of XC namespace
242 
243 #endif
virtual void setDisp(const Vector &disp)
Sets the values of the displacement of the nodes.
Definition: AnalysisModel.cpp:681
virtual int revertDomainToLastCommit(void)
Returns to the last commited state.
Definition: AnalysisModel.cpp:899
virtual LagrangeMFreedom_FE * createLagrangeMFreedom_FE(const int &, MFreedom_Constraint &, DOF_Group &, const double &)
Method to create a LagrangeMFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:244
virtual int getNumEqn(void) const
Returns the number of DOFs in the model which have been assigned an equation number.
Definition: AnalysisModel.cpp:599
LagrangeMRMFreedom_FE is a subclass of FE_Element which handles MRMFreedom_Constraints using the Lagr...
Definition: LagrangeMRMFreedom_FE.h:60
Iterator over DEF groups.
Definition: DOF_GrpConstIter.h:41
Float vector abstraction.
Definition: Vector.h:93
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
A LagrangeDOF_Group object is instantiated by a LagrangeConstraintHandler for every constrained node ...
Definition: LagrangeDOF_Group.h:82
virtual bool addFE_Element(FE_Element *theFE_Ele)
Adds the FE_Element pointed to by theElement to the model.
Definition: AnalysisModel.cpp:169
virtual double getCurrentDomainTime(void)
To get the current time in the Domain.
Definition: AnalysisModel.cpp:922
virtual void setEigenvalues(const Vector &)
Informs the domain of the obtained eigenvalues.
Definition: AnalysisModel.cpp:769
ConstraintHandlers enforce the single and multi freedom constraints that exist in the domain by creat...
Definition: ConstraintHandler.h:92
virtual void setNumEqn(int)
Sets the value of the number of equations in the model.
Definition: AnalysisModel.cpp:590
virtual Graph & getDOFGroupGraph(void)
Returns the connectivity of the DOF_Group objects in the model.
Definition: AnalysisModel.cpp:620
Object that can move between processes.
Definition: MovableObject.h:99
virtual void setCurrentDomainTime(double newTime)
To set the current time in the Domain to be newTime.
Definition: AnalysisModel.cpp:942
] at the locations corresponding to the constrained degree-of-freedom specified by the SFreedom_Const...
Definition: LagrangeSFreedom_FE.h:93
Base class for the object that perform the analysis.
Definition: Analysis.h:116
Degrees of freedom group graph.
Definition: DOF_GroupGraph.h:82
Iterator over DOF groups.
Definition: DOF_GrpIter.h:72
virtual void setAccel(const Vector &vel)
Sets the values of the acceleration of the nodes.
Definition: AnalysisModel.cpp:709
FEM_ObjectBroker is is an object broker class for the finite element method.
Definition: FEM_ObjectBroker.h:145
AnalysisModel * getCopy(void) const
Virtual constructor.
Definition: AnalysisModel.cpp:142
virtual PenaltySFreedom_FE * createPenaltySFreedom_FE(const int &, SFreedom_Constraint &, const double &)
Method to create a PenaltySFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:272
Domain * getDomainPtr(void)
Returns a pointer to the associated Domain, that is the Domain set when the links were set...
Definition: AnalysisModel.cpp:986
virtual void clearAll(void)
Clears from the model all FE_Element and DOF_Group objects.
Definition: AnalysisModel.cpp:512
AnalysisModel & operator=(const AnalysisModel &)
Assignment operator.
Definition: AnalysisModel.cpp:126
ArrayOfTaggedObjects is a storage class.
Definition: ArrayOfTaggedObjects.h:91
virtual LagrangeSFreedom_FE * createLagrangeSFreedom_FE(const int &, SFreedom_Constraint &, DOF_Group &, const double &)
Create an LagrangeSFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:230
virtual FE_EleConstIter & getConstFEs() const
Returns a {FE_EleConstIter} for the FE_Elements of the model.
Definition: AnalysisModel.cpp:569
Base class for the finite elements.
Definition: Element.h:109
PenaltyMRMFreedom_FE is a subclass of FE_Element which handles MRMFreedom_Constraints using the penal...
Definition: PenaltyMRMFreedom_FE.h:78
virtual void setModalParticipationFactors(const Vector &)
Informs the domain of the obtained modal participation factors.
Definition: AnalysisModel.cpp:773
Wrapper for the finite element model "as seen" from the solver.
Definition: ModelWrapper.h:58
A TransformationDOF_Group object is instantiated by the TransformationConstraintHandler for every nod...
Definition: TransformationDOF_Group.h:86
] at the locations corresponding to the constrained degree-of-freedoms specified by the MFreedom_Co...
Definition: LagrangeMFreedom_FE.h:102
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:133
virtual DOF_Group * getDOF_GroupPtr(int tag)
Returns a pointer to the DEF group with the tag beign passed as parameter.
Definition: AnalysisModel.cpp:539
Single freedom constraint.
Definition: SFreedom_Constraint.h:84
The Graph class provides the abstraction of a graph.
Definition: Graph.h:93
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:99
virtual FE_Element * createTransformationFE(const int &, Element *, const std::set< int > &, std::set< FE_Element *> &)
Create a TransformationFE_Element object and append it to the model.
Definition: AnalysisModel.cpp:311
virtual int sendSelf(CommParameters &)
Returns .
Definition: AnalysisModel.cpp:1012
A DOF_Group object is instantiated by the ConstraintHandler for every unconstrained node in the domai...
Definition: DOF_Group.h:106
virtual PenaltyMRMFreedom_FE * createPenaltyMRMFreedom_FE(const int &, MRMFreedom_Constraint &, const double &)
Create a PenaltyMRMFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:298
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:58
virtual int updateDomain(void)
Method which invokes update() on the domain.
Definition: AnalysisModel.cpp:806
virtual int recvSelf(const CommParameters &)
Returns .
Definition: AnalysisModel.cpp:1016
Degrees of freedom graph.
Definition: DOF_Graph.h:85
Iterator over the finite element of the model.
Definition: FE_EleIter.h:76
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
virtual void incrAccel(const Vector &vel)
Sets the values of the acceleration increment of the nodes.
Definition: AnalysisModel.cpp:751
Finite element as seen by analysis.
Definition: FE_Element.h:107
virtual void setResponse(const Vector &, const Vector &, const Vector &)
Sets the values of the displacement, velocity and acceleration of the nodes.
Definition: AnalysisModel.cpp:663
virtual PenaltyMFreedom_FE * createPenaltyMFreedom_FE(const int &, MFreedom_Constraint &, const double &)
Create a PenaltyMFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:285
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
virtual void incrVel(const Vector &vel)
Sets the values of the velocity increment of the nodes.
Definition: AnalysisModel.cpp:737
virtual ~AnalysisModel(void)
Destructor.
Definition: AnalysisModel.cpp:153
Communication parameters between processes.
Definition: CommParameters.h:65
virtual FE_EleIter & getFEs()
Returns an {FE_EleIter} for the FE_Elements of the model.
Definition: AnalysisModel.cpp:561
virtual FE_Element * createFE_Element(const int &, Element *)
Creates a FE_Element and appends it to the model.
Definition: AnalysisModel.cpp:202
Multi-freedom constraint.
Definition: MFreedom_Constraint.h:110
PenaltySFreedom_FE is a subclass of SFreedom_FE which handles SFreedom_Constraints using the penalty ...
Definition: PenaltySFreedom_FE.h:86
virtual void incrDisp(const Vector &disp)
Sets the values of the displacement increment of the nodes.
Definition: AnalysisModel.cpp:723
virtual int getNumDOF_Groups(void) const
Returns the umber of DOF_Group objects added to the model.
Definition: AnalysisModel.cpp:527
TransformationConstraintHandler is a constraint handler for handling constraints using the Transforma...
Definition: TransformationConstraintHandler.h:87
virtual LagrangeDOF_Group * createLagrangeDOF_Group(const int &, SFreedom_Constraint *)
Appends to the model the Lagrange DOFs for the single freedom constraint being passed as parameter...
Definition: AnalysisModel.cpp:415
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
Mesh node.
Definition: Node.h:110
virtual void setVel(const Vector &vel)
Sets the values of the velocity of the nodes.
Definition: AnalysisModel.cpp:695
Const iterator over the finite elements of the model.
Definition: FE_EleConstIter.h:41
PenaltyMFreedom_FE is a subclass of FE_Element which handles MFreedom_Constraints using the penalty m...
Definition: PenaltyMFreedom_FE.h:89
virtual bool addDOF_Group(DOF_Group *theDOF_Grp)
Method to add an DOF to the model.
Definition: AnalysisModel.cpp:363
AnalysisModel(ModelWrapper *owr=nullptr)
Constructor.
Definition: AnalysisModel.cpp:98
virtual int commitDomain(void)
Commits domain state.
Definition: AnalysisModel.cpp:869
virtual LagrangeMRMFreedom_FE * createLagrangeMRMFreedom_FE(const int &, MRMFreedom_Constraint &, DOF_Group &, const double &)
Method to create a LagrangeMRMFreedom_FE object and append it to the model.
Definition: AnalysisModel.cpp:258
virtual void applyLoadDomain(double newTime)
Method which invokes {applyLoad(timeStep, loadFactor)} on the domain.
Definition: AnalysisModel.cpp:791