Functions | Variables
oomph::HypreHelpers Namespace Reference

Helper functions for use with the Hypre library. More...

Functions

int check_HYPRE_error_flag (std::ostringstream &message)
 Helper function to check the Hypre error flag, return the message associated with any error, and reset the global error flag to zero. This function also returns the error value.
 
void create_HYPRE_Vector (const DoubleVector &oomph_vec, const LinearAlgebraDistribution *dist_pt, HYPRE_IJVector &hypre_ij_vector, HYPRE_ParVector &hypre_par_vector)
 Helper function to create a HYPRE_IJVector and HYPRE_ParVector.
 
void create_HYPRE_Vector (const LinearAlgebraDistribution *dist_pt, HYPRE_IJVector &hypre_ij_vector, HYPRE_ParVector &hypre_par_vector)
 Helper function to create a HYPRE_IJVector and HYPRE_ParVector.
 
void create_HYPRE_Matrix (CRDoubleMatrix *oomph_matrix, HYPRE_IJMatrix &hypre_ij_matrix, HYPRE_ParCSRMatrix &hypre_par_matrix, LinearAlgebraDistribution *dist_pt)
 Helper function to create a serial HYPRE_IJMatrix and HYPRE_ParCSRMatrix from a CRDoubleMatrix NOTE: dist_pt is rebuilt to match the distribution of the hypre solver which is not necassarily the same as the oomph lib matrix.
 
void euclid_settings_helper (const bool &use_block_jacobi, const bool &use_row_scaling, const bool &use_ilut, const int &level, const double &drop_tol, const int &print_level, HYPRE_Solver &euclid_object)
 Helper function to set Euclid options using a command line like array.
 

Variables

