20 #ifndef GEOS_FINITEVOLUME_BOUNDARYSTENCIL_HPP_
21 #define GEOS_FINITEVOLUME_BOUNDARYSTENCIL_HPP_
36 template<
typename VIEWTYPE >
68 real64 ( &dWeight_dCoef )[3] )
const;
135 localIndex const *
const elementRegionIndices,
136 localIndex const *
const elementSubRegionIndices,
138 real64 const *
const weights,
148 real64 const (&faceNormal)[3],
149 real64 const (&cellToFaceVec)[3] );
193 real64 (& dWeight_dCoef)[3] )
const
200 real64 faceNormal[3] = LVARRAY_TENSOROPS_INIT_LOCAL_3( m_faceNormal[iconn] );
201 real64 const cellToFace[3] = LVARRAY_TENSOROPS_INIT_LOCAL_3( m_cellToFaceVec[iconn] );
205 auto const compute = [&]
208 LvArray::tensorOps::hadamardProduct< 3 >( faceConormal, coef, faceNormal );
209 weight = LvArray::tensorOps::AiBi< 3 >( cellToFace, faceConormal );
210 LvArray::tensorOps::hadamardProduct< 3 >( dWeight_dCoef, cellToFace, faceNormal );
218 LvArray::tensorOps::copy< 3 >( faceNormal, cellToFace );
225 LvArray::tensorOps::scale< 3 >( dWeight_dCoef, mult );
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
#define GEOS_FORCE_INLINE
Marks a function or lambda for inlining.
Provides management of the boundary stencil points (stencils used to prescribe boundary conditions on...
virtual void add(localIndex const numPts, localIndex const *const elementRegionIndices, localIndex const *const elementSubRegionIndices, localIndex const *const elementIndices, real64 const *const weights, localIndex const connectorIndex) override
Add an entry to the stencil.
BoundaryStencil()
Constructor.
virtual localIndex size() const override
Give the number of stencil entries.
void addVectors(real64 const &transMultiplier, real64 const (&faceNormal)[3], real64 const (&cellToFaceVec)[3])
Add the vectors need to compute the transmissiblity to the Stencil.
constexpr localIndex stencilSize(localIndex const index) const
Gives the number of points in a stencil entry.
KernelWrapper createKernelWrapper() const
Create an update kernel wrapper.
GEOS_HOST_DEVICE void computeWeights(localIndex const iconn, CoefficientAccessor< arrayView3d< real64 const > > const &coefficient, real64 &weight, real64(&dWeight_dCoef)[3]) const
Compute weights and derivatives w.r.t to the coefficient.
GEOS_HOST_DEVICE GEOS_FORCE_INLINE localIndex size() const
Give the number of stencil entries.
ElementRegionManager::ElementViewConst< VIEWTYPE > CoefficientAccessor
Coefficient view accessory type.
BoundaryStencilWrapper(IndexContainerType const &elementRegionIndices, IndexContainerType const &elementSubRegionIndices, IndexContainerType const &elementIndices, WeightContainerType const &weights, arrayView2d< real64, nodes::REFERENCE_POSITION_USD > const &faceNormal, arrayView2d< real64, nodes::REFERENCE_POSITION_USD > const &cellToFaceVec, arrayView1d< real64 > const &weightMultiplier)
Constructor.
GEOS_HOST_DEVICE constexpr GEOS_FORCE_INLINE localIndex stencilSize(localIndex const index) const
Give the number of points in a stencil entry.
GEOS_HOST_DEVICE constexpr GEOS_FORCE_INLINE localIndex numPointsInFlux(localIndex const index) const
Give the number of points between which the flux is.
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
Provides management of the interior stencil points when using Two-Point flux approximation.
TRAITS::IndexContainerType m_elementRegionIndices
The container for the element region indices for each point in each stencil.
TRAITS::IndexContainerViewConstType m_elementRegionIndices
The container for the element region indices for each point in each stencil.
TRAITS::IndexContainerViewConstType m_elementSubRegionIndices
The container for the element sub region indices for each point in each stencil.
TRAITS::WeightContainerViewType m_weights
The container for the weights for each point in each stencil.
TRAITS::IndexContainerViewConstType m_elementIndices
The container for the element indices for each point in each stencil.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Defines the order of element/face in the stencil.
static constexpr localIndex ELEM
Order of element index in stencil.
static constexpr localIndex FACE
Order of face index in stencil.
CONTAINER< localIndex > IndexContainerType
The array type that will be used to store the indices of the stencil contributors.
static constexpr localIndex maxStencilSize
Maximum number of points in a stencil.
CONTAINER< real64 > WeightContainerType
The array type that is used to store the weights of the stencil contributors.
static constexpr localIndex maxNumPointsInFlux
Maximum number of points the flux.