20 #ifndef GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1QUADRILATERALFACELAGRANGE1GAUSSLEGENDRE2_HPP_
21 #define GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1QUADRILATERALFACELAGRANGE1GAUSSLEGENDRE2_HPP_
169 real64 const qCoords[2] = { quadratureFactor *parentCoords0( q ),
170 quadratureFactor *parentCoords1( q ) };
195 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT,
bool UPPER >
202 real64 const & scaleFactor );
221 constexpr
static real64 parentArea = 4.0;
229 constexpr
static real64 quadratureFactor = 1.0 / 1.732050807568877293528;
238 template<
typename T >
241 constexpr
static T linearMap( T
const i, T
const j )
256 return -1.0 + 2.0 * (a & 1);
269 return -1.0 + ( a & 2 );
276 template< localIndex NUMDOFSPERTRIALSUPPORTPOINT,
bool UPPER >
282 [maxSupportPoints * NUMDOFSPERTRIALSUPPORTPOINT]
283 [maxSupportPoints * NUMDOFSPERTRIALSUPPORTPOINT],
284 real64 const & scaleFactor )
301 ( 1 + quadratureFactor*coords[0]*parentCoords0( a ) ) *
302 ( 1 + quadratureFactor*coords[1]*parentCoords1( a ) );
315 ( 1 + quadratureFactor*parentCoords0( q )*parentCoords0( a ) ) *
316 ( 1 + quadratureFactor*parentCoords1( q )*parentCoords1( a ) );
325 real64 ( & N )[numNodes] )
327 return calcN( q, N );
337 real64 const (&X)[numNodes][3] )
339 real64 dXdXi[3][2] = {{0}};
341 real64 const quadratureCoords[2] = { quadratureFactor *parentCoords0( q ),
342 quadratureFactor *parentCoords1( q ) };
344 real64 const psi0[2] = { 0.5*( 1.0 - quadratureCoords[0] ),
345 0.5*( 1.0 + quadratureCoords[0] ) };
346 real64 const psi1[2] = { 0.5*( 1.0 - quadratureCoords[1] ),
347 0.5*( 1.0 + quadratureCoords[1] ) };
348 constexpr
real64 dpsi[2] = { -0.5, 0.5 };
350 for(
int a=0; a<2; ++a )
352 for(
int b=0; b<2; ++b )
354 real64 const dNdXi[2] = { dpsi[a] * psi1[b],
357 localIndex const nodeIndex = linearMap( a, b );
359 for(
int i = 0; i < 3; ++i )
361 for(
int j = 0; j < 2; ++j )
363 dXdXi[i][j] = dXdXi[i][j] + dNdXi[ j ] * X[nodeIndex][i];
369 real64 const detJ = pow( dXdXi[1][0] * dXdXi[2][1] - dXdXi[2][0] * dXdXi[1][1], 2.0 )
370 + pow( dXdXi[2][0] * dXdXi[0][1] - dXdXi[0][0] * dXdXi[2][1], 2.0 )
371 + pow( dXdXi[0][0] * dXdXi[1][1] - dXdXi[1][0] * dXdXi[0][1], 2.0 );
373 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.
Base class for FEM element implementations.
constexpr static localIndex maxSupportPoints
The maximum number of support points per element.
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.
constexpr static localIndex numNodes
The number of nodes/support points per element.
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.
virtual GEOS_HOST_DEVICE localIndex getNumSupportPoints() const override
Virtual getter for the number of support points per element.
static GEOS_HOST_DEVICE localIndex getNumSupportPoints(StackVariables const &stack)
Get the number of support 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.
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.
virtual GEOS_HOST_DEVICE localIndex getMaxSupportPoints() const override
Get the maximum number of support points for this element.
static GEOS_HOST_DEVICE void calcBubbleN(localIndex const q, real64(&N)[1])
Calculate shape bubble functions values at a quadrature point.
constexpr static localIndex numQuadraturePoints
The number of quadrature points per 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 real64 transformedQuadratureWeight(localIndex const q, real64 const (&X)[numNodes][3])
Calculate the integration weights for 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...
virtual GEOS_HOST_DEVICE localIndex getNumQuadraturePoints() const override
Virtual getter for the number of quadrature points per element.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Kernel variables allocated 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.