ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
List of all members
ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable > Class Template Reference

#include <source/sparse_matrix.h>

Public Member Functions

Constructor and initialization
 SparseMatrixView ()=default
 
 SparseMatrixView (SparseMatrix< Number, n_comp, warp_size, simd_length > &sparse_matrix)
 
 SparseMatrixView (const SparseMatrix< Number, n_comp, warp_size, simd_length > &sparse_matrix)
 
template<bool other_writable>
requires (!writable && other_writable)
DEAL_II_HOST_DEVICE SparseMatrixView (const SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, other_writable > &other)
 
template<typename SparseMatrix >
requires (writable != std::is_const_v<SparseMatrix>)
void reinit (SparseMatrix &sparse_matrix)
 
 ACCESSOR_READ_ONLY (sparsity_pattern)
 
Access to scalar or tensor-valued entries
template<typename Number2 = Number>
DEAL_II_HOST_DEVICE Number2 read_entry (const unsigned int row, const unsigned int column_index) const
 
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
DEAL_II_HOST_DEVICE Tensor read_tensor (const unsigned int row, const unsigned int column_index) const
 
template<typename Number2 = Number>
DEAL_II_HOST_DEVICE Number2 read_transposed_entry (const unsigned int row, const unsigned int column_index) const
 
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
DEAL_II_HOST_DEVICE Tensor read_transposed_tensor (const unsigned int row, const unsigned int column_index) const
 
template<typename Number2 = Number>
requires (writable)
DEAL_II_HOST_DEVICE void write_entry (const Number2 entry, const unsigned int row, const unsigned int column_index, const bool do_streaming_store=false) const
 
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
requires (writable)
DEAL_II_HOST_DEVICE void write_tensor (const Tensor &tensor, const unsigned int row, const unsigned int column_index, const bool do_streaming_store=false) const
 
template<typename Number2 = Number>
requires (writable)
DEAL_II_HOST_DEVICE void add_entry (const Number2 entry, const unsigned int row, const unsigned int column_index) const
 
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
requires (writable)
DEAL_II_HOST_DEVICE void add_tensor (const Tensor &tensor, const unsigned int row, const unsigned int column_index) const
 
MPI synchronization
void zero_out_ghost_rows () const
 
void update_ghost_rows () const
 
void compress (dealii::VectorOperation::values operation) const
 

Internal fields

template<typename , int , int , int , typename , bool >
class SparseMatrixView
 

Detailed Description

template<typename Number, int n_comp, int warp_size, int simd_length, typename MemorySpace, bool writable>
class ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >

This class models a "view" of the sparse matrix that lives in the host or device memory space. It provides a number of methods for reading and writing matrix entries.

Note
This class is designed to be captured by value in computation loops with access to either the host or device memory space. As such we do not store a reference to the underlying SparsityPattern but rather raw pointers into the corresponding memory. The view is only valid as long as the underlying SparsityPattern object is not modified.

Definition at line 258 of file sparse_matrix.h.

Constructor & Destructor Documentation

◆ SparseMatrixView() [1/4]

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::SparseMatrixView ( )
default

◆ SparseMatrixView() [2/4]

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::SparseMatrixView ( SparseMatrix< Number, n_comp, warp_size, simd_length > &  sparse_matrix)

◆ SparseMatrixView() [3/4]

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::SparseMatrixView ( const SparseMatrix< Number, n_comp, warp_size, simd_length > &  sparse_matrix)

◆ SparseMatrixView() [4/4]

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<bool other_writable>
requires (!writable && other_writable)
DEAL_II_HOST_DEVICE ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::SparseMatrixView ( const SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, other_writable > &  other)

Converting constructor creating a read only view from a writable view (mirroring the conversion from T * to const T *).

Note
We need to make this a templated constructor, otherwise the writable-converting constructor here would suppress the default copy constructor.

Member Function Documentation

◆ reinit()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename SparseMatrix >
requires (writable != std::is_const_v<SparseMatrix>)
void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::reinit ( SparseMatrix sparse_matrix)

◆ ACCESSOR_READ_ONLY()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::ACCESSOR_READ_ONLY ( sparsity_pattern  )

Return the underlying sparsity pattern view.

◆ read_entry()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number>
DEAL_II_HOST_DEVICE Number2 ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::read_entry ( const unsigned int  row,
const unsigned int  column_index 
) const

Return the (scalar) entry indexed by row and column_index.

Note
If the template argument Number2 is a vectorized 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_comp is equal to 1.

◆ read_tensor()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
DEAL_II_HOST_DEVICE Tensor ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::read_tensor ( const unsigned int  row,
const unsigned int  column_index 
) const

Return the tensor-valued entry indexed by row and column_index. This function performs the same operation as read_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 vectorized 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.

◆ read_transposed_entry()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number>
DEAL_II_HOST_DEVICE Number2 ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::read_transposed_entry ( const unsigned int  row,
const unsigned int  column_index 
) const

Return the transposed (sclar) entry indexed by row and column_index.

Note
If the template argument Number2 is a vectorized 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_comp is equal to 1.

◆ read_transposed_tensor()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
DEAL_II_HOST_DEVICE Tensor ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::read_transposed_tensor ( const unsigned int  row,
const unsigned int  column_index 
) const

Return the transposed tensor-valued entry indexed by row and column_index. This function performs the same operation as read_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 vectorized 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()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number>
requires (writable)
DEAL_II_HOST_DEVICE void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::write_entry ( const Number2  entry,
const unsigned int  row,
const unsigned int  column_index,
const bool  do_streaming_store = false 
) const

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

Note
If the template argument Number2 is a vectorized 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_comp is equal to 1.

◆ write_tensor()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
requires (writable)
DEAL_II_HOST_DEVICE void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::write_tensor ( const Tensor &  tensor,
const unsigned int  row,
const unsigned int  column_index,
const bool  do_streaming_store = false 
) const

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

Note
If the template argument Number2 is a vectorized 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.

◆ add_entry()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number>
requires (writable)
DEAL_II_HOST_DEVICE void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::add_entry ( const Number2  entry,
const unsigned int  row,
const unsigned int  column_index 
) const

Add a (scalar-valued) entry to the matrix indexed by row and column_index.

Note
If the template argument Number2 is a vectorized 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_comp is equal to 1.

◆ add_tensor()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename Number2 = Number, typename Tensor = dealii::Tensor<1, n_comp, Number2>>
requires (writable)
DEAL_II_HOST_DEVICE void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::add_tensor ( const Tensor &  tensor,
const unsigned int  row,
const unsigned int  column_index 
) const

Add a tensor-valued entry to the matrix indexed by row and column_index.

Note
If the template argument Number2 is a vectorized 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.

◆ zero_out_ghost_rows()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::zero_out_ghost_rows ( ) const

◆ update_ghost_rows()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::update_ghost_rows ( ) const

◆ compress()

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
void ryujin::SparseMatrixView< Number, n_comp, warp_size, simd_length, MemorySpace, writable >::compress ( dealii::VectorOperation::values  operation) const

Friends And Related Symbol Documentation

◆ SparseMatrixView

template<typename Number , int n_comp, int warp_size, int simd_length, typename MemorySpace , bool writable>
template<typename , int , int , int , typename , bool >
friend class SparseMatrixView
friend

Definition at line 481 of file sparse_matrix.h.


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