xc
ModelWrapper.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 //ModelWrapper.h
28 
29 #ifndef MODELWRAPPER_H
30 #define MODELWRAPPER_H
31 
32 #include "xc_utils/src/kernel/CommandEntity.h"
33 
34 namespace XC {
35 
36 class Domain;
37 class AnalysisModel;
38 class ConstraintHandler;
39 class DOF_Numberer;
40 class FEM_ObjectBroker;
41 class ID;
42 class CommParameters;
43 class AnalysisAggregation;
44 class Integrator;
45 
47 //
49 //
58 class ModelWrapper: public CommandEntity
59  {
60  AnalysisModel *theModel;
61  ConstraintHandler *theHandler;
62  DOF_Numberer *theDOFNumberer;
63 
64  void free_analysis_model(void);
65  void alloc_analysis_model(void);
66  void copy_analysis_model(AnalysisModel *);
67 
68  void free_constraint_handler(void);
69  bool alloc_constraint_handler(const std::string &);
70  void copy_constraint_handler(const ConstraintHandler *);
71 
72  bool setup_numerador(void);
73  void free_numerador(void);
74  bool alloc_numerador(const std::string &);
75  void copy_numerador(const DOF_Numberer *);
76 
77  void copy(const ModelWrapper &);
78  void free_mem(void);
79 
80  AnalysisAggregation *getAnalysisAggregation(void);
81  const AnalysisAggregation *getAnalysisAggregation(void) const;
82  protected:
83  friend class FEProblem;
84  friend class AnalysisAggregation;
85 
86  public:
87  ModelWrapper(AnalysisAggregation *owr= nullptr);
88  ModelWrapper(const ModelWrapper &);
90  ~ModelWrapper(void);
91 
92  Domain *getDomainPtr(void);
93  const Domain *getDomainPtr(void) const;
95  const Integrator *getIntegratorPtr(void) const;
96 
99  { return theHandler; }
101  inline const ConstraintHandler *getConstraintHandlerPtr(void) const
102  { return theHandler; }
105  { return theDOFNumberer; }
107  inline const DOF_Numberer *getDOF_NumbererPtr(void) const
108  { return theDOFNumberer; }
111  { return theModel; }
113  inline const AnalysisModel *getAnalysisModelPtr(void) const
114  { return theModel; }
115  int setNumberer(DOF_Numberer &theNumberer);
116  void brokeConstraintHandler(const CommParameters &,const ID &);
117  void brokeNumberer(const CommParameters &,const ID &);
118  void brokeAnalysisModel(const CommParameters &,const ID &);
119  bool CheckPointers(void);
120 
121  DOF_Numberer &newNumberer(const std::string &);
122  ConstraintHandler &newConstraintHandler(const std::string &);
123 
124  void clearAll(void);
125  };
126 
127 } // end of XC namespace
128 
129 #endif
Base class for DOF numbererers.
Definition: DOF_Numberer.h:93
DOF_Numberer & newNumberer(const std::string &)
Creates a numberer of the type passed as parameter.
Definition: ModelWrapper.cc:180
Solution procedure for the finite element problem.
Definition: AnalysisAggregation.h:89
ConstraintHandlers enforce the single and multi freedom constraints that exist in the domain by creat...
Definition: ConstraintHandler.h:92
Integrator * getIntegratorPtr(void)
Return a pointer to the integrator.
Definition: ModelWrapper.cc:250
ConstraintHandler * getConstraintHandlerPtr(void)
Return a pointer to the constraints handler.
Definition: ModelWrapper.h:98
Domain * getDomainPtr(void)
Return a pointer to the domain.
Definition: ModelWrapper.cc:234
Vector of integers.
Definition: ID.h:93
ModelWrapper & operator=(const ModelWrapper &)
Assignment operator.
Definition: ModelWrapper.cc:219
~ModelWrapper(void)
Destructor.
Definition: ModelWrapper.cc:227
DOF_Numberer * getDOF_NumbererPtr(void)
Return a pointer to the DOF numberer.
Definition: ModelWrapper.h:104
Wrapper for the finite element model "as seen" from the solver.
Definition: ModelWrapper.h:58
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:133
ModelWrapper(AnalysisAggregation *owr=nullptr)
Default constructor.
Definition: ModelWrapper.cc:209
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:99
bool CheckPointers(void)
Verifica que los pointers no sean nulos.
Definition: ModelWrapper.cc:291
ConstraintHandler & newConstraintHandler(const std::string &)
Create a constraints handler of the type passed as parameter.
Definition: ModelWrapper.cc:119
Finite element problem.
Definition: FEProblem.h:82
const DOF_Numberer * getDOF_NumbererPtr(void) const
Return a pointer to the DOF numberer.
Definition: ModelWrapper.h:107
const AnalysisModel * getAnalysisModelPtr(void) const
Return a pointer to the analysis model.
Definition: ModelWrapper.h:113
const ConstraintHandler * getConstraintHandlerPtr(void) const
Return a pointer to the constraints handler.
Definition: ModelWrapper.h:101
int setNumberer(DOF_Numberer &theNumberer)
Set the numberer to be used in the analysis.
Definition: ModelWrapper.cc:284
AnalysisModel * getAnalysisModelPtr(void)
Return a pointer to the analysis model.
Definition: ModelWrapper.h:110
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116