XC Open source finite element analysis program
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/nucleo/EntCmd.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 //
106 //
108 //
110 //
113 class AnalysisModel: public MovableObject, public EntCmd
114  {
115  private:
116  int numFE_Ele;
117  int numDOF_Grp;
118  int numEqn;
119 
120  ArrayOfTaggedObjects theFEs;
121  ArrayOfTaggedObjects theDOFGroups;
122  FE_EleIter theFEiter;
123  DOF_GrpIter theDOFGroupiter;
124  mutable FE_EleConstIter theFEconst_iter;
125  mutable DOF_GrpConstIter theDOFGroupconst_iter;
126 
127  mutable DOF_Graph myDOFGraph;
128  mutable DOF_GroupGraph myGroupGraph;
129  mutable bool updateGraphs;
130 
131  ModelWrapper *getModelWrapper(void);
132  const ModelWrapper *getModelWrapper(void) const;
133  protected:
134 
135 
136  friend class Integrator;
137  friend class Analysis;
138  virtual void applyLoadDomain(double newTime);
139  virtual int updateDomain(void);
140  virtual int updateDomain(double newTime, double dT);
141  virtual int newStepDomain(double dT =0.0);
142  virtual int commitDomain(void);
143  virtual int revertDomainToLastCommit(void);
144  virtual double getCurrentDomainTime(void);
145  virtual void setCurrentDomainTime(double newTime);
146  virtual void setRayleighDampingFactors(const RayleighDampingFactors &rF);
147 
148  virtual bool addDOF_Group(DOF_Group *theDOF_Grp);
149  virtual bool addFE_Element(FE_Element *theFE_Ele);
150 
151  friend class ModelWrapper;
152  friend class FEM_ObjectBroker;
153  AnalysisModel(ModelWrapper *owr= nullptr);
154  AnalysisModel(int classTag,EntCmd *owr);
155  AnalysisModel(const AnalysisModel &);
157  AnalysisModel *getCopy(void) const;
158  public:
159  virtual ~AnalysisModel(void);
160 
161  // methods to populate/depopulate the AnalysisModel
162  virtual DOF_Group *createDOF_Group(const int &, Node *);
166  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MFreedom_ConstraintBase *, TransformationConstraintHandler*);
167  //virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, MRMFreedom_Constraint *, TransformationConstraintHandler*);
168  virtual TransformationDOF_Group *createTransformationDOF_Group(const int &, Node *, TransformationConstraintHandler*);
169  virtual FE_Element *createFE_Element(const int &, Element *);
170  virtual LagrangeSFreedom_FE *createLagrangeSFreedom_FE(const int &, SFreedom_Constraint &, DOF_Group &,const double &);
171  virtual LagrangeMFreedom_FE *createLagrangeMFreedom_FE(const int &, MFreedom_Constraint &, DOF_Group &,const double &);
172  virtual LagrangeMRMFreedom_FE *createLagrangeMRMFreedom_FE(const int &,MRMFreedom_Constraint &,DOF_Group &,const double &);
173  virtual PenaltySFreedom_FE *createPenaltySFreedom_FE(const int &, SFreedom_Constraint &, const double &);
174  virtual PenaltyMFreedom_FE *createPenaltyMFreedom_FE(const int &, MFreedom_Constraint &, const double &);
175  virtual PenaltyMRMFreedom_FE *createPenaltyMRMFreedom_FE(const int &, MRMFreedom_Constraint &, const double &);
176  virtual FE_Element *createTransformationFE(const int &, Element *, const std::set<int> &,std::set<FE_Element *> &);
177  virtual void clearAll(void);
178 
179  // methods to access the FE_Elements and DOF_Groups and their numbers
180  virtual int getNumDOF_Groups(void) const;
181  virtual DOF_Group *getDOF_GroupPtr(int tag);
182  virtual const DOF_Group *getDOF_GroupPtr(int tag) const;
183  virtual FE_EleIter &getFEs();
184  virtual DOF_GrpIter &getDOFGroups();
185  virtual FE_EleConstIter &getConstFEs() const;
186  virtual DOF_GrpConstIter &getConstDOFs() const;
187 
188  // method to access the connectivity for SysOfEqn to size itself
189  virtual void setNumEqn(int) ;
190  virtual int getNumEqn(void) const ;
191  virtual Graph &getDOFGraph(void);
192  virtual Graph &getDOFGroupGraph(void);
193  virtual const Graph &getDOFGraph(void) const;
194  virtual const Graph &getDOFGroupGraph(void) const;
195 
196  // methods to update the response quantities at the DOF_Groups,
197  // which in turn set the new_ nodal trial response quantities.
198  virtual void setResponse(const Vector &, const Vector &, const Vector &);
199  virtual void setDisp(const Vector &disp);
200  virtual void setVel(const Vector &vel);
201  virtual void setAccel(const Vector &vel);
202 
203  virtual void incrDisp(const Vector &disp);
204  virtual void incrVel(const Vector &vel);
205  virtual void incrAccel(const Vector &vel);
206 
207  // methods added to store the modal analysis quantities in the domain
208  virtual void setNumEigenvectors(int numEigenvectors);
209  virtual void setEigenvector(int mode, const Vector &);
210  virtual void setEigenvalues(const Vector &);
211  virtual void setModalParticipationFactors(const Vector &);
212 
213  virtual int sendSelf(CommParameters &);
214  virtual int recvSelf(const CommParameters &);
215 
216  Domain *getDomainPtr(void);
217  const Domain *getDomainPtr(void) const;
218  ConstraintHandler *getHandlerPtr(void);
219  const ConstraintHandler *getHandlerPtr(void) const;
220  };
221 } // end of XC namespace
222 
223 #endif
A DOF_Group object is instantiated by the ConstraintHandler for every unconstrained node in the domai...
Definition: DOF_Group.h:94
A LagrangeDOF_Group object is instantiated by a LagrangeConstraintHandler for every constrained node ...
Definition: LagrangeDOF_Group.h:78
virtual FE_Element * createFE_Element(const int &, Element *)
Método para crear un objeto FE_Element y agregarlo al modelo.
Definition: AnalysisModel.cpp:171
ArrayOfTaggedObjects is a storage class. The class is responsible for holding and providing access to...
Definition: ArrayOfTaggedObjects.h:81
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
LagrangeMRMFreedom_FE is a subclass of FE_Element which handles MRMFreedom_Constraints using the Lagr...
Definition: LagrangeMRMFreedom_FE.h:60
Definition: Vector.h:82
Clase Base para los objetos que realizan the analysis.
Definition: Analysis.h:109
AnalysisModel(ModelWrapper *owr=nullptr)
Constructor.
Definition: AnalysisModel.cpp:92
virtual DOF_Group * getDOF_GroupPtr(int tag)
Returns a pointer to the DEF group with the tag beign passed as parameter.
Definition: AnalysisModel.cpp:479
Mesh node.
Definition: Node.h:99
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:368
Finite element as seen by analysis.
Definition: FE_Element.h:84
FEM_ObjectBroker is is an object broker class for the finite element method. All methods are virtual ...
Definition: FEM_ObjectBroker.h:138
AnalysisModel * getCopy(void) const
Virtual constructor.
Definition: AnalysisModel.cpp:132
Base calass for the finite elements.
Definition: Element.h:104
A TransformationDOF_Group object is instantiated by the TransformationConstraintHandler for every nod...
Definition: TransformationDOF_Group.h:84
Object that can move between processes.
Definition: MovableObject.h:91
Degrees of freedom group.
Definition: DOF_GroupGraph.h:75
virtual LagrangeSFreedom_FE * createLagrangeSFreedom_FE(const int &, SFreedom_Constraint &, DOF_Group &, const double &)
Método para crear un objeto LagrangeSFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:199
TransformationConstraintHandler is a constraint handler for handling constraints using the Transforma...
Definition: TransformationConstraintHandler.h:83
AnalysisModel & operator=(const AnalysisModel &)
Assignment operator.
Definition: AnalysisModel.cpp:116
LagrangeMFreedom_FE is a subclass of FE_Element which handles MFreedom_Constraints using the Lagrange...
Definition: LagrangeMFreedom_FE.h:84
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
virtual PenaltyMFreedom_FE * createPenaltyMFreedom_FE(const int &, MFreedom_Constraint &, const double &)
Método para crear un objeto PenaltyMFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:251
virtual int getNumDOF_Groups(void) const
Returns the umber of XC::DOF_Group objects added.
Definition: AnalysisModel.cpp:473
LagrangeSFreedom_FE is a subclass of SFreedom_FE which handles SFreedom_Constraints using the Lagrang...
Definition: LagrangeSFreedom_FE.h:79
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
virtual void setModalParticipationFactors(const Vector &)
Comunica al domain el valor de los factores de participación modal obtenidos.
Definition: AnalysisModel.cpp:649
Degrees of freedom graph.
Definition: DOF_Graph.h:79
Wrapper for the finite element model "seen" from the solver. The model wrapper is definied by: ...
Definition: ModelWrapper.h:55
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:45
Const iterator over the finite elements of the model.
Definition: FE_EleConstIter.h:41
PenaltySFreedom_FE is a subclass of SFreedom_FE which handles SFreedom_Constraints using the penalty ...
Definition: PenaltySFreedom_FE.h:78
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
PenaltyMRMFreedom_FE is a subclass of FE_Element which handles MRMFreedom_Constraints using the penal...
Definition: PenaltyMRMFreedom_FE.h:78
PenaltyMFreedom_FE is a subclass of FE_Element which handles MFreedom_Constraints using the penalty m...
Definition: PenaltyMFreedom_FE.h:78
virtual void setEigenvalues(const Vector &)
Comunica al domain el valor de los eigenvalues obtenidos.
Definition: AnalysisModel.cpp:644
Iterator over DEF groups.
Definition: DOF_GrpConstIter.h:41
Los objetos de esta clase, dan acceso a los objetos FE_Element y DOF_Group creados por el Constraint ...
Definition: AnalysisModel.h:113
virtual int revertDomainToLastCommit(void)
Returns to the last commited state.
Definition: AnalysisModel.cpp:747
virtual bool addFE_Element(FE_Element *theFE_Ele)
Método para agregar un objeto FE_Element al modelo.
Definition: AnalysisModel.cpp:140
Multi-freedom constraint. Objectt of this class store the information for a multifreedom constraint...
Definition: MFreedom_Constraint.h:84
virtual LagrangeMRMFreedom_FE * createLagrangeMRMFreedom_FE(const int &, MRMFreedom_Constraint &, DOF_Group &, const double &)
Método para crear un objeto LagrangeMRMFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:225
ConstraintHandlers enforce the single and multi freedom constraints that exist in the domain by creat...
Definition: ConstraintHandler.h:94
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
virtual PenaltyMRMFreedom_FE * createPenaltyMRMFreedom_FE(const int &, MRMFreedom_Constraint &, const double &)
Método para crear un objeto PenaltyMRMFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:264
Communication parameters between processes.
Definition: CommParameters.h:65
virtual int commitDomain(void)
Commits domain state.
Definition: AnalysisModel.cpp:727
================================================================================
Definition: ContinuaReprComponent.h:34
Iterator over DOF groups.
Definition: DOF_GrpIter.h:72
virtual FE_Element * createTransformationFE(const int &, Element *, const std::set< int > &, std::set< FE_Element * > &)
Método para crear un objeto TransformationFE_Element y agregarlo al modelo.
Definition: AnalysisModel.cpp:277
Iterator over the finite element of the model.
Definition: FE_EleIter.h:76
virtual PenaltySFreedom_FE * createPenaltySFreedom_FE(const int &, SFreedom_Constraint &, const double &)
Método para crear un objeto PenaltySFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:238
Base class for the object that performs the integration of physical properties over the domain to for...
Definition: Integrator.h:91
virtual LagrangeMFreedom_FE * createLagrangeMFreedom_FE(const int &, MFreedom_Constraint &, DOF_Group &, const double &)
Método para crear un objeto LagrangeMFreedom_FE y agregarlo al modelo.
Definition: AnalysisModel.cpp:212