preconditioner_mod Module

Provides a type for preconditioning fields in an iterative solver using Picard iteration.


Uses

  • module~~preconditioner_mod~~UsesGraph module~preconditioner_mod preconditioner_mod penf penf module~preconditioner_mod->penf logger_mod logger_mod module~preconditioner_mod->logger_mod factual_mod factual_mod module~preconditioner_mod->factual_mod iso_fortran_env iso_fortran_env module~preconditioner_mod->iso_fortran_env module~jacobian_block_mod jacobian_block_mod module~preconditioner_mod->module~jacobian_block_mod module~jacobian_block_mod->penf module~jacobian_block_mod->logger_mod module~jacobian_block_mod->factual_mod module~jacobian_block_mod->iso_fortran_env f95_lapack f95_lapack module~jacobian_block_mod->f95_lapack module~boundary_types_mod boundary_types_mod module~jacobian_block_mod->module~boundary_types_mod

Contents


Interfaces

public interface preconditioner

  • private function constructor(tolerance, max_iterations) result(this)

    Author
    Chris MacMackin
    Date
    December 2016

    Create a preconditioner object with the desired tolerance and maximum number of iterations.

    Arguments

    Type IntentOptional AttributesName
    real(kind=r8), intent(in), optional :: tolerance

    The tolerance within which to apply the inverse Jacobian. Defaults to 0.001.

    integer, intent(in), optional :: max_iterations

    The maximum number of iterations to use when applying the preconditioner. Defaults to 20.

    Return Value type(preconditioner)


Derived Types

type, public :: preconditioner

Uses Picard iterations to apply the inverse Jacobian of a system to a vector, to low accuracy. Rather than directly computing the inverse Jacobian, it is more efficient to approximate it. If is the vector being preconditioned, and is the result of applying the preconditioner, then Thus, the preconditioner can be applied by approximately solving this system for . Linearising , this system can be solved efficiently using Picard iteration.

Read more…

Components

TypeVisibility AttributesNameInitial
real(kind=r8), private :: tolerance =1.e-3_r8
integer, private :: max_iterations =20

Constructor

private function constructor(tolerance, max_iterations)

Create a preconditioner object with the desired tolerance and maximum number of iterations.

Type-Bound Procedures

procedure, public :: apply => preconditioner_apply

Functions

private function constructor(tolerance, max_iterations) result(this)

Author
Chris MacMackin
Date
December 2016

Create a preconditioner object with the desired tolerance and maximum number of iterations.

Arguments

Type IntentOptional AttributesName
real(kind=r8), intent(in), optional :: tolerance

The tolerance within which to apply the inverse Jacobian. Defaults to 0.001.

integer, intent(in), optional :: max_iterations

The maximum number of iterations to use when applying the preconditioner. Defaults to 20.

Return Value type(preconditioner)


Subroutines

private subroutine preconditioner_apply(this, jacobian, vector, estimate)

Author
Chris MacMackin
Date
December 2016

Use Picard iteration to approximately multiply the state vector by the inverse Jacobian. The details for this procedure are in the documentation of the preconditioner type.

Arguments

Type IntentOptional AttributesName
class(preconditioner), intent(in) :: this
class(jacobian_block), intent(inout), dimension(:,:):: jacobian

An matrix approximating the Jacobian for which the preconditioner is used.

class(scalar_field), intent(in), dimension(:):: vector

A vector of size which is to be preconditioned.

class(scalar_field), intent(inout), dimension(:):: estimate

On entry, an initial guess for the preconditioned vector. On exit, the iteratively determined value of the preconditioned vector.