19 #ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_TAPERKERNEL_HPP_
20 #define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_TAPERKERNEL_HPP_
27 using wsCoordType = WaveSolverUtils::wsCoordType;
46 template<
typename EXEC_POLICY >
58 RAJA::ReduceMin< parallelDeviceReduce, real32 > xMinGlobal( LvArray::NumericLimits< real32 >::max );
59 RAJA::ReduceMin< parallelDeviceReduce, real32 > yMinGlobal( LvArray::NumericLimits< real32 >::max );
60 RAJA::ReduceMin< parallelDeviceReduce, real32 > zMinGlobal( LvArray::NumericLimits< real32 >::max );
61 RAJA::ReduceMax< parallelDeviceReduce, real32 > xMaxGlobal( -LvArray::NumericLimits< real32 >::max );
62 RAJA::ReduceMax< parallelDeviceReduce, real32 > yMaxGlobal( -LvArray::NumericLimits< real32 >::max );
63 RAJA::ReduceMax< parallelDeviceReduce, real32 > zMaxGlobal( -LvArray::NumericLimits< real32 >::max );
64 RAJA::ReduceMin< parallelDeviceReduce, real32 > xMinInterior( LvArray::NumericLimits< real32 >::max );
65 RAJA::ReduceMin< parallelDeviceReduce, real32 > yMinInterior( LvArray::NumericLimits< real32 >::max );
66 RAJA::ReduceMin< parallelDeviceReduce, real32 > zMinInterior( LvArray::NumericLimits< real32 >::max );
67 RAJA::ReduceMax< parallelDeviceReduce, real32 > xMaxInterior( -LvArray::NumericLimits< real32 >::max );
68 RAJA::ReduceMax< parallelDeviceReduce, real32 > yMaxInterior( -LvArray::NumericLimits< real32 >::max );
69 RAJA::ReduceMax< parallelDeviceReduce, real32 > zMaxInterior( -LvArray::NumericLimits< real32 >::max );
76 xMinGlobal.min( nodeCoords[a][0] );
77 yMinGlobal.min( nodeCoords[a][1] );
78 zMinGlobal.min( nodeCoords[a][2] );
79 xMaxGlobal.max( nodeCoords[a][0] );
80 yMaxGlobal.max( nodeCoords[a][1] );
81 zMaxGlobal.max( nodeCoords[a][2] );
84 xGlobalMin[0] = xMinGlobal.get();
85 xGlobalMin[1] = yMinGlobal.get();
86 xGlobalMin[2] = zMinGlobal.get();
87 xGlobalMax[0] = xMaxGlobal.get();
88 xGlobalMax[1] = yMaxGlobal.get();
89 xGlobalMax[2] = zMaxGlobal.get();
102 real32 distXmin = LvArray::math::abs( nodeCoords[a][0]-xGlobalMin[0] );
103 real32 distXmax = LvArray::math::abs( nodeCoords[a][0]-xGlobalMax[0] );
104 real32 distYmin = LvArray::math::abs( nodeCoords[a][1]-xGlobalMin[1] );
105 real32 distYmax = LvArray::math::abs( nodeCoords[a][1]-xGlobalMax[1] );
106 real32 distZmax = LvArray::math::abs( nodeCoords[a][2]-xGlobalMax[2] );
108 dist=LvArray::math::min( distXmin, (LvArray::math::min( distXmax, LvArray::math::min( distYmin, (LvArray::math::min( distYmax, distZmax ))))));
110 taperCoeff[a] = dist;
118 real32 dist = taperCoeff[a];
122 taperCoeff[a] = LvArray::math::exp((((3*vMin)/(2*sizeT))*LvArray::math::log( r )*pow((sizeT-dist)/sizeT, 2 ))*dt );
142 template<
typename EXEC_POLICY >
150 vector[a] *= taperCoeff[a];
#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.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
static T max(T const &value, MPI_Comm comm=MPI_COMM_GEOS)
Convenience function for a MPI_Allreduce using a MPI_MAX operation.
static T min(T const &value, MPI_Comm comm=MPI_COMM_GEOS)
Convenience function for a MPI_Allreduce using a MPI_MIN operation.
static void computeTaperCoeff(localIndex const size, arrayView2d< wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords, real32 const sizeT, real32 const dt, real32 const vMin, real32 const r, arrayView1d< real32 > const taperCoeff)
Compute coefficients for the taper layers. In this computation the choice of the taper length (sizeT)...
static void multiplyByTaperCoeff(localIndex const size, arrayView1d< real32 const > const taperCoeff, arrayView1d< real32 > const vector)
Multiply an array with the taper coefficients.