t_rProfile_poly Derived Type

type, public, extends(c_rProfile) :: t_rProfile_poly


Inherits

type~~t_rprofile_poly~~InheritsGraph type~t_rprofile_poly t_rProfile_poly type~c_rprofile c_rProfile type~t_rprofile_poly->type~c_rprofile

Components

Type Visibility Attributes Name Initial
integer, public :: n_coefs
real(kind=wp), public, ALLOCATABLE :: coefs(:)
integer, public :: deg = 0

Constructor

public interface t_rProfile_poly

  • public function polyProfile_new(coefs) result(sf)

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: coefs(:)

    B-Spline coefficients

    Return Value type(t_rProfile_poly)


Finalization Procedures

final :: polyProfile_free

  • public subroutine polyProfile_free(sf)

    finalize the type rProfile

    Arguments

    Type IntentOptional Attributes Name
    type(t_rProfile_poly), intent(inout) :: sf

    self


Type-Bound Procedures

procedure, public :: eval_at_rho => rProfile_eval_at_rho

  • public function rProfile_eval_at_rho(sf, rho, deriv) result(derivative)

    evaluate the n-th derivative of a radial profile with respect to rho ~sqrt(magnetic flux). NOTE: n has to be in [0,4] due to an explicit implementation of the product rule.

    Arguments

    Type IntentOptional Attributes Name
    class(c_rProfile) :: sf

    self

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

    rho position rho ~sqrt(magnetic flux)

    integer, intent(in), optional :: deriv

    derivative in rho

    Return Value real(kind=wp)

    n-th derivative of a radial profile with respect to rho ~sqrt(magnetic flux).

procedure, public :: eval_at_rho2 => polyProfile_eval_at_rho2

  • public function polyProfile_eval_at_rho2(sf, rho2, deriv) result(profile_prime_value)

    evaluate the n-th derivative of a power polynomial

    Arguments

    Type IntentOptional Attributes Name
    class(t_rProfile_poly), intent(in) :: sf

    self

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

    evaluation point in the toroidal flux coordinate (rho2=phi/phi_edge= spos^2)

    integer, intent(in), optional :: deriv

    Return Value real(kind=wp)

procedure, public :: antiderivative => polyProfile_antiderivative

  • public function polyProfile_antiderivative(sf) result(antideriv)

    get the exact polynomial antiderivative, with respect to rho2

    Arguments

    Type IntentOptional Attributes Name
    class(t_rProfile_poly), intent(in) :: sf

    self

    Return Value class(c_rProfile), ALLOCATABLE

Source Code

  TYPE, EXTENDS(c_rProfile) :: t_rProfile_poly
    !INTEGER               :: n_coefs !! number of polynomial coefficients, part of abstract type
    INTEGER               :: deg = 0
    !REAL(wp), ALLOCATABLE :: coefs(:)   !! polynomial coefficients, part of abstract type
    CONTAINS
    PROCEDURE :: eval_at_rho2        => polyProfile_eval_at_rho2
    PROCEDURE :: antiderivative      => polyProfile_antiderivative
    FINAL     :: polyProfile_free

  END TYPE t_rProfile_poly