PhasicFlow
v0.1
www.cemf.ir
triSurfaceKernels.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
22
#ifndef __triSurfaceKernels_hpp__
23
#define __triSurfaceKernels_hpp__
24
25
#include "
Fields.hpp
"
26
#include "
triangleFunctions.hpp
"
27
28
namespace
pFlow::triSurfaceKernels
29
{
30
31
INLINE_FUNCTION_H
32
bool
calculateArea
(
const
realx3Field_D
& points,
const
int32x3Field_D
& vertices,
realField_D
& area)
33
{
34
auto
numTri = vertices.
size
();
35
auto
areaD = area.
deviceVectorAll
();
36
auto
pointsD = points.
deviceVectorAll
();
37
auto
verticesD = vertices.
deviceVectorAll
();
38
39
Kokkos::parallel_for(
40
"pFlow::triSurfaceKernels::calculateArea"
,
41
numTri,
42
LAMBDA_HD
(
int32
i){
43
auto
v = verticesD[i];
44
areaD[i] =
pFlow::triangleFunctions::triangleSurface
(
45
pointsD[v.x()],
46
pointsD[v.y()],
47
pointsD[v.z()]);
48
});
49
50
return
true
;
51
}
52
53
54
}
55
56
#endif
triangleFunctions.hpp
pFlow::triangleFunctions::triangleSurface
INLINE_FUNCTION_HD real triangleSurface(const realx3 &p1, const realx3 &p2, const realx3 &p3)
Definition:
triangleFunctions.hpp:30
pFlow::Field< VectorSingle, realx3 >
pFlow::triSurfaceKernels
Definition:
triSurfaceKernels.hpp:28
pFlow::int32
int int32
Definition:
builtinTypes.hpp:53
Fields.hpp
pFlow::triSurfaceKernels::calculateArea
INLINE_FUNCTION_H bool calculateArea(const realx3Field_D &points, const int32x3Field_D &vertices, realField_D &area)
Definition:
triSurfaceKernels.hpp:32
INLINE_FUNCTION_H
#define INLINE_FUNCTION_H
Definition:
pFlowMacros.hpp:53
LAMBDA_HD
#define LAMBDA_HD
Definition:
pFlowMacros.hpp:54
pFlow::VectorSingle::size
INLINE_FUNCTION_H size_t size() const
Definition:
VectorSingle.hpp:360
pFlow::VectorSingle::deviceVectorAll
INLINE_FUNCTION_H viewType & deviceVectorAll()
Definition:
VectorSingle.hpp:295
src
phasicFlow
structuredData
trisurfaceStructure
triSurfaceKernels.hpp
Generated by
1.8.17