HermesCommon  3.0
Hermes::Algebra::EpetraMatrix< Scalar > Class Template Reference
+ Inheritance diagram for Hermes::Algebra::EpetraMatrix< Scalar >:

Public Member Functions

 EpetraMatrix (const EpetraMatrix &mat)
 
 EpetraMatrix (Epetra_RowMatrix &mat)
 
virtual void prealloc (unsigned int n)
 
virtual void pre_add_ij (unsigned int row, unsigned int col)
 
virtual void finish ()
 Finish manipulation with matrix (called before solving)
 
virtual void alloc ()
 allocate the memory for stiffness matrix
 
virtual void free ()
 free the memory associated with stiffness matrix
 
virtual Scalar get (unsigned int m, unsigned int n) const
 
virtual int get_num_row_entries (unsigned int row)
 
virtual void extract_row_copy (unsigned int row, unsigned int len, unsigned int &n_entries, double *vals, unsigned int *idxs)
 
virtual void zero ()
 Zero the matrix.
 
virtual void add (unsigned int m, unsigned int n, Scalar v)
 
virtual void multiply_with_vector (Scalar *vector_in, Scalar *&vector_out, bool vector_out_initialized=false) const
 Multiply with a vector.
 
virtual void multiply_with_Scalar (Scalar value)
 Multiply with a Scalar.
 
virtual void add_sparse_matrix (SparseMatrix< Scalar > *mat)
 
EpetraMatrixduplicate ()
 
virtual void add (unsigned int m, unsigned int n, Scalar *mat, int *rows, int *cols, const int size)
 
virtual void export_to_file (const char *filename, const char *var_name, MatrixExportFormat fmt, char *number_format="%lf")
 
virtual unsigned int get_matrix_size () const
 
virtual unsigned int get_nnz () const
 
virtual double get_fill_in () const
 Get fill-in.
 
template<>
void finish ()
 Finish manipulation with matrix (called before solving)
 
template<>
void finish ()
 Finish manipulation with matrix (called before solving)
 
template<>
void free ()
 free the memory associated with stiffness matrix
 
template<>
void free ()
 free the memory associated with stiffness matrix
 
template<>
void zero ()
 Zero the matrix.
 
template<>
void zero ()
 Zero the matrix.
 
template<>
void add (unsigned int m, unsigned int n, double v)
 
template<>
void add (unsigned int m, unsigned int n, std::complex< double > v)
 
template<>
void multiply_with_vector (std::complex< double > *vector_in, std::complex< double > *&vector_out, bool vector_out_initialized) const
 
template<>
void multiply_with_vector (double *vector_in, double *&vector_out, bool vector_out_initialized) const
 
template<>
void multiply_with_Scalar (double value)
 
template<>
void multiply_with_Scalar (std::complex< double > value)
 
template<>
void export_to_file (const char *filename, const char *var_name, MatrixExportFormat fmt, char *number_format)
 
template<>
void export_to_file (const char *filename, const char *var_name, MatrixExportFormat fmt, char *number_format)
 
- Public Member Functions inherited from Hermes::Algebra::SparseMatrix< Scalar >
 SparseMatrix (unsigned int size)
 
virtual void add_sparse_to_diagonal_blocks (int num_stages, SparseMatrix< Scalar > *mat)
 
virtual void add_as_block (unsigned int i, unsigned int j, SparseMatrix< Scalar > *mat)
 
virtual int get_num_row_entries (unsigned int row) const
 
virtual void extract_row_copy (unsigned int row, unsigned int len, unsigned int &n_entries, double *vals, unsigned int *idxs) const
 
virtual int get_num_col_entries (unsigned int col) const
 
virtual void extract_col_copy (unsigned int col, unsigned int len, unsigned int &n_entries, double *vals, unsigned int *idxs) const
 
virtual SparseMatrix< Scalar > * duplicate () const
 Duplicate sparse matrix (including allocation).
 
- Public Member Functions inherited from Hermes::Algebra::Matrix< Scalar >
 Matrix (unsigned int size=0)
 
