ryujin 2.1.1 revision d0a94ad2ccc0c4c2e8c2485c52b06b90e2fc9853
Public Types | Public Member Functions | List of all members
ryujin::SparseMatrixSIMD< Number, n_components, simd_length > Class Template Reference

#include <source/sparse_matrix_simd.h>

Public Types

using VectorizedArray = dealii::VectorizedArray< Number, simd_length >
 
template<typename Number2 >
using EntryType = typename ryujin::EntryType< Number2, n_components >::type
 

Public Member Functions

 SparseMatrixSIMD ()
 
 SparseMatrixSIMD (const SparsityPatternSIMD< simd_length > &sparsity)
 
void reinit (const SparsityPatternSIMD< simd_length > &sparsity)
 
template<typename SparseMatrix >
void read_in (const std::array< SparseMatrix, n_components > &sparse_matrix, bool locally_indexed=true)
 
template<typename SparseMatrix >
void read_in (const SparseMatrix &sparse_matrix, bool locally_indexed=true)
 
template<typename Number2 = Number>
EntryType< Number2 > get_entry (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 = Number>
dealii::Tensor< 1, n_components, Number2 > get_tensor (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 = Number>
EntryType< Number2 > get_transposed_entry (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 = Number>
dealii::Tensor< 1, n_components, Number2 > get_transposed_tensor (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 = Number>
void write_entry (const Number2 entry, const unsigned int row, const unsigned int position_within_column, const bool do_streaming_store=false)
 
template<typename Number2 = Number>
void write_entry (const dealii::Tensor< 1, n_components, Number2 > &entry, const unsigned int row, const unsigned int position_within_column, const bool do_streaming_store=false)
 
void update_ghost_rows_start (const unsigned int communication_channel=0)
 
void update_ghost_rows_finish ()
 
void update_ghost_rows ()
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE auto get_entry (const unsigned int row, const unsigned int position_within_column) const -> EntryType< Number2 >
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, n_components, Number2 > get_tensor (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE auto get_transposed_entry (const unsigned int row, const unsigned int position_within_column) const -> EntryType< Number2 >
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, n_components, Number2 > get_transposed_tensor (const unsigned int row, const unsigned int position_within_column) const
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE void write_entry (const Number2 entry, const unsigned int row, const unsigned int position_within_column, const bool do_streaming_store)
 
template<typename Number2 >
DEAL_II_ALWAYS_INLINE void write_entry (const dealii::Tensor< 1, n_components, Number2 > &entry, const unsigned int row, const unsigned int position_within_column, const bool do_streaming_store)
 

Detailed Description

template<typename Number, int n_components, int simd_length>
class ryujin::SparseMatrixSIMD< Number, n_components, simd_length >

A specialized sparse matrix for efficient vectorized SIMD access.

In the vectorized row index region [0, n_internal_dofs) we store data as an array-of-struct-of-array type (see the documentation of class SparsityPatternSIMD for details). For the non-vectorized row index region [n_internal_dofs, n_locally_relevant_dofs) we store the matrix in CSR format (equivalent to the static dealii::SparsityPattern).

Definition at line 156 of file sparse_matrix_simd.h.

Member Typedef Documentation

◆ VectorizedArray

template<typename Number , int n_components, int simd_length>
using ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::VectorizedArray = dealii::VectorizedArray<Number, simd_length>

Definition at line 173 of file sparse_matrix_simd.h.

◆ EntryType

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
using ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::EntryType = typename ryujin::EntryType<Number2, n_components>::type

The return type of get_entry and get_transposed_entry: If n_components is equal to one then EntryType reduces to Number2, otherwise the type is set to dealii::tensor<1, n_components, Number2>

Definition at line 182 of file sparse_matrix_simd.h.

Constructor & Destructor Documentation

◆ SparseMatrixSIMD() [1/2]

template<typename Number , int n_components, int simd_length>
ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::SparseMatrixSIMD

Definition at line 269 of file sparse_matrix_simd.template.h.

◆ SparseMatrixSIMD() [2/2]

template<typename Number , int n_components, int simd_length>
ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::SparseMatrixSIMD ( const SparsityPatternSIMD< simd_length > &  sparsity)

Member Function Documentation

◆ reinit()

template<typename Number , int n_components, int simd_length>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::reinit ( const SparsityPatternSIMD< simd_length > &  sparsity)

◆ read_in() [1/2]

template<typename Number , int n_components, int simd_length>
template<typename SparseMatrix >
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::read_in ( const std::array< SparseMatrix, n_components > &  sparse_matrix,
bool  locally_indexed = true 
)

◆ read_in() [2/2]

template<typename Number , int n_components, int simd_length>
template<typename SparseMatrix >
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::read_in ( const SparseMatrix &  sparse_matrix,
bool  locally_indexed = true 
)

◆ get_entry() [1/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
EntryType< Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_entry ( const unsigned int  row,
const unsigned int  position_within_column 
) const

Return the entry indexed by row and position_within_column. The return type will either be scalar if n_components is equal to 1, or a tensor if n_components is greater than 1.

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.

◆ get_tensor() [1/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
dealii::Tensor< 1, n_components, Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_tensor ( const unsigned int  row,
const unsigned int  position_within_column 
) const

Return the tensor-valued entry indexed by row and position_within_column. This function performs the same operation as get_entry() except that it always returns the entry as a tensor (even if it is effectively a scalar entry).

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.

◆ get_transposed_entry() [1/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
EntryType< Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_transposed_entry ( const unsigned int  row,
const unsigned int  position_within_column 
) const

Return the transposed entry indexed by row and position_within_column. The return type will either be scalar if n_components is equal to 1, or a tensor if n_components is greater than 1.

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.

◆ get_transposed_tensor() [1/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
dealii::Tensor< 1, n_components, Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_transposed_tensor ( const unsigned int  row,
const unsigned int  position_within_column 
) const

Return the transposed tensor-valued entry indexed by row and position_within_column. This function performs the same operation as get_entry() except that it always returns the entry as a tensor (even if it is effectively a scalar entry).

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.

◆ write_entry() [1/4]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::write_entry ( const Number2  entry,
const unsigned int  row,
const unsigned int  position_within_column,
const bool  do_streaming_store = false 
)

Write a (scalar valued) entry to the matrix indexed by row and position_within_column.

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.
This function is only available if n_components is equal to 1.

◆ write_entry() [2/4]

template<typename Number , int n_components, int simd_length>
template<typename Number2 = Number>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::write_entry ( const dealii::Tensor< 1, n_components, Number2 > &  entry,
const unsigned int  row,
const unsigned int  position_within_column,
const bool  do_streaming_store = false 
)

Write a tensor-valued entry to the matrix indexed by row and position_within_column.

Note
If the template argument Number2 is a vetorized array a specialized, faster access will be performed. In this case the index row must be within the interval [0, n_internal_dofs) and must be divisible by simd_length.

◆ update_ghost_rows_start()

template<typename Number , int n_components, int simd_length>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::update_ghost_rows_start ( const unsigned int  communication_channel = 0)
inline

Definition at line 646 of file sparse_matrix_simd.h.

◆ update_ghost_rows_finish()

template<typename Number , int n_components, int simd_length>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::update_ghost_rows_finish
inline

Definition at line 750 of file sparse_matrix_simd.h.

◆ update_ghost_rows()

template<typename Number , int n_components, int simd_length>
void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::update_ghost_rows
inline

Definition at line 763 of file sparse_matrix_simd.h.

◆ get_entry() [2/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE auto ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_entry ( const unsigned int  row,
const unsigned int  position_within_column 
) const -> EntryType<Number2>
inline

Definition at line 369 of file sparse_matrix_simd.h.

◆ get_tensor() [2/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, n_components, Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_tensor ( const unsigned int  row,
const unsigned int  position_within_column 
) const
inline

Definition at line 384 of file sparse_matrix_simd.h.

◆ get_transposed_entry() [2/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE auto ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_transposed_entry ( const unsigned int  row,
const unsigned int  position_within_column 
) const -> EntryType<Number2>
inline

Definition at line 449 of file sparse_matrix_simd.h.

◆ get_transposed_tensor() [2/2]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, n_components, Number2 > ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::get_transposed_tensor ( const unsigned int  row,
const unsigned int  position_within_column 
) const
inline

Definition at line 465 of file sparse_matrix_simd.h.

◆ write_entry() [3/4]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::write_entry ( const Number2  entry,
const unsigned int  row,
const unsigned int  position_within_column,
const bool  do_streaming_store 
)
inline

Definition at line 555 of file sparse_matrix_simd.h.

◆ write_entry() [4/4]

template<typename Number , int n_components, int simd_length>
template<typename Number2 >
DEAL_II_ALWAYS_INLINE void ryujin::SparseMatrixSIMD< Number, n_components, simd_length >::write_entry ( const dealii::Tensor< 1, n_components, Number2 > &  entry,
const unsigned int  row,
const unsigned int  position_within_column,
const bool  do_streaming_store 
)
inline

Definition at line 580 of file sparse_matrix_simd.h.


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