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.
move_shallow_mesh_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 #ifndef KRATOS_MOVE_MESH_UTILITY_H_INCLUDED
14 #define KRATOS_MOVE_MESH_UTILITY_H_INCLUDED
15 
16 
17 // System includes
18 #include <string>
19 #include <iostream>
20 
21 
22 // External includes
23 
24 
25 // Project includes
26 #include "includes/model_part.h"
30 
31 
32 namespace Kratos
33 {
36 
39 
43 
47 
51 
55 
63 class KRATOS_API(SHALLOW_WATER_APPLICATION) MoveShallowMeshUtility
64 {
65 public:
68 
71 
72  typedef Node NodeType;
73 
75 
77 
79 
83 
88  ModelPart& rLagrangianModelPart,
89  ModelPart& rEulerianModelPart,
90  Parameters ThisParameters);
91 
96 
100 
101 
105 
106  int Check();
107 
108  void Initialize();
109 
110  void MoveMesh();
111 
112  void MapResults();
113 
117 
118 
122 
123 
127 
129  virtual std::string Info() const
130  {
131  std::stringstream buffer;
132  buffer << "MoveShallowMeshUtility";
133  return buffer.str();
134  }
135 
137  virtual void PrintInfo(std::ostream& rOStream) const {rOStream << Info();}
138 
140  virtual void PrintData(std::ostream& rOStream) const {}
141 
142 
146 
147 
149 
150 private:
153 
154 
158 
159  ModelPart& mrLagrangianModelPart;
160  ModelPart& mrEulerianModelPart;
161 
162  BinBasedFastPointLocator<2> mLagrangianSearchStructure;
163  BinBasedFastPointLocator<2> mEulerianSearchStructure;
164  int mMaxResults;
165 
166  std::vector<const Variable<double>*> mScalarVariablesToLagrangian;
167  std::vector<const Variable<array_1d<double,3>>*> mVectorVariablesToLagrangian;
168 
169  std::vector<const Variable<double>*> mScalarVariablesToEulerian;
170  std::vector<const Variable<array_1d<double,3>>*> mVectorVariablesToEulerian;
171 
175 
176 
180 
181  const Parameters GetDefaultParameters() const;
182 
183  template<class TDataType>
184  void FillVariablesList(std::vector<const Variable<TDataType>*>& rVariablesList, const Parameters VariablesNames);
185 
186  bool MoveNode(
187  NodeType& rNode,
188  double Dt,
189  Vector& rN,
190  Element::Pointer& pElement,
191  ResultIteratorType& rResultBegin);
192 
193  void MapToLagrangian(
194  NodeType& rNode,
195  const Vector& rN,
196  const Element::Pointer pElement);
197 
198  void MapToEulerian(
199  NodeType& rNode,
200  const Vector& rN,
201  const Element::Pointer pElement,
202  const bool IsFound);
203 
204  template<class TDataType>
205  void InterpolateVariable(
206  NodeType& rNode,
207  const Vector& rN,
208  const GeometryType& rGeometry,
209  const Variable<TDataType>& rVariable);
210 
214 
215 
219 
220 
224 
227 
230 
232 
233 }; // Class MoveShallowMeshUtility
234 
236 
239 
240 
244 
245 
247 inline std::istream& operator >> (std::istream& rIStream,
248  MoveShallowMeshUtility& rThis);
249 
251 inline std::ostream& operator << (std::ostream& rOStream,
252  const MoveShallowMeshUtility& rThis)
253 {
254  rThis.PrintInfo(rOStream);
255  rOStream << std::endl;
256  rThis.PrintData(rOStream);
257 
258  return rOStream;
259 }
261 
263 
264 } // namespace Kratos.
265 
266 #endif // KRATOS_MOVE_MESH_UTILITY_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
This class is designed to allow the fast location of MANY points on the top of a 3D mesh.
Definition: binbased_fast_point_locator.h:68
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Tools for lagrangian computations.
Definition: move_shallow_mesh_utility.h:64
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: move_shallow_mesh_utility.h:140
virtual ~MoveShallowMeshUtility()
Destructor.
Definition: move_shallow_mesh_utility.h:95
KRATOS_CLASS_POINTER_DEFINITION(MoveShallowMeshUtility)
Pointer definition of MoveShallowMeshUtility.
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: move_shallow_mesh_utility.h:137
Node NodeType
Definition: move_shallow_mesh_utility.h:72
BinBasedFastPointLocator< 2 >::ResultIteratorType ResultIteratorType
Definition: move_shallow_mesh_utility.h:76
BinBasedFastPointLocator< 2 >::ResultContainerType ResultContainerType
Definition: move_shallow_mesh_utility.h:78
Geometry< NodeType > GeometryType
Definition: move_shallow_mesh_utility.h:74
virtual std::string Info() const
Turn back information as a string.
Definition: move_shallow_mesh_utility.h:129
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
void MoveMesh(Scheme< SparseSpaceType, LocalSpaceType > &dummy, ModelPart::NodesContainerType &rNodes)
Definition: add_strategies_to_python.cpp:175
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
Dt
Definition: face_heat.py:78
Configure::ResultIteratorType ResultIteratorType
Definition: transfer_utility.h:252