virtual void set_row_zero (unsigned int n)
 
virtual void add_to_diagonal (Scalar v)
 Add a number to each diagonal entry.
 
virtual unsigned int get_size () const
 
template<>
void add (unsigned int m, unsigned int n, double *mat, int *rows, int *cols, const int size)
 
template<>
void add (unsigned int m, unsigned int n, std::complex< double > *mat, int *rows, int *cols, const int size)
 
- Public Member Functions inherited from Hermes::Mixins::Loggable
 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL, bool add_newline=true)
 
void set_file_output_only (bool onOff)
 
void set_timestamps (bool onOff)
 Sets the addition of a time stamp on each line in the log file. By default it is on.
 
void set_erase_on_beginning (bool onOff)
 Sets the logFile being always erased before logging.
 
void set_logFile_name (const char *filename)
 
void set_logFile_name (std::string filename)
 
void info (const char *msg,...) const
 
void info_if (bool cond, const char *msg,...) const
 
void warn (const char *msg,...) const
 
void warn_if (bool cond, const char *msg,...) const
 
void error (const char *msg,...) const
 
void error_if (bool cond, const char *msg,...) const
 
virtual void set_verbose_output (bool to_set)
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
virtual void set_verbose_callback (callbackFn callback)
 
callbackFn get_verbose_callback () const
 Returns the current value of verbose_callback;.
 
- Public Member Functions inherited from Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >
void export_to_file (std::string filename, const char *var_name, Algebra::MatrixExportFormat fmt, char *number_format="%lf")
 
void export_to_file (std::string filename, std::string var_name, Algebra::MatrixExportFormat fmt, char *number_format="%lf")
 
virtual void import_from_file (const char *filename, const char *var_name, Algebra::MatrixExportFormat fmt)
 
void import_from_file (std::string filename, const char *var_name, Algebra::MatrixExportFormat fmt)
 
void import_from_file (std::string filename, std::string var_name, Algebra::MatrixExportFormat fmt)
 

Public Attributes

Epetra_CrsMatrix * mat
 
- Public Attributes inherited from Hermes::Mixins::Loggable
char * logFileName
 Logfile name.
 

Protected Attributes

Epetra_BlockMap * std_map
 
Epetra_CrsGraph * grph
 
Epetra_CrsMatrix * mat_im
 Imaginary part of the matrix, mat holds the real part.
 
bool owner
 
- Protected Attributes inherited from Hermes::Algebra::SparseMatrix< Scalar >
Pagepages
 array of pages with indices array. Each field of arra contains pages for one column
 
Page ** next_pages
 
- Protected Attributes inherited from Hermes::Algebra::Matrix< Scalar >
unsigned int size
 matrix size
 

Friends

class Hermes::Solvers::AmesosSolver< Scalar >
 
class Hermes::Solvers::AztecOOSolver< Scalar >
 
class Hermes::Preconditioners::IfpackPrecond< Scalar >
 
class Hermes::Preconditioners::MlPrecond< Scalar >
 

Additional Inherited Members

- Static Public Member Functions inherited from Hermes::Mixins::Loggable
static void set_static_logFile_name (const char *filename)
 
static void set_static_logFile_name (std::string filename)
 
- Static Public Attributes inherited from Hermes::Mixins::Loggable
static char * staticLogFileName = nullptr
 
- Protected Member Functions inherited from Hermes::Algebra::SparseMatrix< Scalar >
int sort_and_store_indices (Page *page, int *buffer, int *max)
 
int get_num_indices ()
 
- Protected Member Functions inherited from Hermes::Mixins::Loggable
void hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const
 
void hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const
 
- Static Protected Attributes inherited from Hermes::Algebra::SparseMatrix< Scalar >
static const int PAGE_SIZE = 100
 

Detailed Description

template<typename Scalar>
class Hermes::Algebra::EpetraMatrix< Scalar >

Definition at line 60 of file epetra.h.

Member Function Documentation

