![]() |
|
#include <hypre_solver.h>
Public Member Functions | |
HypreSolver () | |
Constructor. More... | |
~HypreSolver () | |
Empty destructor. More... | |
HypreSolver (const HypreSolver &)=delete | |
Broken copy constructor. More... | |
void | operator= (const HypreSolver &)=delete |
Broken assignment operator. More... | |
void | disable_resolve () |
unsigned & | max_iter () |
Access function to Max_iter. More... | |
double & | tolerance () |
Access function to Tolerance. More... | |
unsigned & | hypre_method () |
Access function to Hypre_method flag – specified via enumeration. More... | |
unsigned & | internal_preconditioner () |
void | amg_using_simple_smoothing () |
unsigned & | amg_simple_smoother () |
Access function to AMG_simple_smoother flag. More... | |
void | amg_using_complex_smoothing () |
unsigned & | amg_complex_smoother () |
Access function to AMG_complex_smoother flag. More... | |
unsigned & | amg_print_level () |
Access function to AMG_print_level. More... | |
unsigned & | amg_smoother_iterations () |
Access function to AMG_smoother_iterations. More... | |
unsigned & | amg_coarsening () |
Access function to AMG_coarsening flag. More... | |
unsigned & | amg_max_levels () |
Access function to AMG_max_levels. More... | |
double & | amg_damping () |
Access function to AMG_damping parameter. More... | |
double & | amg_strength () |
Access function to AMG_strength. More... | |
double & | amg_max_row_sum () |
Access function to AMG_max_row_sum. More... | |
double & | amg_truncation () |
Access function to AMG_truncation. More... | |
int & | parasails_symmetry () |
Access function to ParaSails symmetry flag. More... | |
int & | parasails_nlevel () |
Access function to ParaSails nlevel parameter. More... | |
double & | parasails_thresh () |
Access function to ParaSails thresh parameter. More... | |
double & | parasails_filter () |
Access function to ParaSails filter parameter. More... | |
double & | euclid_droptol () |
Access function to Euclid drop tolerance parameter. More... | |
int & | euclid_level () |
void | enable_euclid_rowScale () |
Enable euclid rowScaling. More... | |
void | disable_euclid_rowScale () |
Disable euclid row scaling. More... | |
void | enable_euclid_using_BJ () |
void | disable_euclid_using_BJ () |
void | euclid_using_ILUK () |
void | euclid_using_ILUT () |
unsigned & | euclid_print_level () |
unsigned & | krylov_print_level () |
Access function to Krylov_print_level. More... | |
void | enable_delete_matrix () |
void | disable_delete_matrix () |
void | solve (Problem *const &problem_pt, DoubleVector &solution) |
void | solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution) |
void | resolve (const DoubleVector &rhs, DoubleVector &solution) |
void | clean_up_memory () |
Function deletes all solver data. More... | |
![]() | |
LinearSolver () | |
Empty constructor, initialise the member data. More... | |
LinearSolver (const LinearSolver &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const LinearSolver &)=delete |
Broken assignment operator. More... | |
virtual | ~LinearSolver () |
Empty virtual destructor. More... | |
void | enable_doc_time () |
Enable documentation of solve times. More... | |
void | disable_doc_time () |
Disable documentation of solve times. More... | |
bool | is_doc_time_enabled () const |
Is documentation of solve times enabled? More... | |
bool | is_resolve_enabled () const |
Boolean flag indicating if resolves are enabled. More... | |
virtual void | enable_resolve () |
virtual void | solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
virtual void | solve_transpose (Problem *const &problem_pt, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
virtual void | resolve_transpose (const DoubleVector &rhs, DoubleVector &result) |
virtual double | jacobian_setup_time () const |
virtual double | linear_solver_solution_time () const |
virtual void | enable_computation_of_gradient () |
void | disable_computation_of_gradient () |
void | reset_gradient () |
void | get_gradient (DoubleVector &gradient) |
function to access the gradient, provided it has been computed More... | |
![]() | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
void | build_distribution (const LinearAlgebraDistribution &dist) |
![]() | |
HypreInterface () | |
Constructor. More... | |
~HypreInterface () | |
Destructor. More... | |
HypreInterface (const HypreInterface &)=delete | |
Broken copy constructor. More... | |
void | operator= (const HypreInterface &)=delete |
Broken assignment operator. More... | |
void | enable_hypre_error_messages () |
Turn on the hypre error messages. More... | |
void | disable_hypre_error_messages () |
Turn off hypre error messages. More... | |
unsigned | existing_solver () |
Function to return value of which solver (if any) is currently stored. More... | |
unsigned | existing_preconditioner () |
Function return value of which preconditioner (if any) is stored. More... | |
Private Attributes | |
bool | Delete_matrix |
Additional Inherited Members | |
![]() | |
enum | Hypre_method_types { CG , GMRES , BiCGStab , BoomerAMG , Euclid , ParaSails , None } |
![]() | |
bool | AMGEuclidSmoother_use_block_jacobi |
bool | AMGEuclidSmoother_use_row_scaling |
bool | AMGEuclidSmoother_use_ilut |
unsigned | AMGEuclidSmoother_level |
double | AMGEuclidSmoother_drop_tol |
unsigned | AMGEuclidSmoother_print_level |
![]() | |
void | clear_distribution () |
![]() | |
void | hypre_clean_up_memory () |
Function deletes all solver data. More... | |
void | hypre_matrix_setup (CRDoubleMatrix *matrix_pt) |
void | hypre_solver_setup () |
void | hypre_solve (const DoubleVector &rhs, DoubleVector &solution) |
![]() | |
bool | Enable_resolve |
bool | Doc_time |
Boolean flag that indicates whether the time taken. More... | |
bool | Compute_gradient |
bool | Gradient_has_been_computed |
flag that indicates whether the gradient was computed or not More... | |
DoubleVector | Gradient_for_glob_conv_newton_solve |
![]() | |
bool | Output_info |
Flag is true to output info and results of timings. More... | |
unsigned | Max_iter |
Maximum number of iterations used in solver. More... | |
double | Tolerance |
Tolerance used to terminate solver. More... | |
unsigned | Hypre_method |
Hypre method flag. Valid values are specified in enumeration. More... | |
unsigned | Internal_preconditioner |
unsigned | AMG_print_level |
unsigned | AMG_max_levels |
Maximum number of levels used in AMG. More... | |
double | AMG_max_row_sum |
Parameter to identify diagonally dominant parts of the matrix in AMG. More... | |
bool | AMG_using_simple_smoothing |
unsigned | AMG_simple_smoother |
unsigned | AMG_complex_smoother |
unsigned | AMG_smoother_iterations |
The number of smoother iterations to apply. More... | |
double | AMG_damping |
Damping factor for BoomerAMG smoothed Jacobi or hybrid SOR. More... | |
double | AMG_strength |
Connection strength threshold parameter for BoomerAMG. More... | |
double | AMG_truncation |
Interpolation truncation factor for BoomerAMG. More... | |
unsigned | AMG_coarsening |
int | ParaSails_symmetry |
int | ParaSails_nlevel |
ParaSails nlevel parameter. More... | |
double | ParaSails_thresh |
ParaSails thresh parameter. More... | |
double | ParaSails_filter |
ParaSails filter parameter. More... | |
double | Euclid_droptol |
Euclid drop tolerance for ILU(k) and ILUT factorization. More... | |
bool | Euclid_rowScale |
Flag to switch on Euclid row scaling. More... | |
bool | Euclid_using_ILUT |
Flag to determine if ILUT (if true) or ILU(k) is used in Euclid. More... | |
bool | Euclid_using_BJ |
Flag to determine if Block Jacobi is used instead of PILU. More... | |
int | Euclid_level |
Euclid level parameter for ILU(k) factorization. More... | |
unsigned | Euclid_print_level |
unsigned | Krylov_print_level |
bool | Hypre_error_messages |
bool | Delete_input_data |
///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// An LinearSolver class using the suite of Hypre solvers to allow
BoomerAMG (AMG), CG, GMRES or BiCGStab
to be used for LinearSolver::solve(...) or LinearSolver::resolve(...).
The Krylov subspace solvers (CG, GMRES and BiCGStab) may be preconditioned using:
BoomerAMG, Euclid or ParaSails
By default GMRES without preconditioning is used.
|
inline |
Constructor.
References Delete_matrix, and oomph::LinearSolver::Doc_time.
|
delete |
Broken copy constructor.
|
inline |
|
inline |
Access function to AMG_complex_smoother flag.
References oomph::HypreInterface::AMG_complex_smoother.
|
inline |
Access function to AMG_damping parameter.
References oomph::HypreInterface::AMG_damping.
|
inline |
Access function to AMG_max_levels.
References oomph::HypreInterface::AMG_max_levels.
|
inline |
Access function to AMG_max_row_sum.
References oomph::HypreInterface::AMG_max_row_sum.
|
inline |
Access function to AMG_print_level.
References oomph::HypreInterface::AMG_print_level.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
inline |
Access function to AMG_simple_smoother flag.
References oomph::HypreInterface::AMG_simple_smoother.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
inline |
Access function to AMG_smoother_iterations.
References oomph::HypreInterface::AMG_smoother_iterations.
|
inline |
Access function to AMG_strength.
References oomph::HypreInterface::AMG_strength.
|
inline |
Access function to AMG_truncation.
References oomph::HypreInterface::AMG_truncation.
|
inline |
Function to select use of 'complex' AMG smoothers as controlled by AMG_complex_smoother flag
References oomph::HypreInterface::AMG_using_simple_smoothing.
|
inline |
Function to select use of 'simple' AMG smoothers as controlled by AMG_simple_smoother flag
References oomph::HypreInterface::AMG_using_simple_smoothing.
|
virtual |
Function deletes all solver data.
clean_up_memory() deletes any existing solver data
Reimplemented from oomph::LinearSolver.
References oomph::HypreInterface::hypre_clean_up_memory().
Referenced by disable_resolve(), and solve().
|
inline |
Hypre copies matrix data from oomph-lib's CRDoubleMatrix or DistributedCRDoubleMatrix into its own data structures, doubling the memory requirements for the matrix. Calling this function ensures that the matrix is not deleted.
References Delete_matrix.
|
inline |
Disable euclid row scaling.
References oomph::HypreInterface::Euclid_rowScale.
|
inline |
Disable use of Block Jacobi, so PILU will be used
References oomph::HypreInterface::Euclid_using_BJ.
|
inlinevirtual |
Disable resolve function (overloads the LinearSolver disable_resolve function).
Reimplemented from oomph::LinearSolver.
References clean_up_memory(), and oomph::LinearSolver::Enable_resolve.
|
inline |
Hypre copies matrix data from oomph-lib's CRDoubleMatrix or DistributedCRDoubleMatrix into its own data structures, doubling the memory requirements for the matrix. As far as the Hypre solvers are concerned the oomph-lib matrix is no longer required and could be deleted to save memory. However, this will not be the expected behaviour and therefore needs to be requested explicitly by the user by calling this function which changes the flag from false (its default) to true.
References Delete_matrix.
|
inline |
Enable euclid rowScaling.
References oomph::HypreInterface::Euclid_rowScale.
|
inline |
Enable use of Block Jacobi as opposed to PILU
References oomph::HypreInterface::Euclid_using_BJ.
|
inline |
Access function to Euclid drop tolerance parameter.
References oomph::HypreInterface::Euclid_droptol.
|
inline |
Access function to Euclid level parameter for ILU(k) factorization
References oomph::HypreInterface::Euclid_level.
|
inline |
Function to set the level of printing from Euclid when the Euclid destructor is called 0: no printing (default) 1: prints summary of runtime settings and timings 2: as 1 plus prints memory usage
References oomph::HypreInterface::Euclid_print_level.
|
inline |
Function to switch on ILU(k) factorization for Euclid (default is ILU(k) factorization)
References oomph::HypreInterface::Euclid_using_ILUT.
|
inline |
Function to switch on ILUT factorization for Euclid (default is ILU(k) factorization)
References oomph::HypreInterface::Euclid_using_ILUT.
|
inline |
Access function to Hypre_method flag – specified via enumeration.
References oomph::HypreInterface::Hypre_method.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
inline |
Access function to Internal_preconditioner flag – specified via enumeration.
References oomph::HypreInterface::Internal_preconditioner.
Referenced by main().
|
inline |
Access function to Krylov_print_level.
References oomph::HypreInterface::Krylov_print_level.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
inline |
Access function to Max_iter.
References oomph::HypreInterface::Max_iter.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
delete |
Broken assignment operator.
|
inline |
Access function to ParaSails filter parameter.
References oomph::HypreInterface::ParaSails_filter.
|
inline |
Access function to ParaSails nlevel parameter.
References oomph::HypreInterface::ParaSails_nlevel.
|
inline |
|
inline |
Access function to ParaSails thresh parameter.
References oomph::HypreInterface::ParaSails_thresh.
|
virtual |
Function to resolve a linear system using the existing solver data, allowing a solve with a new right hand side vector. This function must be used after a call to solve(...) with enable_resolve set to true.
Resolve performs a linear solve using current solver data (if such data exists).
Reimplemented from oomph::LinearSolver.
References oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::Doc_time, oomph::HypreInterface::existing_solver(), oomph::HypreInterface::hypre_solve(), oomph::HypreInterface::None, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::HypreInterface::Output_info, and BiharmonicTestFunctions1::solution().
|
virtual |
Function to solve the linear system defined by matrix_pt and rhs. This function will delete any existing internal data and generate a new Hypre solver. Note: The matrix has to be of type CRDoubleMatrix or Distributed CRDoubleMatrix. Note: Hypre copies matrix data from oomph-lib's CRDoubleMatrix or DistributedCRDoubleMatrix into its own data structures, doubling the memory requirements for the matrix. As far as the Hypre solvers are concerned, the oomph-lib matrix is no longer required and could be deleted to save memory. However, this will not be the expected behaviour and therefore needs to be requested explicitly by the user by calling the enable_delete_matrix() function.
Uses HypreInterface::hypre_solve(...) to solve the linear system for a CRDoubleMatrix or a DistributedCRDoubleMatrix. In the latter case, the rhs needs to be distributed too, i.e. the length of the rhs vector must be equal to the number of rows stored locally. Note: the returned solution vector is never distributed, i.e. all processors hold all values
Reimplemented from oomph::LinearSolver.
References oomph::DistributableLinearAlgebraObject::build_distribution(), clean_up_memory(), oomph::HypreInterface::Delete_input_data, Delete_matrix, oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, oomph::HypreInterface::hypre_matrix_setup(), oomph::HypreInterface::hypre_solve(), oomph::HypreInterface::hypre_solver_setup(), oomph::DoubleMatrixBase::ncol(), oomph::DoubleMatrixBase::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::HypreInterface::Output_info, and BiharmonicTestFunctions1::solution().
|
virtual |
Function which uses problem_pt's get_jacobian(...) function to generate a linear system which is then solved. This function deletes any existing internal data and then generates a new Hypre solver.
//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Problem-based solve function to generate the Jacobian matrix and residual vector and use HypreInterface::hypre_solver_setup(...) and HypreInterface::hypre_solve(...) to solve the linear system. This function will delete any existing data. Note: the returned solution vector is NOT distributed, i.e. all processors hold all values because this is what the Newton solver requires.
Implements oomph::LinearSolver.
References clean_up_memory(), oomph::HypreInterface::Delete_input_data, oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, oomph::Problem::get_jacobian(), oomph::HypreInterface::hypre_matrix_setup(), oomph::HypreInterface::hypre_solve(), oomph::HypreInterface::hypre_solver_setup(), matrix(), oomph::oomph_info, oomph::HypreInterface::Output_info, BiharmonicTestFunctions1::solution(), and oomph::TimingHelpers::timer().
|
inline |
Access function to Tolerance.
References oomph::HypreInterface::Tolerance.
Referenced by main(), and TetmeshPoissonProblem< ELEMENT >::TetmeshPoissonProblem().
|
private |
Hypre copies matrix data from oomph-lib's CRDoubleMatrix or DistributedCRDoubleMatrix into its own data structures, doubling the memory requirements for the matrix. As far as the Hypre solvers are concerned the oomph-lib matrix is no longer required and could be deleted to save memory. However, this will not be the expected behaviour and therefore needs to be requested explicitly by the user by changing this flag from false (its default) to true.
Referenced by disable_delete_matrix(), enable_delete_matrix(), HypreSolver(), and solve().