20#ifndef LIBMESH_TRILINOS_EPETRA_MATRIX_H
21#define LIBMESH_TRILINOS_EPETRA_MATRIX_H
23#include "libmesh/libmesh_common.h"
25#ifdef LIBMESH_TRILINOS_HAVE_EPETRA
28#include "libmesh/ignore_warnings.h"
29#include <Epetra_FECrsMatrix.h>
30#include <Epetra_Map.h>
31#include <Epetra_MpiComm.h>
34#ifdef LIBMESH_TRILINOS_HAVE_EPETRAEXT
35# include <EpetraExt_MatrixMatrix.h>
37#include "libmesh/restore_warnings.h"
40#include "libmesh/sparse_matrix.h"
50template <
typename T>
class DenseMatrix;
101 libmesh_not_implemented();
136 virtual void clear () noexcept override;
138 virtual
void zero () override;
144 virtual
void close () override;
160 const T
value) override;
164 const T
value) override;
192 virtual
bool closed() const override;
202 std::vector<T> & values) const override;
Defines a dense matrix for use in Finite Element-type computations.
This class provides a nice interface to the Epetra data structures for parallel, sparse matrices.
virtual void close() override
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
virtual void update_sparsity_pattern(const SparsityPattern::Graph &) override
Updates the matrix sparsity pattern.
virtual numeric_index_type col_stop() const override
void swap(EpetraMatrix< T > &)
Swaps the internal data pointers, no actual values are swapped.
virtual void set(const numeric_index_type i, const numeric_index_type j, const T value) override
Set the element (i,j) to value.
EpetraMatrix(EpetraMatrix &&)=delete
This class manages the lifetime of an Epetra_FECrsMatrix manually, so we don't want to allow any auto...
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const override
virtual Real linfty_norm() const override
bool _use_transpose
Epetra has no GetUseTranspose so we need to keep track of whether we're transposed manually.
virtual numeric_index_type m() const override
virtual void get_transpose(SparseMatrix< T > &dest) const override
Copies the transpose of the matrix into dest, which may be *this.
virtual void zero() override
Set all entries to 0.
virtual bool closed() const override
EpetraMatrix & operator=(const EpetraMatrix &)=delete
Epetra_FECrsMatrix * _mat
Actual Epetra datatype to hold matrix entries.
virtual void print_personal(std::ostream &os=libMesh::out) const override
Print the contents of the matrix to the screen in a package-personalized style, if available.
virtual bool need_full_sparsity_pattern() const override
The EpetraMatrix needs the full sparsity pattern.
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value) override
Add value to the element (i,j).
virtual void get_row(numeric_index_type i, std::vector< numeric_index_type > &indices, std::vector< T > &values) const override
Get a row from the matrix.
EpetraMatrix(const EpetraMatrix &)=delete
virtual numeric_index_type row_start() const override
virtual void get_diagonal(NumericVector< T > &dest) const override
Copies the diagonal part of the matrix into dest.
virtual Real l1_norm() const override
virtual numeric_index_type col_start() const override
Epetra_Map * _map
Holds the distributed Map.
virtual numeric_index_type row_stop() const override
virtual SparseMatrix< T > & operator=(const SparseMatrix< T > &) override
This looks like a copy assignment operator, but note that, unlike normal copy assignment operators,...
Epetra_CrsGraph * _graph
Holds the sparsity pattern.
virtual numeric_index_type n() const override
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override
Add the full matrix dm to the SparseMatrix.
virtual std::unique_ptr< SparseMatrix< T > > clone() const override
virtual void clear() noexcept override
clear() is called from the destructor, so it should not throw.
Epetra_FECrsMatrix * mat()
bool _destroy_mat_on_exit
This boolean value should only be set to false for the constructor which takes an Epetra_FECrsMatrix ...
virtual SolverPackage solver_package() override
virtual void init(const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1) override
Initialize SparseMatrix with the specified sizes.
const Epetra_FECrsMatrix * mat() const
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
const Parallel::Communicator & comm() const
The libMesh namespace provides an interface to certain functionality in the library.
ParallelType
Defines an enum for parallel data structure types.
dof_id_type numeric_index_type
SolverPackage
Defines an enum for various linear solver packages.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real