polygon_in_mesh_t Derived Type

type, public :: polygon_in_mesh_t

Datatype for polygon running on mesh points This can either be a single closed polygon, or any positive number of open polygon segments (but not both simultaneously). The polgon must be sufficiently well defined, such that only up to two adjacent points can be uniquely determined for each point.


Contents


Components

Type Visibility Attributes Name Initial
integer, public, allocatable, dimension(:) :: ki_seg

Index of initial point of polygon segment


Finalization Procedures

final :: destructor


Type-Bound Procedures

procedure, public :: init => init_polygon_in_mesh

  • interface

    public module subroutine init_polygon_in_mesh(self, equi, mesh, inds, dir_counterclockwise, dbgout)

    Initialises polygon in mesh

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(inout) :: self

    Instance of type

    class(equilibrium_t) :: equi

    Equilibrium

    type(mesh_cart_t), intent(in) :: mesh

    Mesh

    integer, intent(in), dimension(:) :: inds

    Indices (on mesh) of polygon

    logical, intent(in), optional :: dir_counterclockwise

    If true (=default) the direction of the polygons is set counter-clockwise otherwise it is clockwise

    integer, intent(in), optional :: dbgout

    Debug output level

procedure, public :: is_periodic

  • public pure function is_periodic(self) result(res)

    Returns tru if polygon is closed (periodic)

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    Return Value logical

procedure, public :: get_np_total

  • public pure function get_np_total(self) result(res)

    Returns total number of polygon points

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    Return Value integer

procedure, public :: get_nsegs

  • public pure function get_nsegs(self) result(res)

    Returns number of segements

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    Return Value integer

procedure, public :: get_nps

  • public pure function get_nps(self, iseg) result(res)

    Returns number of points of segment

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    integer, intent(in), optional :: iseg

    Number of segment (default 1)

    Return Value integer

procedure, public :: get_ind_on_mesh

  • public pure function get_ind_on_mesh(self, ks, iseg) result(res)

    Returns mesh index of point of segement

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    integer, intent(in) :: ks

    Index on segment For closed polygon this is treated periodically For open segments zero is returned

    integer, intent(in), optional :: iseg

    Number of segment (default 1)

    Return Value integer

procedure, public :: display => display_polygon_in_mesh

  • public subroutine display_polygon_in_mesh(self)

    Displays information on polygon_in_mesh

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

procedure, public :: write_netcdf => write_netcdf_polygon_in_mesh

  • interface

    public module subroutine write_netcdf_polygon_in_mesh(self, fgid)

    Writes polygon_in_mesh to netcdf file

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(in) :: self

    Instance of the type

    integer, intent(in) :: fgid

    Netcdf file or group id

procedure, public :: read_netcdf => read_netcdf_polygon_in_mesh

  • interface

    public module subroutine read_netcdf_polygon_in_mesh(self, fgid)

    Reads polygon_in_mesh from netcdf file

    Arguments

    Type IntentOptional Attributes Name
    class(polygon_in_mesh_t), intent(inout) :: self

    Instance of the type

    integer, intent(in) :: fgid

    Netcdf file or group id