lin_interpnd_class Module

Houses multi-linear interpolation class on n-dimensional data


Used by


Interfaces

interface

  • private pure module function getFirstDataIndicesForDim(this, dim) result(inds)

    Getter for firstDataIndex of component 1D interpolation object with index dim

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(in) :: this
    integer(kind=ik), intent(in) :: dim

    Return Value integer(kind=ik), allocatable, dimension(:)

interface

  • private pure module function getInterpWeightsForDim(this, dim) result(weights)

    Getter for interpWeights of component 1D interpolation object with index dim

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(in) :: this
    integer(kind=ik), intent(in) :: dim

    Return Value real(kind=rk), allocatable, dimension(:)

interface

  • private pure module function getInterpPointsForDim(this, dim) result(points)

    Getter for interpolationPoints of component 1D interpolation object with index dim

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(in) :: this
    integer(kind=ik), intent(in) :: dim

    Return Value real(kind=rk), allocatable, dimension(:)

interface

  • private pure module function interpolate(this, targetArray) result(interpVals)

    Interpolate FlatNDData onto interpolation points using weighted averages of vertices of the containing hypercube

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(in) :: this
    type(FlatNDData), intent(in) :: targetArray

    Return Value real(kind=rk), allocatable, dimension(:)

interface

  • private pure module subroutine initInterpolation(this, interpolationObjs)

    Initialization routine for ND interpolation object

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(inout) :: this
    type(Interpolation1D), intent(in), dimension(:) :: interpolationObjs

interface

  • private pure module subroutine updateInterpolationPoints(this, interpolationPoints)

    Update the interpolation points and weights of all individual 1D interpolation objects and the weights/data indices used

    Arguments

    Type IntentOptional Attributes Name
    class(InterpolationND), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:,:) :: interpolationPoints

Derived Types

type, public, extends(Object) ::  InterpolationND

Linear interpolation object housing information necessary for linearly interpolating N-dimensional data using weighted averages. If interpolation points are outside of the grid will return 0 for interpolated value. NOTE: Does not support changing the number of interpolation points after the first interpolation call.

Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

type(Interpolation1D), private, dimension(:), allocatable :: interpObjs

Individual 1D interpolation objects. They must correspond to the axes of the data this object should be interpolating

integer(kind=ik), private, dimension(:,:), allocatable :: firstDataIndices

An array of shape (Nd,:) where Nd is the dimensionality of the data being interpolated containing the coordinates of the origin of each hyper-cube of points used in interpolation

type(IntArray), private, dimension(:), allocatable :: hyperCube

Indices of individual hyper-cube points (e.g. [0,1,1,1,0] etc.)

real(kind=rk), private, dimension(:,:), allocatable :: weights

Hypercube vertex weigths (2^Nd,:) for each interpolation point

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: getFirstDataIndicesForDim
procedure, public :: getInterpWeightsForDim
procedure, public :: getInterpPointsForDim
procedure, public :: updateInterpolationPoints
procedure, public :: interpolate
procedure, public :: init => initInterpolation