Reference documentation for deal.II version 9.2.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\}}\)
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PETScWrappers::MatrixIterators::const_iterator::Accessor Class Reference

Public Types

using size_type = types::global_dof_index
 

Public Member Functions

 Accessor (const MatrixBase *matrix, const size_type row, const size_type index)
 
size_type row () const
 
size_type index () const
 
size_type column () const
 
PetscScalar value () const
 

Static Public Member Functions

static ::ExceptionBaseExcBeyondEndOfMatrix ()
 
static ::ExceptionBaseExcAccessToNonlocalRow (int arg1, int arg2, int arg3)
 

Private Member Functions

void visit_present_row ()
 

Private Attributes

MatrixBasematrix
 
size_type a_row
 
size_type a_index
 
std::shared_ptr< const std::vector< size_type > > colnum_cache
 
std::shared_ptr< const std::vector< PetscScalar > > value_cache
 

Friends

class const_iterator
 

Detailed Description

Accessor class for iterators

Definition at line 74 of file petsc_matrix_base.h.

Member Typedef Documentation

◆ size_type

Declare type for container size.

Definition at line 80 of file petsc_matrix_base.h.

Constructor & Destructor Documentation

◆ Accessor()

PETScWrappers::MatrixIterators::const_iterator::Accessor::Accessor ( const MatrixBase matrix,
const size_type  row,
const size_type  index 
)

Constructor. Since we use accessors only for read access, a const matrix pointer is sufficient.

Member Function Documentation

◆ row()

size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::row ( ) const

Row number of the element represented by this object.

◆ index()

size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::index ( ) const

Index in row of the element represented by this object.

◆ column()

size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::column ( ) const

Column number of the element represented by this object.

◆ value()

PetscScalar PETScWrappers::MatrixIterators::const_iterator::Accessor::value ( ) const

Value of this matrix entry.

◆ visit_present_row()

void PETScWrappers::MatrixIterators::const_iterator::Accessor::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.

Friends And Related Function Documentation

◆ const_iterator

friend class const_iterator
friend

Definition at line 174 of file petsc_matrix_base.h.

Member Data Documentation

◆ matrix

MatrixBase* PETScWrappers::MatrixIterators::const_iterator::Accessor::matrix
mutableprivate

The matrix accessed.

Definition at line 134 of file petsc_matrix_base.h.

◆ a_row

size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::a_row
private

Current row number.

Definition at line 139 of file petsc_matrix_base.h.

◆ a_index

size_type PETScWrappers::MatrixIterators::const_iterator::Accessor::a_index
private

Current index in row.

Definition at line 144 of file petsc_matrix_base.h.

◆ colnum_cache

std::shared_ptr<const std::vector<size_type> > PETScWrappers::MatrixIterators::const_iterator::Accessor::colnum_cache
private

Cache where we store the column indices of the present row. This is necessary, since PETSc 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 PETSc 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 158 of file petsc_matrix_base.h.

◆ value_cache

std::shared_ptr<const std::vector<PetscScalar> > PETScWrappers::MatrixIterators::const_iterator::Accessor::value_cache
private

Similar cache for the values of this row.

Definition at line 163 of file petsc_matrix_base.h.


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