20 #ifndef GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1WEDGELAGRANGE1GAUSS6_HPP_ 
   21 #define GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_H1WEDGELAGRANGE1GAUSS6_HPP_ 
  132                                                   real64 (& samplingPointCoord)[3] )
 
  140     real64 const r = i0 * step;
 
  141     real64 const s = i1 * step;
 
  142     real64 const t = i2 * 2 * step;
 
  145       samplingPointCoord[0] = r;
 
  146       samplingPointCoord[1] = s;
 
  147       samplingPointCoord[2] = t;
 
  152       samplingPointCoord[0] = 1 - r;
 
  153       samplingPointCoord[1] = 1 - s;
 
  154       samplingPointCoord[2] = t;
 
  207     real64 const r  = pointCoord[0];
 
  208     real64 const s  = pointCoord[1];
 
  209     real64 const xi = pointCoord[2];
 
  232     real64 const pointCoord[3] = {quadratureParentCoords0( q ),
 
  233                                   quadratureParentCoords1( q ),
 
  234                                   quadratureParentCoords2( q )};
 
  322     jacobianTransformation( q, X, J );
 
  323     return LvArray::tensorOps::invert< 3 >( J );
 
  329   constexpr 
static real64 parentVolume = 1.0;
 
  336   constexpr 
static real64 quadratureCrossSectionCoord = 1.0 / 6.0;
 
  341   constexpr 
static real64 quadratureLongitudinalCoord = 1.0 / 1.732050807568877293528;
 
  350   template< 
typename T >
 
  353   constexpr 
static T linearMap( T 
const indexT, T 
const indexL )
 
  355     return 2 * indexT + indexL;
 
  368     return 0.5 * ( a & 2 );
 
  381     return 0.25 * ( a & 4 );
 
  394     return -1.0 + 2 * ( a & 1 );
 
  407     return quadratureCrossSectionCoord + 0.5  * parentCoords0( q );
 
  420     return quadratureCrossSectionCoord + 0.5  * parentCoords1( q );
 
  433     return parentCoords2( q ) * quadratureLongitudinalCoord;
 
  443   static void jacobianTransformation( 
int const q,
 
  458     applyJacobianTransformationToShapeFunctionsDerivatives( 
int const q,
 
  459                                                             real64 const ( &invJ )[3][3],
 
  469 H1_Wedge_Lagrange1_Gauss6::
 
  470   jacobianTransformation( 
int const q,
 
  471                           real64 const (&X)[numNodes][3],
 
  474   real64 const r  = quadratureParentCoords0( q );
 
  475   real64 const s  = quadratureParentCoords1( q );
 
  476   real64 const xi = quadratureParentCoords2( q );
 
  478   real64 const psiTRI[3] = { 1.0 - r - s, r, s };
 
  479   real64 const psiLIN[2] = { 0.5 - 0.5*xi, 0.5 + 0.5*xi };
 
  480   constexpr 
real64 dpsiTRI[2][3] = { { -1.0, 1.0, 0.0 }, { -1.0, 0.0, 1.0 } };
 
  481   constexpr 
real64 dpsiLIN[2] = { -0.5, 0.5 };
 
  487       real64 const dNdXi[3] = { dpsiTRI[0][a] * psiLIN[b],
 
  488                                 dpsiTRI[1][a] * psiLIN[b],
 
  489                                 psiTRI[a] * dpsiLIN[b] };
 
  490       localIndex const nodeIndex = linearMap( a, b );
 
  491       for( 
int i = 0; i < 3; ++i )
 
  493         for( 
int j = 0; j < 3; ++j )
 
  495           J[i][j] = J[i][j] + dNdXi[ j ] * X[nodeIndex][i];
 
  507 H1_Wedge_Lagrange1_Gauss6::
 
  508   applyJacobianTransformationToShapeFunctionsDerivatives( 
int const q,
 
  509                                                           real64 const ( &invJ )[3][3],
 
  510                                                           real64 (& gradN)[numNodes][3] )
 
  512   real64 const r  = quadratureParentCoords0( q );
 
  513   real64 const s  = quadratureParentCoords1( q );
 
  514   real64 const xi = quadratureParentCoords2( q );
 
  516   real64 const psiTRI[3] = { 1.0 - r - s, r, s };
 
  517   real64 const psiLIN[2] = { 0.5 - 0.5*xi, 0.5 + 0.5*xi };
 
  518   constexpr 
real64 dpsiTRI[2][3] = { { -1.0, 1.0, 0.0 }, { -1.0, 0.0, 1.0 } };
 
  519   constexpr 
real64 dpsiLIN[2] = { -0.5, 0.5 };
 
  525       real64 const dNdXi[3] = { dpsiTRI[0][a] * psiLIN[b],
 
  526                                 dpsiTRI[1][a] * psiLIN[b],
 
  527                                 psiTRI[a] * dpsiLIN[b] };
 
  528       localIndex const nodeIndex = linearMap( a, b );
 
  529       for( 
int i = 0; i < 3; ++i )
 
  531         gradN[nodeIndex][i] = 0.0;
 
  532         for( 
int j = 0; j < 3; ++j )
 
  534           gradN[nodeIndex][i] = gradN[nodeIndex][i] + dNdXi[ j ] * invJ[j][i];
 
  549   real64 const r  = coords[0];
 
  550   real64 const s  = coords[1];
 
  551   real64 const xi = coords[2];
 
  553   N[0] = 0.5*( 1.0 - r - s ) * ( 1.0 - xi );
 
  554   N[1] = 0.5*( 1.0 - r - s ) * ( 1.0 + xi );
 
  555   N[2] = 0.5* r * ( 1.0 - xi );
 
  556   N[3] = 0.5* r * ( 1.0 + xi );
 
  557   N[4] = 0.5* s * ( 1.0 - xi );
 
  558   N[5] = 0.5* s * ( 1.0 + xi );
 
  570   real64 const pointCoord[3] = {quadratureParentCoords0( q ),
 
  571                                 quadratureParentCoords1( q ),
 
  572                                 quadratureParentCoords2( q )};
 
  574   calcN( pointCoord, N );
 
  582          real64 ( & N )[numNodes] )
 
  584   return calcN( q, N );
 
  594              real64 const (&X)[numNodes][3],
 
  595              real64 (& gradN)[numNodes][3] )
 
  599   jacobianTransformation( q, X, J );
 
  601   real64 const detJ = LvArray::tensorOps::invert< 3 >( J );
 
  603   applyJacobianTransformationToShapeFunctionsDerivatives( q, J, gradN );
 
  605   return detJ * weight;
 
  612              real64 const (&X)[numNodes][3],
 
  614              real64 ( & gradN )[numNodes][3] )
 
  623                                                 real64 const (&X)[numNodes][3],
 
  624                                                 real64 (& gradN)[numFaces][3] )
 
  629   jacobianTransformation( q, X, J );
 
  631   real64 const detJ = LvArray::tensorOps::invert< 3 >( J );
 
  635   real64 const r  = quadratureParentCoords0( q );
 
  636   real64 const s  = quadratureParentCoords1( q );
 
  637   real64 const xi = quadratureParentCoords2( q );
 
  661     gradN[fi][0] = dNdXi[fi][0] * J[0][0] + dNdXi[fi][1] * J[1][0] + dNdXi[fi][2] * J[2][0];
 
  662     gradN[fi][1] = dNdXi[fi][0] * J[0][1] + dNdXi[fi][1] * J[1][1] + dNdXi[fi][2] * J[2][1];
 
  663     gradN[fi][2] = dNdXi[fi][0] * J[0][2] + dNdXi[fi][1] * J[1][2] + dNdXi[fi][2] * J[2][2];
 
  666   return detJ * weight;
 
  676                                real64 const (&X)[numNodes][3] )
 
  680   jacobianTransformation( q, X, J );
 
  682   return LvArray::tensorOps::determinant< 3 >( J ) * 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 int numSamplingPointsPerDirection
