Opm::detail::BlockExtractor< TypeTag > Struct Template Reference

Wrapping struct holding types used for block-level data extraction. More...

#include <OutputExtractor.hpp>

Classes

struct  Context
 Context passed to element extractor functions. More...
 
struct  Exec
 Descriptor for extractor execution. More...
 
struct  PhaseEntry
 
struct  ScalarEntry
 

Public Types

using ElementContext = GetPropType< TypeTag, Properties::ElementContext >
 
using IntensiveQuantities = GetPropType< TypeTag, Properties::IntensiveQuantities >
 
using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using FluidState = typename IntensiveQuantities::FluidState
 
using FluidSystem = GetPropType< TypeTag, Properties::FluidSystem >
 
using AssignFunc = std::function< void(const Context &)>
 Callback for extractors handling their own assignements. More...
 
using ScalarFunc = std::function< Scalar(const Context &)>
 
using PhaseFunc = std::function< Scalar(const unsigned, const Context &)>
 
using Entry = std::variant< ScalarEntry, PhaseEntry >
 Descriptor for extractors. More...
 
using ExecMap = std::unordered_map< int, std::vector< Exec > >
 A map of extraction executors, keyed by cartesian cell index. More...
 
using LgrExecMap = std::unordered_map< int, std::unordered_map< int, std::vector< Exec > > >
 

Static Public Member Functions

template<std::size_t size>
static std::optional< ScalarFuncmakeExtractor (const std::string_view base_kw, const std::array< Entry, size > &handlers)
 Resolve a block-summary keyword to its bound extraction lambda. More...
 
template<std::size_t size>
static ExecMap setupExecMap (std::map< std::pair< std::string, int >, double > &blockData, const std::array< Entry, size > &handlers)
 Setup an extractor executor map from a map of evaluations to perform. More...
 
static void process (const std::vector< Exec > &blockExtractors, const Context &ectx)
 Process a list of block extractors. More...
 
template<std::size_t size>
static LgrExecMap setupLgrExecMap (std::map< std::tuple< std::string, int, int >, double > &lgrBlockData, const std::array< Entry, size > &handlers)
 Setup an LGR-cell extractor executor map. More...
 

Static Public Attributes

static constexpr int numPhases = FluidSystem::numPhases
 
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
 
static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
 
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
 

Detailed Description

template<class TypeTag>
struct Opm::detail::BlockExtractor< TypeTag >

Wrapping struct holding types used for block-level data extraction.

Member Typedef Documentation

◆ AssignFunc

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::AssignFunc = std::function<void(const Context&)>

Callback for extractors handling their own assignements.

◆ ElementContext

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::ElementContext = GetPropType<TypeTag, Properties::ElementContext>

◆ Entry

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::Entry = std::variant<ScalarEntry, PhaseEntry>

Descriptor for extractors.

◆ ExecMap

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::ExecMap = std::unordered_map<int, std::vector<Exec> >

A map of extraction executors, keyed by cartesian cell index.

◆ FluidState

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::FluidState = typename IntensiveQuantities::FluidState

◆ FluidSystem

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>

◆ IntensiveQuantities

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>

◆ LgrExecMap

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::LgrExecMap = std::unordered_map<int, std::unordered_map<int, std::vector<Exec> >>

A two-level map of extraction executors for cells inside an LGR, keyed by (grid level, level-local linearised Cartesian cell index).

Outer level identifies the LGR (0 = GLOBAL, 1..N = LGRs). Inner key is the cell's level-local linearised Cartesian index. Both keys come from the LgrBlockValues tuple the opm-common LgrBlockValue evaluator reads.

◆ PhaseFunc

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::PhaseFunc = std::function<Scalar(const unsigned , const Context&)>

Callback for extractors assigned to a phase buffer Returns value to store in buffer for requested phase

◆ Scalar

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::Scalar = GetPropType<TypeTag, Properties::Scalar>

◆ ScalarFunc

template<class TypeTag >
using Opm::detail::BlockExtractor< TypeTag >::ScalarFunc = std::function<Scalar(const Context&)>

Callback for extractors assigned to a scalar buffer Return value to store in buffer

Member Function Documentation

◆ makeExtractor()

template<class TypeTag >
template<std::size_t size>
static std::optional< ScalarFunc > Opm::detail::BlockExtractor< TypeTag >::makeExtractor ( const std::string_view  base_kw,
const std::array< Entry, size > &  handlers 
)
inlinestatic

Resolve a block-summary keyword to its bound extraction lambda.

Searches the handler table for base_kw (the underlying B*-family name, e.g. "BPR", "BOSAT") and, when found, returns the extraction function ready to call – selecting the correct phase for phase-valued keywords. Shared by setupExecMap (global B*, level 0) and setupLgrExecMap (LGR-cell LB*, which pass the keyword with its leading 'L' stripped). Returns nullopt when no handler matches.

◆ process()

template<class TypeTag >
static void Opm::detail::BlockExtractor< TypeTag >::process ( const std::vector< Exec > &  blockExtractors,
const Context ectx 
)
inlinestatic

Process a list of block extractors.

Referenced by Opm::OutputBlackOilModule< TypeTag >::processElementBlockData().

◆ setupExecMap()

template<class TypeTag >
template<std::size_t size>
static ExecMap Opm::detail::BlockExtractor< TypeTag >::setupExecMap ( std::map< std::pair< std::string, int >, double > &  blockData,
const std::array< Entry, size > &  handlers 
)
inlinestatic

Setup an extractor executor map from a map of evaluations to perform.

◆ setupLgrExecMap()

template<class TypeTag >
template<std::size_t size>
static LgrExecMap Opm::detail::BlockExtractor< TypeTag >::setupLgrExecMap ( std::map< std::tuple< std::string, int, int >, double > &  lgrBlockData,
const std::array< Entry, size > &  handlers 
)
inlinestatic

Setup an LGR-cell extractor executor map.

The LGR analogue of setupExecMap: identical per-keyword resolution (shared via makeExtractor), but keyed by (grid level, level-local linearised Cartesian index) instead of a single global Cartesian index. The keyword in lgrBlockData carries the LB* prefix ("LBPR", "LBOSAT", ...); the leading 'L' is stripped before the handler lookup. Extractors are grouped by grid level first so a per-DOF lookup short-circuits O(1) on levels that have no LB* requests in this run.

Member Data Documentation

◆ gasPhaseIdx

template<class TypeTag >
constexpr int Opm::detail::BlockExtractor< TypeTag >::gasPhaseIdx = FluidSystem::gasPhaseIdx
staticconstexpr

◆ numPhases

template<class TypeTag >
constexpr int Opm::detail::BlockExtractor< TypeTag >::numPhases = FluidSystem::numPhases
staticconstexpr

◆ oilPhaseIdx

template<class TypeTag >
constexpr int Opm::detail::BlockExtractor< TypeTag >::oilPhaseIdx = FluidSystem::oilPhaseIdx
staticconstexpr

◆ waterPhaseIdx

template<class TypeTag >
constexpr int Opm::detail::BlockExtractor< TypeTag >::waterPhaseIdx = FluidSystem::waterPhaseIdx
staticconstexpr

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