displacement Derived Type

type, public, extends(sdf_base) :: displacement

Displace the surface of a SDF by a function.


Components

Type Visibility Attributes Name Initial
procedure(primitive), public, nopass, pointer :: func
integer, public :: layer

Layer ID of SDF

type(opticalProp_t), public :: optProps

Optical property of the SDF

class(sdf_base), public, pointer :: prim
real(kind=wp), public :: transform(4,4)

Transform to apply to SDF.


Constructor

public interface displacement

  • private function displacement_init(prim, func) result(out)

    Initialise the displacement modifier for a SDF.

    Arguments

    Type IntentOptional Attributes Name
    class(sdf_base), target :: prim

    SDF to modify

    procedure(primitive) :: func

    Function to displace the SDF with.

    Return Value type(displacement)


Type-Bound Procedures

procedure, public :: evaluate => eval_disp

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

    Evaluation function for displacement modifier.

    Arguments

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

    Position to evaluate the modifier at

    Return Value real(kind=wp)

Source Code

    type, extends(sdf_base) :: displacement
        procedure(primitive), nopass, pointer :: func
        class(sdf_base), pointer :: prim
        contains
        procedure :: evaluate => eval_disp
    end type displacement