Reference documentation for deal.II version 8.4.1
Public Types | Public Member Functions | Private Member Functions | List of all members

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

Inheritance diagram for PETScWrappers::FullMatrix:
[legend]

Public Types

typedef types::global_dof_index size_type
 
- Public Types inherited from PETScWrappers::MatrixBase
typedef MatrixIterators::const_iterator const_iterator
 
typedef types::global_dof_index size_type
 
typedef PetscScalar value_type
 

Public Member Functions

 FullMatrix ()
 
 FullMatrix (const size_type m, const size_type n)
 
void reinit (const size_type m, const size_type n)
 
virtual const MPI_Comm & get_mpi_communicator () const
 
- Public Member Functions inherited from PETScWrappers::MatrixBase
 MatrixBase ()
 
virtual ~MatrixBase ()
 
MatrixBaseoperator= (const value_type d)
 
void clear ()
 
void set (const size_type i, const size_type j, const PetscScalar value)
 
void set (const std::vector< size_type > &indices, const FullMatrix< PetscScalar > &full_matrix, const bool elide_zero_values=false)
 
void set (const std::vector< size_type > &row_indices, const std::vector< size_type > &col_indices, const FullMatrix< PetscScalar > &full_matrix, const bool elide_zero_values=false)
 
void set (const size_type row, const std::vector< size_type > &col_indices, const std::vector< PetscScalar > &values, const bool elide_zero_values=false)
 
void set (const size_type row, const size_type n_cols, const size_type *col_indices, const PetscScalar *values, const bool elide_zero_values=false)
 
void add (const size_type i, const size_type j, const PetscScalar value)
 
void add (const std::vector< size_type > &indices, const FullMatrix< PetscScalar > &full_matrix, const bool elide_zero_values=true)
 
void add (const std::vector< size_type > &row_indices, const std::vector< size_type > &col_indices, const FullMatrix< PetscScalar > &full_matrix, const bool elide_zero_values=true)
 
void add (const size_type row, const std::vector< size_type > &col_indices, const std::vector< PetscScalar > &values, const bool elide_zero_values=true)
 
void add (const size_type row, const size_type n_cols, const size_type *col_indices, const PetscScalar *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false)
 
void clear_row (const size_type row, const PetscScalar new_diag_value=0)
 
void clear_rows (const std::vector< size_type > &rows, const PetscScalar new_diag_value=0)
 
void compress (const VectorOperation::values operation)
 
PetscScalar operator() (const size_type i, const size_type j) const
 
PetscScalar el (const size_type i, const size_type j) const
 
PetscScalar diag_element (const size_type i) const
 
size_type m () const
 
size_type n () const
 
size_type local_size () const
 
std::pair< size_type, size_typelocal_range () const
 
bool in_local_range (const size_type index) const
 
size_type n_nonzero_elements () const
 
size_type row_length (const size_type row) const
 
PetscReal l1_norm () const
 
PetscReal linfty_norm () const
 
PetscReal frobenius_norm () const
 
PetscScalar matrix_norm_square (const VectorBase &v) const
 
PetscScalar matrix_scalar_product (const VectorBase &u, const VectorBase &v) const
 
MatrixBaseoperator*= (const PetscScalar factor)
 
MatrixBaseoperator/= (const PetscScalar factor)
 
MatrixBaseadd (const MatrixBase &other, const PetscScalar factor)
 
void vmult (VectorBase &dst, const VectorBase &src) const
 
void Tvmult (VectorBase &dst, const VectorBase &src) const
 
void vmult_add (VectorBase &dst, const VectorBase &src) const
 
void Tvmult_add (VectorBase &dst, const VectorBase &src) const
 
PetscScalar residual (VectorBase &dst, const VectorBase &x, const VectorBase &b) const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator begin (const size_type r) const
 
const_iterator end (const size_type r) const
 
 operator Mat () const
 
void transpose ()
 
PetscBool is_symmetric (const double tolerance=1.e-12)
 
PetscBool is_hermitian (const double tolerance=1.e-12)
 
void write_ascii (const PetscViewerFormat format=PETSC_VIEWER_DEFAULT)
 
void print (std::ostream &out, const bool alternative_output=false) const
 
std::size_t memory_consumption () const
 
 DeclException1 (ExcPETScError, int,<< "An error with error number "<< arg1<< " occurred while calling a PETSc function")
 
 DeclException0 (ExcSourceEqualsDestination)
 
 DeclException2 (ExcWrongMode, int, int,<< "You tried to do a "<< (arg1==1?"'set'":(arg1==2?"'add'":"???"))<< " operation but the matrix is currently in "<< (arg2==1?"'set'":(arg2==2?"'add'":"???"))<< " mode. You first have to call 'compress()'.")
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects."<< "\n\n"<< "(Additional information: "<< arg3<< ")\n\n"<< "See the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "a lot more information on what this error means and "<< "how to fix programs in which it happens.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier <"<< arg2<< "> subscribes to this object of class "<< arg1<< ". Consequently, it cannot be unsubscribed.")
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Member Functions

void do_reinit (const size_type m, const size_type n)
 

Additional Inherited Members

- Protected Member Functions inherited from PETScWrappers::MatrixBase
void prepare_action (const VectorOperation::values new_action)
 
void assert_is_compressed ()
 
void prepare_add ()
 
void prepare_set ()
 
- Protected Attributes inherited from PETScWrappers::MatrixBase
Mat matrix
 
VectorOperation::values last_action
 

Detailed Description

Implementation of a sequential dense matrix class based on PETSC. All the functionality is actually in the base class, except for the calls to generate a sequential dense matrix. This is possible since PETSc only works on an abstract matrix type and internally distributes to functions that do the actual work depending on the actual matrix type (much like using virtual functions). Only the functions creating a matrix of specific type differ, and are implemented in this particular class.

Author
Wolfgang Bangerth, 2004

Definition at line 49 of file petsc_full_matrix.h.

Member Typedef Documentation

Declare type for container size.

Definition at line 56 of file petsc_full_matrix.h.

Constructor & Destructor Documentation

FullMatrix< number >::FullMatrix ( )

Default constructor. Create an empty matrix.

Definition at line 27 of file petsc_full_matrix.cc.

FullMatrix< number >::FullMatrix ( const size_type  m,
const size_type  n 
)

Create a full matrix of dimensions m times n.

Definition at line 33 of file petsc_full_matrix.cc.

Member Function Documentation

void FullMatrix< number >::reinit ( const size_type  m,
const size_type  n 
)

Throw away the present matrix and generate one that has the same properties as if it were created by the constructor of this class with the same argument list as the present function.

Definition at line 40 of file petsc_full_matrix.cc.

const MPI_Comm & FullMatrix< number >::get_mpi_communicator ( ) const
virtual

Return a reference to the MPI communicator object in use with this matrix. Since this is a sequential matrix, it returns the MPI_COMM_SELF communicator.

Implements PETScWrappers::MatrixBase.

Definition at line 70 of file petsc_full_matrix.cc.

void FullMatrix< number >::do_reinit ( const size_type  m,
const size_type  n 
)
private

Do the actual work for the respective reinit() function and the matching constructor, i.e. create a matrix. Getting rid of the previous matrix is left to the caller.

Definition at line 56 of file petsc_full_matrix.cc.


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