14 #if !defined(KRATOS_SOLVING_STRATEGY)
15 #define KRATOS_SOLVING_STRATEGY
62 template<
class TSparseSpace,
class TDenseSpace>
115 : mpModelPart(&rModelPart)
130 : mpModelPart(&rModelPart)
153 virtual typename ClassType::Pointer
Create(
157 return Kratos::make_shared<ClassType>(rModelPart, ThisParameters);
282 mMoveMeshFlag = Flag;
292 return mMoveMeshFlag;
301 return mMoveMeshFlag;
312 KRATOS_ERROR <<
"Accessing the strategy base class \'SetRebuildLevel\'. Please implement it in your derived class." << std::endl;
323 KRATOS_ERROR <<
"Accessing the strategy base class \'GetRebuildLevel\'. Please implement it in your derived class." << std::endl;
401 "name" : "solving_strategy",
402 "move_mesh_flag" : false,
405 return default_parameters;
416 KRATOS_ERROR <<
"\'GetSystemMatrix\' not implemented in base \'SolvingStrategy\'" << std::endl;
429 KRATOS_ERROR <<
"\'GetSystemVector\' not implemented in base \'SolvingStrategy\'" << std::endl;
442 KRATOS_ERROR <<
"\'GetSolutionVector\' not implemented in base \'SolvingStrategy\'" << std::endl;
453 return "solving_strategy";
461 virtual std::string
Info()
const
463 return "SolvingStrategy";
512 return ThisParameters;
522 mMoveMeshFlag = ThisParameters[
"move_mesh_flag"].
GetBool();
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
virtual int Check() const
run input validation
Definition: model_part.cpp:2204
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & FastGetSolutionStepValue(const TVariableType &rThisVariable)
Definition: node.h:435
const PointType & GetInitialPosition() const
Definition: node.h:559
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
bool GetBool() const
This method returns the boolean contained in the current Parameter.
Definition: kratos_parameters.cpp:675
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
Solving strategy base class This is the base class from which we will derive all the strategies (impl...
Definition: solving_strategy.h:64
virtual bool SolveSolutionStep()
Solves the current step. This function returns true if a solution has been found, false otherwise.
Definition: solving_strategy.h:239
ModelPart::DofType TDofType
Definition: solving_strategy.h:85
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: solving_strategy.h:467
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition: solving_strategy.h:77
virtual void Predict()
Operation to predict the solution ... if it is not called a trivial predictor is used in which the va...
Definition: solving_strategy.h:164
virtual std::string Info() const
Turn back information as a string.
Definition: solving_strategy.h:461
virtual double GetResidualNorm()
Operations to get the residual norm.
Definition: solving_strategy.h:368
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solving_strategy.h:79
virtual void InitializeSolutionStep()
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: solving_strategy.h:224
ModelPart::NodesContainerType NodesArrayType
Definition: solving_strategy.h:89
virtual void SetRebuildLevel(int Level)
Set the Rebuild Level value This functions sets the rebuild level of the strategy It is only intended...
Definition: solving_strategy.h:310
virtual int GetRebuildLevel() const
Get the Rebuild Level value This function returns the rebuild level of the strategy It is only intend...
Definition: solving_strategy.h:321
virtual bool IsConverged()
This should be considered as a "post solution" convergence check which is useful for coupled analysis...
Definition: solving_strategy.h:206
TSparseSpace::DataType TDataType
Definition: solving_strategy.h:69
virtual TSystemVectorType & GetSolutionVector()
This method returns the solution vector.
Definition: solving_strategy.h:438
virtual TSystemMatrixType & GetSystemMatrix()
This method returns the LHS matrix.
Definition: solving_strategy.h:412
virtual void FinalizeSolutionStep()
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: solving_strategy.h:232
virtual void SetEchoLevel(const int Level)
This sets the level of echo for the solving strategy.
Definition: solving_strategy.h:255
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
ModelPart::ElementsContainerType ElementsArrayType
Definition: solving_strategy.h:91
virtual void Clear()
Clears the internal storage.
Definition: solving_strategy.h:198
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: solving_strategy.h:507
int GetEchoLevel()
This returns the level of echo for the solving strategy.
Definition: solving_strategy.h:271
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: solving_strategy.h:473
TSparseSpace::MatrixType TSystemMatrixType
Definition: solving_strategy.h:71
virtual ClassType::Pointer Create(ModelPart &rModelPart, Parameters ThisParameters) const
Create method.
Definition: solving_strategy.h:153
virtual void CalculateOutputData()
This operations should be called before printing the results when non trivial results (e....
Definition: solving_strategy.h:216
virtual void Initialize()
Initialization of member variables and prior operations.
Definition: solving_strategy.h:171
SolvingStrategy(ModelPart &rModelPart, Parameters ThisParameters)
Default constructor. (with parameters)
Definition: solving_strategy.h:112
SolvingStrategy()
Default constructor.
Definition: solving_strategy.h:105
virtual ~SolvingStrategy()
Definition: solving_strategy.h:137
bool GetMoveMeshFlag()
This function returns the flag that says if the mesh is moved.
Definition: solving_strategy.h:299
const ModelPart & GetModelPart() const
Operations to get the pointer to the model.
Definition: solving_strategy.h:359
virtual int Check()
Function to perform expensive checks.
Definition: solving_strategy.h:377
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition: solving_strategy.h:75
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: solving_strategy.h:93
SolvingStrategy< TSparseSpace, TDenseSpace > ClassType
Definition: solving_strategy.h:83
virtual void AssignSettings(const Parameters ThisParameters)
This method assigns settings to member variables.
Definition: solving_strategy.h:519
bool MoveMeshFlag()
This function returns the flag that says if the mesh is moved.
Definition: solving_strategy.h:290
virtual double Solve()
The problem of interest is solved.
Definition: solving_strategy.h:183
int mEchoLevel
Definition: solving_strategy.h:485
void SetMoveMeshFlag(bool Flag)
This function sets the flag that says if the mesh is moved.
Definition: solving_strategy.h:280
TSparseSpace::VectorType TSystemVectorType
Definition: solving_strategy.h:73
virtual void MoveMesh()
This function is designed to move the mesh.
Definition: solving_strategy.h:330
SolvingStrategy(ModelPart &rModelPart, bool MoveMeshFlag=false)
Default constructor.
Definition: solving_strategy.h:127
virtual TSystemVectorType & GetSystemVector()
This method returns the RHS vector.
Definition: solving_strategy.h:425
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: solving_strategy.h:397
KRATOS_CLASS_POINTER_DEFINITION(SolvingStrategy)
ModelPart::DofsArrayType DofsArrayType
Definition: solving_strategy.h:87
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: solving_strategy.h:451
TDenseSpace::VectorType LocalSystemVectorType
Definition: solving_strategy.h:81
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
int CheckVariableExists(const TVarType &rVariable, const NodesContainerType &rNodes)
Checks if all the nodes of a node set has the specified variable.
Definition: variable_utils.h:1051
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
bool HasNodalSolutionStepVariable(ModelPart &rModelPart, Variable< TDataType > const &rThisVariable)
Definition: add_model_part_to_python.cpp:39
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484