HermesCommon  3.0
Hermes::Solvers::ExternalSolver< Scalar > Class Template Reference

Special-purpose abstract class for using external solvers. For examples implementation, see the class SimpleExternalSolver. More...

#include <linear_matrix_solver.h>

+ Inheritance diagram for Hermes::Solvers::ExternalSolver< Scalar >:

Public Types

typedef ExternalSolver< Scalar > *(* creation )(CSCMatrix< Scalar > *m, SimpleVector< Scalar > *rhs)
 
- Public Types inherited from Hermes::Mixins::TimeMeasurable
enum  TimerPeriodTickType { HERMES_ACCUMULATE, HERMES_SKIP }
 Tick type. Used by the class Hermes::TimePeriod. More...
 

Public Member Functions

 ExternalSolver (CSCMatrix< Scalar > *m, SimpleVector< Scalar > *rhs)
 
virtual void solve ()
 
virtual void solve (Scalar *initial_guess)
 
virtual int get_matrix_size ()
 Get size of matrix.
 
CSCMatrix< Scalar > * get_matrix ()
 
SimpleVector< Scalar > * get_rhs ()
 
template<>
ExternalSolver< double >::creation create_external_solver
 
template<>
ExternalSolver< std::complex
< double > >::creation 
create_external_solver
 
- Public Member Functions inherited from Hermes::Solvers::LinearMatrixSolver< Scalar >
 LinearMatrixSolver (SparseMatrix< Scalar > *matrix, Hermes::Algebra::Vector< Scalar > *rhs)
 
DirectSolver< Scalar > * as_DirectSolver () const
 
LoopSolver< Scalar > * as_LoopSolver () const
 
IterSolver< Scalar > * as_IterSolver () const
 
AMGSolver< Scalar > * as_AMGSolver () const
 
virtual void free ()=0
 
Scalar * get_sln_vector ()
 
double get_time ()
 
virtual MatrixStructureReuseScheme get_used_reuse_scheme () const
 Get factorization scheme.
 
virtual void set_reuse_scheme (MatrixStructureReuseScheme reuse_scheme)
 
virtual void set_reuse_scheme ()
 Set factorization scheme to default.
 
virtual void use_node_wise_ordering (unsigned int num_pdes)
 Set matrix ordering in the case of a system of PDEs.
 
virtual void use_equations_wise_ordering ()
 
virtual double get_residual_norm ()
 Dummy methods that are implemented in the appropriate classes.
 
SparseMatrix< Scalar > * get_matrix ()
 
Vector< Scalar > * get_rhs ()
 
- 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::Mixins::TimeMeasurable
 TimeMeasurable (const char *name=nullptr)
 Constructs internal structures and starts measuring.
 
const TimeMeasurablereset ()
 Resets accumulated time.
 
const TimeMeasurabletick_reset ()
 Starts a new_ period and resets accumulated time.
 
const TimeMeasurabletick (TimeMeasurable::TimerPeriodTickType type=HERMES_ACCUMULATE)
 Starts/ends a new_ period.
 
const std::string & name () const
 Returns a name of the time period if any.
 
double accumulated () const
 Returns accumulated time (in seconds).
 
std::string accumulated_str () const
 Returns accumulated time in human readable form.
 
double last () const
 Returns last measured period (in seconds). More...
 
std::string last_str () const
 Returns last measured period in human readable form.
 
- Public Member Functions inherited from Hermes::Algebra::Mixins::MatrixRhsOutput< Scalar >
 MatrixRhsOutput ()
 
void process_matrix_output (Hermes::Algebra::SparseMatrix< Scalar > *matrix, int iteration)
 Processes the matrix.
 
void process_matrix_output (Hermes::Algebra::SparseMatrix< Scalar > *matrix)
 
void process_vector_output (Hermes::Algebra::Vector< Scalar > *rhs, int iteration)
 Processes the matrix.
 
void process_vector_output (Hermes::Algebra::Vector< Scalar > *rhs)
 
