surface Derived Type

type, public :: surface


Inherits

type~~surface~~InheritsGraph type~surface surface type~cylinder cylinder type~surface->type~cylinder my_cylinder type~plane plane type~surface->type~plane my_plane type~vector vector type~cylinder->type~vector center, axis type~plane->type~vector normal

Inherited by

type~~surface~~InheritedByGraph type~surface surface type~mesh mesh type~mesh->type~surface surf type~pde pde type~pde->type~mesh msh type~field field type~field->type~mesh msh type~scalar_field scalar_field type~scalar_field->type~field type~vector_field vector_field type~vector_field->type~field type~scalar_pde scalar_pde type~scalar_pde->type~pde type~vector_pde vector_pde type~vector_pde->type~pde

Contents

Source Code


Components

TypeVisibility AttributesNameInitial
integer, private :: itype =0
type(cylinder), private, pointer:: my_cylinder=> null()
type(plane), private, pointer:: my_plane=> null()
logical, private :: set =.false.

Type-Bound Procedures

procedure, public :: free_surface

  • interface

    private module subroutine free_surface(this_surface)

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(inout) :: this_surface

procedure, public :: get_closest_point

  • interface

    private module function get_closest_point(this_surface, point)

    Returns the point on a surface that is closest to the given point

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: this_surface
    type(vector), intent(in) :: point

    Return Value type(vector)

generic, public :: nemo_sizeof => nemo_surface_sizeof

generic, public :: normal_ => get_surface_normal

generic, public :: r2_ => get_surface_r2

procedure, public :: reform_vertex

  • interface

    private module subroutine reform_vertex(this_surface, vtx)

    moves the given vertex onto the closest point on the surface

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: this_surface
    type(vertex), intent(inout) :: vtx

procedure, public :: translate_surface

  • interface

    private module subroutine translate_surface(this_surface, offset)

    Move a surface by translating it in 3D space

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(inout) :: this_surface
    type(vector), intent(in) :: offset

generic, public :: type_ => get_surface_type

procedure, private :: get_surface_normal

  • interface

    private module function get_surface_normal(this_surface, this_point)

    Returns the surface normal at an appropriately close point We assume that the point is actually on the surface

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: this_surface
    type(vector), intent(in) :: this_point

    Return Value type(vector)

procedure, private :: get_surface_r2

  • interface

    private module function get_surface_r2(this_surface)

    Returns the goodness of fit, R2 value, from 0 to 1

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: this_surface

    Return Value real(kind=psb_dpk_)

procedure, private :: get_surface_type

  • interface

    private module function get_surface_type(this_surface)

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: this_surface

    Return Value integer

procedure, private :: nemo_surface_sizeof

  • interface

    private elemental module function nemo_surface_sizeof(surf)

    Arguments

    Type IntentOptional AttributesName
    class(surface), intent(in) :: surf

    Return Value integer(kind=nemo_int_long_)

Source Code

    TYPE surface
        PRIVATE

        ! Surface holds one of these three kinds of surface.
        ! PLANE is-a SURFACE, A_CYLINDER is-a SURFACE, etc.

        TYPE( plane ),    POINTER  :: my_plane =>null()
        TYPE( cylinder ), POINTER  :: my_cylinder => NULL()
        !     type( sphere   ), pointer :: my_sphere => null()    ! not yet written
        LOGICAL :: set = .FALSE.      ! true if this surface has already been created
        INTEGER :: itype = 0          ! indicates the type of surface
    CONTAINS
        PROCEDURE :: free_surface                                  ! Destructor
        PROCEDURE, PRIVATE :: get_surface_type                     ! Returns Int. ID #
        GENERIC, PUBLIC :: type_ => get_surface_type
        PROCEDURE, PRIVATE :: get_surface_normal, get_surface_r2   ! Getters
        GENERIC, PUBLIC :: normal_ => get_surface_normal
        GENERIC, PUBLIC :: r2_ => get_surface_r2
        PROCEDURE :: get_closest_point                    ! Getters, cont.
        PROCEDURE :: reform_vertex, translate_surface     ! Setters.
        PROCEDURE, PRIVATE :: nemo_surface_sizeof
        GENERIC, PUBLIC :: nemo_sizeof => nemo_surface_sizeof
    END TYPE surface