cylinder Derived Type

type, public, extends(sdf_base) :: cylinder

Cylinder SDF


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 :: radius
real(kind=wp), public :: transform(4,4)

Transform to apply to SDF.


Constructor

public interface cylinder

Interface to cylinder SDF initialising function

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

    Initalising function for Cylinder SDF.

    Arguments

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

    Vector position at centre of the bottom circle

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

    Vector position at centre of the top circle

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

    Radius of cylinder

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


Type-Bound Procedures

procedure, public :: evaluate => evaluate_cylinder

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

    Evaluation function for Cylinder SDF.

    Arguments

    Type IntentOptional Attributes Name
    class(cylinder), 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) :: cylinder
        real(kind=wp) :: radius
        type(vector) :: a, b
        contains
        procedure :: evaluate => evaluate_cylinder
    end type cylinder