void output_matrix (bool only_last_iteration=true, int firstIterations=-1)
 
void set_print_zero_matrix_entries (bool to_set)
 Sets this instance to output matrix entries even though they are zero or not.
 
void set_matrix_filename (std::string name)
 
void set_matrix_varname (std::string name)
 
void set_matrix_export_format (Hermes::Algebra::MatrixExportFormat format)
 
void set_matrix_number_format (char *number_format)
 
void output_rhs (bool only_last_iteration=true, int firstIterations=-1)
 
void set_rhs_filename (std::string name)
 
void set_rhs_varname (std::string name)
 
void set_rhs_export_format (Hermes::Algebra::MatrixExportFormat format)
 
void set_rhs_number_format (char *number_format)
 

Static Public Attributes

static creation create_external_solver
 
- Static Public Attributes inherited from Hermes::Mixins::Loggable
static char * staticLogFileName = nullptr
 

Protected Attributes

CSCMatrix< Scalar > * m
 Matrix to solve.
 
SimpleVector< Scalar > * rhs
 Right hand side vector.
 
- Protected Attributes inherited from Hermes::Solvers::LinearMatrixSolver< Scalar >
MatrixStructureReuseScheme reuse_scheme
 Factorization scheme.
 
SparseMatrix< Scalar > * general_matrix
 
Vector< Scalar > * general_rhs
 
Scalar * sln
 Solution vector. More...
 
double time
 
unsigned int n_eq
 Number of equations in a system of PDEs.
 
bool node_wise_ordering
 
- Protected Attributes inherited from Hermes::Algebra::Mixins::MatrixRhsOutput< Scalar >
bool print_matrix_zero_values
 
bool output_matrixOn
 
bool only_lastMatrixIteration
 
int output_matrixIterations
 
std::string matrixFilename
 
std::string matrixVarname
 
Hermes::Algebra::MatrixExportFormat matrixFormat
 
char * matrix_number_format
 
bool output_rhsOn
 
bool only_lastRhsIteration
 
int output_rhsIterations
 
std::string RhsFilename
 
std::string RhsVarname
 
Hermes::Algebra::MatrixExportFormat RhsFormat
 
char * rhs_number_format
 

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)
 
- Public Attributes inherited from Hermes::Mixins::Loggable
char * logFileName
 Logfile name.
 
- 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
 

Detailed Description

template<typename Scalar>
class Hermes::Solvers::ExternalSolver< Scalar >

Special-purpose abstract class for using external solvers. For examples implementation, see the class SimpleExternalSolver.

Definition at line 173 of file linear_matrix_solver.h.

Member Function Documentation

template<typename Scalar>
CSCMatrix<Scalar>* Hermes::Solvers::ExternalSolver< Scalar >::get_matrix ( )
inline

Matrix to solve. template <typename scalar>="">

Definition at line 185 of file linear_matrix_solver.h.

template<typename Scalar>
SimpleVector<Scalar>* Hermes::Solvers::ExternalSolver< Scalar >::get_rhs ( )
inline

Right hand side vector. template <typename scalar>="">

Definition at line 188 of file linear_matrix_solver.h.

template<typename Scalar>
virtual void Hermes::Solvers::ExternalSolver< Scalar >::solve ( )
inlinevirtual

Solve.

Returns
true on succes

Implements Hermes::Solvers::LinearMatrixSolver< Scalar >.

Reimplemented in Hermes::Solvers::SimpleExternalSolver< Scalar >.

Definition at line 180 of file linear_matrix_solver.h.

template<typename Scalar>
virtual void Hermes::Solvers::ExternalSolver< Scalar >::solve ( Scalar *  initial_guess)
inlinevirtual

Solve.

Returns
true on succes
Parameters
[in]initialguess.

Implements Hermes::Solvers::LinearMatrixSolver< Scalar >.

Reimplemented in Hermes::Solvers::SimpleExternalSolver< Scalar >.

Definition at line 181 of file linear_matrix_solver.h.


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