![]() |
ryujin 2.1.1 revision 71cdc42292164f8095c0bd62c4ea75ebcfac58fa
|
#include <source/selected_components_extractor.h>
Public Member Functions | |
Constructor and setup | |
| SelectedComponentsExtractor (const OfflineData< dim, Number > &offline_data, const HyperbolicSystem &hyperbolic_system, const ParabolicSystem ¶bolic_system, const InitialPrecomputedVector &initial_precomputed, const std::vector< std::string > &additional_names={}, const std::vector< std::reference_wrapper< const ScalarVector > > &additional_vectors={}) | |
| void | prepare (const std::vector< std::string > &selected) |
| template<typename MemorySpace = dealii::MemorySpace::Host> | |
| void | prepare_extraction (const StateVector &state_vector) const |
Queries | |
| std::size_t | n_selected () const |
Memory space access | |
| template<typename MemorySpace = dealii::MemorySpace::Host> | |
| SelectedComponentsExtractorView< Description, dim, Number, MemorySpace > | view () const |
Typedefs and constexpr constants | |
| using | HyperbolicSystem = typename Description::HyperbolicSystem |
| using | ParabolicSystem = typename Description::ParabolicSystem |
| using | View = typename HyperbolicSystem::template View< dim, Number > |
| using | StateVector = typename View::StateVector |
| using | InitialPrecomputedVector = typename View::InitialPrecomputedVector |
| using | ScalarVector = Vectors::ScalarVector< Number > |
| using | HyperbolicVector = std::tuple_element_t< 0, StateVector > |
| using | PrecomputedVector = std::tuple_element_t< 1, StateVector > |
| using | ParabolicVector = std::tuple_element_t< 2, StateVector > |
| template<typename MemorySpace > | |
| using | HyperbolicVectorView = auto |
| template<typename MemorySpace > | |
| using | PrecomputedVectorView = auto |
| template<typename MemorySpace > | |
| using | InitialPrecomputedVectorView = auto |
| template<typename MemorySpace > | |
| using | ScalarVectorView = auto |
| static constexpr unsigned int | conserved_offset = 0 |
| static constexpr unsigned int | primitive_offset = View::problem_dimension |
| static constexpr unsigned int | precomputed_offset |
| static constexpr unsigned int | initial_offset |
| static constexpr unsigned int | parabolic_offset |
Internal fields and friends | |
| template<typename , int , typename , typename > | |
| class | SelectedComponentsExtractorView |
A helper class that extracts a selection of named components from a state vector into a vector of scalar vectors suitable for output and postprocessing.
A component can be selected by any of its conserved, primitive, precomputed, initial-precomputed, or parabolic name, or by one of the additional names supplied by the caller.
Intended usage:
The extract() call populates one full scalar vector per selected component. Alternatively, all selected components can be read for a single degree of freedom - in a computation loop running on the host, or on the device:
All bookkeeping and all memory space transfers happen in prepare() and prepare_extraction(); a view is a cheap, copyable collection of pointers, indices, and booleans.
Definition at line 79 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::HyperbolicSystem = typename Description::HyperbolicSystem |
Definition at line 87 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::ParabolicSystem = typename Description::ParabolicSystem |
Definition at line 88 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::View = typename HyperbolicSystem::template View<dim, Number> |
Definition at line 90 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::StateVector = typename View::StateVector |
Definition at line 92 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::InitialPrecomputedVector = typename View::InitialPrecomputedVector |
Definition at line 93 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::ScalarVector = Vectors::ScalarVector<Number> |
Definition at line 95 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::HyperbolicVector = std::tuple_element_t<0, StateVector> |
Definition at line 97 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::PrecomputedVector = std::tuple_element_t<1, StateVector> |
Definition at line 98 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::ParabolicVector = std::tuple_element_t<2, StateVector> |
Definition at line 99 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::HyperbolicVectorView = auto |
Definition at line 102 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::PrecomputedVectorView = auto |
Definition at line 106 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::InitialPrecomputedVectorView = auto |
Definition at line 110 of file selected_components_extractor.h.
| using ryujin::SelectedComponentsExtractor< Description, dim, Number >::ScalarVectorView = auto |
Definition at line 114 of file selected_components_extractor.h.
| ryujin::SelectedComponentsExtractor< Description, dim, Number >::SelectedComponentsExtractor | ( | const OfflineData< dim, Number > & | offline_data, |
| const HyperbolicSystem & | hyperbolic_system, | ||
| const ParabolicSystem & | parabolic_system, | ||
| const InitialPrecomputedVector & | initial_precomputed, | ||
| const std::vector< std::string > & | additional_names = {}, |
||
| const std::vector< std::reference_wrapper< const ScalarVector > > & | additional_vectors = {} |
||
| ) |
Constructor.
In addition to the conserved, primitive, precomputed, initial-precomputed, and parabolic components a caller can supply a list of additional_names with corresponding additional_vectors that can be selected as well.
| void ryujin::SelectedComponentsExtractor< Description, dim, Number >::prepare | ( | const std::vector< std::string > & | selected | ) |
| void ryujin::SelectedComponentsExtractor< Description, dim, Number >::prepare_extraction | ( | const StateVector & | state_vector | ) | const |
Set up all internal data structures necessary for reading the selected components out of state_vector on the selected memory space. This function creates a view for all selected components of the state vector (and all selected additional vectors) on the selected memory space. Depending on the transfer policy of the individual vectors this either asserts that the memory space is resident, or triggers an implicit memory transfer.
A call to prepare_extraction() is necessary before a view for the selected memory space can be created with view().
| std::size_t ryujin::SelectedComponentsExtractor< Description, dim, Number >::n_selected | ( | ) | const |
Return the number of selected components, i.e., the number of entries of the vector returned by extract() and the number of values written by extract_element().
| SelectedComponentsExtractorView< Description, dim, Number, MemorySpace > ryujin::SelectedComponentsExtractor< Description, dim, Number >::view | ( | ) | const |
Return a view on the extractor for the selected memory space that reads all selected components out of the state vector the extraction has been prepared with.
|
friend |
Definition at line 308 of file selected_components_extractor.h.
|
staticconstexpr |
Definition at line 127 of file selected_components_extractor.h.
|
staticconstexpr |
Definition at line 128 of file selected_components_extractor.h.
|
staticconstexpr |
Definition at line 129 of file selected_components_extractor.h.
|
staticconstexpr |
Definition at line 131 of file selected_components_extractor.h.
|
staticconstexpr |
Definition at line 133 of file selected_components_extractor.h.