Species Derived Type

type, public, extends(Object) :: Species

Base species class containing particle properties and associated variable names


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

integer(kind=ik), private :: id
character(len=:), private, allocatable :: name
real(kind=rk), private :: charge

in elementary charge units

real(kind=rk), private :: mass

in kg

type(StringArray), private, allocatable, dimension(:) :: associatedVars

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: getID

  • interface

    private pure module function getID(this) result(id)

    Getter for id

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(in) :: this

    Return Value integer(kind=ik)

procedure, public :: getName

  • interface

    private pure module function getName(this) result(name)

    Getter for name

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: getCharge

  • interface

    private pure module function getCharge(this) result(charge)

    Getter for charge

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(in) :: this

    Return Value real(kind=rk)

procedure, public :: getMass

  • interface

    private pure module function getMass(this) result(mass)

    Getter for mass

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(in) :: this

    Return Value real(kind=rk)

procedure, public :: getAssociatedVars

  • interface

    private pure module function getAssociatedVars(this) result(associatedVars)

    Getter for associatedVars

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(in) :: this

    Return Value type(StringArray), allocatable, dimension(:)

procedure, public :: initFromJSON

  • interface

    private module subroutine initFromJSON(this, name, jsonCont, mpiCont)

    Initialize species from JSON file. Here for extensibility

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(inout) :: this
    character(len=*), intent(in) :: name
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

    type(MPIController), intent(inout) :: mpiCont

    MPIController used with JSONController

procedure, public :: init => initSpecies

  • interface

    private module subroutine initSpecies(this, id, name, Z, A, vars)

    Species initialization. Z is the charge and A the atomic mass (in amus). A/Z are ignored if id = 0, which is reserved for electrons.
    vars is a StringArray containing names of associated variables for easy access

    Arguments

    Type IntentOptional Attributes Name
    class(Species), intent(inout) :: this
    integer(kind=ik), intent(in) :: id
    character(len=*), intent(in) :: name
    real(kind=rk), intent(in) :: Z
    real(kind=rk), intent(in) :: A
    type(StringArray), intent(in), dimension(:) :: vars