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


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 |
| 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 | The trial solutions for which the action is to be calculated |
| actions | The action vectors |
| range | The 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. |
| 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.
| d | On exit, contains the diagonal elements |
| 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.
| p_coefficients | The projection of the vectors onto to the P space |
| actions | On exit, the computed action has been added to the original contents |
| range | The range of the full space for which actions should be computed. |
| 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.
| 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.
| residual | On entry, assumed to be the residual. On exit, the negative of the predicted step. |
| shift | When 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. |
| diagonals | The diagonal elements of the underlying kernel. If passed, they will be used, otherwise the default preconditioner does nothing. |
| range | The 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. |
| 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.
| [in] | iteration | The iteration number if positive, or zero indicating successful convergence, or a negative number indicating failure to converge |
| [in] | verbosity | Expected interpretation:
|
| [in] | errors | The current residual norm for each solution |
| [in] | value | In the case of optimisation only, the current objective function value |
| [in] | eigenvalues | In the case of eigenproblem only, the current eigenvalues |
| 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 | The trial solution for which the residual is to be calculated |
| resid | The residual vector |
| range | The 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. |
| 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.
| vector | Will contain the requested RHS on exit |
| instance | Which equation set for which the RHS should be provided |
| range | The 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. |
| 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.
| instance | |
| parameters |
| type(pspace) iterative_solver_problem::problem::p_space |