segment Derived Type

type, public, extends(sdf_base) :: segment

Segment SDF (2D)


Components

Type Visibility Attributes Name Initial
type(vector), public :: a
type(vector), public :: b
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 segment

Interface to segment SDF initialising function

  • private function segment_init(a, b, optProp, layer, transform) result(out)

    Initalising function for segment SDF. Note this is a 2D function

    Arguments

    Type IntentOptional Attributes Name
    type(vector), intent(in) :: a

    segment start point

    type(vector), intent(in) :: b

    segment end point

    type(opticalProp_t), intent(in) :: optProp

    Optical properties of the SDF

    integer, intent(in) :: layer

    ID number of sdf

    real(kind=wp), intent(in), optional :: transform(4,4)

    Optional transform to apply to SDF

    Return Value type(segment)


Type-Bound Procedures

procedure, public :: evaluate => evaluate_segment

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

    Evaluation function for Segment SDF.

    Arguments

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

    vector position to evaluate SDF at

    Return Value real(kind=wp)

Source Code

    type, extends(sdf_base) :: segment
        type(vector) :: a, b
        contains
        procedure :: evaluate => evaluate_segment
    end type segment