My Project
|
Dynamic source data for block-average pressure calculations. More...
#include <ParallelPAvgDynamicSourceData.hpp>
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<class T > | |
using | SourceDataSpan = typename PAvgDynamicSourceData< Scalar >::template SourceDataSpan< T > |
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. | |
Dynamic source data for block-average pressure calculations.
Specialisation for parallel runs.
using Opm::ParallelPAvgDynamicSourceData< Scalar >::Evaluator = std::function<void(int, SourceDataSpan<Scalar>)> |
Collect source term contributions from local, on-rank, cell.
Called as
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.
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.
Opm::ParallelPAvgDynamicSourceData< Scalar >::ParallelPAvgDynamicSourceData | ( | const Parallel::Communication & | comm, |
const std::vector< std::size_t > & | sourceLocations, | ||
GlobalToLocal | localCellIdx | ||
) |
Constructor.
[in] | comm | MPI communication object. Typically grid.comm()
|
[in] | sourceLocations | Known locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically from a PAvgCalculatorCollection . |
[in] | localCellIdx | Translation from global, Cartesian cell indices to local, on-rank, cell indices. |
void Opm::ParallelPAvgDynamicSourceData< Scalar >::collectLocalSources | ( | Evaluator | eval | ) |
Compute local, on-rank, contributions to the collection of source terms.
[in] | eval | Source term evaluator object. |
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.
[in] | sourceLocations | Known locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically from a PAvgCalculatorCollection . |
[in] | localCellIdx | Translation from global, Cartesian cell indices to local, on-rank, cell indices. |
void Opm::ParallelPAvgDynamicSourceData< Scalar >::setToZero | ( | ) |
Clear contents of local source term contributions.
Mostly useful when collecting source term contributions along the well bore.