xc
SolutionStrategyMap.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 //SolutionStrategyMap.h
29 
30 #ifndef MAPSOLUMETHOD_H
31 #define MAPSOLUMETHOD_H
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include "utility/handler/DataOutputHandler.h"
35 #include "SolutionStrategy.h"
36 
37 namespace XC {
38 
39 class SolutionProcedureControl;
40 class ModelWrapper;
41 
46  {
47  public:
48  typedef std::map<std::string,SolutionStrategy> map_solu_method;
49  typedef map_solu_method::iterator iterator;
50  typedef map_solu_method::const_iterator const_iterator;
51 
52  private:
53  map_solu_method solu_methods;
54  public:
56 
59  const ModelWrapper *getModelWrapper(const std::string &) const;
60  ModelWrapper *getModelWrapper(const std::string &);
61  const std::string &getModelWrapperName(const ModelWrapper *) const;
62 
63  inline iterator begin()
64  { return solu_methods.begin(); }
65  inline iterator end()
66  { return solu_methods.end(); }
67  inline const_iterator begin() const
68  { return solu_methods.begin(); }
69  inline const_iterator end() const
70  { return solu_methods.end(); }
71 
72  inline bool empty(void) const
73  { return solu_methods.empty(); }
74  inline size_t size(void) const
75  { return solu_methods.size(); }
76 
77  bool SolutionStrategyExists(const std::string &) const;
79  const SolutionStrategy *getSolutionStrategy(const std::string &) const;
80  SolutionStrategy *getSolutionStrategy(const std::string &);
81 
82  SolutionStrategy &newSolutionStrategy(const std::string &,const std::string &);
83 
84  void revertToStart(void);
85  void clearAll(void);
86  };
87 
88 } // end of XC namespace
89 
90 #endif
bool SolutionStrategyExists(const std::string &) const
Return true if the solution method exists.
Definition: SolutionStrategyMap.cc:66
const ModelWrapper * getModelWrapper(const std::string &) const
Return a pointer to the model wrapper with the identifier being passed as parameter.
Definition: SolutionStrategyMap.cc:53
Solution strategies container.
Definition: SolutionStrategyMap.h:45
SolutionProcedureControl * getSolutionProcedureControl(void)
Return a pointer to the object owner.
Definition: SolutionStrategyMap.cc:44
SolutionStrategyMap(SolutionProcedureControl *owr)
Default constructor.
Definition: SolutionStrategyMap.cc:40
const SolutionStrategy * getSolutionStrategy(const std::string &) const
Returns a const pointer to the solution method.
Definition: SolutionStrategyMap.cc:73
Wrapper for the finite element model "as seen" from the solver.
Definition: ModelWrapper.h:59
void revertToStart(void)
Returns todo a su estado original.
Definition: SolutionStrategyMap.cc:118
Objet that can execute python scripts.
Definition: CommandEntity.h:40
const std::string & getModelWrapperName(const ModelWrapper *) const
Return the name of a model wrapper.
Definition: SolutionStrategyMap.cc:62
SolutionStrategy & createSolutionStrategy(const std::string &, ModelWrapper *)
Creates a new solution method with the code being passed as parameter.
Definition: SolutionStrategyMap.cc:94
void clearAll(void)
Clears all.
Definition: SolutionStrategyMap.cc:125
Container for the objects that control the solution procedure.
Definition: SolutionProcedureControl.h:45
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
SolutionStrategy & newSolutionStrategy(const std::string &, const std::string &)
Creates a new solution method with the code being passed as parameter.
Definition: SolutionStrategyMap.cc:109