www.cemf.ir
fixedWall.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 #ifndef __fixedWall_hpp__
22 #define __fixedWall_hpp__
23 
24 
25 #include "types.hpp"
26 #include "typeInfo.hpp"
27 #include "Vectors.hpp"
28 #include "uniquePtr.hpp"
29 
30 
31 
32 namespace pFlow
33 {
34 
35 class dictionary;
36 
50 class fixedWall
51 {
52 public:
53 
57  class Model
58  {
59 
60  public:
61 
63  Model(){}
64 
66  Model(const Model&) = default;
67 
69  Model& operator=(const Model&) = default;
70 
71 
74  {
75  return 0.0;
76  }
77 
79  realx3 operator()(int32 n, const realx3& p)const
80  {
81  return 0.0;
82  }
83 
85  realx3 transferPoint(int32 n, const realx3 p, real dt)const
86  {
87  return p;
88  }
89 
91  {
92  return 0;
93  }
94  };
95 
96 protected:
97 
99  const word name_ = "none";
100 
101 
103  bool readDictionary(const dictionary& dict);
104 
106  bool writeDictionary(dictionary& dict)const;
107 
108 public:
109 
111  TypeInfoNV("fixedWall");
112 
113  // - Constructors
114 
116  fixedWall();
117 
119  fixedWall(const dictionary& dict);
120 
122  fixedWall(const fixedWall&) = default;
123 
125  fixedWall(fixedWall&&) = default;
126 
128  fixedWall& operator=(const fixedWall&) = default;
129 
131  fixedWall& operator=(fixedWall&&) = default;
132 
134  ~fixedWall() = default;
135 
136  // - Methods
137 
141  {
142  return Model();
143  }
144 
146  int32 nameToIndex(const word& name)const
147  {
148  return 0;
149  }
150 
153  {
154  return name_;
155  }
156 
159  realx3 pointVelocity(label n, const realx3& p)const
160  {
161  return zero3;
162  }
163 
164 
167  realx3 transferPoint(label n, const realx3 p, real dt)const
168  {
169  return p;
170  }
171 
175  bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
176  {
177  return true;
178  }
179 
182  bool isMoving()const
183  {
184  return false;
185  }
186 
188  bool move(real t, real dt)
189  {
190  return true;
191  }
192 
193  // - IO operations
194 
196  FUNCTION_H
197  bool read(iIstream& is);
198 
200  FUNCTION_H
201  bool write(iOstream& os)const;
202 };
203 
204 } // pFlow
205 
206 #endif //__fixed_hpp__
pFlow::fixedWall::read
FUNCTION_H bool read(iIstream &is)
Read from input stream is.
Definition: fixedWall.cpp:70
pFlow::fixedWall::pointVelocity
INLINE_FUNCTION_HD realx3 pointVelocity(label n, const realx3 &p) const
Velocity at point p.
Definition: fixedWall.hpp:159
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::fixedWall::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(label n, const realx3 p, real dt) const
Transfer point p for dt seconds according to motion component n.
Definition: fixedWall.hpp:167
pFlow::fixedWall::isMoving
INLINE_FUNCTION_HD bool isMoving() const
Are walls moving.
Definition: fixedWall.hpp:182
pFlow::fixedWall::writeDictionary
bool writeDictionary(dictionary &dict) const
write to a dictionary
Definition: fixedWall.cpp:44
pFlow::fixedWall::Model::Model
INLINE_FUNCTION_HD Model()
Definition: fixedWall.hpp:63
types.hpp
pFlow::fixedWall::indexToName
word indexToName(label i) const
Index of motion component to name.
Definition: fixedWall.hpp:152
pFlow::fixedWall::name_
const word name_
Name.
Definition: fixedWall.hpp:99
pFlow::fixedWall::move
bool move(real t, real dt)
Move points.
Definition: fixedWall.hpp:188
pFlow::fixedWall::Model::pointVelocity
INLINE_FUNCTION_HD realx3 pointVelocity(int32 n, const realx3 p) const
Definition: fixedWall.hpp:73
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::zero3
const realx3 zero3(0.0)
Definition: types.hpp:97
Vectors.hpp
pFlow::fixedWall::transferPoint
INLINE_FUNCTION_HD bool transferPoint(label n, realx3 *pVec, size_t numP, real dt)
Transfer a vector of point pVec for dt seconds according to motion component n.
Definition: fixedWall.hpp:175
pFlow::fixedWall::write
FUNCTION_H bool write(iOstream &os) const
Write to output stream os.
Definition: fixedWall.cpp:91
pFlow
Definition: demComponent.hpp:28
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
uniquePtr.hpp
n
int32 n
Definition: NBSCrossLoop.hpp:24
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::fixedWall
Fixed wall motion model for walls.
Definition: fixedWall.hpp:50
pFlow::fixedWall::fixedWall
fixedWall()
Empty.
Definition: fixedWall.cpp:55
pFlow::fixedWall::Model::operator=
INLINE_FUNCTION_HD Model & operator=(const Model &)=default
pFlow::fixedWall::Model::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(int32 n, const realx3 p, real dt) const
Definition: fixedWall.hpp:85
pFlow::fixedWall::nameToIndex
int32 nameToIndex(const word &name) const
Name of the motion component to index.
Definition: fixedWall.hpp:146
pFlow::fixedWall::operator=
fixedWall & operator=(const fixedWall &)=default
Copy assignment.
pFlow::fixedWall::getModel
Model getModel(real t) const
Return motion model t is the current simulation time
Definition: fixedWall.hpp:140
pFlow::fixedWall::Model::numComponents
INLINE_FUNCTION_HD int32 numComponents() const
Definition: fixedWall.hpp:90
pFlow::fixedWall::~fixedWall
~fixedWall()=default
Destructor.
pFlow::fixedWall::readDictionary
bool readDictionary(const dictionary &dict)
Read from a dictionary.
Definition: fixedWall.cpp:26
typeInfo.hpp
pFlow::label
std::size_t label
Definition: builtinTypes.hpp:61
pFlow::fixedWall::TypeInfoNV
TypeInfoNV("fixedWall")
Type info.
pFlow::fixedWall::Model
Motion model class to be passed to computational units/kernels for transfing points and returning vel...
Definition: fixedWall.hpp:57
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::dictionary
Definition: dictionary.hpp:38
pFlow::fixedWall::Model::operator()
INLINE_FUNCTION_HD realx3 operator()(int32 n, const realx3 &p) const
Definition: fixedWall.hpp:79