GEOS
Pk_Pyramid_BCD.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2018-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_PKPYRAMIDBCD_HPP_
21 #define GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_PKPYRAMIDBCD_HPP_
22 
23 #include "FiniteElementBase.hpp"
24 #include "denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.hpp"
25 #include <utility>
26 
27 
28 
29 namespace geos
30 {
31 namespace finiteElement
32 {
33 
34 
41 template< int ORDER >
42 class Pk_Pyramid_BCD final : public FiniteElementBase
43 {
44 public:
45 
47  static constexpr int order = ORDER;
48 
50  constexpr static localIndex numNodes = ( ORDER + 1 ) * ( ORDER + 2 ) * ( 2 * ORDER + 3 ) / 6;
51 
53  constexpr static localIndex numFaces = 5;
54 
56  constexpr static localIndex maxSupportPoints = numNodes;
57 
60 
62  constexpr static localIndex numModes = numNodes;
63 
68  virtual ~Pk_Pyramid_BCD() = default;
69 
71  virtual localIndex getNumQuadraturePoints() const override
72  {
73  return numQuadraturePoints;
74  }
75 
84  {
85  GEOS_UNUSED_VAR( stack );
86  return numQuadraturePoints;
87  }
88 
91  virtual localIndex getNumSupportPoints() const override
92  {
93  return numNodes;
94  }
95 
98  virtual localIndex getMaxSupportPoints() const override
99  {
100  return maxSupportPoints;
101  }
102 
111  {
112  GEOS_UNUSED_VAR( stack );
113  return numNodes;
114  }
115 
116 
117 
125  static localIndex getNumModes( StackVariables const & stack )
126  {
127  GEOS_UNUSED_VAR( stack );
128  return numNodes;
129  }
130 
131 
141  constexpr static localIndex linearIndex3DVal( const localIndex qa, localIndex const qb, localIndex const qc )
142  {
143  localIndex index = 0;
144 
145  for( int l = 0; l < qc; ++l )
146  {
147  int n = order + 1 - l;
148  index += n * n;
149  }
150  int n_k = order + 1 - qc;
151  index += qa + qb * n_k;
152 
153  return index;
154  }
155 
156 
163  static constexpr void generatePointsCoordinates( real64 (& coords)[numNodes][3] )
164  {
165  // Generate the coordinates of the support points based on the order
166  if constexpr (ORDER == 1)
167  {
168  coords[0][0] = -1.0; coords[0][1] = 1.0; coords[0][2] = 0.0;
169  coords[1][0] = -1.0; coords[1][1] = -1.0; coords[1][2] = 0.0;
170  coords[2][0] = 1.0; coords[2][1] = -1.0; coords[2][2] = 0.0;
171  coords[3][0] = 1.0; coords[3][1] = 1.0; coords[3][2] = 0.0;
172  coords[4][0] = 0.0; coords[4][1] = 0.0; coords[4][2] = 1.0;
173  }
174  else if constexpr (ORDER == 2)
175  {
176  //TODO
177  }
178 
179  }
180 
181 
186  template< typename FUNC >
189  static constexpr void generateIndexes( FUNC && func )
190  {
191 
192  for( localIndex i = 0; i <= ORDER; ++i )
193  {
194  for( localIndex j = 0; j <= ORDER; ++j )
195  {
196  localIndex maxIj = LvArray::math::max( i, j );
197  for( localIndex k = 0; k <= ORDER - maxIj; ++k )
198  {
199  func( i, j, k );
200  }
201  }
202 
203  }
204 
205  }
206 
214  static real64 jacobianDeterminant( real64 const (&X)[5][3] )
215 
216  {
217  real64 m[3][3] = {};
218  for( int i = 0; i < 4; i++ )
219  {
220  for( int j = 0; j < 3; j++ )
221  {
222  m[ i ][ j ] = X[ i + 1 ][ j ] - X[ 0 ][ j ];
223  }
224  }
225  return LvArray::math::abs( LvArray::tensorOps::determinant< 3 >( m ) );
226  }
227 
228 
238  real64 const (&X)[5][3] )
239  {
240  int i1 = ( face + 1 ) % 4;
241  int i2 = ( face + 2 ) % 4;
242  int i3 = ( face + 3 ) % 4;
243 
244  real64 ab[3] = { X[ i2 ][ 0 ] - X[ i1 ][ 0 ],
245  X[ i2 ][ 1 ] - X[ i1 ][ 1 ],
246  X[ i2 ][ 2 ] - X[ i1 ][ 2 ] };
247  real64 ac[3] = { X[ i3 ][ 0 ] - X[ i1 ][ 0 ],
248  X[ i3 ][ 1 ] - X[ i1 ][ 1 ],
249  X[ i3 ][ 2 ] - X[ i1 ][ 2 ] };
250  real64 term1 = ab[1] * ac[2] - ab[2] * ac[1];
251  real64 term2 = ab[2] * ac[0] - ab[0] * ac[2];
252  real64 term3 = ab[0] * ac[1] - ab[1] * ac[0];
253  return LvArray::math::sqrt( ( term1 * term1 + term2 * term2 + term3 * term3 ) );
254 
255  }
256 
267  static void calcN( localIndex const q,
268  StackVariables const & stack,
269  real64 ( & N )[numNodes] )
270  {
271  GEOS_UNUSED_VAR( stack );
272  return calcN( q, N );
273  }
274 
275 
286  static constexpr real64 EvaluateJacobiPolynomial( localIndex const n, real64 const alpha, real64 const beta, real64 const x )
287  {
288 
289  if( n == 0 )
290  {
291  real64 val = 1.0;
292  return val;
293  }
294 
295  if( n == 1 )
296  {
297  real64 val = 0.5 * (alpha - beta + (alpha + beta + 2) * x);
298  return val;
299  }
300 
301  // Initial conditions for the recurrence relation
302  real64 P_prev2 = 1.0; // P_0
303  real64 P_prev1 = 0.5 * (alpha - beta + (alpha + beta + 2) * x); // P_1
304  real64 P_current = 0.0;
305 
306  // Recurrence relation to compute the Jacobi polynomial
307  for( int k = 2; k < n+1; ++k )
308  {
309  real64 a_k = 2 * k * (k + alpha + beta) * (2 * k + alpha + beta - 2);
310  real64 b_k = (2 * k + alpha + beta - 1) * (alpha * alpha - beta * beta);
311  real64 c_k = (2 * k + alpha + beta - 1) * (2 * k + alpha + beta) * (2 * k + alpha + beta - 2);
312  real64 d_k = 2 * (k + alpha - 1) * (k + beta - 1) * (2 * k + alpha + beta);
313 
314  P_current = ((b_k + c_k * x) * P_prev1 - d_k * P_prev2) / a_k;
315 
316  // Mise à jour pour l'itération suivante
317  P_prev2 = P_prev1;
318  P_prev1 = P_current;
319  }
320 
321  return P_current;
322  }
323 
334  static constexpr real64 EvaluateJacobiPolynomialDerivative( localIndex const n, real64 const alpha, real64 const beta, real64 const x )
335  {
336  // Particular case for n = 0
337  if( n == 0 )
338  {
339  return 0.0;
340  }
341 
342  // dP_n^{(alpha,beta)}(x)/dx = (n+alpha+beta+1)/2 * P_{n-1}^{(alpha+1,beta+1)}(x)
343  real64 coeff = 0.5 * (n + alpha + beta + 1.0);
344  real64 jacobi_nm1 = EvaluateJacobiPolynomial( n-1, alpha+1.0, beta+1.0, x );
345 
346  return coeff * jacobi_nm1;
347  }
348 
358  static constexpr real64 calcModal( localIndex const i, localIndex const j, localIndex const k, real64 const (&X)[3] )
359  {
360 
361  real64 const x = X[0];
362  real64 const y = X[1];
363  real64 const z = X[2];
364 
365  real64 const epsilon = 1e-10; // Small value to avoid compairing floating point numbers directly
366  if( LvArray::math::abs( z-1.0 ) < epsilon )
367  {
368  if( i == 0 && j == 0 )
369  {
370  return (k+2)*(k+1)/2.0;
371  }
372  else
373  {
374  return 0.0;
375  }
376  }
377 
378  real64 xi = x / (1.0 - z);
379  real64 eta = y / (1.0 - z);
380  real64 chi = 2.0 * z - 1.0;
381  localIndex max_ij = LvArray::math::max( i, j );
382  real64 P_i = EvaluateJacobiPolynomial( i, 0.0, 0.0, xi );
383  real64 P_j = EvaluateJacobiPolynomial( j, 0.0, 0.0, eta );
384  real64 P_k = EvaluateJacobiPolynomial( k, 2.0 * max_ij+2.0, 0.0, chi );
385 
386  return P_i * P_j * std::pow( 1.0 - z, max_ij ) * P_k;
387 
388  }
389 
399  static constexpr void calcGradModal( int i, int j, int k, real64 const (&X)[3],
400  real64 (& gradPsiX)[3] )
401  {
402  real64 x = X[0];
403  real64 y = X[1];
404  real64 z = X[2];
405 
406  real64 const epsilon = 1e-10; // Small value to avoid compairing floating point numbers directly
407  if( LvArray::math::abs( z-1.0 ) < epsilon )
408  {
409  gradPsiX[0] = 0.0;
410  gradPsiX[1] = 0.0;
411  gradPsiX[2] = 0.0;
412  return;
413  }
414 
415 
416  real64 xi = x / (1.0 - z);
417  real64 eta = y / (1.0 - z);
418  real64 chi = 2.0 * z - 1.0;
419  localIndex m = LvArray::math::max( i, j );
420  real64 P_i = EvaluateJacobiPolynomial( i, 0.0, 0.0, xi );
421  real64 P_j = EvaluateJacobiPolynomial( j, 0.0, 0.0, eta );
422  real64 P_k = EvaluateJacobiPolynomial( k, 2.0 * m + 2.0, 0.0, chi );
423  real64 dP_i = EvaluateJacobiPolynomialDerivative( i, 0.0, 0.0, xi );
424  real64 dP_j = EvaluateJacobiPolynomialDerivative( j, 0.0, 0.0, eta );
425  real64 dP_k = EvaluateJacobiPolynomialDerivative( k, 2.0 * m + 2.0, 0.0, chi );
426 
427  real64 f = pow( 1.0 - z, m );
428  // Gradient en x
429  gradPsiX[0] = (1.0 / (1.0 - z)) * dP_i * P_j * f * P_k;
430 
431  // Gradient en y
432  gradPsiX[1] = (1.0 / (1.0 - z)) * dP_j * P_i * f * P_k;
433 
434  // Gradient en z
435  real64 dxi_dz = x / std::pow( 1.0 - z, 2 );
436  real64 deta_dz = y / std::pow( 1.0 - z, 2 );
437  real64 dchi_dz = 2.0;
438  real64 df_dz = -m * std::pow( 1.0 - z, m - 1 );
439  gradPsiX[2] =
440  dP_i * dxi_dz * P_j * f * P_k +
441  P_i * dP_j * deta_dz * f * P_k +
442  P_i * P_j * df_dz * P_k +
443  P_i * P_j * f * dP_k * dchi_dz;
444 
445 
446  }
447 
454  {
455  array2d< real64 > VDM;
456  VDM.resize( numNodes, numNodes );
457  real64 PsiX[numNodes] = {};
458  real64 coords[numNodes][3] = {};
459 
460  generatePointsCoordinates( coords );
461 
462  for( int j = 0; j < numNodes; ++j )
463  {
464  localIndex count = 0;
465  generateIndexes( [&]( localIndex const p, localIndex const r, localIndex const s )
466  {
467  PsiX[count]=calcModal( p, r, s, coords[j] );
468  VDM[count][j] = PsiX[count];
469  ++count;
470  } );
471  // }
472  }
473  array2d< real64 > VDM_inv;
474  VDM_inv.resize( numNodes, numNodes );
475  // Inversion of VanDerMonde matrix
476  BlasLapackLA::matrixInverse( VDM, VDM_inv );
477  return VDM_inv;
478  }
479 
488  static constexpr void calcN( localIndex q, arrayView2d< real64 const > VDM_inv, real64 (& N)[numNodes] )
489  {
490 
491  real64 PsiX[numNodes] = {0.0};
492  real64 coords[numNodes][3] = {{0.0}};
493 
494  //Generate the coordinates of the support points
495  generatePointsCoordinates( coords );
496 
497 
498  localIndex count = 0;
499  //Compute the modal functions at the quadrature point
500  generateIndexes( [&]( localIndex const p, localIndex const r, localIndex const s )
501  {
502  PsiX[count] = calcModal( p, r, s, coords[q] );
503  ++count;
504  } );
505 
506  //Compute the nodal functions at the quadrature point
507  for( int i = 0; i < numNodes; ++i )
508  {
509  N[i] = 0.0;
510  for( int j = 0; j < numNodes; ++j )
511  {
512  N[i] += VDM_inv[i][j] * PsiX[j];
513  }
514  }
515 
516  }
525  static constexpr void calcN( real64 const (&X)[3], arrayView2d< real64 const > VDM_inv, real64 (& N)[numNodes] )
526  {
527 
528  real64 PsiX[numNodes] = {};
529 
530  localIndex count = 0;
531  //Compute the modal functions at the given point
532  generateIndexes( [&]( localIndex const p, localIndex const r, localIndex const s )
533  {
534  PsiX[count] = calcModal( p, r, s, X );
535  ++count;
536  } );
537 
538  //Compute the nodal functions at the given points
539  for( int i = 0; i < numNodes; ++i )
540  {
541  N[i] = 0.0;
542  for( int j = 0; j < numNodes; ++j )
543  {
544  N[i] += VDM_inv[i][j] * PsiX[j];
545  }
546  }
547 
548  }
549 
558  static constexpr void calcGradN( localIndex q, arrayView2d< real64 const > VDM_inv, real64 (& gradN)[numNodes][3] )
559  {
560 
561  real64 gradModal[numNodes][3] = {{}};
562  real64 coords[numNodes][3] = {};
563 
564  //Generate the coordinates of the support points
565  generatePointsCoordinates( coords );
566 
567  localIndex count = 0;
568  //Compute the modal functions derivatives at the quadrature point
569  generateIndexes( [&]( localIndex const p, localIndex const r, localIndex const s )
570  {
571  calcGradModal( p, r, s, coords[q], gradModal[count] );
572  ++count;
573  } );
574 
575 
576  //Compute the nodal functions derivatives at the quadrature point
577  for( int i = 0; i < numNodes; ++i )
578  {
579  gradN[i][0] = 0.0;
580  gradN[i][1] = 0.0;
581  gradN[i][2] = 0.0;
582  for( int j = 0; j < numNodes; ++j )
583  {
584  gradN[i][0] += VDM_inv[i][j] * gradModal[j][0];
585  gradN[i][1] += VDM_inv[i][j] * gradModal[j][1];
586  gradN[i][2] += VDM_inv[i][j] * gradModal[j][2];
587  }
588  }
589 
590  }
591 
600  static constexpr void calcGradN( real64 const (&X)[3], arrayView2d< real64 const > VDM_inv, real64 (& gradN)[numNodes][3] )
601  {
602 
603  real64 gradModal[numNodes][3] = {{}};
604 
605  localIndex count = 0;
606  //Compute the modal functions derivatives at the given point
607  generateIndexes( [&]( localIndex const p, localIndex const r, localIndex const s )
608  {
609  calcGradModal( p, r, s, X, gradModal[count] );
610  ++count;
611  } );
612 
613  //Compute the nodal functions derivatives at the given points
614  for( int i = 0; i < numNodes; ++i )
615  {
616  gradN[i][0] = 0.0;
617  gradN[i][1] = 0.0;
618  gradN[i][2] = 0.0;
619  for( int j = 0; j < numNodes; ++j )
620  {
621  gradN[i][0] += VDM_inv[i][j] * gradModal[j][0];
622  gradN[i][1] += VDM_inv[i][j] * gradModal[j][1];
623  gradN[i][2] += VDM_inv[i][j] * gradModal[j][2];
624  }
625  }
626 
627  }
628 
636  template< typename FUNC >
639  static constexpr void computeMassTerm( arrayView2d< real64 const > VDM_inv, FUNC && func )
640  {
641 
642  // Gauss-Legendre points and weights for the quadrature
643  constexpr real64 GLeQuadraturePoints[3] = { -0.7745966692, 0.0, 0.7745966692 };
644  constexpr real64 GLeQuadratureWeights[3] = { 0.5555555556, 0.8888888889, 0.5555555556 };
645  // Gauss-Jacobi points and weights for the quadrature
646  constexpr real64 GJQuadraturePoints[3] = { 0.07299, 0.34700, 0.70500 };
647  constexpr real64 GJQuadratureWeights[3] = { 0.15714, 0.14625, 0.02995 };
648 
649 
650 
651  real64 N[numNodes] = {0.0};
652  for( localIndex a = 0; a < numNodes; ++a )
653  {
654  for( localIndex b = 0; b < numNodes; ++b )
655  {
656  real64 val = 0.0;
657  for( int i = 0; i < 3; ++i )
658  {
659  for( int j = 0; j < 3; ++j )
660  {
661  for( int k = 0; k < 3; ++k )
662  {
663 
664  real64 xi = GLeQuadraturePoints[i];
665  real64 eta = GLeQuadraturePoints[j];
666  real64 chi = GJQuadraturePoints[k];
667 
668  real64 weight = GLeQuadratureWeights[i] * GLeQuadratureWeights[j] * GJQuadratureWeights[k];
669  real64 x_i = (1-chi)*xi;
670  real64 y_j = (1-chi)*eta;
671  real64 z_k = chi;
672  real64 X[3] = {x_i, y_j, z_k};
673 
674  calcN( X, VDM_inv, N );
675 
676  val += weight * N[a] * N[b];
677 
678  }
679  }
680  }
681  func( a, b, val );
682  }
683  }
684  }
685 
693  template< typename FUNC >
696  static void computeStiffnessTerm( arrayView2d< real64 const > VDM_inv, FUNC && func )
697  {
698  // Gauss-Legendre points and weights for the quadrature
699  constexpr real64 GLeQuadraturePoints[3] = { -0.7745966692, 0.0, 0.7745966692 };
700  constexpr real64 GLeQuadratureWeights[3] = { 0.5555555556, 0.8888888889, 0.5555555556 };
701  // Gauss-Jacobi points and weights for the quadrature
702  constexpr real64 GJQuadraturePoints[3] = { 0.07299, 0.34700, 0.70500 };
703  constexpr real64 GJQuadratureWeights[3] = { 0.15714, 0.14625, 0.02995 };
704 
705 
706 
707  real64 gradN[numNodes][3] = {{0.0}};
708 
709  for( localIndex a = 0; a < numNodes; ++a )
710  {
711  for( localIndex b = 0; b < numNodes; ++b )
712  {
713  real64 val = 0.0;
714  for( int i = 0; i < 3; ++i )
715  {
716  for( int j = 0; j < 3; ++j )
717  {
718  for( int k = 0; k < 3; ++k )
719  {
720  real64 xi = GLeQuadraturePoints[i];
721  real64 eta = GLeQuadraturePoints[j];
722  real64 chi = GJQuadraturePoints[k];
723 
724  real64 weight = GLeQuadratureWeights[i] * GLeQuadratureWeights[j] * GJQuadratureWeights[k];
725  real64 x_i = (1-chi)*xi;
726  real64 y_j = (1-chi)*eta;
727  real64 z_k = chi;
728  real64 X[3] = {x_i, y_j, z_k};
729 
730  calcGradN( X, VDM_inv, gradN );
731  real64 dot = gradN[a][0] * gradN[b][0]
732  + gradN[a][1] * gradN[b][1]
733  + gradN[a][2] * gradN[b][2];
734  val += weight * dot;
735  }
736  }
737  }
738  func( a, b, val );
739  }
740  }
741  }
742 
743 };
744 
749 
750 
751 }
752 }
753 
754 #endif // GEOS_FINITEELEMENT_ELEMENTFORMULATIONS_PKPYRAMIDBCD_HPP_
#define USING_FINITEELEMENTBASE
Macro to simplify name resolution in derived classes.
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:84
#define GEOS_FORCE_INLINE
Marks a function or lambda for inlining.
Definition: GeosxMacros.hpp:51
Base class for FEM element implementations.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void generatePointsCoordinates(real64(&coords)[numNodes][3])
Generate the coordinates of the support points.
constexpr static localIndex numModes
The number of modal points per element.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void calcN(localIndex q, arrayView2d< real64 const > VDM_inv, real64(&N)[numNodes])
Evaluate shape functions of a linear pyramid (5-node) at a quadrature point.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE localIndex getNumSupportPoints(StackVariables const &stack)
Get the number of support points.
GEOS_HOST_DEVICE virtual GEOS_FORCE_INLINE localIndex getMaxSupportPoints() const override
Get the maximum number of support points for this element.
constexpr static localIndex numQuadraturePoints
The number of quadrature points per element.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE real64 calcModal(localIndex const i, localIndex const j, localIndex const k, real64 const (&X)[3])
Calculate modal base functions values for a modal point (i,j,k) at a point X.
static constexpr int order
The order of the finite element.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE localIndex getNumModes(StackVariables const &stack)
Get the number of modal points.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void calcGradModal(int i, int j, int k, real64 const (&X)[3], real64(&gradPsiX)[3])
Calculate modal base functions derivative values for a modal point (i,j,k) at a point X.
constexpr static localIndex numNodes
The number of shape functions per element.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE localIndex getNumQuadraturePoints(StackVariables const &stack)
Get the number of quadrature points.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE real64 jacobianDeterminant(real64 const (&X)[5][3])
Returns the determinant of the Jacobian of the element.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE real64 EvaluateJacobiPolynomial(localIndex const n, real64 const alpha, real64 const beta, real64 const x)
Helper to compute Jacobi Polynomials.
static GEOS_FORCE_INLINE array2d< real64 > computeVanderMondeMatrixInverse()
Compute the inverse of the VanDerMonde matrix.
virtual GEOS_HOST_DEVICE localIndex getNumQuadraturePoints() const override
Virtual getter for the number of quadrature points per element.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void calcN(real64 const (&X)[3], arrayView2d< real64 const > VDM_inv, real64(&N)[numNodes])
Evaluate shape functions of a linear pyramid (5-node) at a quadrature point.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void calcN(localIndex const q, StackVariables const &stack, real64(&N)[numNodes])
Calculate shape functions values for each support point at a quadrature/nodal point.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void generateIndexes(FUNC &&func)
Generate the indexes for the modal shape functions.
GEOS_HOST_DEVICE virtual GEOS_FORCE_INLINE localIndex getNumSupportPoints() const override
Virtual getter for the number of support points per element.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void calcGradN(localIndex q, arrayView2d< real64 const > VDM_inv, real64(&gradN)[numNodes][3])
Evaluate shape functions of a linear pyramid (5-node) at a quadrature point.
constexpr static localIndex numFaces
The number of faces points per element.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE real64 faceJacobianDeterminant(localIndex face, real64 const (&X)[5][3])
Calculate the determinant of the jacobian on the face opposite to the given vertex.
GEOS_HOST_DEVICE static GEOS_FORCE_INLINE void computeStiffnessTerm(arrayView2d< real64 const > VDM_inv, FUNC &&func)
Computes the stifness term Kij in the mass matrix.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void computeMassTerm(arrayView2d< real64 const > VDM_inv, FUNC &&func)
Computes the mass term Mij in the mass matrix.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE void calcGradN(real64 const (&X)[3], arrayView2d< real64 const > VDM_inv, real64(&gradN)[numNodes][3])
Evaluate shape functions of a linear pyramid (5-node) at a given point.
GEOS_HOST_DEVICE static constexpr GEOS_FORCE_INLINE real64 EvaluateJacobiPolynomialDerivative(localIndex const n, real64 const alpha, real64 const beta, real64 const x)
Evaluate the derivative of the Jacobi polynomial at a point x.
GEOS_HOST_DEVICE constexpr static GEOS_FORCE_INLINE localIndex linearIndex3DVal(const localIndex qa, localIndex const qb, localIndex const qc)
The linear index associated to the given one-dimensional indices in the three directions.
constexpr static localIndex maxSupportPoints
The maximum number of support points per element.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:191
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:195