GEOS
AcousticWaveEquationDGKernel.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOS Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONDGKERNEL_HPP_
20 #define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONDGKERNEL_HPP_
21 
23 #include "denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.hpp"
24 
25 namespace geos
26 {
27 
29 namespace AcousticWaveEquationDGKernels
30 {
31 
33 {
34  using EXEC_POLICY = parallelDevicePolicy< >;
35 
63  template< typename EXEC_POLICY, typename FE_TYPE >
64  static void
65  launch( localIndex const size,
66  localIndex const regionIndex,
67  ArrayOfArraysView< localIndex const > const baseFacesToNodes,
69  arrayView1d< globalIndex const > const baseNodeLocalToGlobal,
70  arrayView1d< globalIndex const > const elementLocalToGlobal,
71  ArrayOfArraysView< localIndex const > const baseNodesToElements,
73  arrayView1d< integer const > const elemGhostRank,
74  arrayView2d< localIndex const > const elemsToFaces,
75  arrayView2d< real64 const > const & elemCenter,
76  arrayView2d< real64 const > const sourceCoordinates,
77  arrayView1d< localIndex > const sourceIsAccessible,
78  arrayView1d< localIndex > const sourceElem,
79  arrayView2d< real64 > const sourceConstants,
80  arrayView1d< localIndex > const sourceRegion,
81  arrayView2d< real64 const > const receiverCoordinates,
82  arrayView1d< localIndex > const receiverIsLocal,
83  arrayView1d< localIndex > const receiverElem,
84  arrayView2d< real64 > const receiverConstants,
85  arrayView1d< localIndex > const receiverRegion )
86  {
87 
88  forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k )
89  {
90  real64 const center[3] = { elemCenter[k][0],
91  elemCenter[k][1],
92  elemCenter[k][2] };
93 
94  // Step 1: locate the sources, and precompute the source term
95 
97  for( localIndex isrc = 0; isrc < sourceCoordinates.size( 0 ); ++isrc )
98  {
99  if( sourceIsAccessible[isrc] == 0 )
100  {
101  real64 const coords[3] = { sourceCoordinates[isrc][0],
102  sourceCoordinates[isrc][1],
103  sourceCoordinates[isrc][2] };
104  bool const sourceFound =
105  computationalGeometry::isPointInsideConvexPolyhedronRobust( k,
106  baseNodeCoords,
107  elemsToFaces,
108  baseFacesToNodes,
109  baseNodesToElements,
110  baseNodeLocalToGlobal,
111  elementLocalToGlobal,
112  center,
113  coords );
114 
115  if( sourceFound )
116  {
117  sourceIsAccessible[isrc] = 1;
118  sourceElem[isrc] = k;
119  sourceRegion[isrc] = regionIndex;
120  real64 Ntest[FE_TYPE::numNodes];
121 
122 
123 
124  constexpr localIndex numNodesPerElem = FE_TYPE::numNodes;
125  real64 xLocal[4][3];
126  for( localIndex a=0; a<4; ++a )
127  {
128  for( localIndex i=0; i<3; ++i )
129  {
130  xLocal[a][i] = baseNodeCoords( baseElemsToNodes( k, a ), i );
131  }
132  }
133 
134  FE_TYPE::calcN( xLocal, coords, Ntest );
135 
136  for( localIndex a = 0; a < numNodesPerElem; ++a )
137  {
138  sourceConstants[isrc][a] = Ntest[a];
139  }
140  }
141  }
142  } // end loop over all sources
143 
144  // Step 2: locate the receivers, and precompute the receiver term
145 
147  for( localIndex ircv = 0; ircv < receiverCoordinates.size( 0 ); ++ircv )
148  {
149  if( receiverIsLocal[ircv] == 0 )
150  {
151  real64 const coords[3] = { receiverCoordinates[ircv][0],
152  receiverCoordinates[ircv][1],
153  receiverCoordinates[ircv][2] };
154 
155  bool const receiverFound =
156  computationalGeometry::isPointInsideConvexPolyhedronRobust( k,
157  baseNodeCoords,
158  elemsToFaces,
159  baseFacesToNodes,
160  baseNodesToElements,
161  baseNodeLocalToGlobal,
162  elementLocalToGlobal,
163  center,
164  coords );
165 
166  if( receiverFound && elemGhostRank[k] < 0 )
167  {
168  receiverIsLocal[ircv] = 1;
169  receiverElem[ircv] = k;
170  receiverRegion[ircv] = regionIndex;
171 
172 
173  real64 Ntest[FE_TYPE::numNodes];
174  constexpr localIndex numNodesPerElem = FE_TYPE::numNodes;
175 
176  real64 xLocal[4][3];
177  for( localIndex a=0; a< 4; ++a )
178  {
179  for( localIndex i=0; i<3; ++i )
180  {
181  xLocal[a][i] = baseNodeCoords( baseElemsToNodes( k, a ), i );
182  }
183  }
184  FE_TYPE::calcN( xLocal, coords, Ntest );
185 
186  for( localIndex a = 0; a < numNodesPerElem; ++a )
187  {
188  receiverConstants[ircv][a] = Ntest[a];
189  }
190  }
191  }
192  } // end loop over receivers
193 
194  } );
195 
196  }
197 };
198 
200 {
201 
202  using EXEC_POLICY = parallelDevicePolicy< >;
203 
211  template< typename EXEC_POLICY, typename FE_TYPE >
212  static void
213  launch( localIndex const size,
215  arrayView2d< localIndex const > const & elemsToFaces,
216  arrayView2d< localIndex const > const & facesToElems,
217  ArrayOfArraysView< localIndex const > const & facesToNodes,
218  arrayView1d< localIndex const > const & freeSurfaceFaceIndicator,
219  arrayView2d< localIndex > const & elemsToOpposite,
220  arrayView2d< integer > const & elemsToOppositePermutation )
221  {
222  forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k1 )
223  {
224  localIndex vertices[ 4 ] = { elemsToNodes( k1, 0 ), elemsToNodes( k1, 1 ), elemsToNodes( k1, 2 ), elemsToNodes( k1, 3 ) };
225  for( int i = 0; i < 4; i++ )
226  {
227  localIndex k1OrderedVertices[ 3 ];
228  localIndex f = elemsToFaces( k1, i );
229  localIndex faceVertices[ 3 ] = { facesToNodes( f, 0 ), facesToNodes( f, 1 ), facesToNodes( f, 2 ) };
230  // find neighboring element, if any
231  localIndex k2 = facesToElems( f, 0 );
232  if( k2 == k1 )
233  {
234  k2 = facesToElems( f, 1 );
235  }
236  // find opposite vertex in first element
237  int o1 = -1;
238  int indexo1= -1;
239  int vertex = -1;
240  int count = 0;
241  for( localIndex k=0; k< 4; ++k )
242  {
243  vertex = vertices[k];
244  bool found = false;
245  for( int j = 0; j < 3; j++ )
246  {
247  if( vertex == faceVertices[ j ] )
248  {
249  found = true;
250  break;
251  }
252  }
253  if( !found )
254  {
255  o1 = vertex;
256  indexo1=k;
257  }
258  else
259  {
260  k1OrderedVertices[ count++ ] = vertex;
261  }
262  }
263 
264  GEOS_ERROR_IF( o1 < 0, "Topological error in mesh: a face and its adjacent element share all vertices." );
265  if( k2 < 0 )
266  {
267  // boundary element, either free surface, or absorbing boundary
268  elemsToOpposite( k1, indexo1 ) = freeSurfaceFaceIndicator( f ) == 1 ? -2 : -1;
269  elemsToOppositePermutation( k1, indexo1 ) = 0;
270  }
271  else
272  {
273  elemsToOpposite( k1, indexo1 ) = k2;
274  localIndex oppositeElemVertices[ 4 ] = { elemsToNodes( k2, 0 ), elemsToNodes( k2, 1 ), elemsToNodes( k2, 2 ), elemsToNodes( k2, 3 ) };
275  // compute permutation
276  integer permutation = 0;
277  int c = 1;
278  for( localIndex k2Vertex : oppositeElemVertices )
279  {
280  int position = -1;
281  for( int j = 0; j < 3; j++ )
282  {
283  if( k1OrderedVertices[ j ] == k2Vertex )
284  {
285  position = j;
286  break;
287  }
288  }
289  permutation = permutation + c * ( position + 1 );
290  c = c * 4;
291  }
292  elemsToOppositePermutation( k1, indexo1 ) = permutation;
293  }
294  }
295  } );
296  }
297 };
298 
300 {
301  using EXEC_POLICY = parallelDevicePolicy< >;
302 
312  template< typename EXEC_POLICY >
313  static void
314  launch( localIndex const size,
317  arrayView1d< real32 > const & characteristicSize )
318  {
319  forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k )
320  {
321  characteristicSize[ k ] = WaveSolverUtils::computeReferenceLengthForPenalty( elemsToNodes[ k ], nodeCoords );
322  } );
323  }
324 };
325 
326 
327 //TODO : in the future if needed for boundary condition
328 //struct PrecomputeMassDampingKernel
329 //{
330 // using EXEC_POLICY = parallelDevicePolicy< >;
331 //
332 // /**
333 // * @brief Launches the precomputation of the inverse of the reference mass matrix in the bulk, as well as
334 // * the inverse mass + damping term for the boundary elements.
335 // * @tparam EXEC_POLICY execution policy
336 // * @tparam FE_TYPE finite element type
337 // * @param[in] size the number of elements
338 // * @param[in] nodeCoords coordinates of the nodes
339 // * @param[in] elemsToNodes map from element to nodes
340 // * @param[in] elemToOpposite DG element-to-opposite map
341 // * @param[out] referenceInvMassMatrix computed M^{-1} for the reference element
342 // * @param[out] boundaryInvMassPlusDamping (M + dt/2 D)^{-1} for boundary elements
343 // * @param[in] dt time-step
344 // */
345 // template< typename EXEC_POLICY, typename ATOMIC_POLICY, typename FE_TYPE >
346 // static void
347 // launch( localIndex const size,
348 // arrayView2d< real32 const, nodes::REFERENCE_POSITION_USD > const nodeCoords,
349 // arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes,
350 // arrayView2d< localIndex const > const & elemsToOpposite,
351 // array2d< real64 > & referenceInvMassMatrix,
352 // array3d< real64 > & boundaryInvMassPlusDamping,
353 // real64 const dt )
354 // {
355 // // Precompute reference mass matrix for non-boundary elements
356 // referenceInvMassMatrix.resizeDimension< 0, 1 >( FE_TYPE::numNodes, FE_TYPE::numNodes );
357 // array2d< real64 > massMatrix;
358 // massMatrix.resize( FE_TYPE::numNodes, FE_TYPE::numNodes );
359 // massMatrix.zero();
360 // FE_TYPE::computeReferenceMassMatrix( massMatrix );
361 // BlasLapackLA::matrixInverse( massMatrix, referenceInvMassMatrix );
362 // // Precompute local mass + damping matrix on the boundary elements
363 // localIndex nAbsBdryElems = 0;
364 // forAll< EXEC_POLICY >( size, [&] ( localIndex const k )
365 // {
366 // bool bdry = false;
367 // for( int i = 0; i < 4; i++ )
368 // {
369 // if( elemsToOpposite[ k ][ i ] == -1 )
370 // {
371 // bdry = true;
372 // break;
373 // }
374 // }
375 // if( bdry )
376 // {
377 // RAJA::atomicInc< ATOMIC_POLICY >( &nAbsBdryElems );
378 // }
379 // } );
380 //
381 // boundaryInvMassPlusDamping.resizeDimension< 0, 1, 2 >( nAbsBdryElems, FE_TYPE::numNodes, FE_TYPE::numNodes );
382 // forAll< EXEC_POLICY >( size, [&] ( localIndex const k )
383 // {} );
384 // }
385 //};
386 
387 
388 
390 {
391  using EXEC_POLICY = parallelDevicePolicy< >;
392 
409  template< typename FE_TYPE, typename EXEC_POLICY, typename ATOMIC_POLICY >
410  static void
412  localIndex const regionIndex,
415  arrayView1d< real32 const > const velocity,
416  arrayView1d< real32 const > const density,
417  arrayView2d< real32 > const p_n,
418  arrayView2d< real32 const > const p_nm1,
419  arrayView2d< localIndex > const & elemsToOpposite,
420  arrayView2d< integer > const & elemsToOppositePermutation,
421  arrayView2d< real64 >referenceInvMassMatrix,
422  arrayView1d< real32 const > const characteristicSize,
423  arrayView2d< real64 const > const sourceConstants,
424  arrayView1d< localIndex const > const sourceIsAccessible,
425  arrayView1d< localIndex const > const sourceElem,
426  arrayView1d< localIndex const > const sourceRegion,
427  real64 const dt,
428  real64 const time_n,
429  real32 const timeSourceFrequency,
430  real32 const timeSourceDelay,
431  localIndex const rickerOrder,
432  bool const useSourceWaveletTables,
433  arrayView1d< TableFunction::KernelWrapper const > const sourceWaveletTableWrappers,
434  arrayView2d< real32 > const p_np1 )
435 
436  {
437 
438  real64 const rickerValue = useSourceWaveletTables ? 0 : WaveSolverUtils::evaluateRicker( time_n, timeSourceFrequency, timeSourceDelay, rickerOrder );
439 
440  forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k )
441  {
442 
443  int const order = FE_TYPE::order;
444 
445  // Coefficient for penalisation
446  int const alpha = 12.0*((order*(order+1)*(order+2))/6);
447 
448  real64 const dt2 = pow( dt, 2 );
449 
450  constexpr localIndex numNodesPerElem = FE_TYPE::numNodes;
451 
452  real64 pTemp[numNodesPerElem] = {0.0};
453  real64 flowx[numNodesPerElem] = {0.0};
454 
455  real64 xLocal[4][3];
456  for( localIndex a=0; a< 4; ++a )
457  {
458  for( localIndex i=0; i<3; ++i )
459  {
460  xLocal[a][i] = X( elemsToNodes( k, a ), i );
461  }
462  }
463 
464  //Compute 1/(c2*density) term and compute the determinant of the jacobian
465  real64 const C2 = pow( velocity[k], 2 );
466 
467  real64 const invC2 = 1.0/(C2*density[k]);
468 
469  real64 const det = LvArray::math::abs( FE_TYPE::jacobianDeterminant( xLocal ));
470 
471  //Multiply p_{n } by 2*invC2*Mass and p_{n-1} by -invC2*Mass
472  FE_TYPE::computeMassTerm( xLocal, [&] ( const int i, const int j, const real64 val )
473  {
474  pTemp[i] += 2.0*invC2*val*p_n[k][j];
475  pTemp[i] -= val*invC2*p_nm1[k][j];
476  } );
477 
478  //First stiffness part (volume)
479  FE_TYPE::computeStiffnessTerm( xLocal, [&] ( const int i, const int j, real64 val )
480  {
481  flowx[i] -= val*p_n[k][j];
482  } );
483 
484 
485  //Second stiffness part (surface)
486  FE_TYPE::computeSurfaceTerms( xLocal, [&] ( const int c1, const int c2, const int f1, const int, const int, const int, const int i2, const int j2, const int k2, real64 const val )
487  {
488 
489  // We take the neighbour element
490  const localIndex elemNeigh = elemsToOpposite( k, f1 );
491 
492 
493  if( elemNeigh >= 0 )
494  {
495 
496 
497  // We compute the permutation of the opposite element, used to find the equivalent of c2 on the neighbour element
498  const int perm = elemsToOppositePermutation( k, f1 );
499 
500 
501  const int p1 = perm%4-1;
502  const int p2 = (perm/4)%4-1;
503  const int p3 = (perm/16)%4-1;
504 
505  const int l2 = order-i2-j2-k2;
506  const int Indices[3] = {i2, j2, k2};
507 
508  const int ii2 = p1 < 0 ? l2 : Indices[p1];
509  const int jj2 = p2 < 0 ? l2 : Indices[p2];
510  const int kk2 = p3 < 0 ? l2 : Indices[p3];
511 
512  const int neighDof2 = FE_TYPE::dofIndex( ii2, jj2, kk2 );
513 
514  //Now that we have the neighbor dof, we compute the penalisation term. The extra tyerm 12 is used as a safety for the value
515  // of coefficient alpha= 1/hmin
516 
517 
518  real64 const val1 = (alpha/((LvArray::math::min( characteristicSize[k], characteristicSize[elemNeigh] ))))*val*p_n[k][c2];
519  real64 const val2 = (alpha/((LvArray::math::min( characteristicSize[k], characteristicSize[elemNeigh] ))))*val*p_n[elemNeigh][neighDof2];
520 
521  flowx[c1] += -val1+val2;
522 
523  }
524 
525  },
526  [&] ( const int c1, const int c2, const int f1, const int fNeigh, const int i1, const int j1, const int k1, const int i2, const int j2, const int k2,
527  real64 const val )
528  {
529 
530 
531  // This part is for the flux term
532  //We take the neighbour element
533  const int elemNeigh = elemsToOpposite( k, f1 );
534 
535  if( elemNeigh >= 0 )
536  {
537 
538  const int perm = elemsToOppositePermutation( k, f1 );
539 
540  const int p1 = perm%4-1;
541  const int p2 = (perm/4)%4-1;
542  const int p3 = (perm/16)%4-1;
543  const int p4 = (perm/64)%4-1;
544 
545  // Again we take the permutation of the opposite element, used to find the equivalent of c2 on the neighbour element and c1 this
546  // time
547 
548  const int Indices[3] = {i2, j2, k2};
549 
550  const int l2 = order-i2-j2-k2;
551 
552  const int ii2 = p1 < 0 ? l2 : Indices[p1];
553  const int jj2 = p2 < 0 ? l2 : Indices[p2];
554  const int kk2 = p3 < 0 ? l2 : Indices[p3];
555 
556  const int neighDof2 = FE_TYPE::dofIndex( ii2, jj2, kk2 );
557 
558  const int IndicesTranspose[3] = {i1, j1, k1};
559 
560  const int l1 = order-i1-j1-k1;
561 
562  const int ii1 = p1 < 0 ? l1 : IndicesTranspose[p1];
563  const int jj1 = p2 < 0 ? l1 : IndicesTranspose[p2];
564  const int kk1 = p3 < 0 ? l1 : IndicesTranspose[p3];
565 
566  const int neighDof = FE_TYPE::dofIndex( ii1, jj1, kk1 );
567 
568  // Here the goal is to compute the factor of correction for the flux term
569  // We need to get the local coordinates of the element and the neighbour element on a specific order
570 
571  //We first assign to elemneigh the three value from xLocal which are common to the two elements
572  real64 xLocalNeigh[4][3];
573 
574  int x1 = (f1+1)%4;
575  int x2 = (f1+2)%4;
576  int x3 = (f1+3)%4;
577 
578  if( x2 == fNeigh )
579  {
580  int temp = x2;
581  x2 = x3;
582  x3 = temp;
583  }
584 
585  if( x1 == fNeigh )
586  {
587  int temp = x1;
588  x1 = x3;
589  x3 = temp;
590  }
591 
592  int o1 = fNeigh < 0 ? f1 : fNeigh;
593  int o2 = f1;
594 
595  xLocalNeigh[x1][0] = xLocal[x1][0];
596  xLocalNeigh[x1][1] = xLocal[x1][1];
597  xLocalNeigh[x1][2] = xLocal[x1][2];
598  xLocalNeigh[x2][0] = xLocal[x2][0];
599  xLocalNeigh[x2][1] = xLocal[x2][1];
600  xLocalNeigh[x2][2] = xLocal[x2][2];
601  xLocalNeigh[x3][0] = xLocal[x3][0];
602  xLocalNeigh[x3][1] = xLocal[x3][1];
603  xLocalNeigh[x3][2] = xLocal[x3][2];
604 
605  // Using the permutation we can find the last point of the neighbour element
606 
607  localIndex IndexPerm[4] = {p1, p2, p3, p4};
608 
609  for( localIndex i = 0; i <4; ++i )
610  {
611  if( IndexPerm[i] ==-1 )
612  {
613  xLocalNeigh[f1][0] = X[ elemsToNodes( elemNeigh, i )][0];
614  xLocalNeigh[f1][1] = X[ elemsToNodes( elemNeigh, i )][1];
615  xLocalNeigh[f1][2] = X[ elemsToNodes( elemNeigh, i )][2];
616  }
617 
618  }
619 
620  //We compute the correction factor and the value of the flux term
621  real64 corrLocal = FE_TYPE::computeFluxDerivativeFactor( xLocal, x1, x2, o1, o2 );
622  real64 corrNeigh = FE_TYPE::computeFluxDerivativeFactor( xLocalNeigh, x1, x2, o1, o2 );
623 
624  real64 const val1 = 0.5*val*p_n[k][c2]*corrLocal;
625  real64 const val2 = 0.5*val*p_n[elemNeigh][neighDof2]*corrLocal;
626 //
627  real64 const val3 = 0.5*val*p_n[k][c1]*corrLocal;
628  real64 const val4 = 0.5*val*p_n[elemNeigh][neighDof]*corrNeigh;
629 
630  flowx[c1] += val1-val2;
631  flowx[c2] += val3-val4;
632 
633  }
634  } );
635 
636  //Add time dependency
637  for( localIndex i = 0; i < numNodesPerElem; i++ )
638  {
639  pTemp[i] += dt2*flowx[i];
640  }
641 
642  //Source Injection
643  for( localIndex isrc = 0; isrc < sourceConstants.size( 0 ); ++isrc )
644  {
645  if( sourceIsAccessible[isrc] == 1 )
646  {
647  if( sourceElem[isrc]==k && sourceRegion[isrc] == regionIndex )
648  {
649 
650  real64 const srcValue = useSourceWaveletTables ? sourceWaveletTableWrappers[ isrc ].compute( &time_n ) : rickerValue;
651  for( localIndex i = 0; i < numNodesPerElem; ++i )
652  {
653  pTemp[i]+= dt2*(sourceConstants[isrc][i]*srcValue);
654  }
655  }
656  }
657  }
658 
659  //Multiplication by the inverse mass matrix
660  for( localIndex i = 0; i < numNodesPerElem; ++i )
661  {
662  real64 fx=0.0;
663  for( localIndex j = 0; j < numNodesPerElem; ++j )
664  {
665  fx+= referenceInvMassMatrix( i, j )*pTemp[j];
666  }
667  p_np1[k][i]=(C2*density[k]*fx)/det;
668  }
669 
670  } );
671 
672 
673 
674  }
675 
677  // FE_TYPE const & m_finiteElement;
678 
679 
680 };
681 
682 } // namespace AcousticWaveEquationDGKernels
683 
684 } // namespace geos
685 
686 #endif //GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONDGKERNEL_HPP_
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
#define GEOS_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
Definition: Logger.hpp:142
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
float real32
32-bit floating point type.
Definition: DataTypes.hpp:96
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
Definition: DataTypes.hpp:285
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
int integer
Signed integer type.
Definition: DataTypes.hpp:81
static void launch(localIndex const size, arrayView2d< localIndex const, cells::NODE_MAP_USD > const &elemsToNodes, arrayView2d< localIndex const > const &elemsToFaces, arrayView2d< localIndex const > const &facesToElems, ArrayOfArraysView< localIndex const > const &facesToNodes, arrayView1d< localIndex const > const &freeSurfaceFaceIndicator, arrayView2d< localIndex > const &elemsToOpposite, arrayView2d< integer > const &elemsToOppositePermutation)
Launches the precomputation of the element neighborhood information needed by DG.
static void launch(localIndex const size, arrayView2d< real32 const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const &elemsToNodes, arrayView1d< real32 > const &characteristicSize)
Launches the precomputation of the geometry term of the penalty coefficient.
static void launch(localIndex const size, localIndex const regionIndex, ArrayOfArraysView< localIndex const > const baseFacesToNodes, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const baseNodeCoords, arrayView1d< globalIndex const > const baseNodeLocalToGlobal, arrayView1d< globalIndex const > const elementLocalToGlobal, ArrayOfArraysView< localIndex const > const baseNodesToElements, arrayView2d< localIndex const, cells::NODE_MAP_USD > const &baseElemsToNodes, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const > const elemsToFaces, arrayView2d< real64 const > const &elemCenter, arrayView2d< real64 const > const sourceCoordinates, arrayView1d< localIndex > const sourceIsAccessible, arrayView1d< localIndex > const sourceElem, arrayView2d< real64 > const sourceConstants, arrayView1d< localIndex > const sourceRegion, arrayView2d< real64 const > const receiverCoordinates, arrayView1d< localIndex > const receiverIsLocal, arrayView1d< localIndex > const receiverElem, arrayView2d< real64 > const receiverConstants, arrayView1d< localIndex > const receiverRegion)
Launches the precomputation of the source and receiver terms.
static void pressureComputation(localIndex const size, localIndex const regionIndex, arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, arrayView2d< localIndex const, cells::NODE_MAP_USD > const &elemsToNodes, arrayView1d< real32 const > const velocity, arrayView1d< real32 const > const density, arrayView2d< real32 > const p_n, arrayView2d< real32 const > const p_nm1, arrayView2d< localIndex > const &elemsToOpposite, arrayView2d< integer > const &elemsToOppositePermutation, arrayView2d< real64 >referenceInvMassMatrix, arrayView1d< real32 const > const characteristicSize, arrayView2d< real64 const > const sourceConstants, arrayView1d< localIndex const > const sourceIsAccessible, arrayView1d< localIndex const > const sourceElem, arrayView1d< localIndex const > const sourceRegion, real64 const dt, real64 const time_n, real32 const timeSourceFrequency, real32 const timeSourceDelay, localIndex const rickerOrder, bool const useSourceWaveletTables, arrayView1d< TableFunction::KernelWrapper const > const sourceWaveletTableWrappers, arrayView2d< real32 > const p_np1)
Launches the computation of the pressure for one iteration.
static GEOS_HOST_DEVICE REAL computeReferenceLengthForPenalty(arraySlice1d< localIndex const, cells::NODE_MAP_USD - 1 > const elemsToNodes, arrayView2d< REAL const, nodes::REFERENCE_POSITION_USD > const nodeCoords)
Compute the reference size used for the tetrahederal DG penalty coefficient. This implementation uses...