20 #ifndef GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1QUADRILATERALFACELAGRANGE1GAUSSLEGENDRE2_HPP_
21 #define GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1QUADRILATERALFACELAGRANGE1GAUSSLEGENDRE2_HPP_
63 template<
typename SubregionType >
189 real64 const qCoords[2] = { quadratureFactor *parentCoords0( q ),
190 quadratureFactor *parentCoords1( q ) };
215 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT,
bool UPPER >
222 real64 const & scaleFactor );
241 constexpr
static real64 parentArea = 4.0;
249 constexpr
static real64 quadratureFactor = 1.0 / 1.732050807568877293528;
258 template<
typename T >
261 constexpr
static T linearMap( T
const i, T
const j )
276 return -1.0 + 2.0 * (a & 1);
289 return -1.0 + ( a & 2 );
296 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT,
bool UPPER >
302 [maxSupportPoints * NUMDOFSPERTRIALSUPPORTPOINT]
303 [maxSupportPoints * NUMDOFSPERTRIALSUPPORTPOINT],
304 real64 const & scaleFactor )
321 ( 1 + quadratureFactor*coords[0]*parentCoords0( a ) ) *
322 ( 1 + quadratureFactor*coords[1]*parentCoords1( a ) );
335 ( 1 + quadratureFactor*parentCoords0( q )*parentCoords0( a ) ) *
336 ( 1 + quadratureFactor*parentCoords1( q )*parentCoords1( a ) );
345 real64 ( & N )[numNodes] )
347 return calcN( q, N );
357 real64 const (&X)[numNodes][3] )
359 real64 dXdXi[3][2] = {{0}};
361 real64 const quadratureCoords[2] = { quadratureFactor *parentCoords0( q ),
362 quadratureFactor *parentCoords1( q ) };
364 real64 const psi0[2] = { 0.5*( 1.0 - quadratureCoords[0] ),
365 0.5*( 1.0 + quadratureCoords[0] ) };
366 real64 const psi1[2] = { 0.5*( 1.0 - quadratureCoords[1] ),
367 0.5*( 1.0 + quadratureCoords[1] ) };
368 constexpr
real64 dpsi[2] = { -0.5, 0.5 };
370 for(
int a=0; a<2; ++a )
372 for(
int b=0; b<2; ++b )
374 real64 const dNdXi[2] = { dpsi[a] * psi1[b],
377 localIndex const nodeIndex = linearMap( a, b );
379 for(
int i = 0; i < 3; ++i )
381 for(
int j = 0; j < 2; ++j )
383 dXdXi[i][j] = dXdXi[i][j] + dNdXi[ j ] * X[nodeIndex][i];
389 real64 const detJ = pow( dXdXi[1][0] * dXdXi[2][1] - dXdXi[2][0] * dXdXi[1][1], 2.0 )
390 + pow( dXdXi[2][0] * dXdXi[0][1] - dXdXi[0][0] * dXdXi[2][1], 2.0 )
391 + pow( dXdXi[0][0] * dXdXi[1][1] - dXdXi[1][0] * dXdXi[0][1], 2.0 );
393 return sqrt( detJ ) * weight;
#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_UNUSED_PARAM(X)
Mark an unused argument and silence compiler warnings.
Device-compatible (non virtual) Base class for all finite element formulations.
constexpr static localIndex numQuadraturePoints
The number of quadrature points per element.
constexpr static localIndex maxSupportPoints
The maximum number of support points per element.
constexpr static localIndex numNodes
The number of nodes per element.
GEOS_HOST_DEVICE FiniteElementBase_impl & operator=(FiniteElementBase_impl const &)=default
Default copy assignment operator.
Base class for FEM element implementations.
static GEOS_HOST_DEVICE real64 transformedQuadratureWeight(localIndex const q, real64 const (&X)[numNodes][3])
Calculate the integration weights for a quadrature point.
static GEOS_HOST_DEVICE void getPermutation(int(&permutation)[numNodes])
Calculate the node permutation between the parent element and the geometric element....
static GEOS_HOST_DEVICE localIndex getNumQuadraturePoints(StackVariables const &stack)
Get the number of quadrature points.
static GEOS_HOST_DEVICE void calcN(localIndex const q, real64(&N)[numNodes])
Calculate shape functions values for each support point at a quadrature point.
static GEOS_HOST_DEVICE void addGradGradStabilization(StackVariables const &stack, real64(&matrix)[maxSupportPoints *NUMDOFSPERTRIALSUPPORTPOINT][maxSupportPoints *NUMDOFSPERTRIALSUPPORTPOINT], real64 const &scaleFactor)
Empty method, here for compatibility with methods that require a stabilization of the grad-grad bilin...
static GEOS_HOST_DEVICE void calcBubbleN(localIndex const q, real64(&N)[1])
Calculate shape bubble functions values at a quadrature point.
DO_NOT_DOCUMENT static GEOS_HOST_DEVICE localIndex getNumQuadraturePoints()
Get the number of quadrature points.
static GEOS_HOST_DEVICE void calcN(localIndex const q, StackVariables const &stack, real64(&N)[numNodes])
Calculate shape functions values for each support point at a quadrature point.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void calcBubbleN(real64 const (&pointCoord)[2], real64(&N)[1])
Calculate shape bubble functions values at a given point in the parent space.
static GEOS_HOST_DEVICE localIndex getNumSupportPoints()
Get the number of support points.
typename Base::template MeshData< SubregionType > MeshData
Mesh data structure for the element.
static GEOS_HOST_DEVICE void calcN(real64 const (&coords)[2], real64(&N)[numNodes])
Calculate shape functions values at a single point.
static GEOS_HOST_DEVICE localIndex getNumSupportPoints(StackVariables const &stack)
Get the number of support points.
static GEOS_HOST_DEVICE localIndex getMaxSupportPoints()
Get the maximum number of support points.
H1_QuadrilateralFace_Lagrange1_GaussLegendre2_impl * getImpl()
Get the device-compatible implementation type.
H1_QuadrilateralFace_Lagrange1_GaussLegendre2_impl const * getImpl() const
Get the device-compatible implementation type.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Kernel variables (dof numbers, jacobian and residual) located on the stack.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void valueBubble(real64 const (&coords)[2], real64(&N)[1])
The value of the bubble basis function evaluated at a point along the axes.