constructor Function

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

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)


Called by

proc~~constructor~4~~CalledByGraph proc~constructor~4 constructor interface~preconditioner preconditioner interface~preconditioner->proc~constructor~4

Contents

Source Code


Source Code

  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.
    !
    real(r8), optional, intent(in) :: tolerance
      !! The tolerance within which to apply the inverse Jacobian.
      !! Defaults to 0.001.
    integer, optional, intent(in)  :: max_iterations
      !! The maximum number of iterations to use when applying the
      !! preconditioner. Defaults to 20.
    type(preconditioner) :: this
    if (present(tolerance)) this%tolerance = tolerance
    if (present(max_iterations)) this%max_iterations = max_iterations
  end function constructor