iterative-solver 0.0
 
Loading...
Searching...
No Matches
iterative_solver_problem::problem Type Reference

Abstract class defining the problem-specific interface for the simplified solver interface to IterativeSolver. More...

Inheritance diagram for iterative_solver_problem::problem:
Collaboration diagram for iterative_solver_problem::problem:

Detailed Description

Abstract class defining the problem-specific interface for the simplified solver interface to IterativeSolver.

Public Member Functions

procedure, pass diagonals (this, d)
 Optionally provide the diagonal elements of the underlying kernel. If implemented and returning true, the provided diagonals will be used by the base precondition() function for preconditioning (and therefore the precondition() function does not need to be reimplemented), and, in the case of linear problems, for selection of the P space. Otherwise, preconditioning will be done with precondition(), and any P space has to be provided manually.
 
procedure, pass precondition (this, action, shift, diagonals, range)
 Apply preconditioning to a residual vector in order to predict a step towards the solution. This is a complete implementation provided that the diagonals() function is reimplemented, but can be overridden if desired.
 
procedure, pass residual (this, parameters, residuals, range)
 Calculate the residual vector. Used by non-linear solvers (NonLinearEquations, Optimize) only.
 
procedure, pass action (this, parameters, actions, range)
 Calculate the action of the kernel matrix on a set of parameters. Used by linear solvers, but not by the non-linear solvers (NonLinearEquations, Optimize).
 
procedure, pass rhs (this, vector, instance, range)
 Provide the inhomogeneous part of one of the sets of linear equations. Implementation required only for linear equation solver.
 
procedure, pass report (this, iteration, verbosity, errors, value, eigenvalues)
 Report progress at the end of each iteration, or at the end of the calculation.
 
procedure, pass p_action (this, p_coefficients, actions, range)
 Calculate the action of the kernel matrix on a set of vectors in the P space. Implementation required only for linear hermitian problems for which P-space acceleration is wanted.
 
procedure, pass pp_action_matrix (this)
 Calculate the representation of the kernel matrix in the P space. Implementation required only for linear hermitian problems for which P-space acceleration is wanted.
 
procedure, pass test_parameters (this, instance, parameters)
 Provide values of R vectors for testing the problem class. For use in a non-linear solver, the first vector (instance=0) should be a reference point, and the remainder (instance>0) should be close to it, such that meaningful numerical differentation can be done to test the residual function.
 

Public Attributes

type(pspace) p_space
 

Member Function/Subroutine Documentation

◆ action()

procedure, pass iterative_solver_problem::problem::action ( class(problem), intent(in)  this,
double precision, dimension(:, :), intent(in)  parameters,
double precision, dimension(:, :), intent(inout)  actions,
integer, dimension(2), intent(in)  range 
)

Calculate the action of the kernel matrix on a set of parameters. Used by linear solvers, but not by the non-linear solvers (NonLinearEquations, Optimize).

Parameters
parametersThe trial solutions for which the action is to be calculated
actionsThe action vectors
rangeThe range of the space for which actions should be computed. It's OK to provide also the values outside this range (which will happen in a multiprocessing context), but they will be ignored by the solver.

◆ diagonals()

procedure, pass iterative_solver_problem::problem::diagonals ( class(problem), intent(in)  this,
double precision, dimension(:), intent(inout)  d 
)

Optionally provide the diagonal elements of the underlying kernel. If implemented and returning true, the provided diagonals will be used by the base precondition() function for preconditioning (and therefore the precondition() function does not need to be reimplemented), and, in the case of linear problems, for selection of the P space. Otherwise, preconditioning will be done with precondition(), and any P space has to be provided manually.

Parameters
dOn exit, contains the diagonal elements
Returns
Whether diagonals have been provided.

◆ p_action()

procedure, pass iterative_solver_problem::problem::p_action ( class(problem), intent(in)  this,
double precision, dimension(:, :), intent(in)  p_coefficients,
double precision, dimension(:, :), intent(inout)  actions,
integer, dimension(2), intent(in)  range 
)

Calculate the action of the kernel matrix on a set of vectors in the P space. Implementation required only for linear hermitian problems for which P-space acceleration is wanted.

Parameters
p_coefficientsThe projection of the vectors onto to the P space
actionsOn exit, the computed action has been added to the original contents
rangeThe range of the full space for which actions should be computed.

