Opm::ParallelPAvgDynamicSourceData Class Reference

#include <ParallelPAvgDynamicSourceData.hpp>

Inheritance diagram for Opm::ParallelPAvgDynamicSourceData:
Inheritance graph

Public Types

using GlobalToLocal = std::function< int(const std::size_t)>
 
using Evaluator = std::function< void(int, SourceDataSpan< double >)>
 

Public Member Functions

 ParallelPAvgDynamicSourceData (const Parallel::Communication &comm, const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
 
void setToZero ()
 
void reconstruct (const std::vector< std::size_t > &sourceLocations, GlobalToLocal localCellIdx)
 
void collectLocalSources (Evaluator eval)
 
void synchroniseSources ()
 

Detailed Description

Dynamic source data for block-average pressure calculations. Specialisation for parallel runs.

Member Typedef Documentation

◆ Evaluator

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

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

using Opm::ParallelPAvgDynamicSourceData::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.

Constructor & Destructor Documentation

◆ ParallelPAvgDynamicSourceData()

Opm::ParallelPAvgDynamicSourceData::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()

void Opm::ParallelPAvgDynamicSourceData::collectLocalSources ( Evaluator  eval)

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

Parameters
[in]evalSource term evaluator object.

◆ reconstruct()

void Opm::ParallelPAvgDynamicSourceData::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()

void Opm::ParallelPAvgDynamicSourceData::setToZero ( )

Clear contents of local source term contributions.

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

◆ synchroniseSources()

void Opm::ParallelPAvgDynamicSourceData::synchroniseSources ( )

Exchange local contributions to build full, global view of all source terms.


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