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 
21 
22 #ifndef __geometryMotion_hpp__
23 #define __geometryMotion_hpp__
24 
25 
26 #include "geometry.hpp"
27 #include "VectorDuals.hpp"
28 
29 namespace pFlow
30 {
31 
32 
33 template<typename MotionModelType>
35 :
36  public geometry
37 {
38 public:
39 
40  using MotionModel = MotionModelType;
41 
42 protected:
43 
44 
46 
47  // motion indext mapped on each surface
49 
50  // motion index mapped on each triangle
52 
55 
56  // timer for moveGeometry
58 
59 
60  bool findMotionIndex();
61 
62 public:
63 
64  // type info
65  TypeInfoTemplate("geometry", MotionModel);
66 
68 
70 
71  // construct from components
74  const property& prop,
76  const wordVector& motionCompName,
77  const wordVector& propName,
78  const MotionModel& motionModel);
79 
80  // - construct from components and dictionary that contains
81  // motionModel
83  const property& prop,
84  const dictionary& dict,
86  const wordVector& motionCompName,
87  const wordVector& propName);
88 
89 
90 
91  add_vCtor
92  (
93  geometry,
96  );
97 
98  add_vCtor
99  (
100  geometry,
102  dictionary
103  );
104 
106 
107  auto getModel(real t)const
108  {
109  return motionModel_.getModel(t);
110  }
111 
112  word motionModelTypeName()const override
113  {
114  return motionModel_.typeName();
115  }
116 
117  const int8Vector_HD& triMotionIndex()const override
118  {
119  return triMotionIndex_;
120  }
121 
122  const int8Vector_HD& pointMotionIndex()const override
123  {
124  return pointMotionIndex_;
125  }
126 
127  // - iterate
128  bool beforeIteration() override {
130  return true;
131  }
132 
133  bool iterate() override ;
134 
135  bool afterIteration() override {
137  return true;
138  }
139 
140 
141  bool moveGeometry();
142 
143 };
144 
145 
146 }
147 
148 #include "geometryMotion.cpp"
149 
150 #ifndef BUILD_SHARED_LIBS
152 #endif
153 
154 
155 #endif //__geometryMotion_hpp__
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::geometryMotion::pointMotionIndex
const int8Vector_HD & pointMotionIndex() const override
Definition: geometryMotion.hpp:122
pFlow::geometryMotion::pointMotionIndex_
int8Vector_HD pointMotionIndex_
motion index mapped on each point
Definition: geometryMotion.hpp:54
pFlow::geometryMotion::triMotionIndex
const int8Vector_HD & triMotionIndex() const override
Definition: geometryMotion.hpp:117
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::geometryMotion::triMotionIndex_
int8Vector_HD triMotionIndex_
Definition: geometryMotion.hpp:51
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::geometryMotion::TypeInfoTemplate
TypeInfoTemplate("geometry", MotionModel)
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::geometryMotion::MotionModel
MotionModelType MotionModel
Definition: geometryMotion.hpp:40
pFlow::geometryMotion::motionIndex_
int32Vector_HD motionIndex_
Definition: geometryMotion.hpp:48
geometryMotion.cpp
pFlow::geometryMotion::moveGeometry
bool moveGeometry()
Definition: geometryMotion.cpp:22
pFlow
Definition: demComponent.hpp:28
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:33
pFlow::geometry::afterIteration
bool afterIteration() override
Definition: geometry.hpp:226
pFlow::geometryMotion
Definition: geometryMotion.hpp:34
pFlow::geometryMotion::add_vCtor
add_vCtor(geometry, geometryMotion, systemControl)
pFlow::VectorDual< int32 >
pFlow::Timer
Definition: Timer.hpp:39
pFlow::geometryMotion::moveGeomTimer_
Timer moveGeomTimer_
Definition: geometryMotion.hpp:57
geometryMotionsInstantiate.cpp
geometry.hpp
pFlow::geometry::beforeIteration
bool beforeIteration() override
Definition: geometry.hpp:219
pFlow::geometryMotion::geometryMotion
geometryMotion(systemControl &control, const property &prop)
Definition: geometryMotion.cpp:93
pFlow::geometryMotion::iterate
bool iterate() override
Definition: geometryMotion.cpp:184
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:40
pFlow::geometryMotion::findMotionIndex
bool findMotionIndex()
Definition: geometryMotion.cpp:54
pFlow::geometry
Definition: geometry.hpp:37
pFlow::geometryMotion::getModel
auto getModel(real t) const
Definition: geometryMotion.hpp:107
pFlow::geometryMotion::afterIteration
bool afterIteration() override
Definition: geometryMotion.hpp:135
pFlow::geometryMotion::beforeIteration
bool beforeIteration() override
Definition: geometryMotion.hpp:128
pFlow::geometryMotion::motionModel_
MotionModel & motionModel_
Definition: geometryMotion.hpp:45
pFlow::triSurface
Definition: triSurface.hpp:38
pFlow::Vector< word >
VectorDuals.hpp
pFlow::geometryMotion::motionModelTypeName
word motionModelTypeName() const override
Definition: geometryMotion.hpp:112
pFlow::dictionary
Definition: dictionary.hpp:38