14 #if !defined(KRATOS_EXPLICIT_SOLVING_STRATEGY)
15 #define KRATOS_EXPLICIT_SOLVING_STRATEGY
56 template <
class TSparseSpace,
class TDenseSpace>
100 :
BaseType(rModelPart, ThisParameters)
102 mpExplicitBuilder = Kratos::make_unique<ExplicitBuilder<TSparseSpace, TDenseSpace>>();
114 typename ExplicitBuilderType::Pointer pExplicitBuilder,
116 int RebuildLevel = 0)
118 , mpExplicitBuilder(pExplicitBuilder)
132 int RebuildLevel = 0)
136 mpExplicitBuilder = Kratos::make_unique<ExplicitBuilder<TSparseSpace, TDenseSpace>>();
157 return Kratos::make_shared<ClassType>(rModelPart, ThisParameters);
178 mpExplicitBuilder->SetResetDofSetFlag(
true);
183 mpExplicitBuilder->SetResetLumpedMassVectorFlag(
true);
197 mpExplicitBuilder->Clear();
288 return mpExplicitBuilder;
297 KRATOS_ERROR_IF(mpExplicitBuilder ==
nullptr) <<
"Asking for builder and solver when it is empty" << std::endl;
298 return *mpExplicitBuilder;
307 KRATOS_ERROR_IF(mpExplicitBuilder ==
nullptr) <<
"Asking for builder and solver when it is empty" << std::endl;
308 return *mpExplicitBuilder;
319 auto& r_dof_set = r_explicit_bs.GetDofSet();
325 double res_norm = 0.0;
326 res_norm = block_for_each<SumReduction<double>>(
328 [](
DofType &rDof){
return rDof.GetSolutionStepReactionValue();}
342 "explicit_solving_strategy" : "explicit_solving_strategy",
344 "explicit_builder_settings" : {
345 "name": "explicit_builder"
353 return default_parameters;
362 return "explicit_solving_strategy";
370 std::string
Info()
const override
372 return "ExplicitSolvingStrategy";
402 KRATOS_ERROR <<
"Calling the base ExplicitSolvingStrategy SolveWithLumpedMassMatrix(). Implement the specific explicit scheme solution update in a derived class" << std::endl;
424 const bool rebuild_level = ThisParameters[
"rebuild_level"].
GetInt();
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
Current class provides an implementation for the base explicit builder and solving operations.
Definition: explicit_builder.h:68
Explicit solving strategy base class.
Definition: explicit_solving_strategy.h:58
SolvingStrategy< TSparseSpace, TDenseSpace > BaseType
The definition of the base class.
Definition: explicit_solving_strategy.h:73
int GetRebuildLevel() const override
This returns the build level.
Definition: explicit_solving_strategy.h:277
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: explicit_solving_strategy.h:338
ExplicitBuilderType::Pointer ExplicitBuilderPointerType
Definition: explicit_solving_strategy.h:67
virtual double GetDeltaTime()
Get the Delta Time object This method returns the DELTA_TIME from the ProcessInfo container.
Definition: explicit_solving_strategy.h:410
ExplicitSolvingStrategy()
Default constructor. (empty)
Definition: explicit_solving_strategy.h:88
void InitializeSolutionStep() override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: explicit_solving_strategy.h:204
KRATOS_CLASS_POINTER_DEFINITION(ExplicitSolvingStrategy)
ExplicitBuilder< TSparseSpace, TDenseSpace > ExplicitBuilderType
Definition: explicit_solving_strategy.h:64
std::string Info() const override
Turn back information as a string.
Definition: explicit_solving_strategy.h:370
BaseType::Pointer Create(ModelPart &rModelPart, Parameters ThisParameters) const override
Create method.
Definition: explicit_solving_strategy.h:152
void Clear() override
Clears the internal storage.
Definition: explicit_solving_strategy.h:194
double GetResidualNorm() override
Operations to get the residual norm.
Definition: explicit_solving_strategy.h:315
int mRebuildLevel
Definition: explicit_solving_strategy.h:381
ExplicitSolvingStrategy< TSparseSpace, TDenseSpace > ClassType
The definition of the current class.
Definition: explicit_solving_strategy.h:76
virtual void SolveWithLumpedMassMatrix()
Calculate the explicit update This method is intended to implement the explicit update calculation No...
Definition: explicit_solving_strategy.h:400
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: explicit_solving_strategy.h:217
ExplicitBuilderType::DofType DofType
Definition: explicit_solving_strategy.h:70
ExplicitBuilderPointerType pGetExplicitBuilder()
Operations to get the pointer to the explicit builder and solver.
Definition: explicit_solving_strategy.h:286
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: explicit_solving_strategy.h:419
ExplicitSolvingStrategy(ModelPart &rModelPart, Parameters ThisParameters)
Default constructor. (with parameters)
Definition: explicit_solving_strategy.h:97
void Initialize() override
Initialization of member variables and prior operations.
Definition: explicit_solving_strategy.h:171
void SetRebuildLevel(int Level) override
Definition: explicit_solving_strategy.h:263
const ExplicitBuilderType & GetExplicitBuilder() const
Operations to get the explicit builder and solver.
Definition: explicit_solving_strategy.h:305
ExplicitBuilderType & GetExplicitBuilder()
Operations to get the explicit builder and solver.
Definition: explicit_solving_strategy.h:295
virtual ~ExplicitSolvingStrategy()
Definition: explicit_solving_strategy.h:145
ExplicitSolvingStrategy(const ExplicitSolvingStrategy &Other)=delete
ExplicitSolvingStrategy(ModelPart &rModelPart, bool MoveMeshFlag=false, int RebuildLevel=0)
Default constructor.
Definition: explicit_solving_strategy.h:129
ExplicitSolvingStrategy(ModelPart &rModelPart, typename ExplicitBuilderType::Pointer pExplicitBuilder, bool MoveMeshFlag=false, int RebuildLevel=0)
Default constructor.
Definition: explicit_solving_strategy.h:112
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: explicit_solving_strategy.h:360
bool SolveSolutionStep() override
Solves the current step. The function always return true as convergence is not checked in the explici...
Definition: explicit_solving_strategy.h:230
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
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 RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
Solving strategy base class This is the base class from which we will derive all the strategies (impl...
Definition: solving_strategy.h:64
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
bool GetMoveMeshFlag()
This function returns the flag that says if the mesh is moved.
Definition: solving_strategy.h:299
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 void MoveMesh()
This function is designed to move the mesh.
Definition: solving_strategy.h:330
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: solving_strategy.h:397
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
void InitializeAllEntities(ModelPart &rModelPart)
This method initializes all the active entities (conditions, elements, constraints)
Definition: entities_utilities.cpp:199
void FinalizeNonLinearIterationAllEntities(ModelPart &rModelPart)
This method calls FinalizeNonLinearIteration for all the entities (conditions, elements,...
Definition: entities_utilities.cpp:243
void InitializeSolutionStepAllEntities(ModelPart &rModelPart)
This method calls InitializeSolution for all the entities (conditions, elements, constraints)
Definition: entities_utilities.cpp:210
void FinalizeSolutionStepAllEntities(ModelPart &rModelPart)
This method calls FinalizeSolutionStep for all the entities (conditions, elements,...
Definition: entities_utilities.cpp:221
void InitializeNonLinearIterationAllEntities(ModelPart &rModelPart)
This method calls InitializeNonLinearIteration for all the entities (conditions, elements,...
Definition: entities_utilities.cpp:232
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21