20 #ifndef GEOS_VIRTUALELEMENT_CONFORMINGVIRTUALELEMENTORDER1_HPP_
21 #define GEOS_VIRTUALELEMENT_CONFORMINGVIRTUALELEMENTORDER1_HPP_
24 #include "codingUtilities/traits.hpp"
38 template< localIndex MAXCELLNODES, localIndex MAXFACENODES >
45 template<
typename SUBREGION_TYPE >
48 template<
typename SUBREGION_TYPE >
95 template<
typename SUBREGION_TYPE >
172 J[i][j] = ( i == j ) ? 1.0 : 0.0;
234 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT, localIndex MAXSUPPORTPOINTS,
bool UPPER >
239 [MAXSUPPORTPOINTS * NUMDOFSPERTRIALSUPPORTPOINT]
240 [MAXSUPPORTPOINTS * NUMDOFSPERTRIALSUPPORTPOINT],
241 real64 const & scaleFactor )
249 for(
localIndex d = 0; d < NUMDOFSPERTRIALSUPPORTPOINT; ++d )
251 matrix[i*NUMDOFSPERTRIALSUPPORTPOINT + d][j*NUMDOFSPERTRIALSUPPORTPOINT + d] += contribution;
269 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT, localIndex MAXSUPPORTPOINTS >
273 real64 const ( &dofs )[MAXSUPPORTPOINTS][NUMDOFSPERTRIALSUPPORTPOINT],
274 real64 ( & targetVector )[MAXSUPPORTPOINTS][NUMDOFSPERTRIALSUPPORTPOINT],
275 real64 const scaleFactor )
277 for(
localIndex d = 0; d < NUMDOFSPERTRIALSUPPORTPOINT; ++d )
315 template<
typename SUBREGION_TYPE >
320 SUBREGION_TYPE
const & cellSubRegion,
325 meshData.
cellToNodeMap = cellSubRegion.nodeList().toViewConst();
326 meshData.
cellToFaceMap = cellSubRegion.faceList().toViewConst();
333 meshData.
cellCenters = cellSubRegion.getElementCenter();
334 meshData.
cellVolumes = cellSubRegion.getElementVolume();
344 template<
typename SUBREGION_TYPE >
356 computeProjectors< SUBREGION_TYPE >( cellIndex,
393 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
407 real64 (& samplingPointCoord)[3] )
424 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
443 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
465 GEOS_ERROR(
"No reference element map is defined for VEM classes" );
490 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
516 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
539 GEOS_ERROR(
"VEM functions have to be called with the StackVariables syntax" );
551 localIndex const (&faceToNodes)[MAXFACENODES],
552 localIndex const (&faceToEdges)[MAXFACENODES],
555 real64 const (&faceCenter)[3],
556 real64 const (&faceNormal)[3],
558 real64 const & invCellDiameter,
559 real64 const (&cellCenter)[3],
560 real64 ( &basisIntegrals )[MAXFACENODES],
561 real64 ( &threeDMonomialIntegrals )[3] );
572 template<
typename SUBREGION_TYPE >
576 computeProjectors(
localIndex const & cellIndex,
578 InputCellToNodeMap< SUBREGION_TYPE >
const & cellToNodeMap,
579 InputCellToFaceMap< SUBREGION_TYPE >
const & elementToFaceMap,
586 real64 const (&cellCenter)[3],
587 real64 const & cellVolume,
589 real64 & quadratureWeight,
590 real64 ( &basisFunctionsIntegralMean )[MAXCELLNODES],
591 real64 ( &stabilizationMatrix )[MAXCELLNODES][MAXCELLNODES],
592 real64 ( &basisDerivativesIntegralMean )[MAXCELLNODES][3]
595 template< localIndex DIMENSION,
typename POINT_COORDS_TYPE >
598 static real64 computeDiameter( POINT_COORDS_TYPE points,
602 for(
localIndex numPoint = 0; numPoint < numPoints; ++numPoint )
604 for(
localIndex numOthPoint = 0; numOthPoint < numPoint; ++numOthPoint )
606 real64 candidateDiameter = 0.0;
609 real64 coordDiff = points[numPoint][i] - points[numOthPoint][i];
610 candidateDiameter += coordDiff * coordDiff;
612 if( diameter < candidateDiameter )
614 diameter = candidateDiameter;
618 return LvArray::math::sqrt< real64 >( diameter );
621 template< localIndex DIMENSION,
typename POINT_COORDS_TYPE,
typename POINT_
SELECTION_TYPE >
624 static real64 computeDiameter( POINT_COORDS_TYPE points,
625 POINT_SELECTION_TYPE selectedPoints,
629 for(
localIndex numPoint = 0; numPoint < numSelectedPoints; ++numPoint )
631 for(
localIndex numOthPoint = 0; numOthPoint < numPoint; ++numOthPoint )
633 real64 candidateDiameter = 0.0;
636 real64 coordDiff = points[selectedPoints[numPoint]][i] -
637 points[selectedPoints[numOthPoint]][i];
638 candidateDiameter += coordDiff * coordDiff;
640 if( diameter < candidateDiameter )
642 diameter = candidateDiameter;
646 return LvArray::math::sqrt< real64 >( diameter );
653 template< localIndex MAXCELLNODES, localIndex MAXFACENODES >
697 virtual ~ConformingVirtualElementOrder1() override final = default;
704 #if !defined( GEOS_USE_HIP )
710 #if !defined( GEOS_USE_HIP )
726 #if !defined( GEOS_USE_HIP )
734 #if !defined( GEOS_USE_HIP )
740 #if !defined( GEOS_USE_HIP )
756 #if !defined( GEOS_USE_HIP )
#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.
#define GEOS_ERROR(...)
Raise a hard error and terminate the program.
This class provides an interface to ObjectManagerBase in order to manage edge data.
NodeMapType & nodeList()
Get a node list.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
array2d< real64 > & faceNormal()
Get a mutable accessor to an array containing all the face normals.
array1d< real64 > & faceArea()
Get a mutable accessor to an array containing all the face area.
array2d< real64 > & faceCenter()
Get a mutable accessor to an array containing all the face center.
NodeMapType & nodeList()
Get a mutable accessor to a map containing the list of each nodes for each faces.
EdgeMapType & edgeList()
Get a mutable accessor to a map containing the list of each edges for each faces.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Device-compatible (non virtual) Base class for all finite element formulations.
constexpr static localIndex numSupportPoints
The number of support points per element.
Base class for FEM element implementations.
array2d< real64, nodes::REFERENCE_POSITION_PERM > & referencePosition()
Get the mutable reference position array. This table will contain all the node coordinates.
GEOS_HOST_DEVICE real64 transformedQuadratureWeight(localIndex const q, real64 const (&X)[maxSupportPoints][3]) const
This function returns an error, since to get the quadrature weight with VEM you have to use the Stack...
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void getSamplingPointCoordInParentSpace(int const &linearIndex, real64(&samplingPointCoord)[3])
Get the Sampling Point Coord In the Parent Space.
static GEOS_HOST_DEVICE real64 invJacobianTransformation(int const q, real64 const (&X)[numNodes][3], real64(&J)[3][3])
This function returns an error, since there is no reference element defined in the VEM context....
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE real64 calcJacobian(localIndex const q, real64 const (&X)[numNodes][3], real64(&J)[3][3])
Calculate the Jacobian matrix at a quadrature point.
static GEOS_HOST_DEVICE localIndex getNumSupportPoints()
This function returns an error, since to get the number of support points with VEM you have to use th...
static GEOS_HOST_DEVICE void calcN(localIndex const q, real64(&N)[maxSupportPoints])
This function returns an error, since to get projection of basis functions with VEM you have to use t...
static GEOS_HOST_DEVICE void calcN(real64 const (&coords)[3], real64(&N)[maxSupportPoints])
This function returns an error, since to get projection of gradients with VEM you have to use the Sta...
static GEOS_HOST_DEVICE real64 calcGradN(localIndex const q, real64 const (&X)[maxSupportPoints][3], real64(&gradN)[maxSupportPoints][3])
This function returns an error, since to get projection of gradients with VEM you have to use the Sta...
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.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.