HermesCommon  3.0
Hermes::Solvers Namespace Reference

Namespace for linear / nonlinear / iterative solvers. More...

Classes

class  AbstractParalutionLinearMatrixSolver
 ABSTRACT class containing common functionality of both PARALUTION iterative and AMG linear solver. More...
 
singleton  AmesosSolver
 Encapsulation of Amesos linear solver. More...
 
class  AMGParalutionLinearMatrixSolver
 Encapsulation of PARALUTION AMG linear solver. More...
 
class  AMGSolver
 Abstract class for defining interface for Algebraic Multigrid solvers. Internal, though utilizable for defining interfaces to other algebraic packages. More...
 
singleton  AztecOOSolver
 Encapsulation of AztecOO linear solver. More...
 
class  DirectSolver
 Forward declarations. More...
 
class  ExternalSolver
 Special-purpose abstract class for using external solvers. For examples implementation, see the class SimpleExternalSolver. More...
 
class  IterativeParalutionLinearMatrixSolver
 Encapsulation of PARALUTION iterative linear solver. More...
 
class  IterSolver
 Abstract class for defining interface for iterative solvers. Internal, though utilizable for defining interfaces to other algebraic packages. More...
 
class  LinearMatrixSolver
 Abstract class for defining solver interface. More...
 
class  LoopSolver
 Abstract middle-class for solvers that work in a loop of a kind (iterative, multigrid, ...) More...
 
class  MatrixSolver
 interface for both linear and nonlinear algebraic solvers. More...
 
class  MumpsSolver
 
class  NewtonMatrixSolver
 
class  NonlinearConvergenceMeasurement
 
class  NonlinearMatrixSolver
 Base class for defining interface for nonlinear solvers. More...
 
class  ParalutionInitialization
 
class  PicardMatrixSolver
 See H2D: PicardSolver. More...
 
class  SimpleExternalSolver
 An example class for using external solvers that run a command and store the result in a file. More...
 
class  UMFPackLinearMatrixSolver
 Encapsulation of UMFPACK linear solver. More...
 

Enumerations

enum  MatrixStructureReuseScheme { HERMES_CREATE_STRUCTURE_FROM_SCRATCH, HERMES_REUSE_MATRIX_REORDERING, HERMES_REUSE_MATRIX_REORDERING_AND_SCALING, HERMES_REUSE_MATRIX_STRUCTURE_COMPLETELY }
 
enum  LoopSolverToleranceType { AbsoluteTolerance = 0, RelativeTolerance = 1, DivergenceTolerance = 2 }
 
enum  IterSolverType {
  CG = 0, GMRES = 1, BiCGStab = 2, CR = 3,
  IDR = 4
}
 
enum  NonlinearConvergenceMeasurementType {
  ResidualNormRelativeToPrevious = 0x0001, ResidualNormRatioToInitial = 0x0002, ResidualNormRatioToPrevious = 0x0004, ResidualNormAbsolute = 0x0008,
  SolutionChangeAbsolute = 0x0010, SolutionChangeRelative = 0x0020
}
 This specifies the quantity that is compared to newton_tolerance (settable by set_tolerance()).
 
enum  NonlinearConvergenceState {
  Converged, NotConverged, BelowMinDampingCoeff, AboveMaxAllowedResidualNorm,
  AboveMaxIterations, Error
}
 Nonlinear Convergence state.
 

Functions

template<typename Scalar >
HERMES_API LinearMatrixSolver
< Scalar > * 
create_linear_solver (Matrix< Scalar > *matrix, Vector< Scalar > *rhs, bool use_direct_solver=false)
 Function returning a solver according to the users's choice. More...
 
template<typename Scalar >
ExternalSolver< Scalar > * static_create_external_solver (CSCMatrix< Scalar > *m, SimpleVector< Scalar > *rhs)
 
template<>
HERMES_API LinearMatrixSolver
< double > * 
create_linear_solver (Matrix< double > *matrix, Vector< double > *rhs, bool use_direct_solver)
 
template<>
HERMES_API LinearMatrixSolver
< std::complex< double > > * 
create_linear_solver (Matrix< std::complex< double > > *matrix, Vector< std::complex< double > > *rhs, bool use_direct_solver)
 

Variables

template<typename Scalar >
class HERMES_API UMFPackLinearMatrixSolver
 
const int NonlinearConvergenceMeasurementTypeCount = 6
 
template<typename Scalar >
class HERMES_API NonlinearConvergenceMeasurement
 
template class HERMES_API AmesosSolver< double >
 
template class HERMES_API AztecOOSolver< double >
 
template class HERMES_API MumpsSolver< double >
 
template class HERMES_API IterativeParalutionLinearMatrixSolver< double >
 
