20 #ifndef GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1PYRAMIDLAGRANGE1GAUSS5_HPP_
21 #define GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1PYRAMIDLAGRANGE1GAUSS5_HPP_
71 template<
typename SUBREGION_TYPE >
131 GEOS_ERROR(
"Unsupported bubble functions for pyramid elements" );
147 GEOS_ERROR(
"Unsupported bubble functions for pyramid elements" );
263 jacobianTransformation( q, X, J );
264 return LvArray::tensorOps::invert< 3 >( J );
269 constexpr
static real64 weight = 81.0 / 100.0;
272 constexpr
static real64 weightDelta = 125.0 / 27.0 - weight;
277 constexpr
static real64 quadratureCrossSectionCoord = 0.584237394672177;
281 constexpr
static real64 quadratureLongitudinalCoordNeg = -2.0 / 3.0;
285 constexpr
static real64 quadratureLongitudinalCoordDelta = 16.0 / 15.0;
294 template<
typename T >
297 constexpr
static T linearMap( T
const i, T
const j )
312 return -1.0 + 2.0 * ( a & 1 ) + 0.25 * ( a & 4 );
325 return -1.0 + ( a & 2 ) + 0.25 * ( a & 4 );
338 return -1.0 + 0.5 * ( a & 4 );
351 return parentCoords0( q ) * quadratureCrossSectionCoord;
364 return parentCoords1( q ) * quadratureCrossSectionCoord;
377 return quadratureLongitudinalCoordNeg + 0.5 * ( 1 + parentCoords2( q ) ) * quadratureLongitudinalCoordDelta;
389 return weight + 0.5 * ( 1 + parentCoords2( q ) ) * weightDelta;
399 static void jacobianTransformation(
int const q,
414 applyJacobianTransformationToShapeFunctionsDerivatives(
int const q,
415 real64 const ( &invJ )[3][3],
425 H1_Pyramid_Lagrange1_Gauss5_impl::
426 jacobianTransformation(
int const q,
427 real64 const (&X)[numNodes][3],
430 real64 const quadratureCoords[3] = { quadratureParentCoords0( q ),
431 quadratureParentCoords1( q ),
432 quadratureParentCoords2( q ) };
434 real64 const psi0[2] = { 0.5 - 0.5*quadratureCoords[0],
435 0.5 + 0.5*quadratureCoords[0] };
436 real64 const psi1[2] = { 0.5 - 0.5*quadratureCoords[1],
437 0.5 + 0.5*quadratureCoords[1] };
438 real64 const psi2 = 0.5 - 0.5*quadratureCoords[2];
439 constexpr
real64 dpsi[2] = { -0.5, 0.5 };
446 real64 const dNdXi[3] = { dpsi[a] * psi1[b] * psi2,
447 psi0[a] * dpsi[b] * psi2,
448 psi0[a] * psi1[b] * dpsi[0] };
449 localIndex const nodeIndex = linearMap( a, b );
450 for(
int i = 0; i < 3; ++i )
452 for(
int j = 0; j < 3; ++j )
454 J[i][j] = J[i][j] + dNdXi[ j ] * X[nodeIndex][i];
461 for(
int i = 0; i < 3; ++i )
463 J[i][2] = J[i][2] + dpsi[1] * X[4][i];
472 H1_Pyramid_Lagrange1_Gauss5_impl::
473 applyJacobianTransformationToShapeFunctionsDerivatives(
int const q,
474 real64 const ( &invJ )[3][3],
475 real64 (& gradN)[numNodes][3] )
477 real64 const quadratureCoords[3] = { quadratureParentCoords0( q ),
478 quadratureParentCoords1( q ),
479 quadratureParentCoords2( q ) };
481 real64 const psi0[2] = { 0.5*( 1.0 - quadratureCoords[0] ),
482 0.5*( 1.0 + quadratureCoords[0] ) };
483 real64 const psi1[2] = { 0.5*( 1.0 - quadratureCoords[1] ),
484 0.5*( 1.0 + quadratureCoords[1] ) };
485 real64 const psi2 = 0.5*( 1.0 - quadratureCoords[2]);
486 constexpr
real64 dpsi[2] = { -0.5, 0.5 };
493 real64 const dNdXi[3] = { dpsi[a] * psi1[b] * psi2,
494 psi0[a] * dpsi[b] * psi2,
495 psi0[a] * psi1[b] * dpsi[0] };
496 localIndex const nodeIndex = linearMap( a, b );
497 for(
int i = 0; i < 3; ++i )
499 gradN[nodeIndex][i] = 0.0;
500 for(
int j = 0; j < 3; ++j )
502 gradN[nodeIndex][i] = gradN[nodeIndex][i] + dNdXi[ j ] * invJ[j][i];
509 for(
int i = 0; i < 3; ++i )
511 gradN[4][i] = dpsi[1] * invJ[2][i];
522 real64 ( & N )[numNodes] )
524 N[0] = 0.125*( 1.0 - pointCoord[0] ) * ( 1.0 - pointCoord[1] ) * ( 1.0 - pointCoord[2] );
525 N[1] = 0.125*( 1.0 + pointCoord[0] ) * ( 1.0 - pointCoord[1] ) * ( 1.0 - pointCoord[2] );
526 N[2] = 0.125*( 1.0 - pointCoord[0] ) * ( 1.0 + pointCoord[1] ) * ( 1.0 - pointCoord[2] );
527 N[3] = 0.125*( 1.0 + pointCoord[0] ) * ( 1.0 + pointCoord[1] ) * ( 1.0 - pointCoord[2] );
528 N[4] = 0.5*( 1.0 + pointCoord[2] );
536 real64 ( & N )[numNodes] )
538 real64 const xi[3] = { quadratureParentCoords0( q ),
539 quadratureParentCoords1( q ),
540 quadratureParentCoords2( q ) };
550 real64 ( & N )[numNodes] )
552 return calcN( q, N );
561 real64 const (&X)[numNodes][3],
564 for(
int i = 0; i < 3; ++i )
566 for(
int j = 0; j < 3; ++j )
571 jacobianTransformation( q, X, J );
572 real64 const detJ = LvArray::tensorOps::determinant< 3 >( J );
573 return detJ * quadratureWeight( q );
580 real64 const (&X)[numNodes][3],
590 real64 const (&X)[numNodes][3],
591 real64 (& gradN)[numNodes][3] )
595 jacobianTransformation( q, X, J );
597 real64 const detJ = LvArray::tensorOps::invert< 3 >( J );
599 applyJacobianTransformationToShapeFunctionsDerivatives( q, J, gradN );
601 return detJ * quadratureWeight( q );
608 real64 const (&X)[numNodes][3],
610 real64 ( & gradN )[numNodes][3] )
619 real64 const (&X)[numNodes][3],
620 real64 (& gradN)[numFaces][3] )
623 GEOS_ERROR(
"Unsupported bubble functions for pyramid elements" );
634 real64 const (&X)[numNodes][3] )
638 jacobianTransformation( q, X, J );
640 return LvArray::tensorOps::determinant< 3 >( J ) * quadratureWeight( q );
#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.
#define GEOS_ERROR(...)
Raise a hard error and terminate the program.
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.
constexpr static localIndex numFaces
The number of faces per element.
GEOS_HOST_DEVICE FiniteElementBase_impl & operator=(FiniteElementBase_impl const &)=default
Default copy assignment operator.
Base class for FEM element implementations.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE real64 calcJacobian(localIndex const q, real64 const (&X)[numNodes][3], StackVariables const &stack, real64(&J)[3][3])
Calculate the Jacobian matrix at a quadrature point.
static GEOS_HOST_DEVICE void calcFaceBubbleN(localIndex const q, real64(&N)[numFaces])
Calculate shape functions values for each support face at a quadrature point.
static GEOS_HOST_DEVICE real64 calcGradN(localIndex const q, real64 const (&X)[numNodes][3], real64(&gradN)[numNodes][3])
Calculate the shape functions derivatives wrt the physical coordinates.
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 void calcN(localIndex const q, StackVariables const &stack, real64(&N)[numNodes])
Calculate shape functions values for each support point at a quadrature point.
static GEOS_HOST_DEVICE real64 invJacobianTransformation(int const q, real64 const (&X)[numNodes][3], real64(&J)[3][3])
Calculates the isoparametric "Jacobian" transformation matrix/mapping from the parent space to the ph...
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 calcFaceBubbleN(real64 const (&pointCoord)[3], real64(&N)[numFaces])
Calculate shape functions values for each support face at a given point in the parent space.
static GEOS_HOST_DEVICE real64 calcGradFaceBubbleN(localIndex const q, real64 const (&X)[numNodes][3], real64(&gradN)[numFaces][3])
Calculate the shape bubble function derivatives wrt the physical coordinates.
DO_NOT_DOCUMENT GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void calcN(real64 const (&pointCoord)[3], 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 real64 transformedQuadratureWeight(localIndex const q, real64 const (&X)[numNodes][3], StackVariables const &stack)
Calculate the integration weights for a quadrature point.
static GEOS_HOST_DEVICE real64 calcGradN(localIndex const q, real64 const (&X)[numNodes][3], StackVariables const &stack, real64(&gradN)[numNodes][3])
Calculate the shape functions derivatives wrt the physical coordinates.
H1_Pyramid_Lagrange1_Gauss5_impl * getImpl()
Get the device-compatible implementation type.
H1_Pyramid_Lagrange1_Gauss5_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.
MeshData struct to hold mesh data.
struct to hold stack variables.