20 #ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICMATRICESSEMKERNEL_HPP_
21 #define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICMATRICESSEMKERNEL_HPP_
29 template<
typename FE_TYPE >
50 template<
typename EXEC_POLICY,
typename ATOMIC_POLICY >
63 real32 const invC2 = 1.0 / ( density[e] * pow( velocity[e], 2 ) );
68 localIndex const nodeIndex = elemsToNodes( e, FE_TYPE::meshIndexToLinearIndex3D( a ) );
71 xLocal[a][i] = nodeCoords( nodeIndex, i );
74 constexpr
localIndex numQuadraturePointsPerElem = FE_TYPE::numQuadraturePoints;
75 for(
localIndex q = 0; q < numQuadraturePointsPerElem; ++q )
77 real32 const localIncrement = invC2 * m_finiteElement.computeMassTerm( q, xLocal );
78 RAJA::atomicAdd< ATOMIC_POLICY >( &mass[elemsToNodes( e, q )], localIncrement );
83 FE_TYPE
const & m_finiteElement;
86 template<
typename FE_TYPE >
108 template<
typename EXEC_POLICY,
typename ATOMIC_POLICY >
122 for(
localIndex i = 0; i < elemsToFaces.size( 1 ); ++i )
126 if( facesDomainBoundaryIndicator[f] == 1 && freeSurfaceFaceIndicator[f] != 1 )
132 localIndex const nodeIndex = facesToNodes( f, FE_TYPE::meshIndexToLinearIndex2D( a ) );
135 xLocal[a][d] = nodeCoords( nodeIndex, d );
138 real32 const alpha = 1.0 / (density[e] * velocity[e]);
139 constexpr
localIndex numNodesPerFace = FE_TYPE::numNodesPerFace;
140 for(
localIndex q = 0; q < numNodesPerFace; ++q )
143 RAJA::atomicAdd< ATOMIC_POLICY >( &damping[facesToNodes( f, q )], localIncrement );
#define GEOS_HOST_DEVICE
Marks a host-device function.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
float real32
32-bit floating point type.
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
void computeDampingMatrix(localIndex const size, arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const > const elemsToFaces, ArrayOfArraysView< localIndex const > const facesToNodes, arrayView1d< integer const > const facesDomainBoundaryIndicator, arrayView1d< localIndex const > const freeSurfaceFaceIndicator, arrayView1d< real32 const > const velocity, arrayView1d< real32 const > const density, arrayView1d< real32 > const damping)
Launches the precomputation of the damping matrices.
FE_TYPE const & m_finiteElement
The finite element space/discretization object for the element type in the subRegion.
void computeMassMatrix(localIndex const size, arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes, arrayView1d< real32 const > const velocity, arrayView1d< real32 const > const density, arrayView1d< real32 > const mass)
Launches the precomputation of the mass matrices.