XC Open source finite element analysis program
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/nucleo/EntCmd.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 SoluMethod;
44 class Integrator;
45 
47 //
55 class ModelWrapper: public EntCmd
56  {
57  AnalysisModel *theModel;
58  ConstraintHandler *theHandler;
59  DOF_Numberer *theDOFNumberer;
60 
61  void libera_analysis_model(void);
62  void alloc_analysis_model(void);
63  void copia_analysis_model(AnalysisModel *);
64 
65  void libera_constraint_handler(void);
66  bool alloc_constraint_handler(const std::string &);
67  void copia_constraint_handler(const ConstraintHandler *);
68 
69  bool setup_numerador(void);
70  void libera_numerador(void);
71  bool alloc_numerador(const std::string &);
72  void copia_numerador(const DOF_Numberer *);
73 
74  void copia(const ModelWrapper &otro);
75  void libera(void);
76 
77  SoluMethod *getSoluMethod(void);
78  const SoluMethod *getSoluMethod(void) const;
79  protected:
80  friend class ProblemaEF;
81  friend class SoluMethod;
82 
83  public:
84  ModelWrapper(SoluMethod *owr= nullptr);
85  ModelWrapper(const ModelWrapper &);
87  ~ModelWrapper(void);
88 
89  Domain *getDomainPtr(void);
90  const Domain *getDomainPtr(void) const;
92  const Integrator *getIntegratorPtr(void) const;
93 
96  { return theHandler; }
98  inline const ConstraintHandler *getConstraintHandlerPtr(void) const
99  { return theHandler; }
102  { return theDOFNumberer; }
104  inline const DOF_Numberer *getDOF_NumbererPtr(void) const
105  { return theDOFNumberer; }
108  { return theModel; }
110  inline const AnalysisModel *getAnalysisModelPtr(void) const
111  { return theModel; }
112  int setNumberer(DOF_Numberer &theNumberer);
113  void brokeConstraintHandler(const CommParameters &,const ID &);
114  void brokeNumberer(const CommParameters &,const ID &);
115  void brokeAnalysisModel(const CommParameters &,const ID &);
116  bool CheckPointers(void);
117 
118  DOF_Numberer &newNumberer(const std::string &);
119  ConstraintHandler &newConstraintHandler(const std::string &);
120 
121  void clearAll(void);
122  };
123 
124 } // end of XC namespace
125 
126 #endif
ModelWrapper & operator=(const ModelWrapper &)
Assignment operator.
Definition: ModelWrapper.cc:219
Base class for DOF numbererers.
Definition: DOF_Numberer.h:84
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
ModelWrapper(SoluMethod *owr=nullptr)
Default constructor.
Definition: ModelWrapper.cc:209
~ModelWrapper(void)
Destructor.
Definition: ModelWrapper.cc:227
ConstraintHandler * getConstraintHandlerPtr(void)
Returns a pointer to the manejador de coacciones.
Definition: ModelWrapper.h:95
const ConstraintHandler * getConstraintHandlerPtr(void) const
Returns a pointer to the manejador de coacciones.
Definition: ModelWrapper.h:98
Solution procedure for the finite element problem. The solution procedure is definde by specifiying: ...
Definition: SoluMethod.h:76
AnalysisModel * getAnalysisModelPtr(void)
Returns a pointer to the analysis model.
Definition: ModelWrapper.h:107
bool CheckPointers(void)
Verifica que los pointers no sean nulos.
Definition: ModelWrapper.cc:291
Definition: ID.h:77
Finite element problem.
Definition: ProblemaEF.h:84
Integrator * getIntegratorPtr(void)
Returns a pointer to the integrator.
Definition: ModelWrapper.cc:250
const DOF_Numberer * getDOF_NumbererPtr(void) const
Returns a pointer to the renumerador.
Definition: ModelWrapper.h:104
Wrapper for the finite element model "seen" from the solver. The model wrapper is definied by: ...
Definition: ModelWrapper.h:55
Domain * getDomainPtr(void)
Returns a pointer to the domain.
Definition: ModelWrapper.cc:234
DOF_Numberer * getDOF_NumbererPtr(void)
Returns a pointer to the renumerador.
Definition: ModelWrapper.h:101
Los objetos de esta clase, dan acceso a los objetos FE_Element y DOF_Group creados por el Constraint ...
Definition: AnalysisModel.h:113
int setNumberer(DOF_Numberer &theNumberer)
Sets the renumerador to use in the analysis.
Definition: ModelWrapper.cc:284
ConstraintHandlers enforce the single and multi freedom constraints that exist in the domain by creat...
Definition: ConstraintHandler.h:94
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
ConstraintHandler & newConstraintHandler(const std::string &)
Crea un numerador del tipo being passed as parameter.
Definition: ModelWrapper.cc:119
DOF_Numberer & newNumberer(const std::string &)
Crea un numerador del tipo being passed as parameter.
Definition: ModelWrapper.cc:180
Base class for the object that performs the integration of physical properties over the domain to for...
Definition: Integrator.h:91
const AnalysisModel * getAnalysisModelPtr(void) const
Returns a pointer to the analysis model.
Definition: ModelWrapper.h:110