template class HERMES_API AMGParalutionLinearMatrixSolver< double >
 
template class HERMES_API UMFPackLinearMatrixSolver< double >
 
template class HERMES_API LinearMatrixSolver< double >
 
template class HERMES_API SimpleExternalSolver< double >
 
template class HERMES_API ExternalSolver< double >
 
template class HERMES_API DirectSolver< double >
 
template class HERMES_API LoopSolver< double >
 
template class HERMES_API IterSolver< double >
 
template class HERMES_API AMGSolver< double >
 
template class HERMES_API MatrixSolver< double >
 
template class HERMES_API NewtonMatrixSolver< double >
 
template class HERMES_API NonlinearConvergenceMeasurement< double >
 
template class HERMES_API NonlinearMatrixSolver< double >
 
template class HERMES_API PicardMatrixSolver< double >
 

Detailed Description

Namespace for linear / nonlinear / iterative solvers.

Enumeration Type Documentation

The solver type. Default: CG

Definition at line 275 of file linear_matrix_solver.h.

Various tolerances. Not necessarily supported by all iterative solvers used. Used also for direct solvers, but the settings there are ignored.

Definition at line 230 of file linear_matrix_solver.h.

\ brief Options for matrix factorization reuse.

Reusing the information computed during previous solution of a similar problem significantly improves efficiency of the solver.

Usage: Each solver which allows factorization reuse should perform complete factorization from scratch for the first time it is invoked, keep the precomputed structures according to the current factorization reuse stratregy and use them for next factorization.

Enabled solvers:  -SuperLU - performs reordering, scaling and factorization separately. When the   multithreaded version is used, scaling is performed during the factorization   phase (if neccessary) and thus HERMES_REUSE_MATRIX_REORDERING_AND_SCALING   and HERMES_REUSE_MATRIX_REORDERING have the same effect.  -UMFPack - like the MT version of SuperLU, performs scaling and factorization in one step.   HERMES_REUSE_MATRIX_REORDERING_AND_SCALING has thus the same effect as   HERMES_REUSE_MATRIX_REORDERING (saves the preceding symbolic analysis step).  -MUMPS - If HERMES_REUSE_MATRIX_REORDERING_AND_SCALING is set, scaling is performed   during analysis and only factorization is repeated during each solve.   If HERMES_REUSE_MATRIX_REORDERING is set, scaling is performed during   the factorization phase. This may be less efficient, but more reliable,   especially for highly non-symmetric matrices.  -AMESOS - Behaves like UMFPack.  -PETSc - Factorization reuse applies to the construction of PETSc preconditioner.   Both HERMES_REUSE_MATRIX_REORDERING_AND_SCALING and   HERMES_REUSE_MATRIX_REORDERING allow to reuse the non-zero pattern of the   previously created preconditioner, HERMES_REUSE_MATRIX_STRUCTURE_COMPLETELY   indicates that the preconditioner may be reused completely for future solves.

Typical scenario: When rhsonly was set to true for the assembly phase, HERMES_REUSE_MATRIX_STRUCTURE_COMPLETELY should be set for the following solution phase.

Enumerator
HERMES_CREATE_STRUCTURE_FROM_SCRATCH 

existing factorization data.

Perform new_ factorization (operator creation), don't reuse

HERMES_REUSE_MATRIX_REORDERING 

pattern as the one already factorized.

Factorize matrix (create operatoer) with the same sparsity

HERMES_REUSE_MATRIX_REORDERING_AND_SCALING 

Factorize matrix with the same sparsity pattern and similar numerical values as the one already factorized.

HERMES_REUSE_MATRIX_STRUCTURE_COMPLETELY 

factorization / operator.

Completely reuse the already performed

Definition at line 75 of file linear_matrix_solver.h.

Function Documentation

template<typename Scalar >
HERMES_API LinearMatrixSolver<Scalar>* Hermes::Solvers::create_linear_solver ( Matrix< Scalar > *  matrix,
Vector< Scalar > *  rhs,
bool  use_direct_solver = false 
)

Function returning a solver according to the users's choice.

Parameters
[in]matrixmatrix
[in]rhsright hand side vector
Returns
created linear solver

Variable Documentation

const int Hermes::Solvers::NonlinearConvergenceMeasurementTypeCount = 6

Convergence measurement strategies. Count of the types - for solver to hold arrays of such a length.

Definition at line 40 of file nonlinear_matrix_solver.h.

Referenced by Hermes::Solvers::NonlinearMatrixSolver< Scalar >::clear_tolerances(), Hermes::Solvers::NonlinearConvergenceMeasurement< Scalar >::converged(), and Hermes::Solvers::NonlinearMatrixSolver< Scalar >::isOkay().