www.cemf.ir
domain.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 __domain_hpp__
22 #define __domain_hpp__
23 
24 
25 #include "box.hpp"
26 #include "plane.hpp"
27 
28 namespace pFlow
29 {
30 
31 class domain
32 {
33 private:
34 
36 
39 
42 
45 
48 
51 
54 
55 
56 public:
57 
58  // - type info
59  TypeInfoNV("domain");
60 
63  domain() = default;
64 
65  FUNCTION_H
66  explicit domain(const box& db);
67 
69  domain(const domain&) = default;
70 
72  domain(domain&&) = default;
73 
75  domain& operator=(const domain&) = default;
76 
78  domain& operator=(domain&&) = default;
79 
81  ~domain()=default;
82 
84 
86  const auto& domainBox()const
87  {
88  return domainBox_;
89  }
90 
92  const auto& left()const
93  {
94  return left_;
95  }
96 
98  const auto& right()const
99  {
100  return right_;
101  }
102 
104  const auto& bottom()const
105  {
106  return bottom_;
107  }
108 
110  const auto& top()const
111  {
112  return top_;
113  }
114 
116  const auto& rear()const
117  {
118  return rear_;
119  }
120 
122  const auto& front()const
123  {
124  return front_;
125  }
126 
128  const auto& boundaryPlane(uint32 i)const
129  {
130  switch (i)
131  {
132  case 0:
133  return left_;
134  case 1:
135  return right_;
136  case 2:
137  return bottom_;
138  case 3:
139  return top_;
140  case 4:
141  return rear_;
142  case 5:
143  return front_;
144  default:
146  return front_;
147  }
148  }
149 
151  const auto& minPoint()const
152  {
153  return domainBox_.minPoint();
154  }
155 
157  const auto& maxPoint()const
158  {
159  return domainBox_.maxPoint();
160  }
161 
162 }; // domain
163 
164 
166 bool equal(const domain& d1, const domain& d2, real tol=smallValue)
167 {
168  return equal(d1.domainBox(), d2.domainBox(), tol);
169 }
170 
172 bool operator ==(const domain& d1, const domain& d2)
173 {
174  return equal(d1, d2);
175 }
176 
178 iIstream& operator >>(iIstream& is, domain& d);
179 
181 iOstream& operator << (iOstream& os, const domain& d);
182 
183 
184 }
185 
186 
187 #endif
pFlow::domain::~domain
INLINE_FUNCTION_HD ~domain()=default
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::smallValue
const real smallValue
Definition: numericConstants.hpp:31
pFlow::plane
Definition: plane.hpp:30
pFlow::domain::domainBox
const INLINE_FUNCTION_HD auto & domainBox() const
Definition: domain.hpp:86
pFlow::domain::domain
INLINE_FUNCTION_HD domain()=default
pFlow::domain::rear_
plane rear_
-z
Definition: domain.hpp:50
pFlow::equal
INLINE_FUNCTION_HD bool equal(const box &b1, const box &b2, real tol=smallValue)
Definition: box.hpp:135
pFlow::domain::minPoint
const INLINE_FUNCTION_HD auto & minPoint() const
Definition: domain.hpp:151
pFlow::operator==
INLINE_FUNCTION_HD bool operator==(const box &b1, const box &b2)
Definition: box.hpp:142
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
box.hpp
pFlow::domain::operator=
INLINE_FUNCTION_HD domain & operator=(const domain &)=default
pFlow::domain::bottom
const INLINE_FUNCTION_HD auto & bottom() const
Definition: domain.hpp:104
plane.hpp
pFlow::box::maxPoint
const INLINE_FUNCTION_HD realx3 & maxPoint() const
Definition: box.hpp:97
pFlow
Definition: demGeometry.hpp:27
pFlow::domain::rear
const INLINE_FUNCTION_HD auto & rear() const
Definition: domain.hpp:116
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:62
pFlow::domain::front
const INLINE_FUNCTION_HD auto & front() const
Definition: domain.hpp:122
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::domain::boundaryPlane
const INLINE_FUNCTION_H auto & boundaryPlane(uint32 i) const
Definition: domain.hpp:128
pFlow::domain::right
const INLINE_FUNCTION_HD auto & right() const
Definition: domain.hpp:98
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
INLINE_FUNCTION_H
#define INLINE_FUNCTION_H
Definition: pFlowMacros.hpp:57
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
pFlow::domain::front_
plane front_
+z
Definition: domain.hpp:53
pFlow::domain::TypeInfoNV
TypeInfoNV("domain")
pFlow::domain::right_
plane right_
+x
Definition: domain.hpp:41
pFlow::domain::left_
plane left_
-x
Definition: domain.hpp:38
pFlow::domain::left
const INLINE_FUNCTION_HD auto & left() const
Definition: domain.hpp:92
pFlow::box::minPoint
const INLINE_FUNCTION_HD realx3 & minPoint() const
Definition: box.hpp:91
pFlow::box
Definition: box.hpp:32
pFlow::domain::bottom_
plane bottom_
-y
Definition: domain.hpp:44
pFlow::domain
Definition: domain.hpp:31
pFlow::domain::maxPoint
const INLINE_FUNCTION_HD auto & maxPoint() const
Definition: domain.hpp:157
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::domain::top_
plane top_
+y
Definition: domain.hpp:47
pFlow::domain::domainBox_
box domainBox_
Definition: domain.hpp:35
pFlow::domain::top
const INLINE_FUNCTION_HD auto & top() const
Definition: domain.hpp:110