20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASEUTILITIES_H_
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASEUTILITIES_H_
28 namespace compositionalMultiphaseUtilities
61 template<
typename VEC >
68 for(
integer i = 0; i < numBlocks; ++i )
70 integer const ind = i * numRowsInBlock + numRowsToShift - 1;
72 for(
int j = ind - 1; j >= i * numRowsInBlock; --j )
77 v[i*numRowsInBlock] = tmp;
89 template<
typename VEC >
134 template<
typename MATRIX,
typename VEC >
143 for(
integer k = 0; k < numBlocks; ++k )
145 integer const ind = k * numRowsInBlock + numRowsToShift - 1;
146 for(
integer j = 0; j < numColsInBlock; ++j )
148 work[j] = mat[ind][j];
150 for(
integer i = ind - 1; i >= k * numRowsInBlock; --i )
152 for(
integer j = 0; j < numColsInBlock; ++j )
154 mat[i+1][j] = mat[i][j];
155 work[j] += mat[i][j];
158 for(
integer j = 0; j < numColsInBlock; ++j )
160 mat[k*numRowsInBlock][j] = work[j];
177 template<
typename MATRIX,
typename VEC >
GEOS_HOST_DEVICE void shiftRowsAheadByOneAndReplaceFirstRowWithColumnSum(integer const numRowsInBlock, integer const numColsInBlock, MATRIX &&mat, VEC &&work)
Shifts all rows one position ahead and replaces the first row with the sum of all rows in the input b...
GEOS_HOST_DEVICE void shiftBlockRowsAheadByOneAndReplaceFirstRowWithColumnSum(integer const numRowsToShift, integer const numRowsInBlock, integer const numColsInBlock, integer const numBlocks, MATRIX &&mat, VEC &&work)
In each block, shift the elements from 0 to numRowsToShift-1, shifts all rows one position ahead and ...
GEOS_HOST_DEVICE void shiftElementsAheadByOneAndReplaceFirstElementWithSum(integer const numRows, VEC &&v)
Shifts all elements one position ahead and replaces the first element with the sum of all elements in...
GEOS_HOST_DEVICE void shiftBlockElementsAheadByOneAndReplaceFirstElementWithSum(integer const numRowsToShift, integer const numRowsInBlock, integer const numBlocks, VEC &&v)
In each block, shift the elements from 0 to numRowsToShift-1 one position ahead and replaces the firs...
#define GEOS_HOST_DEVICE
Marks a host-device function.
double real64
64-bit floating point type.
std::int32_t integer
Signed integer type.