19 #ifndef GEOS_MESH_UTILITIES_CICOMPUTATIONKERNEL_HPP_
20 #define GEOS_MESH_UTILITIES_CICOMPUTATIONKERNEL_HPP_
24 #include "finiteElement/FiniteElementDispatch.hpp"
25 #include "common/GEOS_RAJA_Interface.hpp"
27 #include "mesh/CellElementSubRegion.hpp"
39 template<
typename FE_TYPE >
55 m_finiteElementSpace( finiteElementSpace ),
56 m_elementType( elementSubRegion.getElementType() ),
57 m_X( nodeManager.referencePosition() ),
58 m_elemsToNodes( elementSubRegion.nodeList().toViewConst() ),
59 m_fracturedElems( elementSubRegion.fracturedElementsList().toViewConst()),
60 m_cellsToEmbeddedSurfaces( elementSubRegion.embeddedSurfacesList().toViewConst() ),
61 m_normalVector( embeddedSurfSubRegion.getNormalVector().toViewConst()),
62 m_fracCenter( embeddedSurfSubRegion.getElementCenter().toViewConst()),
63 m_fractureSurfaceArea( embeddedSurfSubRegion.getElementArea().toViewConst() ),
64 m_connectivityIndex( embeddedSurfSubRegion.getConnectivityIndex() )
102 template<
typename POLICY,
103 typename KERNEL_TYPE >
108 forAll< POLICY >( kernelComponent.m_fracturedElems.size(),
112 localIndex k = kernelComponent.m_fracturedElems[i];
115 kernelComponent.setup( k, stack );
117 real64 averageDistance = 0.0;
124 kernelComponent.setConnectivityIndex( k, averageDistance );
140 localIndex const localNodeIndex = m_elemsToNodes( k, a );
142 for(
int i=0; i<3; ++i )
144 stack.
xLocal[ a ][ i ] = m_X[ localNodeIndex ][ i ];
158 real64 const (&point)[3] )
const
160 localIndex const embSurfIndex = m_cellsToEmbeddedSurfaces[k][0];
161 real64 pointToFracCenter[3];
162 LvArray::tensorOps::copy< 3 >( pointToFracCenter, point );
163 LvArray::tensorOps::subtract< 3 >( pointToFracCenter, m_fracCenter[embSurfIndex] );
164 return LvArray::math::abs( LvArray::tensorOps::AiBi< 3 >( pointToFracCenter, m_normalVector[embSurfIndex] ));
178 real64 parentSamplingPointCoord[3] = {0.0, 0.0, 0.0};
179 FE_TYPE::getSamplingPointCoordInParentSpace( np, parentSamplingPointCoord );
183 FE_TYPE::calcN( parentSamplingPointCoord, N );
190 for(
int i =0; i < 3; i++ )
205 real64 const averageDistance )
const
207 localIndex const embSurfIndex = m_cellsToEmbeddedSurfaces[k][0];
208 m_connectivityIndex[embSurfIndex] = 2. * m_fractureSurfaceArea[embSurfIndex] / averageDistance;
214 FE_TYPE
const & m_finiteElementSpace;
223 traits::ViewTypeConst< typename CellElementSubRegion::NodeMapType::base_type >
const m_elemsToNodes;
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
Kernel to compute EDFM connectivity index.
static constexpr int numNodesPerElem
number of nodes per element
GEOS_HOST_DEVICE void setConnectivityIndex(localIndex const k, real64 const averageDistance) const
Set the Connectivity Index.
static void launchCIComputationKernel(KERNEL_TYPE &kernelComponent)
launch of CI calculation
CIcomputationKernel(FE_TYPE const &finiteElementSpace, NodeManager const &nodeManager, CellElementSubRegion const &elementSubRegion, EmbeddedSurfaceSubRegion &embeddedSurfSubRegion)
Construct a new CIcomputationKernel object.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
set up the kernel object by copying global values in the stack.
GEOS_HOST_DEVICE real64 computeDistance(localIndex const k, real64 const (&point)[3]) const
computes the distance between a point inside the element and the cut surface k.
static constexpr int numSamplingPoints
number of sampling points per element
GEOS_HOST_DEVICE void samplingPointCoord(integer const np, StackVariables &stack) const
computes coordinates of the sampling point in the physical space.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
double real64
64-bit floating point type.
std::int32_t integer
Signed integer type.
ElementType
Denotes type of cell/element shape.
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
real64 xLocal[numNodesPerElem][3]
C-array stack storage for element local the nodal positions.
GEOS_HOST_DEVICE StackVariables()
Constructor.
real64 samplingPointCoord[3]
C-array stack storage for sampling points coordinates.