iBox.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 __iBox_hpp__
22 #define __iBox_hpp__
23 
24 #include "types.hpp"
25 #include "dictionary.hpp"
26 #include "iIstream.hpp"
27 #include "iOstream.hpp"
28 
29 namespace pFlow
30 {
31 
32 template<typename intType>
33 class iBox
34 {
35 protected:
36 
37  // - min point
39 
40  // - max point
42 
43 public:
44 
45  // - type info
46  TypeInfoTemplateNV("iBox", intType);
47 
50  iBox();
51 
53  iBox(const triple<intType> & minP, const triple<intType> & maxP);
54 
56  iBox(const dictionary& dict);
57 
59  iBox(iIstream& is);
60 
62  iBox(const iBox&) = default;
63 
65  iBox(iBox&&) = default;
66 
68  iBox& operator=(const iBox&) = default;
69 
71  iBox& operator=(iBox&&) = default;
72 
73  ~iBox()=default;
74 
76 
78  bool isInside(const triple<intType> & point)const;
79 
81  const triple<intType> & minPoint()const
82  {
83  return min_;
84  }
85 
87  const triple<intType> & maxPoint()const
88  {
89  return max_;
90  }
91 
94  bool read(iIstream & is);
95 
97  bool write(iOstream& os)const;
98 
100  bool read(const dictionary& dict);
101 
102  FUNCTION_H
103  bool write(dictionary& dict)const;
104 };
105 
106 template<typename intType>
108 iIstream& operator >> (iIstream& is, iBox<intType>& b);
109 
110 template<typename intType>
112 iOstream& operator << (iOstream& os, const iBox<intType>& b);
113 
114 
115 
116 }
117 
118 
119 #include "iBox.cpp"
120 
121 
122 #endif
pFlow::iBox::operator=
FUNCTION_HD iBox & operator=(const iBox &)=default
pFlow::iBox::isInside
INLINE_FUNCTION_HD bool isInside(const triple< intType > &point) const
Definition: iBox.cpp:76
iIstream.hpp
types.hpp
pFlow
Definition: demComponent.hpp:28
pFlow::iBox::iBox
INLINE_FUNCTION_HD iBox()
Definition: iBox.cpp:24
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
pFlow::iBox::~iBox
~iBox()=default
iBox.cpp
pFlow::iBox::max_
triple< intType > max_
Definition: iBox.hpp:41
pFlow::iBox::maxPoint
const INLINE_FUNCTION_HD triple< intType > & maxPoint() const
Definition: iBox.hpp:87
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::iBox::min_
triple< intType > min_
Definition: iBox.hpp:38
dictionary.hpp
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::iBox::write
FUNCTION_H bool write(iOstream &os) const
Definition: iBox.cpp:94
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
FUNCTION_HD
#define FUNCTION_HD
Definition: pFlowMacros.hpp:57
iOstream.hpp
pFlow::iBox
Definition: iBox.hpp:33
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< intType >
pFlow::iBox::TypeInfoTemplateNV
TypeInfoTemplateNV("iBox", intType)
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::iBox::minPoint
const INLINE_FUNCTION_HD triple< intType > & minPoint() const
Definition: iBox.hpp:81
pFlow::dictionary
Definition: dictionary.hpp:38
pFlow::iBox::read
FUNCTION_H bool read(iIstream &is)
Definition: iBox.cpp:85