HermesCommon
3.0
|
Encapsulation of AztecOO linear solver. More...
#include <aztecoo_solver.h>
Public Member Functions | |
AztecOOSolver (EpetraMatrix< Scalar > *m, EpetraVector< Scalar > *rhs) | |
void | free () |
void | set_solver (const char *solver) |
void | set_tolerance (double tol) |
void | set_max_iters (int iters) |
virtual void | set_precond (const char *name) |
virtual void | set_precond (Precond< Scalar > *pc) |
Set preconditioner from IFPACK or ML. More... | |
virtual void | set_reuse_scheme (MatrixStructureReuseScheme reuse_scheme) |
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 void | solve () |
virtual void | solve (Scalar *initial_guess) |
virtual int | get_matrix_size () |
Get size of matrix. | |
virtual int | get_num_iters () |
Get the number of iterations performed. | |
virtual double | get_residual_norm () |
Get the final residual. | |
void | set_option (int option, int value) |
Option setting function. | |
void | set_param (int param, double value) |
Parameter setting function. | |
template<> | |
void | solve () |
template<> | |
void | solve (double *initial_guess) |
template<> | |
void | solve () |
template<> | |
void | solve (std::complex< double > *initial_guess) |
Public Member Functions inherited from Hermes::Solvers::IterSolver< Scalar > | |
IterSolver (SparseMatrix< Scalar > *matrix, Vector< Scalar > *rhs) | |
void | set_solver_type (IterSolverType iterSolverType) |
Public Member Functions inherited from Hermes::Solvers::LoopSolver< Scalar > | |
LoopSolver (SparseMatrix< Scalar > *matrix, Vector< Scalar > *rhs) | |
virtual void | set_tolerance (double tolerance, LoopSolverToleranceType toleranceType) |
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 |
Scalar * | get_sln_vector () |
double | get_time () |
virtual MatrixStructureReuseScheme | get_used_reuse_scheme () const |
Get factorization scheme. | |
virtual void | set_reuse_scheme () |
Set factorization scheme to default. | |
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 TimeMeasurable & | reset () |
Resets accumulated time. | |
const TimeMeasurable & | tick_reset () |
Starts a new_ period and resets accumulated time. | |
const TimeMeasurable & | tick (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. | |
Protected Member Functions | |
void | create_permutation_vectors () |
void | free_permutation_data () |
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 |
Protected Attributes | |
AztecOO | aztec |
Instance of the Aztec solver. | |
EpetraMatrix< Scalar > * | m |
EpetraVector< Scalar > * | rhs |
int * | row_perm |
int * | col_perm |
EpetraExt::Permutation < Epetra_CrsMatrix > * | P |
EpetraExt::Permutation < Epetra_CrsMatrix > * | Q |
EpetraMatrix< Scalar > * | final_matrix |
EpetraPrecond< Scalar > * | pc |
Protected Attributes inherited from Hermes::Solvers::IterSolver< Scalar > | |
bool | precond_yes |
Whether the solver is preconditioned. | |
IterSolverType | iterSolverType |
Protected Attributes inherited from Hermes::Solvers::LoopSolver< Scalar > | |
int | max_iters |
Maximum number of iterations. | |
double | tolerance |
Convergence tolerance. | |
LoopSolverToleranceType | toleranceType |
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 |
Friends | |
template<typename T > | |
LinearMatrixSolver< T > * | create_linear_solver (Matrix< T > *matrix, Vector< T > *rhs, bool use_direct_solver) |
Additional Inherited Members | |
Public Types inherited from Hermes::Mixins::TimeMeasurable | |
enum | TimerPeriodTickType { HERMES_ACCUMULATE, HERMES_SKIP } |
Tick type. Used by the class Hermes::TimePeriod. More... | |
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. | |
Static Public Attributes inherited from Hermes::Mixins::Loggable | |
static char * | staticLogFileName = nullptr |
Encapsulation of AztecOO linear solver.
Definition at line 40 of file aztecoo_solver.h.
|
virtual |
Set maximum number of iterations to perform
[in] | iters | - number of iterations |
Reimplemented from Hermes::Solvers::LoopSolver< Scalar >.
Definition at line 98 of file aztecoo_solver.cpp.
|
virtual |
Set Aztec internal preconditioner
[in] | name | - name of the preconditioner[ none | jacobi | neumann | least-squares ] |
Definition at line 113 of file aztecoo_solver.cpp.
|
virtual |
Set preconditioner from IFPACK or ML.
[in] | pc | - IFPACK or ML preconditioner |
Implements Hermes::Solvers::IterSolver< Scalar >.
Definition at line 104 of file aztecoo_solver.cpp.
|
virtual |
Set factorization scheme.
[in] | reuse_scheme | factoriztion scheme to set |
Reimplemented from Hermes::Solvers::LinearMatrixSolver< Scalar >.
Definition at line 150 of file aztecoo_solver.cpp.
void Hermes::Solvers::AztecOOSolver< Scalar >::set_solver | ( | const char * | solver | ) |
Set the type of the solver
[in] | solver | - name of the solver[ gmres | cg | cgs | tfqmr | bicgstab ] |
Definition at line 71 of file aztecoo_solver.cpp.
|
virtual |
Set the convergence tolerance
[in] | tol | - the tolerance to set |
Reimplemented from Hermes::Solvers::LoopSolver< Scalar >.
Definition at line 92 of file aztecoo_solver.cpp.
|
virtual |
|
virtual |
Solve.
[in] | initial | guess. |
Implements Hermes::Solvers::LinearMatrixSolver< Scalar >.
|
virtual |
Solve.
Implements Hermes::Solvers::LinearMatrixSolver< Scalar >.
Definition at line 216 of file aztecoo_solver.cpp.
|
virtual |
Solve.
Implements Hermes::Solvers::LinearMatrixSolver< Scalar >.
Definition at line 432 of file aztecoo_solver.cpp.