triangleFunctions.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 __triangleFunctions_hpp__
22 #define __triangleFunctions_hpp__
23 
24 #include "types.hpp"
25 
27 {
28 
30 real triangleSurface( const realx3& p1, const realx3& p2, const realx3& p3)
31 {
32  realx3 V1 = p2 - p1;
33  realx3 V2 = p3 - p1;
34  return abs((cross(V1,V2)).length() / static_cast<real>(2.0));
35 }
36 
37 }
38 
39 #endif
pFlow::real
float real
Definition: builtinTypes.hpp:46
types.hpp
pFlow::triangleFunctions::triangleSurface
INLINE_FUNCTION_HD real triangleSurface(const realx3 &p1, const realx3 &p2, const realx3 &p3)
Definition: triangleFunctions.hpp:30
cross
INLINE_FUNCTION_HD triple< T > cross(const triple< T > &v1, const triple< T > &v2)
length
INLINE_FUNCTION_HD T length(const triple< T > &v1)
pFlow::abs
INLINE_FUNCTION_HD real abs(real x)
Definition: math.hpp:43
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::triangleFunctions
Definition: triangleFunctions.hpp:26