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

Dynamic source data for block-average pressure calculations. More...

#include <PAvgDynamicSourceData.hpp>

Classes

class  SourceDataSpan
 Ad hoc implementation of fixed-width span/view of an underlying contiguous range of elements. More...
 

Public Member Functions

 PAvgDynamicSourceData (const std::vector< std::size_t > &sourceLocations)
 Constructor.
 
virtual ~PAvgDynamicSourceData ()
 Destructor.
 
SourceDataSpan< double > operator[] (const std::size_t source)
 Acquire read/write span of data items corresponding to a single source location.
 
SourceDataSpan< const double > operator[] (const std::size_t source) const
 Acquire read-only span of data items corresponding to a single source location.
 

Protected Member Functions

SourceDataSpan< double > sourceTerm (const std::size_t ix, std::vector< double > &src)
 Form mutable data span into non-default backing store.
 
void reconstruct (const std::vector< std::size_t > &sourceLocations)
 Reconstruct Source Data backing storage and internal mapping tables.
 

Static Protected Member Functions

static constexpr std::size_t numSpanItems () noexcept
 Provide number of span items using function syntax.
 

Protected Attributes

std::vector< double > src_ {}
 Contiguous array of data items for all source locations.
 

Detailed Description

Dynamic source data for block-average pressure calculations.

Constructor & Destructor Documentation

◆ PAvgDynamicSourceData()

Opm::PAvgDynamicSourceData::PAvgDynamicSourceData ( const std::vector< std::size_t > &  sourceLocations)
explicit

Constructor.

Parameters
[in]sourceLocationsKnown locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data.

◆ ~PAvgDynamicSourceData()

virtual Opm::PAvgDynamicSourceData::~PAvgDynamicSourceData ( )
inlinevirtual

Destructor.

Marked virtual because this type is intended for inheritance.

Member Function Documentation

◆ numSpanItems()

static constexpr std::size_t Opm::PAvgDynamicSourceData::numSpanItems ( )
inlinestaticconstexprprotectednoexcept

Provide number of span items using function syntax.

Marked 'protected' because derived classes might need this information too.

Returns
Number of span items.

◆ operator[]() [1/2]

Opm::PAvgDynamicSourceData::SourceDataSpan< double > Opm::PAvgDynamicSourceData::operator[] ( const std::size_t  source)

Acquire read/write span of data items corresponding to a single source location.

Mostly intended for assigning values.

Parameters
[in]sourceSource location. Function will throw if source is not one of the known locations registered in the object constructor.
Returns
Read/write span of data items.

◆ operator[]() [2/2]

Opm::PAvgDynamicSourceData::SourceDataSpan< const double > Opm::PAvgDynamicSourceData::operator[] ( const std::size_t  source) const

Acquire read-only span of data items corresponding to a single source location.

Intended for extracting previously assigned data items.

Parameters
[in]sourceSource location. Function will throw if source is not one of the known locations registered in the object constructor.
Returns
Read-only span of data items.

◆ reconstruct()

void Opm::PAvgDynamicSourceData::reconstruct ( const std::vector< std::size_t > &  sourceLocations)
protected

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.

◆ sourceTerm()

Opm::PAvgDynamicSourceData::SourceDataSpan< double > Opm::PAvgDynamicSourceData::sourceTerm ( const std::size_t  ix,
std::vector< double > &  src 
)
protected

Form mutable data span into non-default backing store.

Mainly intended for constructing span objects in backing store for local (on-rank) sources in parallel runs.

Parameters
[in]ixLogical element index into source term backing store.
[in,out]srcSource term backing store.
Returns
Mutable view into src.

Member Data Documentation

◆ src_

std::vector<double> Opm::PAvgDynamicSourceData::src_ {}
protected

Contiguous array of data items for all source locations.

Intentionally accessible to derived classes for use in parallel runs.


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