www.cemf.ir
cylinderRegion.cpp
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 #include "cylinderRegion.hpp"
22 
23 
25 (
26  const dictionary& dict
27 )
28 :
29  cylinder_(dict),
30  random_()
31 {
32 
33 }
34 
36 (
37  const realx3& p
38 ) const
39 {
40  return cylinder_.isInside(p);
41 }
42 
44 {
45  for(int32 i=0; i<500;i++)
46  {
47  auto p =
49  if( cylinder_.isInside(p)) return p;
50  }
51 
53  "cannot peek a random point from cylinderRegion. \n";
54  fatalExit;
55  return 0;
56 }
57 
58 
60 (
61  const dictionary& dict
62 )
63 {
64  return cylinder_.read(dict);
65 }
66 
68 (
69  dictionary& dict
70 )const
71 {
72  return cylinder_.write(dict);
73 }
pFlow::cylinderRegion::peek
realx3 peek() const
Definition: cylinderRegion.cpp:43
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::cylinder::isInside
INLINE_FUNCTION_HD bool isInside(const realx3 &point) const
Definition: cylinder.hpp:88
pFlow::cylinderRegion::random_
uniformRandomReal random_
Definition: cylinderRegion.hpp:36
pFlow::cylinderRegion::cylinderRegion
cylinderRegion(const dictionary &dict)
Definition: cylinderRegion.cpp:25
pFlow::cylinder::minPoint
INLINE_FUNCTION_HD realx3 minPoint() const
Definition: cylinder.hpp:123
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
cylinderRegion.hpp
pFlow::cylinderRegion::cylinder_
cylinder cylinder_
Definition: cylinderRegion.hpp:34
pFlow::cylinder::maxPoint
INLINE_FUNCTION_HD realx3 maxPoint() const
Definition: cylinder.hpp:129
pFlow::cylinderRegion::isInside
bool isInside(const realx3 &p) const
Definition: cylinderRegion.cpp:36
pFlow::cylinderRegion::read
bool read(const dictionary &dict)
Definition: cylinderRegion.cpp:60
pFlow::triple< real >
pFlow::cylinderRegion::write
bool write(dictionary &dict) const
Definition: cylinderRegion.cpp:68
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::uniformRandomReal::randomNumber
real randomNumber(real a, real b)
Definition: uniformRandomReal.hpp:53