www.cemf.ir
geometry.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 __geometry_hpp__
22 #define __geometry_hpp__
23 
24 
25 #include "virtualConstructor.hpp"
26 #include "demGeometry.hpp"
27 #include "property.hpp"
28 #include "Fields.hpp"
29 #include "Vectors.hpp"
30 #include "multiTriSurface.hpp"
31 #include "triSurfaceFields.hpp"
32 #include "dictionary.hpp"
33 
34 namespace pFlow
35 {
36 
37 
43 class geometry
44 :
45  public demGeometry
46 {
47 protected:
48 
49  // - Protected members
50 
52  const property& wallProperty_;
53 
56 
59 
62 
65 
68 
71 
74 
75  // - Protected member functions
76 
79  bool findPropertyId();
80 
82  void zeroForce()
83  {
85  }
86 
87 
88 public:
89 
91  TypeInfo("geometry");
92 
93  // - Constructors
94 
96  geometry(systemControl& control, const property& prop);
97 
100  const property& prop,
102  const wordVector& motionCompName,
103  const wordVector& propName
104  );
105 
109  const property& prop,
110  const dictionary& dict,
112  const wordVector& motionCompName,
113  const wordVector& propName);
114 
116  virtual ~geometry() = default;
117 
120  (
121  geometry,
123  (
125  const property& prop
126  ),
127  (control, prop)
128  );
129 
132  (
133  geometry,
134  dictionary,
136  const property& prop,
137  const dictionary& dict,
139  const wordVector& motionCompName,
140  const wordVector& propName),
141  (control, prop, dict, triSurface, motionCompName, propName)
142  );
143 
144  //- Methods
145 
147  inline
148  auto size()const
149  {
150  return triSurface_.size();
151  }
152 
154  inline
155  auto numPoints()const
156  {
157  return triSurface_.numPoints();
158  }
159 
161  inline
162  auto numTriangles()const
163  {
164  return size();
165  }
166 
168  inline
169  const auto& points()const
170  {
171  return triSurface_.points();
172  }
173 
175  inline
176  const auto& vertices()const
177  {
178  return triSurface_.vertices();
179  }
180 
182  inline auto getTriangleAccessor()const
183  {
185  }
186 
188  inline auto& surface()
189  {
190  return triSurface_;
191  }
192 
194  inline const auto& surface()const
195  {
196  return triSurface_;
197  }
198 
200  inline
202  {
203  return contactForceWall_;
204  }
205 
207  inline
209  {
210  return contactForceWall_;
211  }
212 
214  inline const auto& wallProperty()const
215  {
216  return wallProperty_;
217  }
218 
220  inline
221  const repository& owner()const
222  {
223  return geometryRepository_;
224  }
225 
227  inline
229  {
230  return geometryRepository_;
231  }
232 
234  inline auto path()
235  {
236  return owner().path();
237  }
238 
240  virtual
241  word motionModelTypeName()const = 0;
242 
244  virtual
245  const int8Vector_HD& triMotionIndex() const =0;
246 
248  virtual
249  const int8Vector_HD& pointMotionIndex()const = 0;
250 
253  {
254  return propertyId_;
255  }
256 
258  bool beforeIteration() override;
259 
261  bool afterIteration() override;
262 
263  //- IO
264 
266  bool write()const
267  {
268  return owner().write();
269  }
270 
271 
272  //- Static members
273 
274  static
276 
277  static
280  const property& prop,
281  const dictionary& dict,
283  const wordVector& motionCompName,
284  const wordVector& propName);
285 
286 };
287 
288 }
289 
290 #endif
pFlow::geometry::materialName_
wordField & materialName_
Material name of each wall surface
Definition: geometry.hpp:64
pFlow::triSurface::getTriangleAccessor
auto getTriangleAccessor() const
Definition: triSurface.hpp:174
pFlow::geometry::geometryRepository_
repository & geometryRepository_
Repository to store geometry data at each simulation moment.
Definition: geometry.hpp:55
pFlow::geometry::motionComponentName_
wordField & motionComponentName_
The name of motion component of each wall surface.
Definition: geometry.hpp:61
pFlow::geometry::surface
auto & surface()
Surface.
Definition: geometry.hpp:188
pFlow::geometry::findPropertyId
bool findPropertyId()
Find property id of each triangle based on the supplied material name and the surface wall that the t...
Definition: geometry.cpp:25
triSurfaceFields.hpp
pFlow::geometry::points
const auto & points() const
Access to the points.
Definition: geometry.hpp:169
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::geometry::contactForceWall
const realx3TriSurfaceField_D & contactForceWall() const
Access to contact force.
Definition: geometry.hpp:208
pFlow::geometry::create
static uniquePtr< geometry > create(systemControl &control, const property &prop)
Definition: geometry.cpp:229
pFlow::geometry::motionModelTypeName
virtual word motionModelTypeName() const =0
The name of motion model.
pFlow::geometry::size
auto size() const
Size of tri-surface.
Definition: geometry.hpp:148
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::zero3
const realx3 zero3(0.0)
Definition: types.hpp:97
Vectors.hpp
pFlow::geometry::wallProperty_
const property & wallProperty_
Const reference to physical property of materials.
Definition: geometry.hpp:52
pFlow::Field< Vector, word, vecAllocator< word > >
pFlow::geometry::stressWall_
realx3TriSurfaceField_D & stressWall_
Stress on ech triangle in the set of wall surfaces.
Definition: geometry.hpp:73
pFlow::geometry::owner
const repository & owner() const
Owner repository.
Definition: geometry.hpp:221
pFlow::repository::write
virtual bool write(bool verbose=false) const
Definition: repository.cpp:239
pFlow::triSurface::points
const realx3Vector_D & points() const
Definition: triSurface.hpp:184
pFlow
Definition: demComponent.hpp:28
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:33
pFlow::geometry::afterIteration
bool afterIteration() override
Operations after each iteration.
Definition: geometry.cpp:281
pFlow::geometry::create_vCtor
create_vCtor(geometry, systemControl,(systemControl &control, const property &prop),(control, prop))
Virtual constructor.
pFlow::geometry::contactForceWall_
realx3TriSurfaceField_D & contactForceWall_
Contact force on each triangle in the set of wall surfaces.
Definition: geometry.hpp:70
pFlow::geometry::~geometry
virtual ~geometry()=default
Destructor.
pFlow::triSurfaceField
Definition: triSurfaceField.hpp:34
pFlow::geometry::triSurface_
multiTriSurface & triSurface_
All triangles in the set of wall surfaces.
Definition: geometry.hpp:58
pFlow::geometry::contactForceWall
realx3TriSurfaceField_D & contactForceWall()
Access to contact force.
Definition: geometry.hpp:201
pFlow::VectorDual< int8 >
multiTriSurface.hpp
pFlow::geometry::wallProperty
const auto & wallProperty() const
Access to property.
Definition: geometry.hpp:214
Fields.hpp
dictionary.hpp
pFlow::geometry::write
bool write() const
write
Definition: geometry.hpp:266
pFlow::geometry::vertices
const auto & vertices() const
Access to the vertices.
Definition: geometry.hpp:176
pFlow::geometry::beforeIteration
bool beforeIteration() override
Operations before each iteration.
Definition: geometry.cpp:274
virtualConstructor.hpp
pFlow::triSurface::numPoints
size_t numPoints() const
Definition: triSurface.hpp:149
pFlow::geometry::zeroForce
void zeroForce()
Initialize contact force to zero.
Definition: geometry.hpp:82
pFlow::geometry::numPoints
auto numPoints() const
Number of points in the set of surface walls.
Definition: geometry.hpp:155
pFlow::repository::path
virtual fileSystem path() const
Definition: repository.cpp:61
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:40
pFlow::geometry::owner
repository & owner()
Owner repository.
Definition: geometry.hpp:228
pFlow::geometry::TypeInfo
TypeInfo("geometry")
Type info.
pFlow::geometry::surface
const auto & surface() const
Surface.
Definition: geometry.hpp:194
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pFlow::geometry
Base class for geometry for managing tri-surfaces, geometry motion, and surface physical properties.
Definition: geometry.hpp:43
pFlow::triSurface::vertices
const int32x3Vector_D & vertices() const
Definition: triSurface.hpp:214
pFlow::demGeometry
base for geometry that manages control
Definition: demGeometry.hpp:33
pFlow::geometry::getTriangleAccessor
auto getTriangleAccessor() const
Obtain an object for accessing triangles.
Definition: geometry.hpp:182
pFlow::repository
Definition: repository.hpp:34
property.hpp
pFlow::triSurface
Definition: triSurface.hpp:38
pFlow::geometry::propertyId_
int8TriSurfaceField_D & propertyId_
Property id of each triangle in the set of wall surfaces.
Definition: geometry.hpp:67
pFlow::geometry::numTriangles
auto numTriangles() const
Number of triangles in the set of surface walls.
Definition: geometry.hpp:162
pFlow::Vector< word >
pFlow::geometry::path
auto path()
Path to the repository folder.
Definition: geometry.hpp:234
pFlow::geometry::propertyId
const int8TriSurfaceField_D & propertyId() const
Property ide of triangles.
Definition: geometry.hpp:252
pFlow::geometry::pointMotionIndex
virtual const int8Vector_HD & pointMotionIndex() const =0
Motion model index of points.
pFlow::dictionary
Definition: dictionary.hpp:38
pFlow::triSurface::size
size_t size() const
Definition: triSurface.hpp:159
pFlow::geometry::geometry
geometry(systemControl &control, const property &prop)
Construct from controlSystem and property, for reading from file.
Definition: geometry.cpp:57
pFlow::geometry::triMotionIndex
virtual const int8Vector_HD & triMotionIndex() const =0
Motion model index of triangles.
demGeometry.hpp