xc
ModelWrapper.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 //ModelWrapper.h
29 
30 #ifndef MODELWRAPPER_H
31 #define MODELWRAPPER_H
32 
33 #include "utility/kernel/CommandEntity.h"
34 
35 namespace XC {
36 
37 class Domain;
38 class AnalysisModel;
39 class ConstraintHandler;
40 class DOF_Numberer;
41 class FEM_ObjectBroker;
42 class ID;
43 class Communicator;
44 class SolutionStrategy;
45 class Integrator;
46 
48 //
50 //
60  {
61  AnalysisModel *theModel;
62  ConstraintHandler *theHandler;
63  DOF_Numberer *theDOFNumberer;
64 
65  void free_analysis_model(void);
66  void alloc_analysis_model(void);
67  void copy_analysis_model(AnalysisModel *);
68 
69  void free_constraint_handler(void);
70  bool alloc_constraint_handler(const std::string &);
71  void copy_constraint_handler(const ConstraintHandler *);
72 
73  bool setup_numerador(void);
74  void free_numerador(void);
75  bool alloc_numerador(const std::string &);
76  void copy_numerador(const DOF_Numberer *);
77 
78  void copy(const ModelWrapper &);
79  void free_mem(void);
80 
81  SolutionStrategy *getSolutionStrategy(void);
82  const SolutionStrategy *getSolutionStrategy(void) const;
83  protected:
84  friend class FEProblem;
85  friend class SolutionStrategy;
86 
87  public:
88  ModelWrapper(SolutionStrategy *owr= nullptr);
89  ModelWrapper(const ModelWrapper &);
91  ~ModelWrapper(void);
92 
93  std::string getName(void) const;
94 
95  Domain *getDomainPtr(void);
96  const Domain *getDomainPtr(void) const;
98  const Integrator *getIntegratorPtr(void) const;
99 
102  { return theHandler; }
104  inline const ConstraintHandler *getConstraintHandlerPtr(void) const
105  { return theHandler; }
108  { return theDOFNumberer; }
110  inline const DOF_Numberer *getDOF_NumbererPtr(void) const
111  { return theDOFNumberer; }
114  { return theModel; }
116  inline const AnalysisModel *getAnalysisModelPtr(void) const
117  { return theModel; }
118  int setNumberer(DOF_Numberer &theNumberer);
119  void brokeConstraintHandler(const Communicator &,const ID &);
120  void brokeNumberer(const Communicator &,const ID &);
121  void brokeAnalysisModel(const Communicator &,const ID &);
122  bool CheckPointers(void);
123 
124  DOF_Numberer &newNumberer(const std::string &);
125  ConstraintHandler &newConstraintHandler(const std::string &);
126 
127  void clearAll(void);
128  };
129 
130 } // end of XC namespace
131 
132 #endif
Base class for DOF numbererers.
Definition: DOF_Numberer.h:94
DOF_Numberer & newNumberer(const std::string &)
Creates a numberer of the type passed as parameter.
Definition: ModelWrapper.cc:185
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
Integrator * getIntegratorPtr(void)
Return a pointer to the integrator.
Definition: ModelWrapper.cc:274
ConstraintHandler * getConstraintHandlerPtr(void)
Return a pointer to the constraints handler.
Definition: ModelWrapper.h:101
ModelWrapper(SolutionStrategy *owr=nullptr)
Default constructor.
Definition: ModelWrapper.cc:216
Domain * getDomainPtr(void)
Return a pointer to the domain.
Definition: ModelWrapper.cc:258
Vector of integers.
Definition: ID.h:95
ModelWrapper & operator=(const ModelWrapper &)
Assignment operator.
Definition: ModelWrapper.cc:226
~ModelWrapper(void)
Destructor.
Definition: ModelWrapper.cc:234
DOF_Numberer * getDOF_NumbererPtr(void)
Return a pointer to the DOF numberer.
Definition: ModelWrapper.h:107
Wrapper for the finite element model "as seen" from the solver.
Definition: ModelWrapper.h:59
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:134
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:100
bool CheckPointers(void)
Verify that the point are not null.
Definition: ModelWrapper.cc:315
ConstraintHandler & newConstraintHandler(const std::string &)
Create a constraints handler of the type passed as parameter.
Definition: ModelWrapper.cc:124
Finite element problem.
Definition: FEProblem.h:81
const DOF_Numberer * getDOF_NumbererPtr(void) const
Return a pointer to the DOF numberer.
Definition: ModelWrapper.h:110
const AnalysisModel * getAnalysisModelPtr(void) const
Return a pointer to the analysis model.
Definition: ModelWrapper.h:116
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
const ConstraintHandler * getConstraintHandlerPtr(void) const
Return a pointer to the constraints handler.
Definition: ModelWrapper.h:104
int setNumberer(DOF_Numberer &theNumberer)
Set the numberer to be used in the analysis.
Definition: ModelWrapper.cc:308
AnalysisModel * getAnalysisModelPtr(void)
Return a pointer to the analysis model.
Definition: ModelWrapper.h:113
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
std::string getName(void) const
Returns the name of the material.
Definition: ModelWrapper.cc:241
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117