20 #ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ELASTICMATRICESSEMKERNEL_HPP_
21 #define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ELASTICMATRICESSEMKERNEL_HPP_
28 template<
typename FE_TYPE >
47 template<
typename EXEC_POLICY,
typename ATOMIC_POLICY >
63 localIndex const nodeIndex = elemsToNodes( e, FE_TYPE::meshIndexToLinearIndex3D( a ) );
66 xLocal[a][i] = nodeCoords( nodeIndex, i );
70 constexpr
localIndex numQuadraturePointsPerElem = FE_TYPE::numQuadraturePoints;
71 for(
localIndex q = 0; q < numQuadraturePointsPerElem; ++q )
74 RAJA::atomicAdd< ATOMIC_POLICY >( &mass[elemsToNodes( e, q )], localIncrement );
84 template<
typename FE_TYPE >
110 template<
typename EXEC_POLICY,
typename ATOMIC_POLICY >
128 for(
localIndex i = 0; i < elemsToFaces.size( 1 ); ++i )
132 if( facesDomainBoundaryIndicator[f] == 1 && freeSurfaceFaceIndicator[f] != 1 )
138 localIndex const nodeIndex = facesToNodes( f, FE_TYPE::meshIndexToLinearIndex2D( a ) );
141 xLocal[a][d] = nodeCoords( nodeIndex, d );
145 real32 const nx = faceNormal( f, 0 ), ny = faceNormal( f, 1 ), nz = faceNormal( f, 2 );
146 constexpr
localIndex numNodesPerFace = FE_TYPE::numNodesPerFace;
147 for(
localIndex q = 0; q < numNodesPerFace; ++q )
150 real32 const localIncrementx = aux * ( velocityVp[e] * LvArray::math::abs( nx ) + velocityVs[e] * LvArray::math::sqrt( pow( ny, 2 ) + pow( nz, 2 ) ) );
151 real32 const localIncrementy = aux * ( velocityVp[e] * LvArray::math::abs( ny ) + velocityVs[e] * LvArray::math::sqrt( pow( nx, 2 ) + pow( nz, 2 ) ) );
152 real32 const localIncrementz = aux * ( velocityVp[e] * LvArray::math::abs( nz ) + velocityVs[e] * LvArray::math::sqrt( pow( nx, 2 ) + pow( ny, 2 ) ) );
154 RAJA::atomicAdd< ATOMIC_POLICY >( &dampingx[facesToNodes( f, q )], localIncrementx );
155 RAJA::atomicAdd< ATOMIC_POLICY >( &dampingy[facesToNodes( f, q )], localIncrementy );
156 RAJA::atomicAdd< ATOMIC_POLICY >( &dampingz[facesToNodes( f, q )], localIncrementz );
#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.
FE_TYPE const & m_finiteElement
The finite element space/discretization object for the element type in the subRegion.
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, arrayView2d< real64 const > const faceNormal, arrayView1d< real32 const > const density, arrayView1d< real32 const > const velocityVp, arrayView1d< real32 const > const velocityVs, arrayView1d< real32 > const dampingx, arrayView1d< real32 > const dampingy, arrayView1d< real32 > const dampingz)
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 density, arrayView1d< real32 > const mass)
Launches the precomputation of the mass matrices.