ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
|
#include <source/multicomponent_vector.h>
Public Types | |
using | VectorizedArray = dealii::VectorizedArray< Number, simd_length > |
using | ScalarVector = 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 (ScalarVector &scalar_vector, unsigned int component) const |
void | insert_component (const ScalarVector &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) |
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>> | |
void | add_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 58 of file multicomponent_vector.h.
using ryujin::Vectors::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 67 of file multicomponent_vector.h.
using ryujin::Vectors::MultiComponentVector< Number, n_comp, simd_length >::ScalarVector = 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 74 of file multicomponent_vector.h.
void ryujin::Vectors::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.
void ryujin::Vectors::MultiComponentVector< Number, n_comp, simd_length >::extract_component | ( | ScalarVector & | 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.
void ryujin::Vectors::MultiComponentVector< Number, n_comp, simd_length >::insert_component | ( | const ScalarVector & | 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.
Tensor ryujin::Vectors::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.
Tensor ryujin::Vectors::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::Vectors::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
. void ryujin::Vectors::MultiComponentVector< Number, n_comp, simd_length >::add_tensor | ( | const Tensor & | tensor, |
const unsigned int | 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+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
.