sphere Derived Type

type, public, extends(sdf_base) :: sphere

Sphere SDF


Components

Type Visibility Attributes Name Initial
integer, public :: layer

Layer ID of SDF

type(opticalProp_t), public :: optProps

Optical property of the SDF

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

Transform to apply to SDF.


Constructor

public interface sphere

  • private function sphere_init(radius, optProp, layer, transform) result(out)

    Initalising function for Sphere SDF.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: radius

    radius of the Sphere

    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(sphere)


Type-Bound Procedures

procedure, public :: evaluate => evaluate_sphere

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

    Evaluation function for Sphere SDF.

    Arguments

    Type IntentOptional Attributes Name
    class(sphere), 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) :: sphere
        real(kind=wp) :: radius
        contains
        procedure :: evaluate => evaluate_sphere
    end type sphere