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 
24 #include "geometry.hpp"
25 #include "VectorDuals.hpp"
26 
27 namespace pFlow
28 {
29 
35 template<typename MotionModelType>
37 :
38  public geometry
39 {
40 public:
41 
42  using MotionModel = MotionModelType;
43 
44 protected:
45 
48 
51 
54 
57 
60 
62  bool findMotionIndex();
63 
64 public:
65 
67  TypeInfoTemplate("geometry", MotionModel);
68 
69  // - Constructors
70 
72 
73 
76  const property& prop,
78  const wordVector& motionCompName,
79  const wordVector& propName,
80  const MotionModel& motionModel);
81 
85  const property& prop,
86  const dictionary& dict,
88  const wordVector& motionCompName,
89  const wordVector& propName);
90 
92  add_vCtor
93  (
94  geometry,
97  );
98 
100  add_vCtor
101  (
102  geometry,
104  dictionary
105  );
106 
107  // - Methods
108 
110  auto getModel(real t)const
111  {
112  return motionModel_.getModel(t);
113  }
114 
116  word motionModelTypeName()const override
117  {
118  return motionModel_.typeName();
119  }
120 
122  const int8Vector_HD& triMotionIndex()const override
123  {
124  return triMotionIndex_;
125  }
126 
128  const int8Vector_HD& pointMotionIndex()const override
129  {
130  return pointMotionIndex_;
131  }
132 
134  bool beforeIteration() override;
135 
137  bool iterate() override ;
138 
140  bool afterIteration() override;
141 
143  bool moveGeometry();
144 
145 };
146 
147 } // pFlow
148 
149 #include "geometryMotion.cpp"
150 
151 #ifndef BUILD_SHARED_LIBS
153 #endif
154 
155 
156 #endif //__geometryMotion_hpp__
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::geometryMotion::pointMotionIndex
const int8Vector_HD & pointMotionIndex() const override
Access to motion model index of points.
Definition: geometryMotion.hpp:128
pFlow::geometryMotion::pointMotionIndex_
int8Vector_HD pointMotionIndex_
motion index mapped on each point
Definition: geometryMotion.hpp:56
pFlow::geometryMotion::triMotionIndex
const int8Vector_HD & triMotionIndex() const override
Access to motion model index of triangles.
Definition: geometryMotion.hpp:122
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::geometryMotion::triMotionIndex_
int8Vector_HD triMotionIndex_
motion index mapped on each triangle
Definition: geometryMotion.hpp:53
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::geometryMotion::TypeInfoTemplate
TypeInfoTemplate("geometry", MotionModel)
Type info.
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::geometryMotion::MotionModel
MotionModelType MotionModel
Definition: geometryMotion.hpp:42
pFlow::geometryMotion::motionIndex_
int32Vector_HD motionIndex_
motion indext mapped on each surface
Definition: geometryMotion.hpp:50
geometryMotion.cpp
pFlow::geometryMotion::moveGeometry
bool moveGeometry()
Move geometry.
Definition: geometryMotion.cpp:179
pFlow
Definition: demComponent.hpp:28
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:33
pFlow::geometryMotion
Definition: geometryMotion.hpp:36
pFlow::geometryMotion::add_vCtor
add_vCtor(geometry, geometryMotion, systemControl)
Add virtual constructor.
pFlow::VectorDual< int32 >
pFlow::Timer
Definition: Timer.hpp:39
pFlow::geometryMotion::moveGeomTimer_
Timer moveGeomTimer_
timer for moveGeometry
Definition: geometryMotion.hpp:59
geometryMotionsInstantiate.cpp
geometry.hpp
pFlow::geometryMotion::geometryMotion
geometryMotion(systemControl &control, const property &prop)
Definition: geometryMotion.cpp:62
pFlow::geometryMotion::iterate
bool iterate() override
Iterate geometry one time step
Definition: geometryMotion.cpp:160
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:40
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:43
pFlow::geometryMotion::getModel
auto getModel(real t) const
Obtain motion model at time t.
Definition: geometryMotion.hpp:110
pFlow::geometryMotion::afterIteration
bool afterIteration() override
Operations after each iteration.
Definition: geometryMotion.cpp:172
pFlow::geometryMotion::beforeIteration
bool beforeIteration() override
Operations before each iteration.
Definition: geometryMotion.cpp:153
pFlow::geometryMotion::motionModel_
MotionModel & motionModel_
Ref to motion model.
Definition: geometryMotion.hpp:47
pFlow::triSurface
Definition: triSurface.hpp:38
pFlow::Vector< word >
VectorDuals.hpp
pFlow::geometryMotion::motionModelTypeName
word motionModelTypeName() const override
TypeName / TypeInfo of motion model.
Definition: geometryMotion.hpp:116
pFlow::dictionary
Definition: dictionary.hpp:38