mus_varSys_module Module

This module contains solver data type with pointers to musubi mus_scheme_type, mus_param_type, etc which are required for variable operation method data. Also contains all general routines for the variable system.


Uses


Contents


Abstract Interfaces

abstract interface

  • public subroutine mus_derive_fromPDF(fun, varSys, stencil, iLevel, posInState, pdf, res, nVals)

    This interface describes the arguments to be used for routines that do the derivation of variables from the variable system.

    Arguments

    TypeIntentOptionalAttributesName
    class(tem_varSys_op_type), intent(in) :: fun

    Description of the method to obtain the variables,

    type(tem_varSys_type), intent(in) :: varSys

    The variable system to obtain the variable from.

    type(tem_stencilHeader_type), intent(in) :: stencil

    fluid stencil defintion

    integer, intent(in) :: iLevel

    current level

    integer, intent(in) :: posInState(:)

    Position of element in levelwise state array

    real(kind=rk), intent(in) :: pdf(:)

    pdf

    real(kind=rk), intent(out) :: res(:)

    results

    integer, intent(in) :: nVals

    nVals to get


Derived Types

type, public :: mus_varSys_data_type

Method data container for every variable

Components

TypeVisibilityAttributesNameInitial
type(mus_varSys_solverData_type), private, pointer:: solverData
type(tem_pointData_list_type), private :: pointData
type(tem_varSys_op_data_type), private :: opData

data array for operation or derived varibales consists the index arrys for points stored in the poingtData of input variable size is number of input variables

Contains pointer to musubi data types required for variable operation method_data

Components

TypeVisibilityAttributesNameInitial
type(mus_scheme_type), private, pointer:: scheme=> NULL()

scheme data type

type(mus_physics_type), private, pointer:: physics=> NULL()

contains basic SI units to convert from lattice to physical and vice versa

type(mus_geom_type), private, pointer:: geometry=> NULL()

Contains geometry information and definitions


Functions

public function mus_get_new_solver_ptr(solver) result(resPtr)

Routine to get a pointer to a new instance of mus_varSys_solverData_type to be used as method data for a variable in the variable system.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(mus_varSys_solverData_type), intent(in), optional target:: solver

The prototype is used to initialize the new instance.

Return Value type(c_ptr)

Pointer to the newly created instance.


Subroutines

public subroutine mus_init_varSys_solverData(me, scheme, physics, geometry)

Arguments

TypeIntentOptionalAttributesName
type(mus_varSys_solverData_type), intent(out) :: me
type(mus_scheme_type), intent(in), target:: scheme
type(mus_physics_type), intent(in), target:: physics
type(mus_geom_type), intent(in), target:: geometry

public subroutine mus_set_stFun_getElement(solData_evalElem, fun)

Routine to store musubi varSys Data in stFun variable

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_solverData_evalElem_type), intent(in) :: solData_evalElem

Description on how to set the element retrieval function for stfuns.

type(tem_varSys_op_type), intent(inout) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

public recursive subroutine mus_deriveVar_forPoint(fun, varSys, point, time, tree, nPnts, res)

Derive variable for a given set of points using linear interpolation. This is a generic routine for any variable. Limitation: If neighbor is halo element then its not considered for interpolation, only the fluid (non-ghost) elements in the local process are used for interpolation.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

type(tem_varSys_type), intent(in) :: varSys

The variable system to obtain the variable from.

real(kind=rk), intent(in) :: point(:,:)

Three-dimensional coordinates at which the variable should be evaluated. Only useful for variables provided as space-time functions.

type(tem_time_type), intent(in) :: time

Point in time at which to evaluate the variable.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

integer, intent(in) :: nPnts

Number of values to obtain for this variable (vectorized access).

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

Dimension: n requested entries x nComponents of this variable Access: (iElem-1)*fun%nComponents + iComp

public subroutine mus_generic_varFromPDF_fromIndex(fun, varSys, time, iLevel, idx, idxLen, nVals, fnCalcPtr, res)

Routine to get the actual value for a given array of indices for musubi derive variables The indices belong to the grwarray of points storing levelwise in Pointdata%pntLvl(iLevel). Hence this routines takes the indeices as input, can refer to the pointData and evaluate the variable and returns the values

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables,

type(tem_varSys_type), intent(in) :: varSys

The variable system to obtain the variable from.

type(tem_time_type), intent(in) :: time

Point in time at which to evaluate the variable.

integer, intent(in) :: iLevel

Level on which values are requested

integer, intent(in) :: idx(:)

Index of points in the growing array and variable val array to return. Size: n

integer, intent(in), optional :: idxLen(:)

With idx as start index in contiguous memory, idxLength defines length of each contiguous memory Size: dependes on number of first index for contiguous array, but the sum of all idxLen is equal to nVals

integer, intent(in) :: nVals

Number of values to obtain for this variable (vectorized access).

procedure(mus_derive_fromPDF), pointer:: fnCalcPtr

Function pointer to perform specific operation.

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

Dimension: n requested entries x nComponents of this variable Access: (iElem-1)*fun%nComponents + iComp

public recursive subroutine mus_generic_fromPDF_forElement(fun, varsys, elempos, tree, time, nVals, fnCalcPtr, ndofs, res)

This routine prepares the data for variable derivation or operators. It gathers all input variables from the variable system, calls the function with the actual calculation.

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

type(tem_varSys_type), intent(in) :: varsys

the variable system to obtain the variable from.

integer, intent(in) :: elempos(:)

position of the treeid of the element to get the variable for in the global treeid list.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

type(tem_time_type), intent(in) :: time

point in time at which to evaluate the variable.

integer, intent(in) :: nVals

Number of values to obtain for this variable

procedure(mus_derive_fromPDF), pointer:: fnCalcPtr

Function pointer to perform specific operation.

integer, intent(in) :: ndofs

number of degrees of freedom within an element.

real(kind=rk), intent(out) :: res(:)

resulting values for the requested variable.

linearized array dimension: (n requested entries) x (ncomponents of this variable) x (ndegrees of freedom) access: (ielem-1)fun%ncomponentsndofs + (idof-1)*fun%ncomponents + icomp