template<typename Scalar>
virtual void Hermes::Algebra::EpetraMatrix< Scalar >::add ( unsigned int  m,
unsigned int  n,
Scalar  v 
)
virtual

update the stiffness matrix

Parameters
[in]m- the row where to update
[in]n- the column where to update
[in]v- value

Implements Hermes::Algebra::Matrix< Scalar >.

template<typename Scalar >
void Hermes::Algebra::EpetraMatrix< Scalar >::add ( unsigned int  m,
unsigned int  n,
Scalar *  mat,
int *  rows,
int *  cols,
const int  size 
)
virtual

update the stiffness matrix

Parameters
[in]m- number of rows of given block
[in]n- number of columns of given block
[in]mat- block of values
[in]rows- array with row indexes
[in]cols- array with column indexes

Reimplemented from Hermes::Algebra::Matrix< Scalar >.

Definition at line 239 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraMatrix< Scalar >::add_sparse_matrix ( SparseMatrix< Scalar > *  mat)
virtual

Add matrix

Parameters
matmatrix to add

Reimplemented from Hermes::Algebra::SparseMatrix< Scalar >.

Definition at line 260 of file epetra.cpp.

template<typename Scalar>
virtual void Hermes::Algebra::EpetraMatrix< Scalar >::export_to_file ( const char *  filename,
const char *  var_name,
MatrixExportFormat  fmt,
char *  number_format = "%lf" 
)
virtual

writing matrix.

Parameters
[in]filenameobvious
[in]var_namename of variable (will be written to output file)
[in]fmtoutput file format
[in]number_formatspecifies the number format where possible

Implements Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >.

template<>
void Hermes::Algebra::EpetraMatrix< double >::export_to_file ( const char *  filename,
const char *  var_name,
MatrixExportFormat  fmt,
char *  number_format 
)
virtual

writing matrix.

Parameters
[in]filenameobvious
[in]var_namename of variable (will be written to output file)
[in]fmtoutput file format
[in]number_formatspecifies the number format where possible

Implements Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >.

Definition at line 271 of file epetra.cpp.

template<>
void Hermes::Algebra::EpetraMatrix< std::complex< double > >::export_to_file ( const char *  filename,
const char *  var_name,
MatrixExportFormat  fmt,
char *  number_format 
)
virtual

writing matrix.

Parameters
[in]filenameobvious
[in]var_namename of variable (will be written to output file)
[in]fmtoutput file format
[in]number_formatspecifies the number format where possible

Implements Hermes::Algebra::Mixins::MatrixRhsImportExport< Scalar >.

Definition at line 287 of file epetra.cpp.

template<typename Scalar >
Scalar Hermes::Algebra::EpetraMatrix< Scalar >::get ( unsigned int  m,
unsigned int  n 
) const
virtual

Get the value from a position

Returns
the value from the specified position
Parameters
[in]m- the number of row
[in]n- the number of column

Implements Hermes::Algebra::Matrix< Scalar >.

Definition at line 150 of file epetra.cpp.

template<typename Scalar >
unsigned int Hermes::Algebra::EpetraMatrix< Scalar >::get_nnz ( ) const
virtual

get number of nonzero numbers in matrix

Returns
number of nonzero numbers in matrix

Reimplemented from Hermes::Algebra::SparseMatrix< Scalar >.

Definition at line 305 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraMatrix< Scalar >::pre_add_ij ( unsigned int  row,
unsigned int  col 
)
virtual

add indices of nonzero matrix element

Parameters
[in]row- row index
[in]col- column index

Reimplemented from Hermes::Algebra::SparseMatrix< Scalar >.

Definition at line 90 of file epetra.cpp.

template<typename Scalar >
void Hermes::Algebra::EpetraMatrix< Scalar >::prealloc ( unsigned int  n)
virtual

prepare memory

Parameters
[in]n- number of unknowns

Reimplemented from Hermes::Algebra::SparseMatrix< Scalar >.

Definition at line 78 of file epetra.cpp.


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