My Project
Loading...
Searching...
No Matches
Opm::PAvgCalculatorCollection Class Reference

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

#include <PAvgCalculatorCollection.hpp>

Public Types

using CalculatorPtr = std::unique_ptr< PAvgCalculator >
 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.
 
PAvgCalculatorCollectionoperator= (const PAvgCalculatorCollection &)=delete
 Assignment operator.
 
PAvgCalculatorCollectionoperator= (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.
 
PAvgCalculatoroperator[] (const std::size_t i)
 Access mutable WBPn calculation object.
 
const PAvgCalculatoroperator[] (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

Collection of WBPn calculation objects, one for each well.

Member Typedef Documentation

◆ ActivePredicate

using Opm::PAvgCalculatorCollection::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

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()

std::vector< std::size_t > Opm::PAvgCalculatorCollection::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]

PAvgCalculator & Opm::PAvgCalculatorCollection::operator[] ( const std::size_t  i)

Access mutable WBPn calculation object.

Parameters
[in]iWBPn calculation object index. Must be one returned from a previous call to setCalculator.
Returns
Mutable WBPn calculation object.

◆ operator[]() [2/2]

const PAvgCalculator & Opm::PAvgCalculatorCollection::operator[] ( const std::size_t  i) const

Access immutable WBPn calculation object.

Parameters
[in]iWBPn calculation object index. Must be one returned from a previous call to setCalculator.
Returns
Immutable WBPn calculation object.

◆ pruneInactiveWBPCells()

void Opm::PAvgCalculatorCollection::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]isActivePredicate for whether or not a source location is "active". The caller determines what "active" means. Must abide by the protocol outlined above.

◆ setCalculator()

std::size_t Opm::PAvgCalculatorCollection::setCalculator ( const std::size_t  wellID,
CalculatorPtr  calculator 
)

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

Parameters
[in]wellIDUnique numeric ID representing a single well. Typically the
seqIndex()
of a Well object.
[in]calculatorCalculation 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: