model Derived Type

type, public, extends(sdf_base) :: model

Model type. Allows the collection of multiple SDF into one model. Used to apply modifiers.


Components

Type Visibility Attributes Name Initial
type(sdf), public, allocatable :: array(:)

Array of SDFs in the model

procedure(op), public, nopass, pointer :: func

SDF modifier function

real(kind=wp), public :: k

Parameter that may be used in modifer function.

integer, public :: layer

Layer ID of SDF

type(opticalProp_t), public :: optProps

Optical property of the SDF

real(kind=wp), public :: transform(4,4)

Transform to apply to SDF.


Constructor

public interface model

  • private function model_init(array, func, kopt) result(out)

    Initalise the model type.

    Arguments

    Type IntentOptional Attributes Name
    type(sdf), intent(in) :: array(:)

    Array of SDFs

    procedure(op) :: func

    Operator to apply to SDF.

    real(kind=wp), intent(in), optional :: kopt

    Parameter used in modifier

    Return Value type(model)


Type-Bound Procedures

procedure, public :: evaluate => eval_model

  • private pure elemental function eval_model(this, pos) result(res)

    Evaluate the model

    Arguments

    Type IntentOptional Attributes Name
    class(model), intent(in) :: this
    type(vector), intent(in) :: pos

    Vector position to evaluate at

    Return Value real(kind=wp)

Source Code

    type, extends(sdf_base) :: model
        !> Array of SDFs in the model
        type(sdf), allocatable         :: array(:)
        !> SDF modifier function
        procedure(op), nopass, pointer :: func
        !> Parameter that may be used in modifer function.
        real(kind=wp) :: k
        contains
            procedure :: evaluate => eval_model
    end type model