ryujin 2.1.1 revision b04fb4aba7bd97ddfa5994a6b4b6e8586eb15db2
Loading...
Searching...
No Matches
Classes | List of all members
ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace > Class Template Reference

#include <source/selected_components_extractor.h>

Public Types

Typedefs and constexpr constants
using Extractor = SelectedComponentsExtractor< Description, dim, Number >
 
using ScalarVector = dealii::LinearAlgebra::distributed::Vector< Number, MemorySpace >
 

Public Member Functions

Extracting components
std::vector< ScalarVector > extract () const
 
DEAL_II_HOST_DEVICE_ALWAYS_INLINE unsigned int n_selected () const
 
template<typename T = Number, typename Writer >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE void extract_element (unsigned int i, const Writer &write) const
 

Constructor, internal fields, and friends

class SelectedComponentsExtractor< Description, dim, Number >
 

Detailed Description

template<typename Description, int dim, typename Number, typename MemorySpace>
class ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >

A "view" of a SelectedComponentsExtractor that extracts the selected components on the host or device memory space.

A view is created with SelectedComponentsExtractor::view() and is a cheap, copyable object that can be captured by value in a computation loop. It is only valid as long as neither SelectedComponentsExtractor::prepare(), nor SelectedComponentsExtractor::prepare_extraction() is called again.

Definition at line 260 of file selected_components_extractor.h.

Member Typedef Documentation

◆ Extractor

template<typename Description , int dim, typename Number , typename MemorySpace >
using ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >::Extractor = SelectedComponentsExtractor<Description, dim, Number>

Definition at line 272 of file selected_components_extractor.h.

◆ ScalarVector

template<typename Description , int dim, typename Number , typename MemorySpace >
using ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >::ScalarVector = dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace>

Shorthand typedef for the scalar dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace> that a single extracted component is stored in.

Definition at line 279 of file selected_components_extractor.h.

Member Function Documentation

◆ extract()

template<typename Description , int dim, typename Number , typename MemorySpace >
std::vector< ScalarVector > ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >::extract ( ) const

Extract all selected components out of the state vector the extraction was prepared with and return them as a vector of scalar vectors that is populated on the memory space of the view. The returned vector contains one entry per selected component in the order in which the components have been selected in prepare().

◆ n_selected()

template<typename Description , int dim, typename Number , typename MemorySpace >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE unsigned int ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >::n_selected ( ) const
inline

Return the number of selected components, i.e., the number of values passed to the writer by extract_element().

Definition at line 301 of file selected_components_extractor.h.

◆ extract_element()

template<typename Description , int dim, typename Number , typename MemorySpace >
template<typename T = Number, typename Writer >
DEAL_II_HOST_DEVICE_ALWAYS_INLINE void ryujin::SelectedComponentsExtractorView< Description, dim, Number, MemorySpace >::extract_element ( unsigned int  i,
const Writer &  write 
) const

Extract all selected components for the single degree of freedom i and hand them to write: The function calls write(k, value) exactly once for every k = 0, ..., n_selected()-1 in increasing order, where value (of type T) is the value of the k-th selected component, i.e., it corresponds to the k-th entry of the vector returned by extract().

Note
The function neither allocates memory, nor does it perform any memory space transfers: it can be called on the memory space of the view. Correspondingly, write has to be callable on the memory space of the view.

If the template parameter T is a VectorizedArray then the function hands out SIMD vectorized values populated with the entries stored at indices i, i+1, ..., i+simd_length-1. Correspondingly, i has to be divisible by the SIMD length.

Friends And Related Symbol Documentation

◆ SelectedComponentsExtractor< Description, dim, Number >

template<typename Description , int dim, typename Number , typename MemorySpace >
friend class SelectedComponentsExtractor< Description, dim, Number >
friend

Definition at line 386 of file selected_components_extractor.h.


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