# PhasicFlow: src/phasicFlow/structuredData/peakableRegion/cylinderRegion/cylinderRegion.cpp Source File

cylinderRegion.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "cylinderRegion.hpp"
pFlow::cylinderRegion::cylinderRegion
(
const dictionary& dict
)
:
cylinder_(dict),
random_()
{
}
bool pFlow::cylinderRegion::isInside
(
const realx3& p
) const
{
return cylinder_.isInside(p);
}
pFlow::realx3 pFlow::cylinderRegion::peek()const
{
for(int32 i=0; i<500;i++)
{
auto p =
random_.randomNumber(cylinder_.minPoint(), cylinder_.maxPoint());
if( cylinder_.isInside(p)) return p;
}
fatalErrorInFunction<<
"cannot peek a random point from cylinderRegion. \n";
fatalExit;
return 0;
}
bool pFlow::cylinderRegion::read
(
const dictionary& dict
)
{
return cylinder_.read(dict);
}
bool pFlow::cylinderRegion::write
(
dictionary& dict
)const
{
return cylinder_.write(dict);
}
pFlow::cylinderRegion::peek
realx3 peek() const
Definition: cylinderRegion.cpp:43
fatalExit
#define fatalExit
Definition: error.hpp:57
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:121
fatalErrorInFunction
#define fatalErrorInFunction
Definition: error.hpp:42
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
cylinderRegion.hpp
pFlow::cylinderRegion::cylinder_
cylinder cylinder_
Definition: cylinderRegion.hpp:34
pFlow::cylinder::maxPoint
INLINE_FUNCTION_HD realx3 maxPoint() const
Definition: cylinder.hpp:127
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
Definition: dictionary.hpp:38
pFlow::uniformRandomReal::randomNumber
real randomNumber(real a, real b)
Definition: uniformRandomReal.hpp:53