diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEMKernel.hpp index daf91ab2d0f..ac793524a2a 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEMKernel.hpp @@ -41,7 +41,7 @@ struct PrecomputeSourceAndReceiverKernel * @param[in] size the number of cells in the subRegion * @param[in] numNodesPerElem number of nodes per element * @param[in] numFacesPerElem number of faces per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemGhostRank rank of the ghost element * @param[in] elemsToNodes map from element to nodes * @param[in] elemsToFaces map from element to faces @@ -70,7 +70,7 @@ struct PrecomputeSourceAndReceiverKernel localIndex const regionIndex, localIndex const numNodesPerElem, localIndex const numFacesPerElem, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes, arrayView2d< localIndex const > const elemsToFaces, @@ -127,7 +127,7 @@ struct PrecomputeSourceAndReceiverKernel WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); sourceIsAccessible[isrc] = 1; @@ -175,7 +175,7 @@ struct PrecomputeSourceAndReceiverKernel { WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); receiverIsLocal[ircv] = 1; rcvElem[ircv] = k; @@ -211,7 +211,7 @@ struct MassMatrixKernel * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] velocity cell-wise velocity * @param[in] density cell-wise density @@ -220,7 +220,7 @@ struct MassMatrixKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + 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, @@ -239,7 +239,7 @@ struct MassMatrixKernel { for( localIndex i = 0; i < 3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } @@ -337,7 +337,7 @@ struct VelocityComputation * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] p_np1 pressure array (only used here) * @param[in] dt time-step @@ -348,7 +348,7 @@ struct VelocityComputation template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes, arrayView1d< real32 const > const p_np1, arrayView1d< real32 const > const density, @@ -367,7 +367,7 @@ struct VelocityComputation { for( localIndex i=0; i<3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } @@ -447,7 +447,7 @@ struct PressureComputation * @param[in] size the number of cells in the subRegion * @param[in] regionIndex Index of the subregion * @param[in] size_node the number of nodes in the subRegion - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[out] velocity_x velocity array in the x direction (only used here) * @param[out] velocity_y velocity array in the y direction (only used here) @@ -468,7 +468,7 @@ struct PressureComputation launch( localIndex const size, localIndex const regionIndex, localIndex const size_node, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes, arrayView2d< real32 const > const velocity_x, arrayView2d< real32 const > const velocity_y, @@ -502,7 +502,7 @@ struct PressureComputation { for( localIndex i=0; i<3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEM.cpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEM.cpp index 5184f533170..68dff0e5793 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEM.cpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEM.cpp @@ -244,7 +244,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups() /// get the array of indicators: 1 if the face is on the boundary; 0 otherwise arrayView1d< integer > const & facesDomainBoundaryIndicator = faceManager.getDomainBoundaryIndicator(); - arrayView2d< wsCoordType const, nodes::REFERENCE_POSITION_USD > const X32 = + arrayView2d< wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords = nodeManager.getField< fields::referencePosition32 >().toViewConst(); /// get face to node map @@ -273,7 +273,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups() { arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes = elementSubRegion.nodeList(); - arrayView2d< localIndex const > const facesToElements = faceManager.elementList(); + arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList(); arrayView1d< real32 const > const velocity = elementSubRegion.getField< fields::wavesolverfields::MediumVelocity >(); arrayView1d< real32 const > const epsilon = elementSubRegion.getField< fields::wavesolverfields::Epsilon >(); arrayView1d< real32 const > const delta = elementSubRegion.getField< fields::wavesolverfields::Delta >(); @@ -288,16 +288,16 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups() acousticVTIWaveEquationSEMKernels::MassMatrixKernel< FE_TYPE > kernelM( finiteElement ); kernelM.template launch< EXEC_POLICY, ATOMIC_POLICY >( elementSubRegion.size(), - X32, + nodeCoords, elemsToNodes, velocity, mass ); acousticVTIWaveEquationSEMKernels::DampingMatrixKernel< FE_TYPE > kernelD( finiteElement ); - kernelD.template launch< EXEC_POLICY, ATOMIC_POLICY >( faceManager.size(), - X32, - facesToElements, + kernelD.template launch< EXEC_POLICY, ATOMIC_POLICY >( elementSubRegion.size(), + nodeCoords, + elemsToFaces, facesToNodes, facesDomainBoundaryIndicator, freeSurfaceFaceIndicator, diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEMKernel.hpp index f79cf79011c..bd062c38fa2 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEMKernel.hpp @@ -34,9 +34,6 @@ namespace acousticVTIWaveEquationSEMKernels struct PrecomputeSourceAndReceiverKernel { - - - /** * @brief Launches the precomputation of the source and receiver terms * @tparam EXEC_POLICY execution policy @@ -44,7 +41,7 @@ struct PrecomputeSourceAndReceiverKernel * @param[in] size the number of cells in the subRegion * @param[in] numNodesPerElem number of nodes per element * @param[in] numFacesPerElem number of faces per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemGhostRank the ghost ranks * @param[in] elemsToNodes map from element to nodes * @param[in] elemsToFaces map from element to faces @@ -69,7 +66,7 @@ struct PrecomputeSourceAndReceiverKernel launch( localIndex const size, localIndex const numNodesPerElem, localIndex const numFacesPerElem, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes, arrayView2d< localIndex const > const elemsToFaces, @@ -122,7 +119,7 @@ struct PrecomputeSourceAndReceiverKernel WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); sourceIsAccessible[isrc] = 1; @@ -168,7 +165,7 @@ struct PrecomputeSourceAndReceiverKernel { WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); receiverIsLocal[ircv] = 1; @@ -203,7 +200,7 @@ struct MassMatrixKernel * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] velocity cell-wise velocity * @param[out] mass diagonal of the mass matrix @@ -211,32 +208,32 @@ struct MassMatrixKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + 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 mass ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) { constexpr localIndex numNodesPerElem = FE_TYPE::numNodes; constexpr localIndex numQuadraturePointsPerElem = FE_TYPE::numQuadraturePoints; - real32 const invC2 = 1.0 / ( velocity[k] * velocity[k] ); + real32 const invC2 = 1.0 / ( velocity[e] * velocity[e] ); real64 xLocal[ numNodesPerElem ][ 3 ]; for( localIndex a = 0; a < numNodesPerElem; ++a ) { for( localIndex i = 0; i < 3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( e, a ), i ); } } for( localIndex q = 0; q < numQuadraturePointsPerElem; ++q ) { real32 const localIncrement = invC2 * m_finiteElement.computeMassTerm( q, xLocal ); - RAJA::atomicAdd< ATOMIC_POLICY >( &mass[elemsToNodes[k][q]], localIncrement ); + RAJA::atomicAdd< ATOMIC_POLICY >( &mass[elemsToNodes( e, q )], localIncrement ); } } ); // end loop over element } @@ -259,8 +256,8 @@ struct DampingMatrixKernel * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion - * @param[in] X coordinates of the nodes - * @param[in] facesToElems map from faces to elements + * @param[in] nodeCoords coordinates of the nodes + * @param[in] elemsToFaces map from faces to elements * @param[in] facesToNodes map from face to nodes * @param[in] facesDomainBoundaryIndicator flag equal to 1 if the face is on the boundary, and to 0 otherwise * @param[in] freeSurfaceFaceIndicator flag equal to 1 if the face is on the free surface, and to 0 otherwise @@ -278,8 +275,8 @@ struct DampingMatrixKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, - arrayView2d< localIndex const > const facesToElems, + 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, @@ -294,67 +291,65 @@ struct DampingMatrixKernel arrayView1d< real32 > const damping_pq, arrayView1d< real32 > const damping_qp ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const f ) + forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) { - // face on the domain boundary and not on free surface - if( facesDomainBoundaryIndicator[f] == 1 && freeSurfaceFaceIndicator[f] != 1 ) + for( localIndex i = 0; i < elemsToFaces.size( 1 ); ++i ) { - localIndex k = facesToElems( f, 0 ); - if( k < 0 ) + localIndex const f = elemsToFaces( e, i ); + // face on the domain boundary and not on free surface + if( facesDomainBoundaryIndicator[f] == 1 && freeSurfaceFaceIndicator[f] != 1 ) { - k = facesToElems( f, 1 ); - } - - // ABC coefficients - real32 alpha = 1.0 / velocity[k]; - // VTI coefficients - real32 vti_p_xy= 0, vti_p_z = 0, vti_pq_z = 0; - real32 vti_q_xy= 0, vti_q_z = 0, vti_qp_xy= 0; - if( lateralSurfaceFaceIndicator[f] == 1 ) - { - // ABC coefficients updated to fit horizontal velocity - alpha /= sqrt( 1+2*epsilon[k] ); - - vti_p_xy = (1+2*epsilon[k]); - vti_q_xy = -(vti_f[k]-1); - vti_qp_xy = (vti_f[k]+2*delta[k]); - } - if( bottomSurfaceFaceIndicator[f] == 1 ) - { - // ABC coefficients updated to fit horizontal velocity - alpha /= sqrt( 1+2*delta[k] ); - vti_p_z = -(vti_f[k]-1); - vti_pq_z = vti_f[k]; - vti_q_z = 1; - } + // ABC coefficients + real32 alpha = 1.0 / velocity[e]; + // VTI coefficients + real32 vti_p_xy= 0, vti_p_z = 0, vti_pq_z = 0; + real32 vti_q_xy= 0, vti_q_z = 0, vti_qp_xy= 0; + if( lateralSurfaceFaceIndicator[f] == 1 ) + { + // ABC coefficients updated to fit horizontal velocity + alpha /= sqrt( 1+2*epsilon[e] ); - constexpr localIndex numNodesPerFace = FE_TYPE::numNodesPerFace; + vti_p_xy = (1+2*epsilon[e]); + vti_q_xy = -(vti_f[e]-1); + vti_qp_xy = (vti_f[e]+2*delta[e]); + } + if( bottomSurfaceFaceIndicator[f] == 1 ) + { + // ABC coefficients updated to fit horizontal velocity + alpha /= sqrt( 1+2*delta[e] ); + vti_p_z = -(vti_f[e]-1); + vti_pq_z = vti_f[e]; + vti_q_z = 1; + } - real64 xLocal[ numNodesPerFace ][ 3 ]; - for( localIndex a = 0; a < numNodesPerFace; ++a ) - { - for( localIndex i = 0; i < 3; ++i ) + constexpr localIndex numNodesPerFace = FE_TYPE::numNodesPerFace; + real64 xLocal[ numNodesPerFace ][ 3 ]; + for( localIndex a = 0; a < numNodesPerFace; ++a ) { - xLocal[a][i] = X( facesToNodes( k, a ), i ); + for( localIndex d = 0; d < 3; ++d ) + { + xLocal[a][d] = nodeCoords( facesToNodes( f, a ), d ); + } } - } - for( localIndex q = 0; q < numNodesPerFace; ++q ) - { - real32 const localIncrement_p = alpha*(vti_p_xy + vti_p_z) * m_finiteElement.computeDampingTerm( q, xLocal ); - RAJA::atomicAdd< ATOMIC_POLICY >( &damping_p[facesToNodes[f][q]], localIncrement_p ); + for( localIndex q = 0; q < numNodesPerFace; ++q ) + { + real32 const aux = m_finiteElement.computeDampingTerm( q, xLocal ); + real32 const localIncrement_p = alpha*(vti_p_xy + vti_p_z) * aux; + RAJA::atomicAdd< ATOMIC_POLICY >( &damping_p[facesToNodes( f, q )], localIncrement_p ); - real32 const localIncrement_pq = alpha*vti_pq_z * m_finiteElement.computeDampingTerm( q, xLocal ); - RAJA::atomicAdd< ATOMIC_POLICY >( &damping_pq[facesToNodes[f][q]], localIncrement_pq ); + real32 const localIncrement_pq = alpha*vti_pq_z * aux; + RAJA::atomicAdd< ATOMIC_POLICY >( &damping_pq[facesToNodes( f, q )], localIncrement_pq ); - real32 const localIncrement_q = alpha*(vti_q_xy + vti_q_z) * m_finiteElement.computeDampingTerm( q, xLocal ); - RAJA::atomicAdd< ATOMIC_POLICY >( &damping_q[facesToNodes[f][q]], localIncrement_q ); + real32 const localIncrement_q = alpha*(vti_q_xy + vti_q_z) * aux; + RAJA::atomicAdd< ATOMIC_POLICY >( &damping_q[facesToNodes( f, q )], localIncrement_q ); - real32 const localIncrement_qp = alpha*vti_qp_xy * m_finiteElement.computeDampingTerm( q, xLocal ); - RAJA::atomicAdd< ATOMIC_POLICY >( &damping_qp[facesToNodes[f][q]], localIncrement_qp ); + real32 const localIncrement_qp = alpha*vti_qp_xy * aux; + RAJA::atomicAdd< ATOMIC_POLICY >( &damping_qp[facesToNodes( f, q )], localIncrement_qp ); + } } } - } ); // end loop over element + } ); } /// The finite element space/discretization object for the element type in the subRegion @@ -433,7 +428,7 @@ class ExplicitAcousticVTISEM : public finiteElement::KernelBase< SUBREGION_TYPE, Base( elementSubRegion, finiteElementSpace, inputConstitutiveType ), - m_X( nodeManager.getField< fields::referencePosition32 >() ), + m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ), m_p_n( nodeManager.getField< fields::wavesolverfields::Pressure_p_n >() ), m_q_n( nodeManager.getField< fields::wavesolverfields::Pressure_q_n >() ), m_stiffnessVector_p( nodeManager.getField< fields::wavesolverfields::StiffnessVector_p >() ), @@ -485,7 +480,7 @@ class ExplicitAcousticVTISEM : public finiteElement::KernelBase< SUBREGION_TYPE, localIndex const nodeIndex = m_elemsToNodes( k, a ); for( int i=0; i< 3; ++i ) { - stack.xLocal[ a ][ i ] = m_X[ nodeIndex ][ i ]; + stack.xLocal[ a ][ i ] = m_nodeCoords[ nodeIndex ][ i ]; } } } @@ -526,7 +521,7 @@ class ExplicitAcousticVTISEM : public finiteElement::KernelBase< SUBREGION_TYPE, protected: /// The array containing the nodal position array. - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_X; + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_nodeCoords; /// The array containing the nodal pressure array. arrayView1d< real32 const > const m_p_n; diff --git a/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEMKernel.hpp index 122c7f1d48d..09fae59376d 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/AcousticWaveEquationSEMKernel.hpp @@ -41,7 +41,7 @@ struct PrecomputeSourceAndReceiverKernel * @tparam FE_TYPE finite element type * @param[in] size the number of cells in the subRegion * @param[in] numNodesPerElem number of nodes per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] elemsToFaces map from element to faces * @param[in] facesToNodes map from faces to nodes @@ -60,7 +60,7 @@ struct PrecomputeSourceAndReceiverKernel launch( localIndex const size, localIndex const numNodesPerElem, localIndex const numFacesPerElem, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes, arrayView2d< localIndex const > const elemsToFaces, @@ -113,7 +113,7 @@ struct PrecomputeSourceAndReceiverKernel WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); sourceIsAccessible[isrc] = 1; @@ -159,7 +159,7 @@ struct PrecomputeSourceAndReceiverKernel { WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); receiverIsLocal[ircv] = 1; @@ -195,7 +195,7 @@ struct MassMatrixKernel * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion * @param[in] numFacesPerElem number of faces per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] velocity cell-wise velocity * @param[in] density cell-wise density @@ -204,7 +204,7 @@ struct MassMatrixKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + 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, @@ -222,7 +222,7 @@ struct MassMatrixKernel { for( localIndex i = 0; i < 3; ++i ) { - xLocal[a][i] = X( elemsToNodes( e, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( e, a ), i ); } } @@ -384,7 +384,7 @@ struct PMLKernel * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] targetSet list of cells in the target set - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemToNodesViewConst constant array view of map from element to nodes * @param[in] velocity cell-wise velocity * @param[in] p_n pressure field at time n @@ -403,7 +403,7 @@ struct PMLKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( SortedArrayView< localIndex const > const targetSet, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, traits::ViewTypeConst< CellElementSubRegion::NodeMapType > const elemToNodesViewConst, arrayView1d< real32 const > const velocity, arrayView1d< real32 const > const p_n, @@ -456,8 +456,8 @@ struct PMLKernel auxU[i] = u_n[elemToNodesViewConst[k][i]]; for( int j=0; j<3; ++j ) { - xLocal[i][j] = X[elemToNodesViewConst[k][i]][j]; - xLocal32[i][j] = X[elemToNodesViewConst[k][i]][j]; + xLocal[i][j] = nodeCoords[elemToNodesViewConst[k][i]][j]; + xLocal32[i][j] = nodeCoords[elemToNodesViewConst[k][i]][j]; auxV[j][i] = v_n[elemToNodesViewConst[k][i]][j]; } } @@ -538,7 +538,7 @@ struct waveSpeedPMLKernel * @tparam EXEC_POLICY the execution policy * @tparam ATOMIC_POLICY the atomic policy * @param[in] targetSet list of cells in the target set - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemToNodesViewConst constant array view of map from element to nodes * @param[in] velocity cell-wise velocity * @param[in] xMin coordinate limits of the inner PML boundaries, left-front-top @@ -551,7 +551,7 @@ struct waveSpeedPMLKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( SortedArrayView< localIndex const > const targetSet, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, traits::ViewTypeConst< CellElementSubRegion::NodeMapType > const elemToNodesViewConst, arrayView1d< real32 const > const velocity, real32 const (&xMin)[3], @@ -594,7 +594,7 @@ struct waveSpeedPMLKernel { for( localIndex i=0; i() ), + m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ), m_p_n( nodeManager.getField< fields::Pressure_n >() ), m_stiffnessVector( nodeManager.getField< fields::StiffnessVector >() ), m_density( elementSubRegion.template getField< fields::MediumDensity >() ), @@ -783,7 +783,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE, localIndex const nodeIndex = m_elemsToNodes( k, a ); for( int i=0; i< 3; ++i ) { - stack.xLocal[ a ][ i ] = m_X[ nodeIndex ][ i ]; + stack.xLocal[ a ][ i ] = m_nodeCoords[ nodeIndex ][ i ]; } } } @@ -811,7 +811,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE, protected: /// The array containing the nodal position array. - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_X; + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_nodeCoords; /// The array containing the nodal pressure array. arrayView1d< real32 const > const m_p_n; diff --git a/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEMKernel.hpp index 3a9fa825ff3..c4414f17c0e 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/ElasticFirstOrderWaveEquationSEMKernel.hpp @@ -39,7 +39,7 @@ struct PrecomputeSourceAndReceiverKernel * @tparam FE_TYPE finite element type * @param[in] size the number of cells in the subRegion * @param[in] numFacesPerElem number of face on an element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemGhostRank array containing the ghost rank * @param[in] elemsToNodes map from element to nodes * @param[in] elemsToFaces map from element to faces @@ -64,7 +64,7 @@ struct PrecomputeSourceAndReceiverKernel localIndex const regionIndex, localIndex const numNodesPerElem, localIndex const numFacesPerElem, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes, arrayView2d< localIndex const > const elemsToFaces, @@ -121,7 +121,7 @@ struct PrecomputeSourceAndReceiverKernel WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); sourceIsAccessible[isrc] = 1; sourceElem[isrc] = k; @@ -168,7 +168,7 @@ struct PrecomputeSourceAndReceiverKernel { WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); receiverIsLocal[ircv] = 1; rcvElem[ircv] = k; @@ -204,7 +204,7 @@ struct MassMatrixKernel * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion * @param[in] numFacesPerElem number of faces per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] velocity cell-wise velocity * @param[out] mass diagonal of the mass matrix @@ -212,7 +212,7 @@ struct MassMatrixKernel template< typename EXEC_POLICY, typename ATOMIC_POLICY > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + 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 ) @@ -229,7 +229,7 @@ struct MassMatrixKernel { for( localIndex i = 0; i < 3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } @@ -339,7 +339,7 @@ struct StressComputation void launch( localIndex const size, localIndex const regionIndex, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes, arrayView1d< real32 const > const ux_np1, arrayView1d< real32 const > const uy_np1, @@ -373,7 +373,7 @@ struct StressComputation { for( localIndex i=0; i<3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } @@ -514,7 +514,7 @@ struct VelocityComputation void launch( localIndex const size, localIndex const size_node, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes, arrayView2d< real32 const > const stressxx, arrayView2d< real32 const > const stressyy, @@ -550,7 +550,7 @@ struct VelocityComputation { for( localIndex i=0; i<3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } diff --git a/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEMKernel.hpp index 8b57bce3f82..ebdd56542f4 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/ElasticWaveEquationSEMKernel.hpp @@ -39,7 +39,7 @@ struct PrecomputeSourceAndReceiverKernel * @tparam FE_TYPE finite element type * @param[in] size the number of cells in the subRegion * @param[in] numFacesPerElem number of face on an element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemGhostRank array containing the ghost rank * @param[in] elemsToNodes map from element to nodes * @param[in] elemsToFaces map from element to faces @@ -65,7 +65,7 @@ struct PrecomputeSourceAndReceiverKernel static void launch( localIndex const size, localIndex const numFacesPerElem, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, arrayView1d< integer const > const elemGhostRank, arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes, arrayView2d< localIndex const > const elemsToFaces, @@ -117,7 +117,7 @@ struct PrecomputeSourceAndReceiverKernel { for( localIndex i=0; i<3; ++i ) { - xLocal[a][i] = X( elemsToNodes( k, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i ); } } @@ -137,7 +137,7 @@ struct PrecomputeSourceAndReceiverKernel WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); sourceIsAccessible[isrc] = 1; @@ -194,7 +194,7 @@ struct PrecomputeSourceAndReceiverKernel { WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords, elemsToNodes[k], - X, + nodeCoords, coordsOnRefElem ); receiverIsLocal[ircv] = 1; @@ -230,7 +230,7 @@ struct MassMatrixKernel * @tparam ATOMIC_POLICY the atomic policy * @param[in] size the number of cells in the subRegion * @param[in] numFacesPerElem number of faces per element - * @param[in] X coordinates of the nodes + * @param[in] nodeCoords coordinates of the nodes * @param[in] elemsToNodes map from element to nodes * @param[in] velocity cell-wise velocity * @param[out] mass diagonal of the mass matrix @@ -239,7 +239,7 @@ struct MassMatrixKernel //std::enable_if_t< geos::is_sem_formulation< std::remove_cv_t< FE_TYPE_ > >::value, void > void launch( localIndex const size, - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X, + 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 ) @@ -256,7 +256,7 @@ struct MassMatrixKernel { for( localIndex i = 0; i < 3; ++i ) { - xLocal[a][i] = X( elemsToNodes( e, a ), i ); + xLocal[a][i] = nodeCoords( elemsToNodes( e, a ), i ); } } @@ -418,7 +418,7 @@ class ExplicitElasticSEM : public finiteElement::KernelBase< SUBREGION_TYPE, Base( elementSubRegion, finiteElementSpace, inputConstitutiveType ), - m_X( nodeManager.getField< fields::referencePosition32 >() ), + m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ), m_ux_n( nodeManager.getField< fields::Displacementx_n >() ), m_uy_n( nodeManager.getField< fields::Displacementy_n >() ), m_uz_n( nodeManager.getField< fields::Displacementz_n >() ), @@ -475,7 +475,7 @@ class ExplicitElasticSEM : public finiteElement::KernelBase< SUBREGION_TYPE, localIndex const nodeIndex = m_elemsToNodes( k, a ); for( int i=0; i< 3; ++i ) { - stack.xLocal[ a ][ i ] = m_X[ nodeIndex ][ i ]; + stack.xLocal[ a ][ i ] = m_nodeCoords[ nodeIndex ][ i ]; } } stack.mu = m_density[k] * m_velocityVs[k] * m_velocityVs[k]; @@ -521,7 +521,7 @@ class ExplicitElasticSEM : public finiteElement::KernelBase< SUBREGION_TYPE, protected: /// The array containing the nodal position array. - arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_X; + arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const m_nodeCoords; /// The array containing the nodal displacement array in x direction. arrayView1d< real32 > const m_ux_n;