Loading...
Searching...
No Matches
Opm::PAvgCalculatorCollection< Scalar > Class Template Reference

Collection of WBPn calculation objects, one for each well. More...

`#include <PAvgCalculatorCollection.hpp>`

## Public Types

using | CalculatorPtr = std::unique_ptr< PAvgCalculator< Scalar > >
| Wrapper for a WBPn calclation object.
using | ActivePredicate = std::function< std::vector< bool >(const std::vector< std::size_t > &)>
| Predicate for whether or not a particular source location is active.

## Public Member Functions

| PAvgCalculatorCollection ()=default
| Default constructor.
| ~PAvgCalculatorCollection ()=default
| Destructor.
| PAvgCalculatorCollection (const PAvgCalculatorCollection &)=delete
| Copy constructor.
| PAvgCalculatorCollection (PAvgCalculatorCollection &&)=default
| Move constructor.
PAvgCalculatorCollection & | operator= (const PAvgCalculatorCollection &)=delete
| Assignment operator.
PAvgCalculatorCollection & | operator= (PAvgCalculatorCollection &&)=default
| Move-assignment operator.
std::size_t | setCalculator (const std::size_t wellID, CalculatorPtr calculator)
| Assign/register a WBPn calculation object for a single well.
void | pruneInactiveWBPCells (ActivePredicate isActive)
| Discard inactive source locations from all WBPn calculation objects.
PAvgCalculator< Scalar > & | operator[] (const std::size_t i)
| Access mutable WBPn calculation object.
const PAvgCalculator< Scalar > & | operator[] (const std::size_t i) const
| Access immutable WBPn calculation object.
bool | empty () const
| Whether or not this collection has any WBPn calculation objects.
std::size_t | numCalculators () const
| Number of WBPn calculation objects owned by this collection.
std::vector< std::size_t > | allWBPCells () const
| Union of all distinct/unique cells/source locations contributing to this complete collection of WBPn calculation objects.

## Detailed Description

template<class Scalar>
class Opm::PAvgCalculatorCollection< Scalar >

Collection of WBPn calculation objects, one for each well.

## Member Typedef Documentation

## ActivePredicate

template<class Scalar >

using Opm::PAvgCalculatorCollection< Scalar >::ActivePredicate = std::function< std::vector<bool>(const std::vector<std::size_t>&)>

Predicate for whether or not a particular source location is active.

One typical use case is determining whether or not a particular cell defined by its Cartesian (I,J,K) index triple is actually amongst the model's active cells.

This predicate will be called with a vector of source location indices and must return a vector of the same size that holds the value 'true' if the corresponding source location is active and 'false' otherwise.

## CalculatorPtr

template<class Scalar >

using Opm::PAvgCalculatorCollection< Scalar >::CalculatorPtr = std::unique_ptr<PAvgCalculator<Scalar> >

Wrapper for a WBPn calclation object.

We use a pointer here to enable polymorphic behaviour at runtime, e.g., parallel calculation in an MPI-enabled simulation run.

## Member Function Documentation

## allWBPCells()

template<class Scalar >

std::vector< std::size_t > Opm::PAvgCalculatorCollection< Scalar >::allWBPCells | ( |  | ) | const

Union of all distinct/unique cells/source locations contributing to this complete collection of WBPn calculation objects.

Mainly intended to configure `PAvgDynamicSourceData` objects.

## operator[]() [1/2]

template<class Scalar >

PAvgCalculator< Scalar > & Opm::PAvgCalculatorCollection< Scalar >::operator[] | ( | const std::size_t | i | ) |

Access mutable WBPn calculation object.

Parameters

  [in] | i | WBPn calculation object index. Must be one returned from a previous call to `setCalculator`.

Returns
  Mutable WBPn calculation object.

## operator[]() [2/2]

template<class Scalar >

const PAvgCalculator< Scalar > & Opm::PAvgCalculatorCollection< Scalar >::operator[] | ( | const std::size_t | i | ) | const

Access immutable WBPn calculation object.

Parameters

  [in] | i | WBPn calculation object index. Must be one returned from a previous call to `setCalculator`.

Returns
  Immutable WBPn calculation object.

## pruneInactiveWBPCells()

template<class Scalar >

void Opm::PAvgCalculatorCollection< Scalar >::pruneInactiveWBPCells | ( | ActivePredicate | isActive | ) |

Discard inactive source locations from all WBPn calculation objects.

At the end of this call, no source location deemed to be "inactive" will be amongst those later used for collection of source term contributions.

Parameters

  [in] | isActive | Predicate for whether or not a source location is "active". The caller determines what "active" means. Must abide by the protocol outlined above.

## setCalculator()

template<class Scalar >

std::size_t Opm::PAvgCalculatorCollection< Scalar >::setCalculator | ( | const std::size_t | wellID,
|  | CalculatorPtr | calculator
| ) |  |

Assign/register a WBPn calculation object for a single well.

Parameters

  [in] | wellID | Unique numeric ID representing a single well. Typically the seqIndex() of a `Well` object.
  [in] | calculator | Calculation object specific to a single well.

Returns
  Index by which to refer to the calculation object later, e.g., when calculating the WBPn values for a single well. No relation to `wellID`.

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

- opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp
- opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.cpp