xc
SolutionStrategy.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 //SolutionStrategy.h
29 
30 #ifndef ANALYSISAGGREGATION_H
31 #define ANALYSISAGGREGATION_H
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include "utility/handler/DataOutputHandler.h"
35 
36 namespace XC {
37 
38 class Domain;
39 
40 class AnalysisModel;
41 class ConstraintHandler;
42 class DOF_Numberer;
43 
44 class SolutionAlgorithm;
45 class EigenAlgorithm;
46 class EquiSolnAlgo;
47 class DomainDecompAlgo;
48 
49 class Integrator;
50 class IncrementalIntegrator;
51 class EigenIntegrator;
52 class LinearBucklingIntegrator;
53 class TransientIntegrator;
54 class StaticIntegrator;
55 
56 class SystemOfEqn;
57 class LinearSOE;
58 class EigenSOE;
59 
60 class ConvergenceTest;
61 class ModelWrapper;
62 
63 class Analysis;
64 
65 class FEM_ObjectBroker;
66 class ID;
67 
68 class SolutionStrategyMap;
69 class SolutionProcedureControl;
70 
95  {
96  ModelWrapper *theModelWrapper;
97  SolutionAlgorithm *theSolnAlgo;
98  Integrator *theIntegrator;
99  SystemOfEqn *theSOE;
100  ConvergenceTest *theTest;
101 
102  Analysis *getAnalysisPtr(void);
103  const Analysis *getAnalysisPtr(void) const;
104  protected:
105  friend class FEProblem;
106 
107  void free_soln_algo(void);
108  bool alloc_soln_algo(const std::string &);
110 
111  void free_integrator(void);
112  bool alloc_integrator(const std::string &,const Vector &);
113  void copy_integrator(Integrator *);
114  void set_integrator(void);
115 
116  void free_system_of_equations(void);
117  bool alloc_system_of_equations(const std::string &,AnalysisModel *);
119 
120  void free_conv_test(void);
121  bool alloc_conv_test(const std::string &);
122  void copy_conv_test(ConvergenceTest *);
123 
124  void free_mem(void);
125  void copy(const SolutionStrategy &);
126 
127  public:
128  SolutionStrategy(SolutionStrategyMap *owr= nullptr, ModelWrapper *b= nullptr);
131  ~SolutionStrategy(void);
132 
133  const SolutionStrategyMap *getSolutionStrategyMap(void) const;
137  std::string getName(void) const;
138  const std::string &getModelWrapperName(void) const;
139 
140  inline ModelWrapper *getModelWrapperPtr(void)
141  { return theModelWrapper; }
142  Domain *getDomainPtr(void);
143  const Domain *getDomainPtr(void) const;
145  DOF_Numberer *getDOF_NumbererPtr(void) const;
146  AnalysisModel *getAnalysisModelPtr(void) const;
147 
148  LinearSOE *getLinearSOEPtr(void);
149  const LinearSOE *getLinearSOEPtr(void) const;
150  EigenSOE *getEigenSOEPtr(void);
151  const EigenSOE *getEigenSOEPtr(void) const;
152  Integrator &newIntegrator(const std::string &, const Vector &);
153 
156  { return theIntegrator; }
157  inline const Integrator *getIntegratorPtr(void) const
158  { return theIntegrator; }
162  TransientIntegrator *getTransientIntegratorPtr(void);
164  SystemOfEqn &newSystemOfEqn(const std::string &);
165 
168  { return theSolnAlgo; }
169  inline const SolutionAlgorithm *getSolutionAlgorithmPtr(void) const
170  { return theSolnAlgo; }
174  SolutionAlgorithm &newSolutionAlgorithm(const std::string &);
175 
177  const ConvergenceTest *getConvergenceTestPtr(void) const;
178  ConvergenceTest &newConvergenceTest(const std::string &);
179 
180  virtual const DomainSolver *getDomainSolverPtr(void) const;
181  virtual DomainSolver *getDomainSolverPtr(void);
182  virtual const Subdomain *getSubdomainPtr(void) const;
183  virtual Subdomain *getSubdomainPtr(void);
184 
185  int setLinearSOE(LinearSOE &theSOE);
186  int setEigenSOE(EigenSOE &theSOE);
187  int setIntegrator(Integrator &theNewIntegrator);
188  int setAlgorithm(SolutionAlgorithm &theNewAlgorithm);
189  int setConvergenceTest(ConvergenceTest &theNewTest);
190 
191  void brokeDDLinearSOE(const Communicator &,const ID &);
192  void brokeLinearSOE(const Communicator &,const ID &);
193 
194  void brokeIncrementalIntegrator(const Communicator &,const ID &);
195  void brokeStaticIntegrator(const Communicator &,const ID &);
196  void brokeTransientIntegrator(const Communicator &,const ID &);
197 
198  void brokeDomainDecompAlgo(const Communicator &,const ID &);
199  void brokeEquiSolnAlgo(const Communicator &,const ID &);
200  bool CheckPointers(void);
201  void revertToStart(void);
202 
203  void clearAll(void);
204  };
205 
206 } // end of XC namespace
207 
208 #endif
EigenIntegrator * getEigenIntegratorPtr(void)
Returns, if possible, a pointer to the eigen integrator otherwise it returns nullptr.
Definition: SolutionStrategy.cc:1072
bool CheckPointers(void)
Verifies that the pointers are not null.
Definition: SolutionStrategy.cc:1242
{staticFormTaylor} {equation}
Definition: StaticIntegrator.h:138
const SolutionProcedureControl * getSolutionProcedureControl(void) const
Returns a pointer to the solution procedure control object that contains this object.
Definition: SolutionStrategy.cc:849
Base class for DOF numbererers.
Definition: DOF_Numberer.h:94
DomainDecompAlgo * getDomainDecompSolutionAlgorithmPtr(void)
Returns, if possible, a pointer al solution algorithm DomainDecomp , otherwise it returns nullptr...
Definition: SolutionStrategy.cc:1144
Float vector abstraction.
Definition: Vector.h:94
Domain enclosed in another domain.
Definition: Subdomain.h:102
Base class for solution algorithms.
Definition: SolutionAlgorithm.h:91
int setLinearSOE(LinearSOE &theSOE)
Sets the linear system of equations to use in the analysis.
Definition: SolutionStrategy.cc:1163
int setEigenSOE(EigenSOE &theSOE)
Sets the eigenSOE to use in the analysis.
Definition: SolutionStrategy.cc:1170
int setAlgorithm(SolutionAlgorithm &theNewAlgorithm)
Sets the solution algorithm to use in the analysis.
Definition: SolutionStrategy.cc:1186
ConstraintHandlers enforce the single and multi freedom constraints that exist in the domain by creat...
Definition: ConstraintHandler.h:93
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:64
Communication parameters between processes.
Definition: Communicator.h:66
Linear system of equations.
Definition: LinearSOE.h:92
EigenAlgorithm * getEigenSolutionAlgorithmPtr(void)
Returns, if possible, a pointer to the solution algorithm of the eigen problem,, otherwise it returns...
Definition: SolutionStrategy.cc:1120
Solution strategies container.
Definition: SolutionStrategyMap.h:45
DOF_Numberer * getDOF_NumbererPtr(void) const
Returns a pointer to the numberer.
Definition: SolutionStrategy.cc:991
int setIntegrator(Integrator &theNewIntegrator)
Sets the integrator to use in the analysis.
Definition: SolutionStrategy.cc:1179
SolutionAlgorithm & newSolutionAlgorithm(const std::string &)
Creates a new solution algorithm with the name being passed as parameter.
Definition: SolutionStrategy.cc:132
Integrator * getIntegratorPtr(void)
Returns a pointer to the integrator.
Definition: SolutionStrategy.h:155
Base class for the object that perform the analysis.
Definition: Analysis.h:117
Solution algorithm for domain decomposition analysis.
Definition: DomainDecompAlgo.h:89
AnalysisModel * getAnalysisModelPtr(void) const
Returns a pointer to the analysis model.
Definition: SolutionStrategy.cc:999
Vector of integers.
Definition: ID.h:95
Domain * getDomainPtr(void)
Returns a pointer to the domain.
Definition: SolutionStrategy.cc:930
IncrementalIntegrator * getIncrementalIntegratorPtr(void)
Returns, if possible, a pointer to the incremental integrator otherwise it returns nullptr...
Definition: SolutionStrategy.cc:1060
void set_integrator(void)
Informs the analysis object of the new integrator.
Definition: SolutionStrategy.cc:493
void copy_system_of_equations(SystemOfEqn *)
To change the linear system of equation object between analysis.
Definition: SolutionStrategy.cc:657
void revertToStart(void)
Returns the modelo a su estado original.
Definition: SolutionStrategy.cc:1281
void copy_integrator(Integrator *)
To change the integration scheme between analysis.
Definition: SolutionStrategy.cc:477
LinearBucklingIntegrator is an algorithmic class for setting up the finite element equations for a li...
Definition: LinearBucklingIntegrator.h:49
int setConvergenceTest(ConvergenceTest &theNewTest)
Sets the convergence test to use in the analysis.
Definition: SolutionStrategy.cc:1193
SolutionAlgorithm * getSolutionAlgorithmPtr(void)
Returns a pointer to the solution algorithm.
Definition: SolutionStrategy.h:167
Wrapper for the finite element model "as seen" from the solver.
Definition: ModelWrapper.h:59
System of equations base class.
Definition: SystemOfEqn.h:90
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:134
virtual const Subdomain * getSubdomainPtr(void) const
Returns a pointer to the subdomain.
Definition: SolutionStrategy.cc:966
ConstraintHandler * getConstraintHandlerPtr(void)
Returns a pointer to the constraint handler.
Definition: SolutionStrategy.cc:982
ConvergenceTest & newConvergenceTest(const std::string &)
Set convergence test to be used.
Definition: SolutionStrategy.cc:739
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Solution algorithm for eigenproblem.
Definition: EigenAlgorithm.h:84
SolutionStrategy(SolutionStrategyMap *owr=nullptr, ModelWrapper *b=nullptr)
Default constructor.
Definition: SolutionStrategy.cc:768
Integrator & newIntegrator(const std::string &, const Vector &)
Defines a new integrator.
Definition: SolutionStrategy.cc:568
virtual const DomainSolver * getDomainSolverPtr(void) const
Returns a pointer to the DomainSolver.
Definition: SolutionStrategy.cc:950
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:100
IncrementalIntegrator is an algorithmic class for setting up the finite element equations in an incre...
Definition: IncrementalIntegrator.h:100
Finite element problem.
Definition: FEProblem.h:81
Container for the objects that control the solution procedure.
Definition: SolutionProcedureControl.h:45
Base class for eigenproblem integrators.
Definition: EigenIntegrator.h:86
Base class for solution algorithms.
Definition: EquiSolnAlgo.h:91
std::string getName(void) const
Return the name of this object in its container.
Definition: SolutionStrategy.cc:870
SolutionStrategy & operator=(const SolutionStrategy &)
Assignment operator.
Definition: SolutionStrategy.cc:789
StaticIntegrator * getStaticIntegratorPtr(void)
Returns, if possible, a pointer to the static integrator otherwise it returns nullptr.
Definition: SolutionStrategy.cc:1108
convergence test.
Definition: ConvergenceTest.h:81
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
TransientIntegrator * getTransientIntegratorPtr(void)
Returns, if possible, a pointer to the transient integrator otherwise it returns nullptr.
Definition: SolutionStrategy.cc:1096
void copy_soln_algo(SolutionAlgorithm *)
To change the algorithm between analysis.
Definition: SolutionStrategy.cc:117
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
used to solve a system of equations and to do static condensation operations on the linear system of ...
Definition: DomainSolver.h:83
EquiSolnAlgo * getEquiSolutionAlgorithmPtr(void)
Returns, if possible, a pointer to the system of equations solution algorithm, otherwise it returns n...
Definition: SolutionStrategy.cc:1132
~SolutionStrategy(void)
Destructor.
Definition: SolutionStrategy.cc:800
SystemOfEqn & newSystemOfEqn(const std::string &)
Sets the system of equations type to use.
Definition: SolutionStrategy.cc:672
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
LinearBucklingIntegrator * getLinearBucklingIntegratorPtr(void)
Returns, if possible, a pointer to the linear buckling integrator otherwise it returns nullptr...
Definition: SolutionStrategy.cc:1084
LinearSOE * getLinearSOEPtr(void)
Returns a pointer to the linear system of equations.
Definition: SolutionStrategy.cc:1009
EigenSOE * getEigenSOEPtr(void)
Returns a pointer to the system of equations de eigenvalues.
Definition: SolutionStrategy.cc:1037
const SolutionStrategyMap * getSolutionStrategyMap(void) const
Returns a pointer to the solution strategy map that contains this object.
Definition: SolutionStrategy.cc:805
ConvergenceTest * getConvergenceTestPtr(void)
Returns a pointer to the convergence test.
Definition: SolutionStrategy.cc:1155
const std::string & getModelWrapperName(void) const
Return the name of a model wrapper.
Definition: SolutionStrategy.cc:899