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.
estimate_dt_utility.h
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: Miguel Maso Sotomayor
11 //
12 
13 
14 #ifndef KRATOS_ESTIMATE_TIME_STEP_UTILITY_H_INCLUDED
15 #define KRATOS_ESTIMATE_TIME_STEP_UTILITY_H_INCLUDED
16 
17 
18 // System includes
19 
20 
21 // External includes
22 
23 
24 // Project includes
25 #include "includes/node.h"
26 #include "geometries/geometry.h"
28 
29 
30 namespace Kratos
31 {
34 
37 
41 
45 
49 
53 
55 class ModelPart;
56 
58 
60 class KRATOS_API(SHALLOW_WATER_APPLICATION) EstimateTimeStepUtility
61 {
62 public:
65 
68 
69  typedef Node NodeType;
70 
72 
76 
78  EstimateTimeStepUtility(ModelPart& rThisModelPart, Parameters ThisParameters);
79 
82 
86 
87 
91 
92  double Execute() const;
93 
97 
98 
102 
103 
107 
109  std::string Info() const;
110 
112  void PrintInfo(std::ostream& rOStream) const;
113 
115  void PrintData(std::ostream& rOStream) const;
116 
117 
121 
122 
124 
125 private:
128 
129 
133 
134  const ModelPart& mrModelPart;
135  bool mEstimateDt;
136  bool mAdaptiveDt;
137  double mConstantDt;
138  double mCourant;
139  double mMinDt;
140  double mMaxDt;
141 
145 
146 
150 
151  double EstimateTimeStep() const;
152 
153  double ElementCharacteristicTime(const GeometryType& rElement, double Gravity) const;
154 
158 
159 
163 
164 
168 
171 
174 
175 
177 
178 }; // Class EstimateTimeStepUtility
179 
181 
184 
185 
189 
190 
192 inline std::istream& operator >> (std::istream& rIStream,
193  EstimateTimeStepUtility& rThis);
194 
196 inline std::ostream& operator << (std::ostream& rOStream,
197  const EstimateTimeStepUtility& rThis)
198 {
199  rThis.PrintInfo(rOStream);
200  rOStream << std::endl;
201  rThis.PrintData(rOStream);
202 
203  return rOStream;
204 }
206 
208 
209 } // namespace Kratos.
210 
211 #endif // KRATOS_ESTIMATE_TIME_STEP_UTILITY_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Utility to estimate the time step in terms of the courant number.
Definition: estimate_dt_utility.h:61
Node NodeType
Definition: estimate_dt_utility.h:69
~EstimateTimeStepUtility()
Destructor.
Definition: estimate_dt_utility.h:81
KRATOS_CLASS_POINTER_DEFINITION(EstimateTimeStepUtility)
Pointer definition of EstimateTimeStepUtility.
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
std::string Info() const
Turn back information as a string.
Geometry< NodeType > GeometryType
Definition: estimate_dt_utility.h:71
void PrintData(std::ostream &rOStream) const
Print object's data.
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
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