My Project
|
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. | |
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 & | operator[] (const std::size_t i) |
Access mutable WBPn calculation object. | |
const PAvgCalculator & | 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. | |
Collection of WBPn calculation objects, one for each well.
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.
using Opm::PAvgCalculatorCollection::CalculatorPtr = std::unique_ptr<PAvgCalculator> |
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.
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.
PAvgCalculator & Opm::PAvgCalculatorCollection::operator[] | ( | const std::size_t | i | ) |
Access mutable WBPn calculation object.
[in] | i | WBPn calculation object index. Must be one returned from a previous call to setCalculator . |
const PAvgCalculator & Opm::PAvgCalculatorCollection::operator[] | ( | const std::size_t | i | ) | const |
Access immutable WBPn calculation object.
[in] | i | WBPn calculation object index. Must be one returned from a previous call to setCalculator . |
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.
[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. |
std::size_t Opm::PAvgCalculatorCollection::setCalculator | ( | const std::size_t | wellID, |
CalculatorPtr | calculator | ||
) |
Assign/register a WBPn calculation object for a single well.
[in] | wellID | Unique numeric ID representing a single well. Typically the seqIndex()
Well object. |
[in] | calculator | Calculation object specific to a single well. |
wellID
.