integration_class_2d Derived Type

type, public, extends(integration_class) :: integration_class_2d

double integration class: for 2d integration of f(x,y)


Inherits

type~~integration_class_2d~~InheritsGraph type~integration_class_2d integration_class_2d type~integration_class_1d integration_class_1d type~integration_class_2d->type~integration_class_1d iy, ix type~integration_class integration_class type~integration_class_2d->type~integration_class type~integration_class_1d->type~integration_class

Contents

Source Code


Components

TypeVisibilityAttributesNameInitial
procedure(func_2d), public, pointer:: fxy=> null()

function f(x,y) to be integrated

type(integration_class_1d), public :: iy

for the dy integration

type(integration_class_1d), public :: ix

for the dx integration


Type-Bound Procedures

procedure, public :: initialize => initialize_integration_class_2d

to set up the class

  • private subroutine initialize_integration_class_2d(me, fxy, xl, xu, yl, yu, tolx, toly, methodx, methody)

    Initialize the 2D integration class. Must be called before integration is performed.

    Arguments

    TypeIntentOptionalAttributesName
    class(integration_class_2d), intent(inout) :: me
    procedure(func_2d) :: fxy

    2d function: f(x,y)

    real(kind=wp), intent(in) :: xl

    x integration lower bound

    real(kind=wp), intent(in) :: xu

    x integration upper bound

    real(kind=wp), intent(in) :: yl

    y integration lower bound

    real(kind=wp), intent(in) :: yu

    y integration upper bound

    real(kind=wp), intent(in) :: tolx

    error tolerance for dx integration

    real(kind=wp), intent(in) :: toly

    error tolerance for dy integration

    integer, intent(in) :: methodx

    quadrature method to use for x

    integer, intent(in) :: methody

    quadrature method to use for y

procedure, public :: integrate => integrate_2d

to integrate the function fxy

  • private subroutine integrate_2d(me, ans, ierr, err)

    Perform the 2D integration.

    Arguments

    TypeIntentOptionalAttributesName
    class(integration_class_2d), intent(inout) :: me
    real(kind=wp), intent(out) :: ans
    integer, intent(out) :: ierr
    real(kind=wp), intent(out) :: err

Source Code

    type,extends(integration_class),public :: integration_class_2d
        !! double integration class: for 2d integration of `f(x,y)`
        private
        procedure(func_2d),pointer :: fxy => null()   !! function `f(x,y)` to be integrated
        type(integration_class_1d) :: iy     !! for the dy integration
        type(integration_class_1d) :: ix     !! for the dx integration
        contains
        private
        procedure,public :: initialize => initialize_integration_class_2d !! to set up the class
        procedure,public :: integrate  => integrate_2d !! to integrate the function `fxy`
    end type integration_class_2d