rotatingAxis.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 __rotatingAxis_hpp__
22 #define __rotatingAxis_hpp__
23 
24 #include "timeInterval.hpp"
25 #include "line.hpp"
26 
27 namespace pFlow
28 {
29 
30 class dictionary;
31 class rotatingAxis;
32 
33 #include "rotatingAxisFwd.hpp"
34 
36 :
37  public timeInterval,
38  public line
39 {
40 protected:
41 
42  // rotation speed
43  real omega_ = 0;
44 
45  bool rotating_ = false;
46 
47 public:
48 
51 
53  rotatingAxis(const dictionary& dict);
54 
56  rotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0);
57 
59  rotatingAxis(const rotatingAxis&) = default;
60 
61  rotatingAxis& operator=(const rotatingAxis&) = default;
62 
65 
66 
68  real omega()const
69  {
70  return omega_;
71  }
72 
74  bool isRotating()const
75  {
76  return rotating_;
77  }
78 
81 
82  // - IO operation
83  FUNCTION_H
84  bool read(const dictionary& dict);
85 
87  bool write(dictionary& dict) const;
88 
90  bool read(iIstream& is);
91 
93  bool write(iOstream& os)const;
94 
95 };
96 
97 inline iOstream& operator <<(iOstream& os, const rotatingAxis& ax)
98 {
99  if(!ax.write(os))
100  {
101  fatalExit;
102  }
103  return os;
104 }
105 
107 {
108  if( !ax.read(is) )
109  {
110  fatalExit;
111  }
112  return is;
113 }
114 
115 }
116 
117 
118 #include "rotatingAxisI.hpp"
119 
120 #endif
timeInterval.hpp
pFlow::rotatingAxis::setOmega
FUNCTION_HD real setOmega(real omega)
Definition: rotatingAxis.cpp:58
pFlow::real
float real
Definition: builtinTypes.hpp:46
fatalExit
#define fatalExit
Definition: error.hpp:57
pFlow::line
Definition: line.hpp:36
pFlow::rotatingAxis::write
FUNCTION_H bool write(dictionary &dict) const
Definition: rotatingAxis.cpp:84
pFlow::rotatingAxis::rotating_
bool rotating_
Definition: rotatingAxis.hpp:45
pFlow::rotatingAxis::isRotating
INLINE_FUNCTION_HD bool isRotating() const
Definition: rotatingAxis.hpp:74
rotatingAxisI.hpp
pFlow
Definition: demComponent.hpp:28
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::rotatingAxis::omega_
real omega_
Definition: rotatingAxis.hpp:43
pFlow::rotatingAxis
Definition: rotatingAxis.hpp:35
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::rotatingAxis::omega
INLINE_FUNCTION_HD real omega() const
Definition: rotatingAxis.hpp:68
pFlow::timeInterval
Definition: timeInterval.hpp:16
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
FUNCTION_HD
#define FUNCTION_HD
Definition: pFlowMacros.hpp:57
pFlow::rotatingAxis::read
FUNCTION_H bool read(const dictionary &dict)
Definition: rotatingAxis.cpp:68
rotatingAxisFwd.hpp
pFlow::rotatingAxis::linTangentialVelocityPoint
INLINE_FUNCTION_HD realx3 linTangentialVelocityPoint(const realx3 &p) const
Definition: rotatingAxisI.hpp:22
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::rotatingAxis::operator=
rotatingAxis & operator=(const rotatingAxis &)=default
line.hpp
pFlow::rotatingAxis::rotatingAxis
FUNCTION_HD rotatingAxis()
Definition: rotatingAxis.hpp:50
pFlow::dictionary
Definition: dictionary.hpp:38