20 #ifndef GEOS_FINITEVOLUME_EMBEDDEDSURFACETOCELLSTENCIL_HPP_
21 #define GEOS_FINITEVOLUME_EMBEDDEDSURFACETOCELLSTENCIL_HPP_
36 template<
typename VIEWTYPE >
99 real64 ( &dWeight_dVar )[1][2] )
const;
112 real64 ( &dWeight_dVar )[1][2] )
const;
130 real64 ( &dWeight_dVar1 )[1][2],
131 real64 ( &dWeight_dVar2 )[1][2] )
const;
140 real64 ( & stabilizationWeight )[1][2] )
const
170 virtual void move( LvArray::MemorySpace
const space )
override;
173 localIndex const *
const elementRegionIndices,
174 localIndex const *
const elementSubRegionIndices,
176 real64 const *
const weights,
216 real64 ( & weight )[1][2],
217 real64 ( & dWeight_dVar )[1][2] )
const
228 real64 const t0 =
m_weights[iconn][0] * LvArray::tensorOps::l2Norm< 3 >( coefficient[er0][esr0][ei0][0] );
230 real64 const t1 =
m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2];
232 real64 const sumOfTrans = t0+t1;
233 real64 const value = t0*t1/sumOfTrans;
235 weight[0][0] = value;
236 weight[0][1] = -value;
239 real64 const dt0 =
m_weights[iconn][0] * dCoeff_dVar[er0][esr0][ei0][0][0];
240 real64 const dt1 =
m_weights[iconn][1] * dCoeff_dVar[er1][esr1][ei1][0][2];
242 dWeight_dVar[0][0] = ( dt0 * t1 * sumOfTrans - dt0 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
243 dWeight_dVar[0][1] = ( t0 * dt1 * sumOfTrans - dt1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
250 real64 ( & weight )[1][2],
251 real64 ( & dWeight_dVar )[1][2] )
const
256 real64 const sumOfTrans = t0+t1;
257 real64 const value = t0*t1/sumOfTrans;
259 weight[0][0] = value;
260 weight[0][1] = -value;
262 dWeight_dVar[0][0] = 0;
263 dWeight_dVar[0][1] = 0;
274 real64 (& dWeight_dVar1 )[1][2],
275 real64 (& dWeight_dVar2 )[1][2] )
const
286 real64 const t0 =
m_weights[iconn][0] * LvArray::tensorOps::l2Norm< 3 >( coefficient[er0][esr0][ei0][0] );
288 real64 const t1 =
m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2];
290 real64 const sumOfTrans = t0+t1;
291 real64 const value = t0*t1/sumOfTrans;
293 weight[0][0] = value;
294 weight[0][1] = -value;
297 real64 const dt0_dVar1 =
m_weights[iconn][0] * dCoeff_dVar1[er0][esr0][ei0][0][0];
298 real64 const dt1_dVar1 =
m_weights[iconn][1] * dCoeff_dVar1[er1][esr1][ei1][0][2];
299 real64 const dt0_dVar2 =
m_weights[iconn][0] * dCoeff_dVar2[er0][esr0][ei0][0][0];
300 real64 const dt1_dVar2 =
m_weights[iconn][1] * dCoeff_dVar2[er1][esr1][ei1][0][2];
302 dWeight_dVar1[0][0] = ( dt0_dVar1 * t1 * sumOfTrans - dt0_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
303 dWeight_dVar1[0][1] = ( t0 * dt1_dVar1 * sumOfTrans - dt1_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
305 dWeight_dVar2[0][0] = ( dt0_dVar2 * t1 * sumOfTrans - dt0_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
306 dWeight_dVar2[0][1] = ( t0 * dt1_dVar2 * sumOfTrans - dt1_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans );
#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.
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
Provides management of the interior stencil points for a face elements when using Two-Point flux appr...
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.
constexpr localIndex stencilSize(localIndex const index) const
Give the number of points in a stencil entry.
virtual void move(LvArray::MemorySpace const space) override
Move the data arrays associated with the stencil to a specified memory space.
virtual localIndex size() const override
Return the stencil size.
KernelWrapper createKernelWrapper() const
Create an update kernel wrapper.
Provide access to the EmbeddedSurfaceToCellStencil that may be called from a kernel function.
GEOS_HOST_DEVICE constexpr GEOS_FORCE_INLINE localIndex stencilSize(localIndex const index) const
Give the number of stencil entries for the provided index.
ElementRegionManager::ElementViewConst< VIEWTYPE > CoefficientAccessor
Coefficient view accessory type.
EmbeddedSurfaceToCellStencilWrapper(IndexContainerType const &elementRegionIndices, IndexContainerType const &elementSubRegionIndices, IndexContainerType const &elementIndices, WeightContainerType const &weights)
Constructor.
GEOS_HOST_DEVICE void addHydraulicApertureContribution(localIndex const iconn, ElementRegionManager::ElementViewConst< arrayView1d< real64 const > > hydraulicAperture) const
Add the contribution of the aperture to the weight in the stencil (done after aperture update)
GEOS_HOST_DEVICE void removeHydraulicApertureContribution(localIndex const iconn, ElementRegionManager::ElementViewConst< arrayView1d< real64 const > > hydraulicAperture) const
Remove the contribution of the aperture from the weight in the stencil (done before aperture update)
GEOS_HOST_DEVICE void computeWeights(localIndex const iconn, CoefficientAccessor< arrayView3d< real64 const > > const &coefficient, CoefficientAccessor< arrayView3d< real64 const > > const &dCoeff_dVar, real64(&weight)[1][2], real64(&dWeight_dVar)[1][2]) const
Compute weigths and derivatives w.r.t to one variable.
GEOS_HOST_DEVICE void computeStabilizationWeights(localIndex iconn, real64(&stabilizationWeight)[1][2]) const
Compute the stabilization weights.
localIndex size() const
Give the number of stencil entries.
GEOS_HOST_DEVICE constexpr GEOS_FORCE_INLINE localIndex numPointsInFlux(localIndex const index) const
Give the number of points between which the flux is.
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.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
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.