◆ pp_action_matrix()

procedure, pass iterative_solver_problem::problem::pp_action_matrix ( class(problem), intent(in)  this)

Calculate the representation of the kernel matrix in the P space. Implementation required only for linear hermitian problems for which P-space acceleration is wanted.

◆ precondition()

procedure, pass iterative_solver_problem::problem::precondition ( class(problem), intent(in)  this,
double precision, dimension(:, :), intent(inout)  action,
double precision, dimension(:), intent(in), optional  shift,
double precision, dimension(:), intent(in), optional  diagonals,
integer, dimension(2), intent(in)  range 
)

Apply preconditioning to a residual vector in order to predict a step towards the solution. This is a complete implementation provided that the diagonals() function is reimplemented, but can be overridden if desired.

Parameters
residualOn entry, assumed to be the residual. On exit, the negative of the predicted step.
shiftWhen called from LinearEigensystem, contains the corresponding current eigenvalue estimates for each of the parameter vectors in the set. All other solvers should pass a vector of zeroes, which is the default if omitted.
diagonalsThe diagonal elements of the underlying kernel. If passed, they will be used, otherwise the default preconditioner does nothing.
rangeThe range of the space for which actions should be computed. It's OK to provide also the values outside this range (which will happen in a multiprocessing context), but they will be ignored by the solver.

◆ report()

procedure, pass iterative_solver_problem::problem::report ( class(problem), intent(in)  this,
integer, intent(in)  iteration,
integer, intent(in)  verbosity,
double precision, dimension(:), intent(in)  errors,
double precision, intent(in), optional  value,
double precision, dimension(:), intent(in), optional  eigenvalues 
)

Report progress at the end of each iteration, or at the end of the calculation.

Returns
.true. if the information was used, and therefore the caller should be silent. This is a complete implementation that can be used, but can be overridden if desired.
Parameters
[in]iterationThe iteration number if positive, or zero indicating successful convergence, or a negative number indicating failure to converge
[in]verbosityExpected interpretation:
  • 0 or less, nothing should be printed
  • 1 nothing should be printed if iteration > 0
  • 2 or more show progress in each iteration
[in]errorsThe current residual norm for each solution
[in]valueIn the case of optimisation only, the current objective function value
[in]eigenvaluesIn the case of eigenproblem only, the current eigenvalues

◆ residual()

procedure, pass iterative_solver_problem::problem::residual ( class(problem), intent(in)  this,
double precision, dimension(:, :), intent(in)  parameters,
double precision, dimension(:, :), intent(inout)  residuals,
integer, dimension(2), intent(in)  range 
)

Calculate the residual vector. Used by non-linear solvers (NonLinearEquations, Optimize) only.

Parameters
parametersThe trial solution for which the residual is to be calculated
residThe residual vector
rangeThe range of the space for which actions should be computed. It's OK to provide also the values outside this range (which will happen in a multiprocessing context), but they will be ignored by the solver.
Returns
In the case where the residual is an exact differential, the corresponding function value. Used by Optimize but not NonLinearEquations.

◆ rhs()

procedure, pass iterative_solver_problem::problem::rhs ( class(problem), intent(in)  this,
double precision, dimension(:), intent(inout)  vector,
integer, intent(in)  instance,
integer, dimension(2), intent(in)  range 
)

Provide the inhomogeneous part of one of the sets of linear equations. Implementation required only for linear equation solver.

Parameters
vectorWill contain the requested RHS on exit
instanceWhich equation set for which the RHS should be provided
rangeThe range of the space for which actions should be computed. It's OK to provide also the values outside this range (which will happen in a multiprocessing context), but they will be ignored by the solver.
Returns
Whether the requested instance exists

◆ test_parameters()

procedure, pass iterative_solver_problem::problem::test_parameters ( class(problem), intent(in)  this,
integer, intent(in)  instance,
double precision, dimension(:), intent(inout)  parameters 
)

Provide values of R vectors for testing the problem class. For use in a non-linear solver, the first vector (instance=0) should be a reference point, and the remainder (instance>0) should be close to it, such that meaningful numerical differentation can be done to test the residual function.

Parameters
instance
parameters
Returns
true if a vector has been provided

Member Data Documentation

◆ p_space

type(pspace) iterative_solver_problem::problem::p_space