![]() |
ryujin 2.1.1 revision 9dcb748690310d6a540ebb8b066d1a0834fc7604
|
#include <source/multicomponent_vector.h>
Public Types | |
using | VectorizedArray = dealii::VectorizedArray< Number, simd_length > |
using | scalar_type = dealii::LinearAlgebra::distributed::Vector< Number > |
Public Member Functions | |
void | reinit_with_scalar_partitioner (const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &scalar_partitioner) |
void | extract_component (scalar_type &scalar_vector, unsigned int component) const |
void | insert_component (const scalar_type &scalar_vector, unsigned int component) |
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
Tensor | get_tensor (const unsigned int i) const |
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
Tensor | get_tensor (const unsigned int *js) const |
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
void | write_tensor (const Tensor &tensor, const unsigned int i) |
A wrapper around dealii::LinearAlgebra::distributed::Vector<Number> that stores a vector element of n_comp
components per entry (instead of a scalar value).
Definition at line 56 of file multicomponent_vector.h.
using ryujin::MultiComponentVector< Number, n_comp, simd_length >::VectorizedArray = dealii::VectorizedArray<Number, simd_length> |
Shorthand typedef for the underlying dealii::VectorizedArray type used to insert and extract SIMD packed values from the MultiComponentVector.
Definition at line 65 of file multicomponent_vector.h.
using ryujin::MultiComponentVector< Number, n_comp, simd_length >::scalar_type = dealii::LinearAlgebra::distributed::Vector<Number> |
Shorthand typedef for the underlying scalar dealii::LinearAlgebra::distributed::Vector<Number> used to insert and extract a single component of the MultiComponentVector.
Definition at line 72 of file multicomponent_vector.h.
void ryujin::MultiComponentVector< Number, n_comp, simd_length >::reinit_with_scalar_partitioner | ( | const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > & | scalar_partitioner | ) |
Reinitializes the MultiComponentVector with a scalar MPI partitioner. The function calls create_vector_partitioner() internally to create and store a corresponding "vector" MPI partitioner.
Referenced by ryujin::InitialValues< Description, dim, Number >::interpolate_precomputed_initial_values(), and ryujin::TimeLoop< Description, dim, Number >::output().
void ryujin::MultiComponentVector< Number, n_comp, simd_length >::extract_component | ( | scalar_type & | scalar_vector, |
unsigned int | component | ||
) | const |
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.
Referenced by ryujin::TimeLoop< Description, dim, Number >::compute_error(), and ryujin::Checkpointing::write_checkpoint().
void ryujin::MultiComponentVector< Number, n_comp, simd_length >::insert_component | ( | const scalar_type & | scalar_vector, |
unsigned int | component | ||
) |
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.
Referenced by ryujin::InitialValues< Description, dim, Number >::interpolate(), ryujin::InitialValues< Description, dim, Number >::interpolate_precomputed_initial_values(), and ryujin::Checkpointing::load_state_vector().
Tensor ryujin::MultiComponentVector< Number, n_comp, simd_length >::get_tensor | ( | const unsigned int | i | ) | const |
Return a dealii::Tensor populated with the n_comp
component vector stored at index 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+simd_length-1.
Referenced by ryujin::InitialValues< Description, dim, Number >::interpolate(), and ryujin::SolutionTransfer< Description, dim, Number >::prepare_for_interpolation().
Tensor ryujin::MultiComponentVector< Number, n_comp, simd_length >::get_tensor | ( | const unsigned int * | js | ) | const |
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+simd_length-1), i.e., js
has to point to an array of size simd_length
containing all indices.
void ryujin::MultiComponentVector< Number, n_comp, simd_length >::write_tensor | ( | const Tensor & | tensor, |
const unsigned int | i | ||
) |
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+simd_length_1. 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
. Referenced by ryujin::InitialValues< Description, dim, Number >::interpolate(), ryujin::SolutionTransfer< Description, dim, Number >::interpolate(), and ryujin::TimeLoop< Description, dim, Number >::run().