opm-common
Loading...
Searching...
No Matches
Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T > Class Template Reference

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

#include <PAvgDynamicSourceData.hpp>

Public Types

enum class  Item {
  Pressure , MixtureDensity , PoreVol , Depth ,
  Last_Do_Not_Use
}
 Supported items of dynamic data per source location.
using ElmT = std::remove_cv_t<T>

Public Member Functions

constexpr ElmT operator[] (const Item i) const
 Read-only access to numerical value of specified item.
template<typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v< T >, Ret > set (const Item i, const ElmT value)
 Assign specified item.
template<typename U, typename Ret = SourceDataSpan&>
constexpr std::enable_if_t<! std::is_const_v< T >, Ret > operator= (const SourceDataSpan< U > src)
 Assign all items.

Friends

class PAvgDynamicSourceData< Scalar >

Detailed Description

template<typename Scalar>
template<typename T>
class Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >

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

Template Parameters
TElement type. Const or non-const as needed. Typically Scalar or
.

Member Function Documentation

◆ operator=()

template<typename Scalar>
template<typename T>
template<typename U, typename Ret = SourceDataSpan&>
std::enable_if_t<! std::is_const_v< T >, Ret > Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::operator= ( const SourceDataSpan< U > src)
inlineconstexpr

Assign all items.

Available only if underlying range is non-const.

Parameters
[src]Source data span
Returns
to enable chaining.

◆ operator[]()

template<typename Scalar>
template<typename T>
ElmT Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::operator[] ( const Item i) const
inlinenodiscardconstexpr

Read-only access to numerical value of specified item.

Parameters
[in]iItem of dynamic source data.
Returns
Numerical value of specified item.

◆ set()

template<typename Scalar>
template<typename T>
template<typename Ret = SourceDataSpan&>
std::enable_if_t<! std::is_const_v< T >, Ret > Opm::PAvgDynamicSourceData< Scalar >::SourceDataSpan< T >::set ( const Item i,
const ElmT value )
inlineconstexpr

Assign specified item.

Availble only if underlying range is non-const.

Parameters
[in]iItem of dynamic source data.
[in]valueNumerical value of specified item.
Returns
to enable chaining.

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