SolverParametersModule Module

A Module For Storing The Parameters For Iterative Solvers.



Contents


Variables

Type Visibility Attributes Name Initial
real(kind=NTREAL), public, parameter :: CONVERGENCE_DIFF_CONST = 1e-6_NTREAL

The default convergence difference.

integer, public, parameter :: MAX_ITERATIONS_CONST = 1000

The default maximum number of iterations.


Derived Types

type, public ::  SolverParameters_t

A class for passing parameters to an iterative solver.

Components

Type Visibility Attributes Name Initial
real(kind=NTREAL), public :: converge_diff

When do we consider a calculation converged.

integer, public :: max_iterations

Maximum number of iterations of a solver before termination.

real(kind=NTREAL), public :: threshold

Threshold for sparse multiplication and addition.

logical, public :: be_verbose

If true, the sparse solver prints out information each loop iteration.

logical, public :: do_load_balancing

If true, the sparse solver will try and load balance before calculation.

type(Permutation_t), public :: BalancePermutation

The permutation used for load balancing.

real(kind=NTREAL), public :: step_thresh

Thresholds for step size searches.


Subroutines

public subroutine ConstructSolverParameters(this, converge_diff_in, threshold_in, max_iterations_in, be_verbose_in, BalancePermutation_in, step_thresh_in)

Construct a data type which stores iterative solver parameters.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameters to construct.

real(kind=NTREAL), intent(in), optional :: converge_diff_in

Converge_diff_in the difference between iterations to consider a calculation converged.

real(kind=NTREAL), intent(in), optional :: threshold_in

The zero threshold

integer, intent(in), optional :: max_iterations_in

The maximum number of iterations to perform

logical, intent(in), optional :: be_verbose_in

Whether to print during the calculation (default = False)

type(Permutation_t), intent(in), optional :: BalancePermutation_in

For load balancing

real(kind=NTREAL), intent(in), optional :: step_thresh_in

Step size for differential equation solvers.

public subroutine CopySolverParameters(paramA, paramB)

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(in) :: paramA

Parameters to copy

type(SolverParameters_t), intent(inout) :: paramB

paramB = paramA

public pure subroutine SetParametersConvergeDiff(this, new_value)

Set the value of the convergence difference.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public pure subroutine SetParametersMaxIterations(this, new_value)

Set the value of the max iterations.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

integer, intent(in) :: new_value

Value to set it to.

public pure subroutine SetParametersThreshold(this, new_value)

Set the value of the threshold.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public pure subroutine SetParametersBeVerbose(this, new_value)

Set the value of the verbosity.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

logical, intent(in) :: new_value

Value to set it to.

public pure subroutine SetParametersLoadBalance(this, new_value)

Set the value of the load balance.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

type(Permutation_t), intent(in) :: new_value

Value to set it to.

public pure subroutine SetParametersStepThreshold(this, new_value)

Set the value of the step threshold.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.

real(kind=NTREAL), intent(in) :: new_value

Value to set it to.

public subroutine PrintParameters(this)

Print out the iterative solver parameter values.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(in) :: this

The parameter object.

public pure subroutine DestructSolverParameters(this)

Cleanup the solver parameters datastructure.

Arguments

Type IntentOptional Attributes Name
type(SolverParameters_t), intent(inout) :: this

The parameter object.