initialization_support Module

Contains various support routines used in data initialization


Used by


Interfaces

interface

  • public module subroutine initVarListFromJSON(varList, jsonCont, mpiCont, isDerivedList)

    Initialize variable list based on variable data from a JSON file. If isDerivedList = .true. the list is initialized based on derived list data, otherwise it uses the implicit list.

    Arguments

    Type IntentOptional Attributes Name
    type(VariableList), intent(inout) :: varList
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

    logical, intent(in), optional :: isDerivedList

interface

  • public module subroutine initGridFromJSON(gridObj, jsonCont, mpiCont, lengthNorm)

    Initialize grid object based on data from a JSON file.

    Arguments

    Type IntentOptional Attributes Name
    type(Grid), intent(inout) :: gridObj
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

    real(kind=rk), intent(in), optional :: lengthNorm

    Length normalization if the supplied grid is in meters, defaults to 1

interface

  • public module subroutine initPartFromJSON(partObj, gridObj, jsonCont, mpiCont)

    Initialize simple partition object based on data from a JSON file and grid object

    Arguments

    Type IntentOptional Attributes Name
    type(Partition), intent(inout) :: partObj
    type(Grid), intent(in) :: gridObj

    Grid object used to get numX and numH

    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

interface

  • public module subroutine initGeometryFromJSON(geometryObj, gridObj, jsonCont, mpiCont)

    Initialize geometry object based on data from a JSON file and grid object

    Arguments

    Type IntentOptional Attributes Name
    type(Geometry), intent(inout) :: geometryObj
    type(Grid), intent(in) :: gridObj

    Grid object used to infer cell widths for consistency

    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

interface

  • public module subroutine initPETScContFromJSON(petscCont, indexingObj, jsonCont, mpiCont)

    Initialize PETSc controller object based on data from a JSON file and indexing object

    Arguments

    Type IntentOptional Attributes Name
    type(PETScController), intent(inout) :: petscCont
    type(Indexing), intent(in) :: indexingObj
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController and to initialize PETSc

interface

  • public module subroutine initHDF5ContFromJSON(hdf5Cont, varCont, jsonCont, mpiCont)

    Initialize HDF5 controller object based on data from a JSON file and variable container object

    Arguments

    Type IntentOptional Attributes Name
    type(HDF5Controller), intent(inout) :: hdf5Cont
    type(VariableContainer), intent(in) :: varCont
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController and to initialize HDF5

interface

  • public module subroutine initVarContFromJSON(varCont, indexingObj, partObj, textbookObj, jsonCont, mpiCont)

    Initialize variable container based on variable data from a JSON file.

    Arguments

    Type IntentOptional Attributes Name
    type(VariableContainer), intent(inout) :: varCont
    type(Indexing), intent(in) :: indexingObj

    Indexing object used in variable container initialization

    type(Partition), intent(in) :: partObj

    Partition object used in variable container initialization

    type(Textbook), intent(in) :: textbookObj

    Textbook object used to retrieve derivation rules for variable container

    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

interface

  • public module subroutine initStandardIntegrator(integratorObj, varCont, indexingObj, jsonCont, mpiCont)

    Initialize standard integrator based on data from a JSON file. The standard integrator is a composit integrator containing either RK or BDE integrators.

    Arguments

    Type IntentOptional Attributes Name
    type(CompositeIntegrator), intent(inout) :: integratorObj
    type(VariableContainer), intent(in) :: varCont
    type(Indexing), intent(in) :: indexingObj

    Indexing object used in BDE integrator initialization

    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

interface

  • public module subroutine initStandardTextbook(textbookObj, gridObj, geometryObj, partObj, vSpaceObj, normObj, speciesListObj, varList, jsonCont, mpiCont)

    Assumes that the velocity grid is normalized to electron thermal speed. The textbook includes (passed variables are in appearance order unless otherwise specified):

    "flowSpeedFromFlux" = flux/density (normalized to n_0 * u_0) "sonicSpeed" for each ion species (negative IDs) = sqrt((poly_e * T_e + poly_i * T_i)/m_i) where i is the index of the ion species (normalized to u_0) "tempFromEnergy" for each species specified in config file as requiring temperature derivation = 2/3 * energy/density - mass * flux2/(3*density2) "leftElectronGamma" = sheath heat transmission coeffiecient for electrons at the left boundary using T_e and T_i "rightElectronGamma" = sheath heat transmission coefficient for electrons at the right boundary using T_e and T_i "densityMoment" = zeroth moment of f_0 "energyMoment" = second order of f_0 "cclDragCoeff" = Chang-Cooper-Langdon drag coefficient - assumes passed variable is the single harmonic f_0 "cclDiffusionCoeff" = Chang-Cooper-Langdon diffusion coefficient - assumes passed variables are the single harmonic f_0 and cclWeight "cclWeight" = Chang-Cooper-Langdon interpolation weight - assumes passed variables are the single harmonic cclDragCoeff and cclDiffusionCoeff if l=1 is resolved: "fluxMoment" = first moment of f_1/3 (normalized to n_0u_0) "heatFluxMoment" = third moment of f_1/3 (normalized to m_e * n_0 * v_th3 / 2) if l=2 is resolved: "viscosityTensorxxMoment" = second moment of 2f_2/15 (normalized to n_0 * e * T_0) Interpolation for staggered grids:
    "gridToDual" = interpolates one variable from regular to staggered(dual) grid "dualToGrid" = interpolates one variable from staggered(dual) to regular grid "distributionInterp" = interpolates one distribution function (even harmonics to dual, odd to regular grid) Other useful derivations: "gradDeriv" = calculates gradient of variable on regular grid, interpolating on cell faces and extrapolating at boundaries "logLei" = calculates electron-ion Coulomb log taking in electron temperature and density (derivations added for each ion species) "logLee" = calculates electron self collision Coulomb log taking in electron temperature and density "logLii" = calculates ion-ion collision frequency for each ion collision combination taking in the two species temperatures and densities (used as"logLiis_S" where s and S are the first and second ion species name) "maxwellianDistribution" = calculates distribution function with Maxwellian l=0 harmonic and all other harmonics 0. Takes in temperature and density Also automatically includes all defined custom derivations

    Arguments

    Type IntentOptional Attributes Name
    type(Textbook), intent(inout) :: textbookObj
    type(Grid), intent(in) :: gridObj
    type(Geometry), intent(in) :: geometryObj
    type(Partition), intent(in) :: partObj
    type(VSpace), intent(in) :: vSpaceObj
    class(Normalization), intent(in) :: normObj
    type(SpeciesList), intent(in) :: speciesListObj
    type(VariableList), intent(in) :: varList
    type(JSONController), intent(inout) :: jsonCont

    JSONController used to get parameters from ./config.json

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

    MPIController used with JSONController

interface

  • public module subroutine initStandardSignals(signalCollectionObj)

    Initialize signal collection with commonly used signals and their names. The signals are: 1. constant signal 2. hat signal 3. cut sine signal

    Arguments

    Type IntentOptional Attributes Name
    type(SignalCollection), intent(inout) :: signalCollectionObj

interface

  • public module subroutine setDistHarmonic(dist, h, xArr, vArr)

    Set the h-th harmonic of distribution function variable dist to xArr*vArr at corresponding x, and v coordinates. vArr should be either rank 1 or 2, and if it is rank 2 it should be size(numV,size(xArr))

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(inout), dimension(:) :: dist
    integer(kind=ik), intent(in) :: h
    real(kind=rk), intent(in), dimension(:) :: xArr
    real(kind=rk), intent(in), dimension(..) :: vArr