unsigned Number_of_active_hypre_solvers = 0
 Number of active Hypre solvers (smart pointer like behaviuor to make sure that the initialise/finalize functions are only called the required number of times.
 
double AMG_strength = 0.25
 Default for AMG strength (0.25 recommended for 2D problems; larger (0.5-0.75, say) for 3D.
 
unsigned AMG_coarsening = 6
 Default AMG coarsening strategy. Coarsening types include: 0 = CLJP (parallel coarsening using independent sets) 1 = classical RS with no boundary treatment (not recommended in parallel) 3 = modified RS with 3rd pass to add C points on the boundaries 6 = Falgout (uses 1 then CLJP using interior coarse points as first independent set) 8 = PMIS (parallel coarsening using independent sets - lower complexities than 0, maybe also slower convergence) 10= HMIS (one pass RS on each processor then PMIS on interior coarse points as first independent set) 11= One pass RS on each processor (not recommended)
 
double AMG_truncation = 0.0
 AMG interpolation truncation factor.
 

Detailed Description

Helper functions for use with the Hypre library.

Function Documentation

◆ check_HYPRE_error_flag()

int oomph::HypreHelpers::check_HYPRE_error_flag ( std::ostringstream &  message)

Helper function to check the Hypre error flag, return the message associated with any error, and reset the global error flag to zero. This function also returns the error value.

Helper function to check the Hypre error flag, return the message associated with any error, and reset the error flag to zero.

Definition at line 155 of file hypre_solver.cc.

References hypre__global_error, and oomph::oomph_info.

Referenced by oomph::HypreInterface::hypre_clean_up_memory(), oomph::HypreInterface::hypre_matrix_setup(), oomph::HypreInterface::hypre_solve(), and oomph::HypreInterface::hypre_solver_setup().

◆ create_HYPRE_Matrix()

void oomph::HypreHelpers::create_HYPRE_Matrix ( CRDoubleMatrix oomph_matrix,
HYPRE_IJMatrix hypre_ij_matrix,
HYPRE_ParCSRMatrix hypre_par_matrix,
LinearAlgebraDistribution dist_pt 
)

Helper function to create a serial HYPRE_IJMatrix and HYPRE_ParCSRMatrix from a CRDoubleMatrix NOTE: dist_pt is rebuilt to match the distribution of the hypre solver which is not necassarily the same as the oomph lib matrix.

Helper function to create a serial HYPRE_IJMatrix and HYPRE_ParCSRMatrix from a CRDoubleMatrix.

Definition at line 278 of file hypre_solver.cc.

References i, oomph::lower(), and oomph::MPI_Helpers::mpi_has_been_initialised().

Referenced by oomph::HypreInterface::hypre_matrix_setup().

◆ create_HYPRE_Vector() [1/2]

void oomph::HypreHelpers::create_HYPRE_Vector ( const DoubleVector oomph_vec,
const LinearAlgebraDistribution dist_pt,
HYPRE_IJVector hypre_ij_vector,
HYPRE_ParVector hypre_par_vector 
)

Helper function to create a HYPRE_IJVector and HYPRE_ParVector.

  • If no MPI then serial vectors are created
  • If MPI and serial input vector then distributed hypre vectors are created
  • If MPI and distributed input vector the distributed output vectors are created.

Definition at line 186 of file hypre_solver.cc.

References i, and oomph::lower().

Referenced by oomph::HypreInterface::hypre_solve(), and oomph::HypreInterface::hypre_solver_setup().

◆ create_HYPRE_Vector() [2/2]

void oomph::HypreHelpers::create_HYPRE_Vector ( const LinearAlgebraDistribution dist_pt,
HYPRE_IJVector hypre_ij_vector,
HYPRE_ParVector hypre_par_vector 
)

Helper function to create a HYPRE_IJVector and HYPRE_ParVector.

Helper function to create an empty HYPRE_IJVector and HYPRE_ParVector.

  • If no MPI then serial vectors are created
  • If MPI and serial input vector then distributed hypre vectors are created
  • If MPI and distributed input vector the distributed output vectors are created.
  • If no MPI then serial vectors are created
  • If MPI and serial distribution then distributed hypre vectors are created
  • If MPI and distributed input distribution the distributed output vectors are created.

Definition at line 248 of file hypre_solver.cc.

References oomph::lower().

◆ euclid_settings_helper()

void oomph::HypreHelpers::euclid_settings_helper ( const bool use_block_jacobi,
const bool use_row_scaling,
const bool use_ilut,
const int level,
const double drop_tol,
const int print_level,
HYPRE_Solver euclid_object 
)

Helper function to set Euclid options using a command line like array.

Definition at line 444 of file hypre_solver.cc.

Referenced by oomph::HypreInterface::hypre_solver_setup().

Variable Documentation

◆ AMG_coarsening

unsigned oomph::HypreHelpers::AMG_coarsening = 6

Default AMG coarsening strategy. Coarsening types include: 0 = CLJP (parallel coarsening using independent sets) 1 = classical RS with no boundary treatment (not recommended in parallel) 3 = modified RS with 3rd pass to add C points on the boundaries 6 = Falgout (uses 1 then CLJP using interior coarse points as first independent set) 8 = PMIS (parallel coarsening using independent sets - lower complexities than 0, maybe also slower convergence) 10= HMIS (one pass RS on each processor then PMIS on interior coarse points as first independent set) 11= One pass RS on each processor (not recommended)

Definition at line 142 of file hypre_solver.cc.

Referenced by oomph::HypreInterface::HypreInterface().

◆ AMG_strength

double oomph::HypreHelpers::AMG_strength = 0.25

Default for AMG strength (0.25 recommended for 2D problems; larger (0.5-0.75, say) for 3D.

Definition at line 126 of file hypre_solver.cc.

Referenced by oomph::HypreInterface::HypreInterface().

◆ AMG_truncation

double oomph::HypreHelpers::AMG_truncation = 0.0

AMG interpolation truncation factor.

Definition at line 148 of file hypre_solver.cc.

Referenced by oomph::HypreInterface::HypreInterface().

◆ Number_of_active_hypre_solvers

unsigned oomph::HypreHelpers::Number_of_active_hypre_solvers = 0

Number of active Hypre solvers (smart pointer like behaviuor to make sure that the initialise/finalize functions are only called the required number of times.

Definition at line 120 of file hypre_solver.cc.

Referenced by oomph::HypreInterface::HypreInterface(), and oomph::HypreInterface::~HypreInterface().