![]() |
ryujin 2.1.1 revision 71cbe157f0746717db03d7e1e977da66a7d7bfb5
|
#include <source/multicomponent_vector.h>
Public Types | |
Typedefs and constexpr constants | |
| using | ScalarVector = dealii::LinearAlgebra::distributed::Vector< Number, MemorySpace > |
Public Member Functions | |
Constructor and initialization | |
| MultiComponentVectorView ()=default | |
| MultiComponentVectorView (MultiComponentVector< Number > &multi_component_vector) | |
| MultiComponentVectorView (const MultiComponentVector< Number > &multi_component_vector) | |
| template<bool other_writable> requires (!writable && other_writable) | |
| DEAL_II_HOST_DEVICE | MultiComponentVectorView (const MultiComponentVectorView< Number, n_comp, MemorySpace, other_writable > &other) |
| template<typename MultiComponentVector > requires (writable != std::is_const_v<MultiComponentVector>) | |
| void | reinit (MultiComponentVector &multi_component_vector) |
Extracting and inserting components | |
| template<typename Functor = std::identity> | |
| void | extract_component (ScalarVector &scalar_vector, unsigned int component, const Functor &functor=std::identity{}) const |
| template<typename Functor = std::identity> requires writable | |
| void | insert_component (const ScalarVector &scalar_vector, unsigned int component, const Functor &functor=std::identity{}) const |
| template<typename Functor = std::identity> requires writable | |
| void | insert_component (const dealii::Vector< Number > &scalar_vector, unsigned int component, const Functor &functor=std::identity{}) const |
Access to scalar or tensor-valued entries from various | |
contexts (scalar, SIMD, GPU): | |
| template<typename Number2 = Number> | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number2 | read_entry (const unsigned int i) const |
| template<typename Number2 = Number> | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Number2 | read_entry (const unsigned int *js) const |
| template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Tensor | read_tensor (const unsigned int i) const |
| template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE Tensor | read_tensor (const unsigned int *js) const |
| template<typename Number2 = Number> requires writable | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE void | write_entry (const Number2 &entry, const unsigned int i) const |
| template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> requires writable | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE void | write_tensor (const Tensor &tensor, const unsigned int i) const |
| template<typename Number2 = Number> requires writable | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE void | add_entry (const Number2 &entry, const unsigned int i) const |
| template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> requires writable | |
| DEAL_II_HOST_DEVICE_ALWAYS_INLINE void | add_tensor (const Tensor &tensor, const unsigned int i) const |
MPI synchronization | |
| void | zero_out_ghost_values () const |
| void | update_ghost_values () const |
| void | compress (dealii::VectorOperation::values operation) const |
Internal fields | |
| template<typename , int , typename , bool > | |
| class | MultiComponentVectorView |
A "view" of a MultiComponentVector that lives in the host or device memory space. It provides a number of methods for reading and writing scalar and tensor-valued entries.
Definition at line 259 of file multicomponent_vector.h.
| using ryujin::MultiComponentVectorView< Number, n_comp, MemorySpace, writable >::ScalarVector = dealii::LinearAlgebra::distributed::Vector<Number, MemorySpace> |
Shorthand typedef for the underlying scalar deal.II vector used to insert and extract a single component of the MultiComponentVector.
Definition at line 335 of file multicomponent_vector.h.
|
default |
|
inline |
Definition at line 269 of file multicomponent_vector.h.
|
inline |
Definition at line 276 of file multicomponent_vector.h.
|
inline |
Converting constructor creating a read only view from a writable view (mirroring the conversion from T * to const T *).
Definition at line 292 of file multicomponent_vector.h.
|
inline |
Definition at line 306 of file multicomponent_vector.h.
|
inline |
Extracts a single component out of the MultiComponentVector and stores it in scalar_vector. The destination vector must have a compatible corresponding (scalar) MPI partitioner, i.e., the "local
size", the number of locally owned elements, has to match.
The function calls scalar_vector.update_ghost_values() before returning.
Optionally, a third argument functor can be supplied that is applied to each (scalar) value individually before stored in scalar_vector.
functor has to be callable on the selected memory space.Definition at line 367 of file multicomponent_vector.h.
|
inline |
Inserts a single component into a MultiComponentVector. The source vector must have a compatible corresponding (scalar) MPI partitioner, i.e., the "local size", the number of locally owned elements, has to match.
The function does not call update_ghost_values() automatically. This has to be done by the user once all components are updated.
Optionally, a third argument functor can be supplied that is applied to each (scalar) value individually before stored in the corresponding component.
Definition at line 414 of file multicomponent_vector.h.
|
inline |
Variant of the method above that reads values out of a dealii::Vector in (rank-) local numbering.
Definition at line 444 of file multicomponent_vector.h.
|
inline |
Return the entry indexed by i.
If the template parameter Number2 is a VectorizedArray then the function returns a SIMD vectorized dealii::Tensor populated with entries from the n_comp component vectors stored at indices i, i+1, ..., i+n-1, where n is the SIMD width.
n_comp is equal to 1. Definition at line 487 of file multicomponent_vector.h.
|
inline |
Variant of above function.
Returns a SIMD vectorized dealii::Tensor populated with entries from the n_comp component vectors stored at indices *(js), *(js+1), ..., *(js+n-1), i.e., js has to point to an array of size n (the SIMD width) containing all indices.
n_comp is equal to 1. Definition at line 511 of file multicomponent_vector.h.
|
inline |
Return the tensor-valued entry indexed by i.
If the template parameter Number2 is a VectorizedArray then the function returns a SIMD vectorized dealii::Tensor populated with entries from the n_compontens component vectors stored at indices i, i+1, ..., i+n-1, where n is the SIMD width.
Definition at line 532 of file multicomponent_vector.h.
|
inline |
Variant of above function.
Returns a SIMD vectorized dealii::Tensor populated with entries from the n_comp component vectors stored at indices *(js), *(js+1), ..., *(js+n-1), i.e., js has to point to an array of size n (the SIMD width) containing all indices.
Definition at line 575 of file multicomponent_vector.h.
|
inline |
Write a (scalar valued) entry to the vector at position by i.
If the template parameter Number2 is a VectorizedArray then the function takes a SIMD vectorized tensor as argument instead and updates the values of the n_comp component vectors at indices i, i+1, ..., i+n-1 (n being the SIMD width) with the values supplied by tensor.
n_comp is equal to 1. Definition at line 624 of file multicomponent_vector.h.
|
inline |
Update the values of the n_comp component vector at index i with the values supplied by tensor.
If the template parameter Number2 is a VectorizedArray then the function takes a SIMD vectorized tensor as argument instead and updates the values of the n_comp component vectors at indices i, i+1, ..., i+n-1 (n being the SIMD width) with the values supplied by tensor.
tensor can be an arbitrary indexable container, such as dealii::Tensor or std::array, that has an operator[]() returning a Number, and has a type trait value_type. Definition at line 656 of file multicomponent_vector.h.
|
inline |
Add a (scalar valued) entry to the vector at position i. Update the values of the n_comp component vector at index i by adding the values supplied by tensor.
If the template parameter Number2 is a VectorizedArray then the function takes a SIMD vectorized tensor as argument instead and updates the values of the n_comp component vectors at indices i, i+1, ..., i+n-1 (n being the SIMD width) with the values supplied by tensor.
n_comp is equal to 1. Definition at line 677 of file multicomponent_vector.h.
|
inline |
Update the values of the n_comp component vector at index i by adding the values supplied by tensor.
If the template parameter Number2 is a VectorizedArray then the function takes a SIMD vectorized tensor as argument instead and updates the values of the n_comp component vectors at indices i, i+1, ..., i+n-1 (n being the SIMD width) with the values supplied by tensor.
tensor can be an arbitrary indexable container, such as dealii::Tensor or std::array, that has an operator[]() returning a Number, and has a type trait value_type. Definition at line 710 of file multicomponent_vector.h.
|
inline |
MPI synchronization: Zero out all ghost values stored in the vector.
Definition at line 725 of file multicomponent_vector.h.
|
inline |
MPI synchronization: Import all ghost values from neighboring MPI ranks on the templated memory space.
Definition at line 739 of file multicomponent_vector.h.
|
inline |
MPI synchronization: Copy the data that has accumulated in the ghost range to the owning processor. This function operates on the templated memory space.
Definition at line 754 of file multicomponent_vector.h.
|
friend |
Definition at line 779 of file multicomponent_vector.h.