penalisation_t Derived Type

type, public :: penalisation_t

Datatype for penalisation


Contents


Components

Type Visibility Attributes Name Initial
real(kind=GP), public, allocatable, dimension(:) :: charfun

Characteristic function of penalisation Formerly known as chi

real(kind=GP), public, allocatable, dimension(:) :: dirindfun

Function indicating direction of magnetic field (towards/away from target) Formerly known as xi or zeta

integer, public, allocatable, dimension(:) :: p_inds

Indices on full mesh which lie in penalisation region

integer, public :: n_p_inds

Size of p_inds

integer, public, allocatable, dimension(:) :: pb_inds

Indices on full mesh with charfun value 0 that have direct neighbors in the penalisation region

integer, public :: n_pb_inds

Size of pb_inds


Finalization Procedures

final :: destructor


Type-Bound Procedures

procedure, public :: set_parameters => set_parameters_penalisation

  • interface

    public module subroutine set_parameters_penalisation(self, dphi, filename, pen_method_in, penfuns_type_in, hermite_order_in, charfun_parwidth_in, charfun_radlimwidth_in, dirindfun_parwidth_in, dphi_max_in, charfun_at_target_in, max_step_size_in, rho_min_in)

    Sets parameters for penalisation, either via namelist from file, or setting explicitly

    Arguments

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

    Instance of the type

    real(kind=GP), intent(in) :: dphi

    Toroidal grid distance

    character(len=*), intent(in), optional :: filename

    Filename where parameter are read from

    integer, intent(in), optional :: pen_method_in

    Method of penalisation

    integer, intent(in), optional :: penfuns_type_in

    Type of penalisation function

    integer, intent(in), optional :: hermite_order_in

    Order of Hermite polynomial used as penalisation function

    real(kind=GP), intent(in), optional :: charfun_parwidth_in

    Parallel decay length of characteristic penalisation function

    real(kind=GP), intent(in), optional :: charfun_radlimwidth_in

    Radial decay length (only for limiter geometry)

    real(kind=GP), intent(in), optional :: dirindfun_parwidth_in

    Parallel decay length of direction indicator function

    real(kind=GP), intent(in), optional :: dphi_max_in

    Parallel decay length of direction indicator function

    real(kind=GP), intent(in), optional :: charfun_at_target_in

    Contourvalue of characteristic function at location of target plate

    real(kind=GP), intent(in), optional :: max_step_size_in

    Maximum step size for the tracing

    real(kind=GP), intent(in), optional :: rho_min_in

    For the build VIA_STABLE_TRACE: grid points that have smaller rho values than this, all penalization functions are automatically zero

procedure, public :: build => build_penalisation

  • interface

    public module subroutine build_penalisation(self, comm_handler, equi, mesh, multigrid, dbgout)

    Builds penalisation functions

    Arguments

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

    Instance of the type

    type(comm_handler_t), intent(in) :: comm_handler

    Comunication handler

    class(equilibrium_t) :: equi

    Equilibrium (not changed)

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

    Mesh

    type(multigrid_t), intent(inout) :: multigrid

    Multigrid

    integer, intent(in), optional :: dbgout

    Debug output level

procedure, public :: build_wip3d => build_wip3d_penalisation

  • interface

    public module subroutine build_wip3d_penalisation(pen_cano, pen_stag, comm_handler, equi, equi_on_cano, equi_on_stag, mesh_cano, mesh_stag, multigrid_cano, multigrid_stag, map, dbgout)

    Builds penalisation functions for 3d equilibria based on parallel diffusion equation This is yet an experimental feature

    Arguments

    Type IntentOptional Attributes Name
    class(penalisation_t), intent(inout) :: pen_cano

    Penalisation for canonical mesh

    class(penalisation_t), intent(inout) :: pen_stag

    Penalisation for staggered mesh

    type(comm_handler_t), intent(in) :: comm_handler

    Comunication handler

    class(equilibrium_t) :: equi

    Equilibrium (not changed)

    class(equilibrium_storage_t), intent(inout) :: equi_on_cano

    Equilibrim quantities on canonical mesh

    class(equilibrium_storage_t), intent(inout) :: equi_on_stag

    Equilibrim quantities on staggered mesh

    type(mesh_cart_t), intent(inout) :: mesh_cano

    Mesh (canonical)

    type(mesh_cart_t), intent(inout) :: mesh_stag

    Mesh (staggered)

    type(multigrid_t), intent(inout) :: multigrid_cano

    Multigrid (canonical)

    type(multigrid_t), intent(inout) :: multigrid_stag

    Multigrid (staggered)

    type(parallel_map_t), intent(in) :: map

    Map

    integer, intent(in), optional :: dbgout

    Debug output level

procedure, public :: write_netcdf => write_netcdf_penalisation

  • interface

    public module subroutine write_netcdf_penalisation(self, fgid)

    Writes penalisation to netcdf file

    Arguments

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

    Instance of the type

    integer, intent(in) :: fgid

    netcdf file or group id

procedure, public :: read_netcdf => read_netcdf_penalisation

  • interface

    public module subroutine read_netcdf_penalisation(self, fgid)

    Reads penalisation from netcdf file

    Arguments

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

    Instance of the type

    integer, intent(in) :: fgid

    netcdf file or group id

procedure, public :: display => display_penalisation

  • interface

    public module subroutine display_penalisation(self)

    Displays information on penalisation

    Arguments

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

    Instance of the type

procedure, public :: get_dphi

  • public pure function get_dphi(self)

    Toroidal grid distance

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_dphi_max

  • public pure function get_dphi_max(self)

    Maximum angle to be traced for building penalisation

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_penfuns_type

  • public pure function get_penfuns_type(self)

    Returns type of penalisation function

    Arguments

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

    Instance of the type

    Return Value integer

procedure, public :: get_hermite_order

  • public pure function get_hermite_order(self)

    Returns order of Hermite polynomial used as penalisation function

    Arguments

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

    Instance of the type

    Return Value integer

procedure, public :: get_charfun_parwidth

  • public pure function get_charfun_parwidth(self)

    Returns parallel decay length of characteristic penalisation function

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_charfun_radlimwidth

  • public pure function get_charfun_radlimwidth(self)

    Radial radial decay length (only for limiter geometry)

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_dirindfun_parwidth

  • public pure function get_dirindfun_parwidth(self)

    Returns parallel decay length of direction indicator function

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_charfun_at_target

  • public pure function get_charfun_at_target(self)

    Contourvalue of characteristic function at target plate

    Arguments

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

    Instance of the type

    Return Value real(kind=gp)

procedure, public :: get_charfun_val

  • public pure function get_charfun_val(self, ki)

    Returns value of characteristic function

    Arguments

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

    Instance of the type

    integer, intent(in) :: ki

    Running index for inner grid

    Return Value real(kind=gp)

procedure, public :: get_dirindfun_val

  • public pure function get_dirindfun_val(self, ki)

    Returns value of direction indicator function

    Arguments

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

    Instance of the type

    integer, intent(in) :: ki

    Running index for inner grid

    Return Value real(kind=gp)