KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
velocity_verlet_solver_strategy.h
Go to the documentation of this file.
1 //
2 // Authors: Ferran Arrufat farrufat@cimne.upc.edu,
3 // Guillermo Casas gcasas@cimne.upc.edu
4 //
5 
6 #if !defined(KRATOS_VERLET_SOLVER_STRATEGY)
7 #define KRATOS_VERLET_SOLVER_STRATEGY
9 
10 namespace Kratos
11 {
12  template<class TBaseStrategy>
13  class VelocityVerletSolverStrategy: public TBaseStrategy
14  {
15  public:
16 
19 
22 
24  ExplicitSolverSettings& settings,
25  const double max_delta_time,
26  const double n_step_search,
27  const double safety_factor,
28  const int delta_option,
29  ParticleCreatorDestructor::Pointer p_creator_destructor,
30  DEM_FEM_Search::Pointer p_dem_fem_search,
31  SpatialSearch::Pointer pSpSearch,
32  Parameters strategy_parameters)
33 
34  :TBaseStrategy(settings, max_delta_time, n_step_search, safety_factor, delta_option, p_creator_destructor, p_dem_fem_search, pSpSearch, strategy_parameters)
35  {}
36 
39  {
40  //Timer::SetOuputFile("TimesPartialRelease");
42  }
43 
44  void Initialize() override
45  {
46 
48  ModelPart& r_model_part = this->GetModelPart();
49  TBaseStrategy::Initialize();
50  this->InitializeSolutionStep();
51  this->ForceOperations(r_model_part);
52  this->FinalizeSolutionStep();
53 
54  KRATOS_CATCH("")
55  }
56 
57  double SolveSolutionStep() override
58  {
60  ModelPart& r_model_part = this->GetModelPart();
61 
62  bool has_mpi = false;
63  VariablesList r_modelpart_nodal_variables_list = r_model_part.GetNodalSolutionStepVariablesList();
64  if(r_modelpart_nodal_variables_list.Has(PARTITION_INDEX) ) has_mpi = true;
65 
66  this->PerformTimeIntegrationOfMotion(1);
67 
68  this->SearchDEMOperations(r_model_part, has_mpi);
69  this->SearchFEMOperations(r_model_part, has_mpi);
70  this->ForceOperations(r_model_part);
71 
72  this->PerformTimeIntegrationOfMotion(2);
73 
74  KRATOS_CATCH("")
75 
76  return 0.0;
77 
78  }//SolveSolutionStep()
79 
80  }; // Class VelocityVerletSolverStrategy<TBaseStrategy>
81 
82 
83 } // namespace Kratos.
84 
85 #endif // KRATOS_FILENAME_H_INCLUDED defined
Definition: explicit_solver_strategy.h:54
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
static void PrintTimingInformation()
This method prints the timing information.
Definition: timer.cpp:220
Holds a list of variables and their position in VariablesListDataValueContainer.
Definition: variables_list.h:50
bool Has(const VariableData &rThisVariable) const
Definition: variables_list.h:372
Definition: velocity_verlet_solver_strategy.h:14
double SolveSolutionStep() override
Definition: velocity_verlet_solver_strategy.h:57
VelocityVerletSolverStrategy()
Default constructor.
Definition: velocity_verlet_solver_strategy.h:21
VelocityVerletSolverStrategy(ExplicitSolverSettings &settings, const double max_delta_time, const double n_step_search, const double safety_factor, const int delta_option, ParticleCreatorDestructor::Pointer p_creator_destructor, DEM_FEM_Search::Pointer p_dem_fem_search, SpatialSearch::Pointer pSpSearch, Parameters strategy_parameters)
Definition: velocity_verlet_solver_strategy.h:23
virtual ~VelocityVerletSolverStrategy()
Destructor.
Definition: velocity_verlet_solver_strategy.h:38
void Initialize() override
Definition: velocity_verlet_solver_strategy.h:44
KRATOS_CLASS_POINTER_DEFINITION(VelocityVerletSolverStrategy)
Pointer definition of ExplicitSolverStrategy.
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
safety_factor
Definition: edgebased_PureConvection.py:110