www.cemf.ir
geometryMotion.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 #ifndef __geometryMotion_hpp__
21 #define __geometryMotion_hpp__
22 
23 #include "vocabs.hpp"
24 #include "geometry.hpp"
25 
26 namespace pFlow
27 {
28 
34 template<typename MotionModelType>
36 :
37  public geometry
38 {
39 public:
40 
41  using MotionModel = MotionModelType;
42 
43  using ModelComponent = typename MotionModelType::ModelComponent;
44 
45 private:
46 
48  MotionModelType motionModel_;
49 
51  uint32Field_D surfMotionIndex_{"triMotionIndex"};
52 
54  uint32Field_D triMotionIndex_ {"surfMotionIndex"};
55 
57  uint32Field_D pointMotionIndex_{"pointMotionIndex"};
58 
61 
63  bool findMotionIndex();
64 
66  bool moveGeometry();
67 
68 public:
69 
72 
73  // - Constructors
74 
76 
79  const property& prop,
80  multiTriSurface& surf,
81  const wordVector& motionCompName,
82  const wordVector& materialName,
83  const dictionary& motionDict);
84 
86  add_vCtor
87  (
88  geometry,
91  );
92 
94  add_vCtor
95  (
96  geometry,
99  );
100 
101  // - Methods
102 
104  auto getModel(uint32 iter, real t, real dt)const
105  {
106  return motionModel_.getModelInterface(iter, t, dt);
107  }
108 
110  word motionModelTypeName()const override
111  {
112  return motionModel_.typeName();
113  }
114 
116  const uint32Field_D& triMotionIndex()const override
117  {
118  return triMotionIndex_;
119  }
120 
122  const uint32Field_D& pointMotionIndex()const override
123  {
124  return pointMotionIndex_;
125  }
126 
128  bool iterate() override ;
129 
130 
131 
132 };
133 
134 } // pFlow
135 
136 #include "geometryMotion.cpp"
137 
138 
139 
140 #endif //__geometryMotion_hpp__
pFlow::geometryMotion::triMotionIndex_
uint32Field_D triMotionIndex_
motion index mapped on each triangle
Definition: geometryMotion.hpp:54
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::geometryMotion::motionModel_
MotionModelType motionModel_
Ref to motion model.
Definition: geometryMotion.hpp:48
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::geometryMotion::ModelComponent
typename MotionModelType::ModelComponent ModelComponent
Definition: geometryMotion.hpp:43
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::geometryMotion::pointMotionIndex_
uint32Field_D pointMotionIndex_
motion index mapped on each point
Definition: geometryMotion.hpp:57
pFlow::geometryMotion::MotionModel
MotionModelType MotionModel
Definition: geometryMotion.hpp:41
geometryMotion.cpp
pFlow::Field< uint32 >
pFlow::geometryMotion::moveGeometry
bool moveGeometry()
Move geometry.
Definition: geometryMotion.cpp:96
pFlow
Definition: demGeometry.hpp:27
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:32
pFlow::geometryMotion
Definition: geometryMotion.hpp:35
pFlow::geometryMotion::add_vCtor
add_vCtor(geometry, geometryMotion, systemControl)
Add virtual constructor.
pFlow::geometryMotion::surfMotionIndex_
uint32Field_D surfMotionIndex_
motion indext mapped on each surface
Definition: geometryMotion.hpp:51
pFlow::Timer
Definition: Timer.hpp:33
pFlow::geometryMotion::moveGeomTimer_
Timer moveGeomTimer_
timer for moveGeometry
Definition: geometryMotion.hpp:60
geometry.hpp
pFlow::geometryMotion::geometryMotion
geometryMotion(systemControl &control, const property &prop)
Definition: geometryMotion.cpp:137
pFlow::geometryMotion::iterate
bool iterate() override
Iterate geometry one time step
Definition: geometryMotion.cpp:204
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:37
pFlow::geometryMotion::findMotionIndex
bool findMotionIndex()
determine the motion index of each triangle
Definition: geometryMotion.cpp:22
pFlow::geometry
Base class for geometry for managing tri-surfaces, geometry motion, and surface physical properties.
Definition: geometry.hpp:44
pFlow::geometryMotion::pointMotionIndex
const uint32Field_D & pointMotionIndex() const override
Access to motion model index of points.
Definition: geometryMotion.hpp:122
pFlow::geometryMotion::triMotionIndex
const uint32Field_D & triMotionIndex() const override
Access to motion model index of triangles.
Definition: geometryMotion.hpp:116
pFlow::geometryMotion::TypeInfoTemplate11
TypeInfoTemplate11("geometry", ModelComponent)
Type info.
pFlow::demComponent::dt
real dt() const
Time step of integration.
Definition: demComponent.cpp:33
vocabs.hpp
pFlow::geometryMotion::getModel
auto getModel(uint32 iter, real t, real dt) const
Obtain motion model at time t.
Definition: geometryMotion.hpp:104
pFlow::Vector< word >
pFlow::geometryMotion::motionModelTypeName
word motionModelTypeName() const override
TypeName / TypeInfo of motion model.
Definition: geometryMotion.hpp:110
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67