20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASEUTILITIES_H_
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONALMULTIPHASEUTILITIES_H_
48 namespace compositionalMultiphaseUtilities
94 template<
typename VEC >
101 for(
integer i = 0; i < numBlocks; ++i )
103 integer const ind = i * numRowsInBlock + numRowsToShift - 1;
105 for(
int j = ind - 1; j >= i * numRowsInBlock; --j )
110 v[i*numRowsInBlock] = tmp;
122 template<
typename VEC >
167 template<
typename MATRIX,
typename VEC >
177 for(
integer k = 0; k < numBlocks; ++k )
179 integer const firstRow = k * numRowsInBlock;
180 integer const ind = firstRow + numRowsToShift - 1;
181 for(
integer j = 0; j < numColsInBlock; ++j )
183 work[j] = mat[ind][j];
185 for(
integer i = ind; i > firstRow; --i )
187 for(
integer j = 0; j < numColsInBlock; ++j )
189 mat[i][j] = mat[i-1][j];
190 work[j] += mat[i-1][j];
193 for(
integer j = 0; j < numColsInBlock; ++j )
195 mat[firstRow][j] = work[j];
212 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...
ScalingType
Solution scaling type, used in CompositionalMultiphaseFVM.
@ Global
Scale the Newton update with a unique scaling factor.
@ Local
Scale the Newton update locally (modifies the Newton direction)
#define GEOS_HOST_DEVICE
Marks a host-device function.
double real64
64-bit floating point type.
int integer
Signed integer type.
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "richardson", "preconditioner")
Declare strings associated with enumeration values.
GravityDensityScheme
Options for density treatment in gravity.