# PhasicFlow: src/phasicFlow/structuredData/trisurfaceStructure/triSurfaceKernels.hpp Source File

triSurfaceKernels.hpp
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.
-----------------------------------------------------------------------------*/
#ifndef __triSurfaceKernels_hpp__
#define __triSurfaceKernels_hpp__
#include "Fields.hpp"
#include "triangleFunctions.hpp"
namespace pFlow::triSurfaceKernels
{
INLINE_FUNCTION_H
bool calculateArea(const realx3Field_D& points, const int32x3Field_D& vertices, realField_D& area)
{
auto numTri = vertices.size();
auto areaD = area.deviceVectorAll();
auto pointsD = points.deviceVectorAll();
auto verticesD = vertices.deviceVectorAll();
Kokkos::parallel_for(
"pFlow::triSurfaceKernels::calculateArea",
numTri,
LAMBDA_HD(int32 i){
auto v = verticesD[i];
areaD[i] = pFlow::triangleFunctions::triangleSurface(
pointsD[v.x()],
pointsD[v.y()],
pointsD[v.z()]);
});
return true;
}
}
#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