1 #ifndef KRATOS_SOLVER_SETTINGS_H
2 #define KRATOS_SOLVER_SETTINGS_H
48 template<
class TSparseSpace,
76 const unsigned int ThisDomainSize,
77 const unsigned int ThisTimeOrder,
79 const bool MoveMeshFlag,
80 const bool ReformDofSet):
83 mrModelPart(rModelPart),
84 mDomainSize(ThisDomainSize),
85 mTimeOrder(ThisTimeOrder),
88 mReformDofSet(ReformDofSet),
89 mMoveMeshFlag(MoveMeshFlag)
120 typename TLinearSolver::Pointer pLinearSolver,
121 const double Tolerance,
122 const unsigned int MaxIter) = 0;
125 typename TLinearSolver::Pointer pLinearSolver,
126 const double Tolerance,
127 const unsigned int MaxIter) {}
139 pTurbulenceModel.reset();
163 return mMoveMeshFlag;
169 typename std::map<StrategyLabel,StrategyPointerType>::iterator itStrategy =
mStrategies.find(rStrategyLabel);
173 if(itStrategy->second !=
nullptr)
175 pThisStrategy.swap(itStrategy->second);
178 KRATOS_INFO(
"SolverSettingsFractionalStepStrategy")<<
"Strategy for :: "<<rStrategyLabel<<
" not found."<<std::endl;
183 KRATOS_INFO(
"SolverSettingsFractionalStepStrategy")<<
"Strategy for :: "<<rStrategyLabel<<
" not found."<<std::endl;
191 typename std::map< StrategyLabel,double >::iterator itTol =
mTolerances.find(rStrategyLabel);
194 rTolerance = itTol->second;
202 unsigned int& rMaxIter)
204 typename std::map< StrategyLabel,unsigned int >::iterator itMaxIter =
mMaxIter.find(rStrategyLabel);
207 rMaxIter = itMaxIter->second;
217 for (
typename std::map< StrategyLabel, StrategyPointerType>::iterator itStrategy =
mStrategies.begin(); itStrategy !=
mStrategies.end(); ++itStrategy)
228 return mReformDofSet;
240 virtual std::string
Info()
const
242 std::stringstream buffer;
243 buffer <<
"SolverSettings" ;
248 virtual void PrintInfo(std::ostream& rOStream)
const {rOStream <<
"SolverSettings";}
323 unsigned int mDomainSize;
325 unsigned int mTimeOrder;
327 unsigned int mEchoLevel;
367 SolverSettings(SolverSettings
const& rOther){}
386 template<
class TDenseSpace,
class TSparseSpace,
class TLinearSolver >
394 template<
class TDenseSpace,
class TSparseSpace,
class TLinearSolver >
399 rOStream << std::endl;
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Helper class to define solution strategies for FS_Strategy.
Definition: solver_settings.h:53
virtual std::string Info() const
Turn back information as a string.
Definition: solver_settings.h:240
KRATOS_CLASS_POINTER_DEFINITION(SolverSettings)
Pointer definition of SolverSettings.
StrategyLabel
Definition: solver_settings.h:66
@ Velocity
Definition: solver_settings.h:66
@ Pressure
Definition: solver_settings.h:66
@ NumLabels
Definition: solver_settings.h:66
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > StrategyType
Definition: solver_settings.h:61
virtual bool FindMaxIter(StrategyLabel const &rStrategyLabel, unsigned int &rMaxIter)
Definition: solver_settings.h:201
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: solver_settings.h:248
virtual void SetStrategy(StrategyLabel const &rStrategyLabel, typename TLinearSolver::Pointer pLinearSolver, const double Tolerance, const unsigned int MaxIter)=0
virtual unsigned int GetDomainSize() const
Definition: solver_settings.h:146
ModelPart & GetModelPart()
Definition: solver_settings.h:285
virtual void SetTurbulenceModel(TurbulenceModelLabel const &rTurbulenceModel, typename TLinearSolver::Pointer pLinearSolver, const double Tolerance, const unsigned int MaxIter)
Definition: solver_settings.h:124
virtual bool MoveMesh() const
Definition: solver_settings.h:161
bool GetReformDofSet()
Definition: solver_settings.h:226
virtual void SetTurbulenceModel(ProcessPointerType pTurbulenceModel)
Definition: solver_settings.h:129
StrategyType::Pointer StrategyPointerType
Definition: solver_settings.h:62
virtual bool UseSlipConditions() const
Definition: solver_settings.h:156
SolverSettings(ModelPart &rModelPart, const unsigned int ThisDomainSize, const unsigned int ThisTimeOrder, const bool UseSlip, const bool MoveMeshFlag, const bool ReformDofSet)
Constructor.
Definition: solver_settings.h:75
virtual StrategyPointerType pGetStrategy(StrategyLabel const &rStrategyLabel)
Definition: solver_settings.h:108
std::map< StrategyLabel, double > mTolerances
Definition: solver_settings.h:292
virtual bool GetTurbulenceModel(ProcessPointerType &pTurbulenceModel)
Definition: solver_settings.h:135
virtual bool FindStrategy(StrategyLabel const &rStrategyLabel, StrategyPointerType &pThisStrategy)
Definition: solver_settings.h:166
std::map< StrategyLabel, StrategyPointerType > mStrategies
Definition: solver_settings.h:290
std::map< StrategyLabel, unsigned int > mMaxIter
Definition: solver_settings.h:294
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: solver_settings.h:251
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > TBuilderAndSolverType
Definition: solver_settings.h:64
Process::Pointer ProcessPointerType
Definition: solver_settings.h:63
virtual unsigned int GetEchoLevel()
Definition: solver_settings.h:221
TurbulenceModelLabel
Definition: solver_settings.h:68
@ NumTurbModels
Definition: solver_settings.h:68
@ SpalartAllmaras
Definition: solver_settings.h:68
virtual bool FindTolerance(StrategyLabel const &rStrategyLabel, double &rTolerance)
Definition: solver_settings.h:188
virtual ~SolverSettings()
Destructor.
Definition: solver_settings.h:93
bool mHaveTurbulenceModel
Definition: solver_settings.h:298
virtual void SetStrategy(StrategyLabel const &rStrategyLabel, StrategyPointerType pStrategy)
Definition: solver_settings.h:113
virtual void SetEchoLevel(unsigned int EchoLevel)
Definition: solver_settings.h:214
ProcessPointerType mpTurbulenceModel
Definition: solver_settings.h:296
virtual unsigned int GetTimeOrder() const
Definition: solver_settings.h:151
#define KRATOS_INFO(label)
Definition: logger.h:250
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432