opm-simulators
Loading...
Searching...
No Matches
Opm::ParallelPAvgDynamicSourceData< Scalar > Class Template Reference

Dynamic source data for block-average pressure calculations. More...

#include <ParallelPAvgDynamicSourceData.hpp>

Inheritance diagram for Opm::ParallelPAvgDynamicSourceData< Scalar >:

Public Types

using GlobalToLocal = std::function<int(const std::size_t)>
 Translate globally unique, linearised Cartesian cell indices to local, on-rank, cell indices.
template<typename T>
using SourceDataSpan
 Fixed-width span/view of a underlying range of contiguous elements.
using Evaluator = std::function<void(int, SourceDataSpan<Scalar>)>
 Collect source term contributions from local, on-rank, cell.

Public Member Functions

 ParallelPAvgDynamicSourceData (const Parallel::Communication &comm, const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
 Constructor.
void setToZero ()
 Clear contents of local source term contributions.
void reconstruct (const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
 Reconstruct Source Data backing storage and internal mapping tables.
void collectLocalSources (Evaluator eval)
 Compute local, on-rank, contributions to the collection of source terms.
void synchroniseSources ()
 Exchange local contributions to build full, global view of all source terms.

Detailed Description

template<class Scalar>
class Opm::ParallelPAvgDynamicSourceData< Scalar >

Dynamic source data for block-average pressure calculations.

Specialisation for parallel runs.

Member Typedef Documentation

◆ Evaluator

template<class Scalar>
using Opm::ParallelPAvgDynamicSourceData< Scalar >::Evaluator = std::function<void(int, SourceDataSpan<Scalar>)>

Collect source term contributions from local, on-rank, cell.

Called as

eval(cellIndex, sourceTerm)

in which cellIndex is the local, on-rank, cell index in the range 0 to #active cells on rank - 1. Function eval is expected to fill in/assign all sourceTerm items for this cell.

◆ GlobalToLocal

template<class Scalar>
using Opm::ParallelPAvgDynamicSourceData< Scalar >::GlobalToLocal = std::function<int(const std::size_t)>

Translate globally unique, linearised Cartesian cell indices to local, on-rank, cell indices.

Assumed to return a negative value result if the input cell index is not owned by the current rank.

◆ SourceDataSpan

template<class Scalar>
template<typename T>
using Opm::ParallelPAvgDynamicSourceData< Scalar >::SourceDataSpan
Initial value:
typename
PAvgDynamicSourceData<Scalar>::template SourceDataSpan<T>
typename PAvgDynamicSourceData< Scalar >::template SourceDataSpan< T > SourceDataSpan
Fixed-width span/view of a underlying range of contiguous elements.
Definition ParallelPAvgDynamicSourceData.hpp:52

Fixed-width span/view of a underlying range of contiguous elements.

Interface type for populating or providing dynamic source information for a specified location (typically a cell).

Template Parameters
TElement type. Const or non-const as needed. Typically Scalar or
const Scalar
.

Constructor & Destructor Documentation

◆ ParallelPAvgDynamicSourceData()

template<class Scalar>
Opm::ParallelPAvgDynamicSourceData< Scalar >::ParallelPAvgDynamicSourceData ( const Parallel::Communication & comm,
const std::vector< std::size_t > & sourceLocations,
GlobalToLocal localCellIdx )

Constructor.

Parameters
[in]commMPI communication object. Typically
grid.comm()
from the main simulation grid.
[in]sourceLocationsKnown locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically
allWBPCells()
from a PAvgCalculatorCollection.
[in]localCellIdxTranslation from global, Cartesian cell indices to local, on-rank, cell indices.

Member Function Documentation

◆ collectLocalSources()

template<class Scalar>
void Opm::ParallelPAvgDynamicSourceData< Scalar >::collectLocalSources ( Evaluator eval)

Compute local, on-rank, contributions to the collection of source terms.

Parameters
[in]evalSource term evaluator object.

◆ reconstruct()

template<class Scalar>
void Opm::ParallelPAvgDynamicSourceData< Scalar >::reconstruct ( const std::vector< std::size_t > & sourceLocations,
GlobalToLocal localCellIdx )

Reconstruct Source Data backing storage and internal mapping tables.

Effectively replaces the original object formed by the constructor. Mainly intended for updating objects as new wells and/or new reservoir connections are introduced.

Parameters
[in]sourceLocationsKnown locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically
allWBPCells()
from a PAvgCalculatorCollection.
[in]localCellIdxTranslation from global, Cartesian cell indices to local, on-rank, cell indices.

◆ setToZero()

template<class Scalar>
void Opm::ParallelPAvgDynamicSourceData< Scalar >::setToZero ( )

Clear contents of local source term contributions.

Mostly useful when collecting source term contributions along the well bore.


The documentation for this class was generated from the following files: