Reference documentation for deal.II version 9.6.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace > Class Template Reference

#include <deal.II/lac/trilinos_tpetra_sparsity_pattern.h>

Inheritance diagram for LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >:

Public Types

using size_type = ::types::global_dof_index
 

Public Member Functions

 Accessor (const SparsityPattern< MemorySpace > *sparsity_pattern, const size_type row, const size_type index)
 
size_type row () const
 
size_type index () const
 
size_type column () const
 

Static Public Member Functions

static ::ExceptionBaseExcBeyondEndOfSparsityPattern ()
 
static ::ExceptionBaseExcAccessToNonlocalRow (size_type arg1, size_type arg2, size_type arg3)
 

Private Member Functions

void visit_present_row ()
 

Private Attributes

SparsityPattern< MemorySpace > * sparsity_pattern
 
size_type a_row
 
size_type a_index
 
std::shared_ptr< std::vector<::types::signed_global_dof_index > > colnum_cache
 

Friends

class Iterator< MemorySpace >
 

Detailed Description

template<typename MemorySpace = ::MemorySpace::Host>
class LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >

Accessor class for iterators into sparsity patterns. This class is also the base class for both const and non-const accessor classes into sparse matrices.

Note that this class only allows read access to elements, providing their row and column number. It does not allow modifying the sparsity pattern itself.

Definition at line 84 of file trilinos_tpetra_sparsity_pattern.h.

Member Typedef Documentation

◆ size_type

template<typename MemorySpace = ::MemorySpace::Host>
using LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::size_type = ::types::global_dof_index

Declare type for container size.

Definition at line 90 of file trilinos_tpetra_sparsity_pattern.h.

Constructor & Destructor Documentation

◆ Accessor()

template<typename MemorySpace = ::MemorySpace::Host>
LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::Accessor ( const SparsityPattern< MemorySpace > * sparsity_pattern,
const size_type row,
const size_type index )

Constructor.

Member Function Documentation

◆ row()

template<typename MemorySpace = ::MemorySpace::Host>
size_type LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::row ( ) const

Row number of the element represented by this object.

◆ index()

template<typename MemorySpace = ::MemorySpace::Host>
size_type LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::index ( ) const

Index in row of the element represented by this object.

◆ column()

template<typename MemorySpace = ::MemorySpace::Host>
size_type LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::column ( ) const

Column number of the element represented by this object.

◆ visit_present_row()

template<typename MemorySpace >
void LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::visit_present_row ( )
private

Discard the old row caches (they may still be used by other accessors) and generate new ones for the row pointed to presently by this accessor.

Definition at line 40 of file trilinos_tpetra_sparsity_pattern.cc.

Friends And Related Symbol Documentation

◆ Iterator< MemorySpace >

template<typename MemorySpace = ::MemorySpace::Host>
friend class Iterator< MemorySpace >
friend

Definition at line 171 of file trilinos_tpetra_sparsity_pattern.h.

Member Data Documentation

◆ sparsity_pattern

template<typename MemorySpace = ::MemorySpace::Host>
SparsityPattern<MemorySpace>* LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::sparsity_pattern
private

The matrix accessed.

Definition at line 138 of file trilinos_tpetra_sparsity_pattern.h.

◆ a_row

template<typename MemorySpace = ::MemorySpace::Host>
size_type LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::a_row
private

Current row number.

Definition at line 143 of file trilinos_tpetra_sparsity_pattern.h.

◆ a_index

template<typename MemorySpace = ::MemorySpace::Host>
size_type LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::a_index
private

Current index in row.

Definition at line 148 of file trilinos_tpetra_sparsity_pattern.h.

◆ colnum_cache

template<typename MemorySpace = ::MemorySpace::Host>
std::shared_ptr<std::vector<::types::signed_global_dof_index> > LinearAlgebra::TpetraWrappers::SparsityPatternIterators::Accessor< MemorySpace >::colnum_cache
private

Cache where we store the column indices of the present row. This is necessary, since Trilinos makes access to the elements of its matrices rather hard, and it is much more efficient to copy all column entries of a row once when we enter it than repeatedly asking Trilinos for individual ones. This also makes some sense since it is likely that we will access them sequentially anyway.

In order to make copying of iterators/accessor of acceptable performance, we keep a shared pointer to these entries so that more than one accessor can access this data if necessary.

Definition at line 163 of file trilinos_tpetra_sparsity_pattern.h.


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