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.
automatic_dt_process.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ignasi de Pouplana
11 //
12 
13 
14 #if !defined(KRATOS_AUTOMATIC_DT_PROCESS )
15 #define KRATOS_AUTOMATIC_DT_PROCESS
16 
17 // System includes
18 #include <limits>
19 
20 // Project includes
22 #include "processes/process.h"
23 
24 // Application includes
27 
29 
30 namespace Kratos
31 {
32 
33 class KRATOS_API(DEM_APPLICATION) AutomaticDTProcess : public Process
34 {
35 
36 public:
37 
39 
41 
44  ModelPart& rModelPart,
45  Parameters rParameters
46  ) : Process() ,
47  mrModelPart(rModelPart)
48  {
50 
51  Parameters default_parameters( R"(
52  {
53  "model_part_name":"MODEL_PART_NAME",
54  "correction_factor" : 5.0e-3
55  } )" );
56 
57  // Now validate agains defaults -- this also ensures no type mismatch
58  rParameters.ValidateAndAssignDefaults(default_parameters);
59 
60  mCorrectionFactor = rParameters["correction_factor"].GetDouble();
61 
62  KRATOS_CATCH("");
63  }
64 
66 
68  ~AutomaticDTProcess() override {}
69 
71 
73  void Execute() override
74  {
75  }
76 
79  void ExecuteBeforeSolutionLoop() override;
80 
82  std::string Info() const override
83  {
84  return "AutomaticDTProcess";
85  }
86 
88  void PrintInfo(std::ostream& rOStream) const override
89  {
90  rOStream << "AutomaticDTProcess";
91  }
92 
94  void PrintData(std::ostream& rOStream) const override
95  {
96  }
97 
99 
100 protected:
101 
103 
106 
108 
109 private:
110 
113 
115  //AutomaticDTProcess(AutomaticDTProcess const& rOther);
116 
117 }; // Class AutomaticDTProcess
118 
120 inline std::istream& operator >> (std::istream& rIStream,
121  AutomaticDTProcess& rThis);
122 
124 inline std::ostream& operator << (std::ostream& rOStream,
125  const AutomaticDTProcess& rThis)
126 {
127  rThis.PrintInfo(rOStream);
128  rOStream << std::endl;
129  rThis.PrintData(rOStream);
130 
131  return rOStream;
132 }
133 
134 } // namespace Kratos.
135 
136 #endif /* KRATOS_AUTOMATIC_DT_PROCESS defined */
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: automatic_dt_process.hpp:34
KRATOS_CLASS_POINTER_DEFINITION(AutomaticDTProcess)
std::string Info() const override
Turn back information as a string.
Definition: automatic_dt_process.hpp:82
AutomaticDTProcess(ModelPart &rModelPart, Parameters rParameters)
Constructor.
Definition: automatic_dt_process.hpp:43
void Execute() override
Execute method is used to execute the AutomaticDTProcess algorithms.
Definition: automatic_dt_process.hpp:73
ModelPart & mrModelPart
Member Variables.
Definition: automatic_dt_process.hpp:104
double mCorrectionFactor
Definition: automatic_dt_process.hpp:105
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: automatic_dt_process.hpp:88
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: automatic_dt_process.hpp:94
~AutomaticDTProcess() override
Destructor.
Definition: automatic_dt_process.hpp:68
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
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
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
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
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