|
opm-simulators
|
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. | |
| using | ScalarFunc = std::function< Scalar(const Context &)> |
| Callback for extractors assigned to a scalar buffer Return value to store in buffer. | |
| using | 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. | |
| using | Entry = std::variant< ScalarEntry, PhaseEntry > |
| Descriptor for extractors. | |
| using | ExecMap = std::unordered_map< int, std::vector< Exec > > |
| A map of extraction executors, keyed by cartesian cell index. | |
| using | 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). More... | |
Static Public Member Functions | |
| template<std::size_t size> | |
| static std::optional< ScalarFunc > | makeExtractor (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. | |
| static void | process (const std::vector< Exec > &blockExtractors, const Context &ectx) |
| Process a list of block extractors. | |
| 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... | |
Wrapping struct holding types used for block-level data extraction.
| 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.
|
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.
|
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.