xc
AnalysisModel.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.9 $
49 // $Date: 2005/11/28 21:23:50 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/AnalysisModel.h,v $
51 
52 
53 #ifndef AnalysisModel_h
54 #define AnalysisModel_h
55 
56 // Written: fmk
57 // Created: 9/96
58 // Revision: A
59 //
60 // Description: This file contains the class definition for AnalysisModel.
61 // AnalysisModel is a container class. This class is responsible for holding
62 // and providing access to the FE_Element and DOF_Group objects that the
63 // ConstraintHandler creates. It is also responsible for updating the
64 // response quantities at the DOF_Groups and for triggering methods
65 // in the associated Domain.
66 //
67 // What: "@(#) AnalysisModel.h, revA"
68 
69 #include <utility/actor/actor/MovableObject.h>
70 #include "utility/kernel/CommandEntity.h"
71 #include "solution/graph/graph/DOF_Graph.h"
72 #include "solution/graph/graph/DOF_GroupGraph.h"
73 #include "utility/tagged/storage/ArrayOfTaggedObjects.h"
74 #include "solution/analysis/model/FE_EleIter.h"
75 #include "solution/analysis/model/FE_EleConstIter.h"
76 #include "solution/analysis/model/DOF_GrpIter.h"
77 #include "solution/analysis/model/DOF_GrpConstIter.h"
78 
79 namespace XC {
80 class Domain;
81 class Graph;
82 class FE_Element;
83 class LagrangeSFreedom_FE;
84 class LagrangeMFreedom_FE;
85 class LagrangeMRMFreedom_FE;
86 class PenaltySFreedom_FE;
87 class PenaltyMFreedom_FE;
88 class PenaltyMRMFreedom_FE;
89 class MFreedom_ConstraintBase;
90 class TransformationFE;
91 class DOF_Group;
92 class LagrangeDOF_Group;
93 class TransformationDOF_Group;
94 class Vector;
95 class DOF_GroupGraph;
96 class FEM_ObjectBroker;
97 class ConstraintHandler;
98 class TransformationConstraintHandler;
99 class RayleighDampingFactors;
100 class ModelWrapper;
101 
105 //
109 //
111 //
135  {
136  private:
137  int numFE_Ele;
138  int numDOF_Grp;
139  int numEqn;
140 
141  ArrayOfTaggedObjects theFEs;
142  ArrayOfTaggedObjects theDOFGroups;
143  FE_EleIter theFEiter;
144  DOF_GrpIter theDOFGroupiter;
145  mutable FE_EleConstIter theFEconst_iter;
146  mutable DOF_GrpConstIter theDOFGroupconst_iter;
147 
148  mutable DOF_Graph myDOFGraph;
149  mutable DOF_GroupGraph myGroupGraph;
150  mutable bool updateGraphs;
151 
152  ModelWrapper *getModelWrapper(void);
153  const ModelWrapper *getModelWrapper(void) const;
154  protected:
155 
156 
157  friend class Integrator;
158  friend class Analysis;
159  virtual void applyLoadDomain(double newTime);
160  virtual int updateDomain(void);
161  virtual int updateDomain(double newTime, double dT);
162  virtual int newStepDomain(double dT =0.0);
163  virtual int commitDomain(void);
164  virtual int revertDomainToLastCommit(void);
165  virtual double getCurrentDomainTime(void) const;
166  virtual void setCurrentDomainTime(double newTime);
167  virtual void setRayleighDampingFactors(const RayleighDampingFactors &rF);
168 
169  friend class AutoConstraintHandler;
170  virtual bool addDOF_Group(DOF_Group *theDOF_Grp);
171  virtual bool addFE_Element(FE_Element *theFE_Ele);
172 
173  friend class ModelWrapper;
174  friend class FEM_ObjectBroker;
175  AnalysisModel(ModelWrapper *owr= nullptr);
176  AnalysisModel(int classTag,CommandEntity *owr);
177  AnalysisModel(const AnalysisModel &);
179  AnalysisModel *getCopy(void) const;
180  public:
181  virtual ~AnalysisModel(void);
182 
183  // methods to populate/depopulate the AnalysisModel
184  virtual DOF_Group *createDOF_Group(const int &, Node *);
188  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MFreedom_ConstraintBase *, TransformationConstraintHandler*);
189  //virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MRMFreedom_Constraint *, TransformationConstraintHandler*);
190  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, TransformationConstraintHandler*);
191  virtual FE_Element *createFE_Element(const int &, Element *);
192  virtual LagrangeSFreedom_FE *createLagrangeSFreedom_FE(const int &, SFreedom_Constraint &, DOF_Group &,const double &);
193  virtual LagrangeMFreedom_FE *createLagrangeMFreedom_FE(const int &, MFreedom_Constraint &, DOF_Group &,const double &);
194  virtual LagrangeMRMFreedom_FE *createLagrangeMRMFreedom_FE(const int &,MRMFreedom_Constraint &,DOF_Group &,const double &);
195  virtual PenaltySFreedom_FE *createPenaltySFreedom_FE(const int &, SFreedom_Constraint &, const double &);
196  virtual PenaltyMFreedom_FE *createPenaltyMFreedom_FE(const int &, MFreedom_Constraint &, const double &);
197  virtual PenaltyMRMFreedom_FE *createPenaltyMRMFreedom_FE(const int &, MRMFreedom_Constraint &, const double &);
198  virtual FE_Element *createTransformationFE(const int &, Element *, const std::set<int> &,std::set<FE_Element *> &);
199  virtual void clearAll(void);
200 
201  // methods to access the FE_Elements and DOF_Groups and their numbers
202  virtual int getNumDOF_Groups(void) const;
203  virtual DOF_Group *getDOF_GroupPtr(int tag);
204  virtual const DOF_Group *getDOF_GroupPtr(int tag) const;
205  virtual FE_EleIter &getFEs();
206  virtual DOF_GrpIter &getDOFGroups();
207  virtual FE_EleConstIter &getConstFEs() const;
208  virtual DOF_GrpConstIter &getConstDOFs() const;
209 
210  // method to access the connectivity for SysOfEqn to size itself
211  virtual void setNumEqn(int) ;
212  virtual int getNumEqn(void) const ;
213  virtual Graph &getDOFGraph(void);
214  virtual Graph &getDOFGroupGraph(void);
215  virtual const Graph &getDOFGraph(void) const;
216  virtual const Graph &getDOFGroupGraph(void) const;
217 
218  // methods to update the response quantities at the DOF_Groups,
219  // which in turn set the new_ nodal trial response quantities.
220  virtual void setResponse(const Vector &, const Vector &, const Vector &);
221  virtual void setDisp(const Vector &disp);
222  virtual void setVel(const Vector &vel);
223  virtual void setAccel(const Vector &vel);
224 
225  virtual void incrDisp(const Vector &disp);
226  virtual void incrVel(const Vector &vel);
227  virtual void incrAccel(const Vector &vel);
228 
229  // methods added to store the modal analysis quantities in the domain
230  virtual void setNumEigenvectors(int numEigenvectors);
231  virtual void setEigenvector(int mode, const Vector &);
232  virtual void setEigenvalues(const Vector &);
233  virtual void setModalParticipationFactors(const Vector &);
234 
235  virtual int sendSelf(Communicator &);
236  virtual int recvSelf(const Communicator &);
237 
238  Domain *getDomainPtr(void);
239  const Domain *getDomainPtr(void) const;
240  ConstraintHandler *getHandlerPtr(void);
241  const ConstraintHandler *getHandlerPtr(void) const;
242  };
243 } // end of XC namespace
244 
245 #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 committed 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:61
Iterator over DEF groups.
Definition: DOF_GrpConstIter.h:42
Float vector abstraction.
Definition: Vector.h:94
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:58
A LagrangeDOF_Group object is instantiated by a LagrangeConstraintHandler for every constrained node ...
Definition: LagrangeDOF_Group.h:85
virtual bool addFE_Element(FE_Element *theFE_Ele)
Adds the FE_Element pointed to by theElement to the model.
Definition: AnalysisModel.cpp:169
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:93
Communication parameters between processes.
Definition: Communicator.h:66
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:100
virtual void setCurrentDomainTime(double newTime)
To set the current time in the Domain to be newTime.
Definition: AnalysisModel.cpp:942
virtual int recvSelf(const Communicator &)
Returns .
Definition: AnalysisModel.cpp:1016
] at the locations corresponding to the constrained degree-of-freedom specified by the SFreedom_Const...
Definition: LagrangeSFreedom_FE.h:94
Base class for the object that perform the analysis.
Definition: Analysis.h:117
Degrees of freedom group graph.
Definition: DOF_GroupGraph.h:83
Iterator over DOF groups.
Definition: DOF_GrpIter.h:73
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:151
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:92
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:112
PenaltyMRMFreedom_FE is a subclass of FE_Element which handles MRMFreedom_Constraints using the penal...
Definition: PenaltyMRMFreedom_FE.h:79
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:59
A TransformationDOF_Group object is instantiated by the TransformationConstraintHandler for every nod...
Definition: TransformationDOF_Group.h:92
] at the locations corresponding to the constrained degree-of-freedoms specified by the MFreedom_Co...
Definition: LagrangeMFreedom_FE.h:103
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:134
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:85
Objet that can execute python scripts.
Definition: CommandEntity.h:40
The Graph class provides the abstraction of a graph.
Definition: Graph.h:94
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:100
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
A DOF_Group object is instantiated by the ConstraintHandler for every unconstrained node in the domai...
Definition: DOF_Group.h:107
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
virtual double getCurrentDomainTime(void) const
To get the current time in the Domain.
Definition: AnalysisModel.cpp:922
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:59
virtual int updateDomain(void)
Method which invokes update() on the domain.
Definition: AnalysisModel.cpp:806
Degrees of freedom graph.
Definition: DOF_Graph.h:86
Iterator over the finite element of the model.
Definition: FE_EleIter.h:77
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:59
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:108
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:35
Definition: AutoConstraintHandler.h:84
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
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:113
PenaltySFreedom_FE is a subclass of SFreedom_FE which handles SFreedom_Constraints using the penalty ...
Definition: PenaltySFreedom_FE.h:87
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:88
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:117
Mesh node.
Definition: Node.h:111
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:42
virtual int sendSelf(Communicator &)
Returns .
Definition: AnalysisModel.cpp:1012
PenaltyMFreedom_FE is a subclass of FE_Element which handles MFreedom_Constraints using the penalty m...
Definition: PenaltyMFreedom_FE.h:90
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