Number of sampling points.
 
static GEOS_HOST_DEVICE void calcFaceBubbleN(localIndex const q, real64(&N)[numFaces])
Calculate face bubble functions values for each face at a quadrature point.
 
virtual GEOS_HOST_DEVICE localIndex getNumSupportPoints() const override
Virtual getter for the number of support points per element.
 
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void getSamplingPointCoordInParentSpace(int const &linearIndex, real64(&samplingPointCoord)[3])
Get the Sampling Point Coord In the Parent Space.
 
constexpr static localIndex numNodes
The number of nodes/support points per element.
 
constexpr static localIndex numFaces
The number of faces/support points per element.
 
static GEOS_HOST_DEVICE localIndex getNumQuadraturePoints(StackVariables const &stack)
Get the number of quadrature points.
 
constexpr static localIndex numQuadraturePoints
The number of quadrature points per element.
 
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.
 
virtual GEOS_HOST_DEVICE localIndex getNumQuadraturePoints() const override
Virtual getter for the number of quadrature 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.
 
static GEOS_HOST_DEVICE localIndex getNumSupportPoints(StackVariables const &stack)
Get the number of support points.
 
constexpr static int numSamplingPoints
The number of sampling points per element.
 
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 calcN(localIndex const q, real64(&N)[numNodes])
Calculate shape functions values for each support point at a quadrature point.
 
static GEOS_HOST_DEVICE void calcN(real64 const (&coords)[3], real64(&N)[numNodes])
Calculate shape functions values at a single 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.
 
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.
 
virtual GEOS_HOST_DEVICE localIndex getMaxSupportPoints() const override
Get the maximum number of support points for this element.
 
constexpr static localIndex maxSupportPoints
The maximum number of support points per element.
 
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 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.
 
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.
 
GEOS_HOST_DEVICE constexpr static GEOS_FORCE_INLINE real64 gradientBubble(const real64 xi)
The gradient of the bubble basis function for support point 1 evaluated at a point along the axes.
 
GEOS_HOST_DEVICE constexpr static GEOS_FORCE_INLINE real64 valueBubble(const real64 xi)
The value of the bubble basis function.
 
GEOS_HOST_DEVICE constexpr static GEOS_FORCE_INLINE real64 gradient(const int index, const real64 xi)
The gradient of the basis function for a support point evaluated at a point along the axes.
 
GEOS_HOST_DEVICE constexpr static GEOS_FORCE_INLINE real64 value(const int index, const real64 xi)
The value of the basis function for a support point evaluated at a point along the axes.
 
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.
 
Kernel variables allocated on the stack.