GEOS
Namespaces | Functions
CompositionalMultiphaseUtilities.hpp File Reference
#include "common/DataTypes.hpp"

Go to the source code of this file.

Namespaces

 geos
 

Functions

template<typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 first element with the sum of all elements from 0 to numRowsToShift-1 of the input block one-dimensional array of values. More...
 
template<typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::shiftElementsAheadByOneAndReplaceFirstElementWithSum (integer const numRows, VEC &&v)
 Shifts all elements one position ahead and replaces the first element with the sum of all elements in the input one-dimensional array of values. More...
 
template<typename MATRIX , typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 replaces the first row with the sum of all rows from 0 to numRowsToShift-1 of the input block row two-dimensional array of values. More...
 
template<typename MATRIX , typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 block row two-dimensional array of values. More...
 

Function Documentation

◆ shiftBlockElementsAheadByOneAndReplaceFirstElementWithSum()

template<typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 first element with the sum of all elements from 0 to numRowsToShift-1 of the input block one-dimensional array of values.

Template Parameters
VECtype of one-dimensional array of values
Parameters
numRowsToShiftnumber of rows to shift in each block
numRowsInBlockblock size
numBlocksnumber of blocks
vblock one-dimensional array of values

@detail numRowsToShift is different from numRowsInBlock if there is an equation that we do not want to modify, like the energy flux for thermal simulations. In that specific case, numRowsToShift is set to numRowsInBlock-1 to make sure that we don't modify the last row of each block (the energy flux)

Let's consider the following blocks arising when computing the localFlux in the thermal compositional solver (for two-component flow)

(mass_comp_1)_1 \ (mass_comp_2)_1 |=> block 1 (energy)_1 /

(mass_comp_1)_2 \ (mass_comp_2)_2 |=> block 2 (energy)_2 /

In this case:

  • numRowsToShift = 2
  • numRowsInBlock = 3
  • numBlocks = 2

Definition at line 63 of file CompositionalMultiphaseUtilities.hpp.

◆ shiftBlockRowsAheadByOneAndReplaceFirstRowWithColumnSum()

template<typename MATRIX , typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 replaces the first row with the sum of all rows from 0 to numRowsToShift-1 of the input block row two-dimensional array of values.

Template Parameters
MATRIXtype of two-dimensional array of values
VECtype of one-dimensional array of values
Parameters
numRowsToShiftnumber of rows to shift in each block
numRowsInBlockblock number of rows
numColsInBlockblock number of columns
numBlocksnumber of row blocks
matblock row two-dimensional array of values
workone-dimensional working array of values of size numColsInBlock

@detail numRowsToShift is different from numRowsInBlock if there is an equation that we do not want to modify, like the energy flux for thermal simulations. In that specific case, numRowsToShift is set to numRowsInBlock-1 to make sure that we don't modify the last row of each block (the energy flux)

Let's consider the following blocks arising when computing the localFluxJacobian in the thermal compositional solver (for two-component flow)

                  p    \rho_1   \rho_2   T

(mass_comp_1)_1 . . . . \ (mass_comp_2)_1 . . . . |=> block 1 (energy)_1 . . . . /

(mass_comp_1)_2 . . . . \ (mass_comp_2)_2 . . . . |=> block 2 (energy)_2 . . . . /

In this case:

  • numRowsToShift = 2
  • numRowsInBlock = 3
  • numColsInBlock = 4
  • numBlocks = 2

Definition at line 136 of file CompositionalMultiphaseUtilities.hpp.

◆ shiftElementsAheadByOneAndReplaceFirstElementWithSum()

template<typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::shiftElementsAheadByOneAndReplaceFirstElementWithSum ( integer const  numRows,
VEC &&  v 
)

Shifts all elements one position ahead and replaces the first element with the sum of all elements in the input one-dimensional array of values.

Template Parameters
VECtype of one-dimensional array of values
Parameters
numRowsvector size
vone-dimensional array of values

Definition at line 91 of file CompositionalMultiphaseUtilities.hpp.

◆ shiftRowsAheadByOneAndReplaceFirstRowWithColumnSum()

template<typename MATRIX , typename VEC >
GEOS_HOST_DEVICE void geos::compositionalMultiphaseUtilities::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 block row two-dimensional array of values.

Template Parameters
MATRIXtype of two-dimensional array of values
VECtype of one-dimensional array of values
Parameters
numRowsInBlocknumber of rows
numColsInBlocknumber of columns
matblock row two-dimensional array of values
workone-dimensional working array of values of size numColsInBlock

Definition at line 179 of file CompositionalMultiphaseUtilities.hpp.