# PhasicFlow: src/phasicFlow/structuredData/plane/plane.cpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

plane.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 "plane.hpp"
pFlow::plane::plane
(
const realx3& p1,
const realx3& p2,
const realx3& p3,
const realx3& p4
)
:
infinitePlane(p1,p2,p3),
p1_(p1),
p2_(p2),
p3_(p3),
p4_(p4)
{
if(!pointOnPlane(p4))
{
fatalErrorInFunction<<
"points "<< realx4x3(p1,p2,p3,p4)<<" do not form a planner surface"<<endl;
fatalExit;
}
}
pFlow::plane pFlow::plane::parallelPlane(real distance)const
{
auto pp1 = line(normal_, p1_, true).point(distance);
auto pp2 = line(normal_, p2_, true).point(distance);
auto pp3 = line(normal_, p3_, true).point(distance);
auto pp4 = line(normal_, p4_, true).point(distance);
return plane(pp1, pp2, pp3, pp4);
}
bool pFlow::plane::validPlane4(
const realx3 &p1,
const realx3 &p2,
const realx3 &p3,
const realx3 &p4)
{
if( !validPlane3(p1,p2,p3)) return false;
if( !infinitePlane(p1,p2,p3).pointOnPlane(p4)) return false;
return true;
}
pFlow::infinitePlane::normal_
realx3 normal_
normal vector
Definition: infinitePlane.hpp:37
pFlow::plane::p4_
realx3 p4_
Fourth point.
Definition: plane.hpp:46
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::realx4x3
quadruple< realx3 > realx4x3
Definition: types.hpp:51
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::plane
Definition: plane.hpp:30
pFlow::line
Definition: line.hpp:36
pFlow::plane::plane
INLINE_FUNCTION_HD plane()
Definition: plane.hpp:51
pFlow::infinitePlane
Definition: infinitePlane.hpp:32
pFlow::plane::p3_
realx3 p3_
Third point.
Definition: plane.hpp:43
pFlow::plane::p1_
realx3 p1_
First point.
Definition: plane.hpp:37
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::plane::validPlane4
static bool validPlane4(const realx3 &p1, const realx3 &p2, const realx3 &p3, const realx3 &p4)
Definition: plane.cpp:57
plane.hpp
pFlow::plane::parallelPlane
plane parallelPlane(real distance) const
Definition: plane.cpp:47
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::line::point
INLINE_FUNCTION_HD realx3 point(real t) const
Definition: line.hpp:102
pFlow::plane::p2_
realx3 p2_
Second point.
Definition: plane.hpp:40
pFlow::triple< real >