20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASE_STATISTICSKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASE_STATISTICSKERNEL_HPP
24 #include "common/GEOS_RAJA_Interface.hpp"
29 namespace singlePhaseBaseKernels
44 deltaPres[ei] = pres[ei] - initPres[ei];
67 real64 & totalUncompactedPoreVol,
71 RAJA::ReduceSum< parallelDeviceReduce, localIndex > subRegionElemCount( 0 );
73 RAJA::ReduceMin< parallelDeviceReduce, real64 > subRegionMinPres( LvArray::NumericLimits< real64 >::max );
74 RAJA::ReduceSum< parallelDeviceReduce, real64 > subRegionAvgPresNumerator( 0.0 );
75 RAJA::ReduceMax< parallelDeviceReduce, real64 > subRegionMaxPres( -LvArray::NumericLimits< real64 >::max );
77 RAJA::ReduceMin< parallelDeviceReduce, real64 > subRegionMinDeltaPres( LvArray::NumericLimits< real64 >::max );
78 RAJA::ReduceMax< parallelDeviceReduce, real64 > subRegionMaxDeltaPres( -LvArray::NumericLimits< real64 >::max );
80 RAJA::ReduceMin< parallelDeviceReduce, real64 > subRegionMinTemp( LvArray::NumericLimits< real64 >::max );
81 RAJA::ReduceSum< parallelDeviceReduce, real64 > subRegionAvgTempNumerator( 0.0 );
82 RAJA::ReduceMax< parallelDeviceReduce, real64 > subRegionMaxTemp( -LvArray::NumericLimits< real64 >::max );
84 RAJA::ReduceSum< parallelDeviceReduce, real64 > subRegionTotalUncompactedPoreVol( 0.0 );
85 RAJA::ReduceSum< parallelDeviceReduce, real64 > subRegionTotalPoreVol( 0.0 );
86 RAJA::ReduceSum< parallelDeviceReduce, real64 > subRegionTotalMass( 0.0 );
88 forAll< parallelDevicePolicy<> >( targetSet.size(),
93 if( elemGhostRank[ei] >= 0 )
97 real64 const uncompactedPoreVol = volume[ei] * refPorosity[ei];
98 real64 const dynamicPoreVol = volume[ei] * porosity[ei][0];
100 subRegionElemCount += 1;
102 subRegionMinPres.min( pres[ei] );
103 subRegionAvgPresNumerator += uncompactedPoreVol * pres[ei];
104 subRegionMaxPres.max( pres[ei] );
106 subRegionMinDeltaPres.min( deltaPres[ei] );
107 subRegionMaxDeltaPres.max( deltaPres[ei] );
109 subRegionMinTemp.min( temp[ei] );
110 subRegionAvgTempNumerator += uncompactedPoreVol * temp[ei];
111 subRegionMaxTemp.max( temp[ei] );
113 subRegionTotalUncompactedPoreVol += uncompactedPoreVol;
114 subRegionTotalPoreVol += dynamicPoreVol;
115 subRegionTotalMass += dynamicPoreVol * density[ei][0];
118 elemCount =
globalIndex( subRegionElemCount.get() );
120 minPres = subRegionMinPres.get();
121 avgPresNumerator = subRegionAvgPresNumerator.get();
122 maxPres = subRegionMaxPres.get();
124 minDeltaPres = subRegionMinDeltaPres.get();
125 maxDeltaPres = subRegionMaxDeltaPres.get();
127 minTemp = subRegionMinTemp.get();
128 avgTempNumerator = subRegionAvgTempNumerator.get();
129 maxTemp = subRegionMaxTemp.get();
131 totalUncompactedPoreVol = subRegionTotalUncompactedPoreVol.get();
132 totalPoreVol = subRegionTotalPoreVol.get();
133 totalMass = subRegionTotalMass.get();
#define GEOS_HOST_DEVICE
Marks a host-device function.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.