14 #if !defined(KRATOS_NEW_LAPLACIAN_MESHMOVING_STRATEGY)
15 #define KRATOS_NEW_LAPLACIAN_MESHMOVING_STRATEGY
57 template <
class TSparseSpace,
class TDenseSpace,
class TLinearSolver>
78 typename TLinearSolver::Pointer pNewLinearSolver,
80 bool ReformDofSetAtEachStep =
false,
81 bool ComputeReactions =
false,
84 const bool ReInitializeModelPartEachStep =
false)
89 mreform_dof_set_at_each_step = ReformDofSetAtEachStep || ReInitializeModelPartEachStep;
91 mcompute_reactions = ComputeReactions;
93 mtime_order = TimeOrder;
94 bool calculate_norm_dx_flag =
false;
95 mreinitialize_model_part_at_each_step = ReInitializeModelPartEachStep;
97 typename SchemeType::Pointer pscheme =
typename SchemeType::Pointer(
101 const std::string
element_type =
"LaplacianMeshMovingElement";
107 mpbuilder_and_solver_x =
typename TBuilderAndSolverType::Pointer(
109 TSparseSpace, TDenseSpace, TLinearSolver, VarComponent>(
110 pNewLinearSolver, MESH_DISPLACEMENT_X));
112 mpbuilder_and_solver_y =
typename TBuilderAndSolverType::Pointer(
114 TSparseSpace, TDenseSpace, TLinearSolver, VarComponent>(
115 pNewLinearSolver, MESH_DISPLACEMENT_Y));
117 mpbuilder_and_solver_z =
typename TBuilderAndSolverType::Pointer(
119 TSparseSpace, TDenseSpace, TLinearSolver, VarComponent>(
120 pNewLinearSolver, MESH_DISPLACEMENT_Z));
125 mpbuilder_and_solver_x,
127 mreform_dof_set_at_each_step,
128 calculate_norm_dx_flag));
130 mstrategy_x->SetEchoLevel(mecho_level);
135 mpbuilder_and_solver_y,
137 mreform_dof_set_at_each_step,
138 calculate_norm_dx_flag));
140 mstrategy_y->SetEchoLevel(mecho_level);
145 mpbuilder_and_solver_z,
147 mreform_dof_set_at_each_step,
148 calculate_norm_dx_flag));
150 mstrategy_z->SetEchoLevel(mecho_level);
161 find_nodal_neighbours_process.
Execute();
167 if (mreinitialize_model_part_at_each_step) {
170 mpmesh_model_part->
pGetProperties(0),
"LaplacianMeshMovingElement");
183 rCurrentProcessInfo[LAPLACIAN_DIRECTION] = 1;
184 mstrategy_x->Solve();
186 rCurrentProcessInfo[LAPLACIAN_DIRECTION] = 2;
187 mstrategy_y->Solve();
190 rCurrentProcessInfo[LAPLACIAN_DIRECTION] = 1;
191 mstrategy_x->Solve();
193 rCurrentProcessInfo[LAPLACIAN_DIRECTION] = 2;
194 mstrategy_y->Solve();
196 rCurrentProcessInfo[LAPLACIAN_DIRECTION] = 3;
197 mstrategy_z->Solve();
200 if (mreform_dof_set_at_each_step ==
true)
202 mstrategy_x->Clear();
203 mstrategy_y->Clear();
204 mstrategy_z->Clear();
274 typename BaseType::Pointer mstrategy_x;
275 typename BaseType::Pointer mstrategy_y;
276 typename BaseType::Pointer mstrategy_z;
277 typename TBuilderAndSolverType::Pointer mpbuilder_and_solver_x;
278 typename TBuilderAndSolverType::Pointer mpbuilder_and_solver_y;
279 typename TBuilderAndSolverType::Pointer mpbuilder_and_solver_z;
281 bool mreform_dof_set_at_each_step;
282 bool mcompute_reactions;
285 bool mcalculate_mesh_velocities;
286 bool mreinitialize_model_part_at_each_step;
MeshType & LocalMesh()
Returns the reference to the mesh storing all local entities.
Definition: communicator.cpp:245
This method allows to look for neighbours in a triangular or tetrahedral mesh.
Definition: find_nodal_neighbours_process.h:59
void Execute() override
This method esxecutes the neighbour search.
Definition: find_nodal_neighbours_process.cpp:49
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > TBuilderAndSolverType
Definition: implicit_solving_strategy.h:84
Short class definition.
Definition: laplacian_meshmoving_strategy.h:59
KRATOS_CLASS_POINTER_DEFINITION(LaplacianMeshMovingStrategy)
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: laplacian_meshmoving_strategy.h:68
double Solve() override
The problem of interest is solved.
Definition: laplacian_meshmoving_strategy.h:164
Scheme< TSparseSpace, TDenseSpace > SchemeType
Definition: laplacian_meshmoving_strategy.h:70
LaplacianMeshMovingStrategy(ModelPart &ModelPart, typename TLinearSolver::Pointer pNewLinearSolver, int TimeOrder=1, bool ReformDofSetAtEachStep=false, bool ComputeReactions=false, bool CalculateMeshVelocities=true, int EchoLevel=0, const bool ReInitializeModelPartEachStep=false)
Definition: laplacian_meshmoving_strategy.h:77
void Initialize() override
Initialization of member variables and prior operations.
Definition: laplacian_meshmoving_strategy.h:159
BaseType::TBuilderAndSolverType TBuilderAndSolverType
Definition: laplacian_meshmoving_strategy.h:69
virtual ~LaplacianMeshMovingStrategy()
Definition: laplacian_meshmoving_strategy.h:155
NodesContainerType & Nodes()
Definition: mesh.h:346
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
PropertiesType::Pointer pGetProperties(IndexType PropertiesId, IndexType MeshIndex=0)
Returns the Properties::Pointer corresponding to it's identifier.
Definition: model_part.cpp:664
Communicator & GetCommunicator()
Definition: model_part.h:1821
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Definition: residualbased_elimination_builder_and_solver_componentwise.h:95
This class provides the implementation of a static scheme.
Definition: residualbased_incrementalupdate_static_scheme.h:57
This is a very simple strategy to solve linearly the problem.
Definition: residualbased_linear_strategy.h:64
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
This class implements a set of auxiliar, already parallelized, methods to perform some common tasks r...
Definition: variable_utils.h:63
void UpdateCurrentToInitialConfiguration(const ModelPart::NodesContainerType &rNodes)
This method updates the current nodal coordinates back to the initial coordinates.
Definition: variable_utils.cpp:245
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
void CalculateMeshVelocities(ModelPart &rModelPart, const TimeDiscretization::BDF1 &rBDF)
Definition: mesh_velocity_calculation.cpp:56
void InitializeMeshPartWithElements(ModelPart &rDestinationModelPart, ModelPart &rOriginModelPart, Properties::Pointer pProperties, const std::string &rElementName)
Definition: move_mesh_utilities.cpp:176
ModelPart * GenerateMeshPart(ModelPart &rModelPart, const std::string &rElementName)
Definition: move_mesh_utilities.cpp:143
ProcessInfo & GetProcessInfo(ModelPart &rModelPart)
Definition: add_model_part_to_python.cpp:54
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
element_type
Choosing element type for lagrangian_model_part.
Definition: lagrangian_droplet_test.py:56