www.cemf.ir
pointStructure.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 __pointStructure_hpp__
21 #define __pointStructure_hpp__
22 
23 #include "IOobject.hpp"
24 #include "demComponent.hpp"
25 #include "internalPoints.hpp"
26 #include "simulationDomain.hpp"
27 #include "pointSorting.hpp"
28 #include "boundaryList.hpp"
29 #include "streams.hpp"
30 
31 namespace pFlow
32 {
33 
35 :
36  public IOobject,
37  public demComponent,
38  public internalPoints
39 {
40 public:
41 
43 
45 
47 
49 
51 
52 private:
53 
56 
58 
60 
62 
64 
65 
66 
67  bool setupPointStructure(const realx3Vector& points);
68 
69  bool setupPointStructure(const PointsTypeHost& points);
70 
71  bool initializePoints(const PointsTypeHost& points);
72 
73 public:
74 
75 
76  // - type info
77  TypeInfo("pointStructure");
78 
79 
81 
84 
88  const realx3Vector& posVec);
89 
90  pointStructure(const pointStructure&) = delete;
91 
92  // - no move construct
93  pointStructure(pointStructure&&) = delete;
94 
95 
96  pointStructure& operator=(const pointStructure&) = delete;
97 
98  // - no move assignment
100 
101  // - destructor
102  ~pointStructure() override = default;
103 
104  // - Iteration methods
105 
107  bool beforeIteration() override;
108 
111  bool iterate() override;
112 
114  bool afterIteration() override;
115 
116  // - Access methods
117 
118  auto& boundaries()
119  {
120  return boundaries_;
121  }
122 
123  const auto& boundaries()const
124  {
125  return boundaries_;
126  }
127 
128  Time& time() override
129  {
130  return demComponent::time();
131  }
132 
133  const Time& time() const override
134  {
135  return demComponent::time();
136  }
137 
138  boundaryBase& boundary(size_t i ) override
139  {
140  return boundaries_[i];
141  }
142 
143  const boundaryBase& boundary(size_t i)const override
144  {
145  return boundaries_[i];
146  }
147 
148  inline
149  const auto& simDomain()const
150  {
151  return simulationDomain_();
152  }
153 
154  inline
155  const auto& thisDomain()const
156  {
157  return simulationDomain_().thisDomain();
158  }
159 
160  inline
161  const auto& extendedDomain()const
162  {
163  return boundaries_.extendedDomain();
164  }
165 
166  inline
167  auto internalDomainBox()const
168  {
170  }
171 
172  // - IO methods
173 
178  bool read(iIstream& is, const IOPattern& iop) override;
179 
180 
182  bool write(iOstream& os, const IOPattern& iop)const override;
183 
184 
185 };
186 
187 
188 /*inline iOstream& operator << (iOstream& os, const pointStructure& ps )
189 {
190  if( !ps.write(os, IOPattern::AllProcessorsDifferent) )
191  {
192  ioErrorInFile(os.name(), os.lineNumber());
193  fatalExit;
194  }
195  return os;
196 }*/
197 
198 } // pFlow
199 
200 
201 
202 
203 #endif //__pointStructure_hpp__
pFlow::boundaryList::internalDomainBox
box internalDomainBox() const
Definition: boundaryList.cpp:165
pointSorting.hpp
pFlow::internalPoints
Definition: internalPoints.hpp:38
pFlow::pointStructure::time
const Time & time() const override
Definition: pointStructure.hpp:133
pFlow::internalPoints::execution_space
typename PointsType::execution_space execution_space
Definition: internalPoints.hpp:54
IOobject.hpp
pFlow::pointStructure::read
bool read(iIstream &is, const IOPattern &iop) override
read the point structure from the input stream.
Definition: pointStructure.cpp:257
pFlow::pointStructure::time
Time & time() override
Definition: pointStructure.hpp:128
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::pointStructure::boundaries
const auto & boundaries() const
Definition: pointStructure.hpp:123
pFlow::pointStructure::beforeIteration
bool beforeIteration() override
In the time loop before iterate.
Definition: pointStructure.cpp:175
pFlow::boundaryList::extendedDomain
const auto & extendedDomain() const
Definition: boundaryList.hpp:113
pFlow::pointStructure::thisDomain
const auto & thisDomain() const
Definition: pointStructure.hpp:155
pFlow::pointStructure::pointStructure
pointStructure(systemControl &control)
an empty pointStructure, good for reading from file
Definition: pointStructure.cpp:94
pFlow::demComponent::time
const auto & time() const
Definition: demComponent.hpp:113
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::boundaryList
Definition: boundaryList.hpp:35
pFlow::pointStructure::boundaryUpdateTimer_
Timer boundaryUpdateTimer_
Definition: pointStructure.hpp:61
pFlow::Field< realx3 >
pFlow::pointStructure::simDomain
const auto & simDomain() const
Definition: pointStructure.hpp:149
simulationDomain.hpp
pFlow::pointStructure::pointSorting_
uniquePtr< pointSorting > pointSorting_
Definition: pointStructure.hpp:57
pFlow
Definition: demGeometry.hpp:27
pFlow::IOobject
Definition: IOobject.hpp:35
boundaryList.hpp
pFlow::pointStructure::boundaryDataTransferTimer_
Timer boundaryDataTransferTimer_
Definition: pointStructure.hpp:63
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::pointStructure::~pointStructure
~pointStructure() override=default
pFlow::VectorSingle< realx3, void >::device_type
typename viewType::device_type device_type
Definition: VectorSingle.hpp:72
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::pointStructure::boundaries
auto & boundaries()
Definition: pointStructure.hpp:118
pFlow::demComponent
A base class for every main component of DEM system.
Definition: demComponent.hpp:42
pFlow::Timer
Definition: Timer.hpp:33
pFlow::internalPoints::PointsTypeHost
typename PointsType::FieldTypeHost PointsTypeHost
Definition: internalPoints.hpp:48
pFlow::IOPattern
Definition: IOPattern.hpp:32
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
pFlow::pointStructure::write
bool write(iOstream &os, const IOPattern &iop) const override
Write.
Definition: pointStructure.cpp:279
pFlow::pointStructure::extendedDomain
const auto & extendedDomain() const
Definition: pointStructure.hpp:161
streams.hpp
pFlow::internalPoints::device_type
typename PointsType::device_type device_type
Definition: internalPoints.hpp:50
pFlow::pointStructure::boundary
boundaryBase & boundary(size_t i) override
Definition: pointStructure.hpp:138
pFlow::pointStructure::iterate
bool iterate() override
This is called in time loop.
Definition: pointStructure.cpp:232
pFlow::pointStructure::initializePoints
bool initializePoints(const PointsTypeHost &points)
Definition: pointStructure.cpp:83
demComponent.hpp
pFlow::internalPoints::memory_space
typename PointsType::memory_space memory_space
Definition: internalPoints.hpp:52
pFlow::internalPoints::PointsType
realx3Field_D PointsType
Definition: internalPoints.hpp:46
pFlow::pointStructure::setupPointStructure
bool setupPointStructure(const realx3Vector &points)
Definition: pointStructure.cpp:27
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::pointStructure::simulationDomain_
uniquePtr< simulationDomain > simulationDomain_
Definition: pointStructure.hpp:55
pFlow::pointStructure::afterIteration
bool afterIteration() override
This is called in time loop, after iterate.
Definition: pointStructure.cpp:244
pFlow::pointStructure::boundary
const boundaryBase & boundary(size_t i) const override
Definition: pointStructure.hpp:143
pFlow::Field< realx3 >::memory_space
typename VectorType::memory_space memory_space
Definition: Field.hpp:48
pFlow::pointStructure::operator=
pointStructure & operator=(const pointStructure &)=delete
pFlow::pointStructure::TypeInfo
TypeInfo("pointStructure")
pFlow::Vector< realx3 >
pFlow::pointStructure::boundaries_
boundaryList boundaries_
Definition: pointStructure.hpp:59
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
internalPoints.hpp
pFlow::Field< realx3 >::execution_space
typename VectorType::execution_space execution_space
Definition: Field.hpp:50
pFlow::pointStructure::internalDomainBox
auto internalDomainBox() const
Definition: pointStructure.hpp:167
pFlow::Time
Definition: Time.hpp:37