SolverParametersModule Module

A Module For Storing The Parameters For Iterative Solvers.



Contents


Variables

TypeVisibility AttributesNameInitial
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.


Interfaces

public interface SolverParameters_t

  • private pure function SolverParameters_init(converge_diff_in, threshold_in, max_iterations_in, be_verbose_in, BalancePermutation_in) result(this)

    Construct a data type which stores iterative solver parameters.

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value type(SolverParameters_t)


Derived Types

type, public :: SolverParameters_t

A class for passing parameters to an iterative solver.

Components

TypeVisibility AttributesNameInitial
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.

Constructor

private pure function SolverParameters_init(converge_diff_in, threshold_in, max_iterations_in, be_verbose_in, BalancePermutation_in)

Construct a data type which stores iterative solver parameters.


Subroutines

public subroutine SetParametersConvergeDiff(this, new_value)

Set the value of the convergence difference.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

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

Value to set it to.

public subroutine SetParametersMaxIterations(this, new_value)

Set the value of the max iterations.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

integer, intent(in) :: new_value

Value to set it to.

public subroutine SetParametersThreshold(this, new_value)

Set the value of the threshold.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

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

Value to set it to.

public subroutine SetParametersBeVerbose(this, new_value)

Set the value of the verbosity.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

logical, intent(in) :: new_value

Value to set it to.

public subroutine SetParametersLoadBalance(this, new_value)

Set the value of the load balance.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.

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

Value to set it to.

public subroutine PrintParameters(this)

Print out the iterative solver parameter values.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(in) :: this

The parameter object.

public subroutine DestructSolverParameters(this)

Cleanup the solver parameters datastructure.

Arguments

Type IntentOptional AttributesName
type(SolverParameters_t), intent(inout) :: this

The parameter object.