tem_spatial_module Module

Spatial functions let you describe functions that may vary in space. The are needed for initial conditions and volumetric information like source terms. A space-time function that depends also on time can be constructed by the space-time function of kind combined, see the tem_spacetime_fun_module.

The spatial functions may be constants, various predefined functions, or arbitrary Lua functions that depend on the three space coordinates. In the Lua script, the spatial function is either a constant scalar number, a Lua function, or a table.

If it is a table, it either is a constant definition for a vector value, for example a velocity definition, or it is a table that contains a definition of either a fun, const or predefined key. Here, fun would in turn need to be a Lua function, and const the definition of constant values (either a scalar, or a vector in a table). The predefined key signals the use of one of the available predefined functions and further parameters for their definition depend on the respective functions.

Available predefined functions are:

The simplest spatial function definition is just a constant scalar number:

  spatial = 1.0

Similarly the definition of a spatial function by a Lua function can simply be written as

  spatial = fun(x,y,z)
    return x*y*z
  end fun

The Lua function needs to take 3 arguments, representing the three spatial coordinates.

An example for the definition of a predefined function can take the following form:

  spatial = {
    predefined = 'random',
    min = 0,
    max = 1
  }

Uses

Used by

  • module~~tem_spatial_module~~UsedByGraph module~tem_spatial_module tem_spatial_module module~tem_spacetime_fun_module tem_spacetime_fun_module module~tem_spacetime_fun_module->module~tem_spatial_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_spacetime_var_module->module~tem_spatial_module module~tem_spacetime_var_module->module~tem_spacetime_fun_module module~tem_variable_module tem_variable_module module~tem_spacetime_var_module->module~tem_variable_module module~tem_ini_condition_module tem_ini_condition_module module~tem_ini_condition_module->module~tem_spatial_module module~tem_depend_module tem_depend_module module~tem_ini_condition_module->module~tem_depend_module module~tem_variable_module->module~tem_spacetime_fun_module module~tem_face_module tem_face_module module~tem_face_module->module~tem_spacetime_fun_module module~tem_bc_module tem_bc_module module~tem_bc_module->module~tem_spacetime_fun_module module~tem_varmap_module tem_varMap_module module~tem_bc_module->module~tem_varmap_module module~tem_surfacedata_module tem_surfaceData_module module~tem_surfacedata_module->module~tem_spacetime_fun_module module~tem_derived_module tem_derived_module module~tem_derived_module->module~tem_spacetime_fun_module module~tem_derived_module->module~tem_spacetime_var_module module~tem_derived_module->module~tem_variable_module module~tem_operation_var_module tem_operation_var_module module~tem_derived_module->module~tem_operation_var_module module~tem_varmap_module->module~tem_spacetime_fun_module module~tem_varmap_module->module~tem_spacetime_var_module module~tem_operation_var_module->module~tem_variable_module module~tem_operation_var_module->module~tem_varmap_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_varmap_module module~tem_restart_module tem_restart_module module~hvs_output_module->module~tem_restart_module module~tem_depend_module->module~tem_varmap_module module~tem_restart_module->module~tem_varmap_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_varmap_module module~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_varmap_module module~tem_tracking_module->module~hvs_output_module module~tem_general_module tem_general_module module~tem_general_module->module~tem_restart_module module~tem_abortcriteria_module tem_abortCriteria_module module~tem_abortcriteria_module->module~tem_convergence_module module~tem_simcontrol_module tem_simControl_module module~tem_simcontrol_module->module~tem_convergence_module

Contents


Variables

Type Visibility Attributes Name Initial
real(kind=rk), private :: ref_amp = 1.0_rk

Interfaces

public interface tem_spatial_lua_for

  • private function tem_spatial_lua_for_treeIds(fun_ref, conf, treeIds, tree, n) result(res)

    This function invokes the Lua function, in which the barycentric coordinates are computed from treeIds of an element.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State) :: conf

    lua state

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value

  • private function tem_spatial_lua_for_coord(fun_ref, conf, coord, n) result(res)

    This function invokes the Lua function, which takes barycentric coordinates of an element.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State) :: conf

    lua state

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value

  • private function tem_spatial_lua_for_index(fun_ref, conf, grwPnt, idx, nVals) result(res)

    This function invokes the Lua function, which takes tem_grwPoints_type and evaluate a function at a point of given idx in grwPnt.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State) :: conf

    lua state

    type(tem_grwPoints_type), intent(in) :: grwPnt

    growing array of all spatial point of a variable

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

    Index position to return a pre-store value or to compute

    integer, intent(in) :: nVals

    number of return values

    Return Value real(kind=rk), (nVals)

    return value

  • private function tem_spatial_lua_vector_for_treeIds(fun_ref, conf, treeIds, tree, n, ncomp) result(res)

    This function invokes the vectorial Lua function, in which the barycentric coordinates are computed from treeIds of an element.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State) :: conf

    lua state

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    integer, intent(in) :: ncomp

    Number of components in each returned value

    Return Value real(kind=rk), (n,ncomp)

    return value

  • private function tem_spatial_lua_vector_for_coord(fun_ref, conf, coord, n, ncomp) result(res)

    This function invokes the vectorial Lua function, which takes barycentric coordinates of an element.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State), optional :: conf

    lua state

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    number of return values

    integer, intent(in) :: ncomp

    number of components in the resulting vector

    Return Value real(kind=rk), (n,ncomp)

    return value

  • private function tem_spatial_lua_vector_for_index(fun_ref, conf, grwPnt, idx, nVals, nComps) result(res)

    This function invokes the vectorial Lua function, which takes tem_grwPoints_type and evaluate a function at a point of given idx in grwPnt.

    Lua function defined in the script is connected to the conf handle and return the result of the function. The Lua function takes barycentric coordinate as input argument i.e fun_name(x,y,z)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: fun_ref

    Lua reference to the function to evaluate.

    type(flu_State) :: conf

    lua state

    type(tem_grwPoints_type), intent(in) :: grwPnt

    growing array of all spatial point of a variable

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

    Index position to return a pre-store value or to compute

    integer, intent(in) :: nVals

    number of return values

    integer, intent(in) :: nComps

    number of components per returned value

    Return Value real(kind=rk), (nVals,nComps)

    return value

public interface tem_spatial_parabol2d_for

  • private function tem_spatial_parabol2d_for_treeIds(me, treeIds, tree, n) result(res)

    This function computes 2d parabola profile from treeIds of elements

    This profile is defined by element barycentric coordinate and 2d parabola parameters. 2D parabola profile at given plane is computed in the following way:

    • Project barycentric coordinate vector in a given plane via
    • Compute spatial value using Actual parabola 2d formula: \f$ (y-y_0) = a(x-x_0)^2 ) parabola open towards opposite x and with vertex at (1,0) is given by

    Arguments

    Type IntentOptional Attributes Name
    type(tem_canonicalND_type) :: me

    contains parameters for 2d parabola

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value of a function

  • private function tem_spatial_parabol2d_for_coord(me, coord, n) result(res)

    This function computes 2d parabola profile from coord of elements

    This profile is defined by element barycentric coordinate and 2d parabola parameters. 2D parabola profile at given plane is computed in the following way:

    • Project barycentric coordinate vector in a given plane via
    • Compute spatial value using

    Arguments

    Type IntentOptional Attributes Name
    type(tem_canonicalND_type) :: me

    contains line parameters for 2d parabola

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value of a function

public interface tem_spatial_parabol3d_for

  • private function tem_spatial_parabol3d_for_treeIds(me, treeIds, tree, n) result(res)

    This function computes 3d parabola profile from treeIDs of an element.

    This profile is defined by element barycentric coordinate and 3d parabola parameters. 3D parabola profile at given plane is computed in the following way:

    • Project barycentric coordinate vector in a given plane via
    • Compute spatial value using Example: Parabolic 3D profile at channel inlet.

    parabolic3d

    Arguments

    Type IntentOptional Attributes Name
    type(tem_canonicalND_type) :: me

    contains plane parameter for 3d parabola

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value of a function

  • private function tem_spatial_parabol3d_for_coord(me, coord, n) result(res)

    This function computes 3d parabola profile from coord of an element.

    This profile is defined by element barycentric coordinate and 3d parabola parameters. 3D parabola profile at given plane is computed in the following way:

    • Project barycentric coordinate vector in a given plane via
    • Compute spatial value using Example: Parabolic 3D profile at channel inlet. parabolic 3D

    Arguments

    Type IntentOptional Attributes Name
    type(tem_canonicalND_type) :: me

    contains parameter for 3d parabola

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    the number of return values

    Return Value real(kind=rk), (n)

    return value of a function

public interface tem_spatial_for

  • private function tem_spatial_for_treeIDs(me, treeIds, tree, n) result(res)

    This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given treeIDs

    If a spatial block is not defined, default value is set to 1.0 or default value passed while loading tem_load_spatial. If both spatial and temporal block are not defined in the lua file, the return value = 1.0_rk. based spatial_kind(kind).

    1. const - set constant value
    2. lua_fun - lua function
    3. gausspulse - fortran gauss pulse function
    4. 2dcrvp - fortran spinning vortex function
    5. parabol - fotran parabolic function

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type) :: me

    spatial type for given boundary state

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value of a function

  • private function tem_spatial_for_coord(me, coord, n) result(res)

    This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given coord

    If a spatial block is not defined and a temporal block is defined in the lua file, the return value is either 1.0 or default value provided in tem_load_spatial. If both spatial and temporal block are not defined in the lua file, the return value = 1.0_rk. based spatial_kind(kind).

    1. const - set constant value
    2. lua_fun - lua function
    3. gausspulse - fortran gauss pulse function
    4. 2dcrvp - fortran spinning vortex function
    5. parabol - fotran parabolic function

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type), intent(in) :: me

    spatial type for given boundary state

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    number of return values

    Return Value real(kind=rk), (n)

    return value of a function

  • private function tem_spatial_vector_for_treeIDs(me, treeIds, tree, n, ncomp) result(res)

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type) :: me

    spatial type for given boundary state

    integer(kind=long_k), intent(in) :: treeIds(n)

    treeIds of elements in given level

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

    global treelm mesh

    integer, intent(in) :: n

    number of return values

    integer, intent(in) :: ncomp

    number of components in the resulting vector

    Return Value real(kind=rk), (n,ncomp)

    return value of a function

  • private function tem_spatial_vector_for_coord(me, coord, n, ncomp) result(res)

    This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given coord

    If a spatial block is not defined and a temporal block is defined in the lua file, the return value = ref_value. If both spatial and temporal block are not defined in the lua file, the return value = 1.0_rk. based spatial_kind(kind).

    1. const - set constant value
    2. lua_fun - lua function
    3. gausspulse - fortran gauss pulse function
    4. 2dcrvp - fortran spinning vortex function
    5. parabol - fotran parabolic function

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type) :: me

    spatial type for given boundary state

    real(kind=rk), intent(in) :: coord(n,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: n

    number of return values

    integer, intent(in) :: ncomp

    number of components per returned value

    Return Value real(kind=rk), (n,ncomp)

    return value of a function

  • private function tem_spatial_scalar_for_index(me, grwPnt, idx, nVals, iLevel) result(res)

    This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx in growing array of points. Return value is a scalar.

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type), intent(in) :: me

    spatial type

    type(tem_grwPoints_type), intent(in) :: grwPnt

    growing array of all spatial point of a variable

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

    Index position to return a pre-store value or to compute

    integer, intent(in) :: nVals

    number of return values

    integer, intent(in) :: iLevel

    Level to which the evaluated values to be returned

    Return Value real(kind=rk), (nVals)

    return value of a function

  • private function tem_spatial_vector_for_index(me, grwPnt, idx, nVals, iLevel, nComps) result(res)

    This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx. Return value is a vector.

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type), intent(in) :: me

    spatial type

    type(tem_grwPoints_type), intent(in) :: grwPnt

    growing array of all spatial point of a variable

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

    Index position to return a pre-store value or to compute

    integer, intent(in) :: nVals

    number of return values

    integer, intent(in) :: iLevel

    Level to which the evaluated values to be returned

    integer, intent(in) :: nComps

    number of components per returned value

    Return Value real(kind=rk), (nVals,nComps)

    return value of a function

public interface tem_spatial_storeVal

  • private subroutine tem_spatial_scalar_storeVal(me, coord, nVals, iLevel)

    This routine evaluate scalar spatial function and store its value in growing array

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type), intent(inout) :: me

    spatial type for given boundary state

    real(kind=rk), intent(in) :: coord(nVals,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: nVals

    number of return values

    integer, intent(in) :: iLevel

    Level to which the evaluated values to be stored

  • private subroutine tem_spatial_vector_storeVal(me, coord, nVals, iLevel, nComps)

    This routine evaluate vector spatial function and store its value in growing array with access Array Of Structure pattern (iVal-1)*nComps + iComp

    Arguments

    Type IntentOptional Attributes Name
    type(tem_spatial_type), intent(inout) :: me

    spatial type for given boundary state

    real(kind=rk), intent(in) :: coord(nVals,3)

    barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

    integer, intent(in) :: nVals

    number of return values

    integer, intent(in) :: iLevel

    Level to which the evaluated values to be stored

    integer, intent(in) :: nComps

    number of components per returned value


Derived Types

type, public ::  tem_spatial_type

contains spatial state information

Components

Type Visibility Attributes Name Initial
character(len=LabelLen), public :: kind Read more…
real(kind=rk), public, allocatable :: const(:)

constant spatial value for nComponents

integer, public :: lua_fun_ref = 0

Reference to the Lua function if the spatial function is defined as a Lua function.

type(flu_State), public :: conf
type(ic_gausspulse_type), public :: gausspulse

defines gausspulse

type(ic_2dcrvp_type), public :: crvp

2d co-rotating vortex pair

type(ic_tgv_type), public :: tgv

Taylor-Green vortex type

type(spatial_parabol_type), public :: parabol

Parabol type

type(spatial_random_type), public :: random

Random type

type(spatial_hopf_type), public :: hopf

Hopf Fibration type

type(tem_miescatter_field_type), public :: mie_fun

Spatial function for Mie-series solution of electrodynamic scattering at dielectric sphere.

type(tem_heaviside_gibbs_type), public :: heaviside_gibbs_fun

Spatial function for Heaviside function including Gibbs oscillations.

type(spatial_value_type), public :: valOnLvl(globalMaxLevels)

store spatial value on each level

type(tem_spongeLayer_plane_type), public :: spongePlane

type for the plane sponge layer

type(tem_spongeLayer_box_type), public :: spongeBox

type for the box sponge layer

type(tem_spongeLayer_radial_type), public :: spongeRadial

type for the radial sponge layer

type(tem_pmlLayer_type), public :: pml

type for the pml damping medium

type(tem_cylindricalWave_type), public :: cylindricalWave

type for a scalar cylindrical wave.

type(tem_polygon_material_type), public :: polygon_material

Description of a material definition by a polygon.

real(kind=rk), public :: rect_ly

range of x and y dimention for rectangular function

real(kind=rk), public :: rect_lz
logical, public :: isStored = .false.

to store spatial values during initialization

type, private ::  spatial_value_type

stores values of spatial term during initialization to reduce computations during main loop.

Components

Type Visibility Attributes Name Initial
type(grw_realarray_type), public :: evalVal

Evaluated variable value on each point. For vectorial variable, the values are stored as (iVal-1)*nComp + iComp

type, private ::  spatial_parabol_type

defines parabola functions shape kind defines 2d or 3d parabola

Components

Type Visibility Attributes Name Initial
type(tem_shape_type), public :: geometry

define point, line or plane spatial profile

real(kind=rk), public, allocatable :: amplitude(:)

magnitude of the spatial value

type, private ::  spatial_random_type

Defines a random spatial distribution within a given interval.

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: val_min

Minimal value to produce

real(kind=rk), public :: val_max

Maximal value to produce

real(kind=rk), public :: val_range

Length of the value interval

type, private ::  spatial_hopf_type

Defines a stationary solution of the Euler equation by the Hopf Fibration.

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: radius

Minimal value to produce

real(kind=rk), public :: p0

Maximal value to produce


Functions

private function tem_spatial_parabol3d_for_treeIds(me, treeIds, tree, n) result(res)

This function computes 3d parabola profile from treeIDs of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_canonicalND_type) :: me

contains plane parameter for 3d parabola

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_parabol3d_for_coord(me, coord, n) result(res)

This function computes 3d parabola profile from coord of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_canonicalND_type) :: me

contains parameter for 3d parabola

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

the number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_parabol2d_for_treeIds(me, treeIds, tree, n) result(res)

This function computes 2d parabola profile from treeIds of elements

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_canonicalND_type) :: me

contains parameters for 2d parabola

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_parabol2d_for_coord(me, coord, n) result(res)

This function computes 2d parabola profile from coord of elements

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_canonicalND_type) :: me

contains line parameters for 2d parabola

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_random_for(me, n) result(res)

Produce random numbers

Arguments

Type IntentOptional Attributes Name
type(spatial_random_type), intent(in) :: me

Interval definition to get the random values from.

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_lua_for_treeIds(fun_ref, conf, treeIds, tree, n) result(res)

This function invokes the Lua function, in which the barycentric coordinates are computed from treeIds of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State) :: conf

lua state

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value

private function tem_spatial_lua_vector_for_treeIds(fun_ref, conf, treeIds, tree, n, ncomp) result(res)

This function invokes the vectorial Lua function, in which the barycentric coordinates are computed from treeIds of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State) :: conf

lua state

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

integer, intent(in) :: ncomp

Number of components in each returned value

Return Value real(kind=rk), (n,ncomp)

return value

private function tem_spatial_lua_for_coord(fun_ref, conf, coord, n) result(res)

This function invokes the Lua function, which takes barycentric coordinates of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State) :: conf

lua state

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value

private function tem_spatial_lua_vector_for_coord(fun_ref, conf, coord, n, ncomp) result(res)

This function invokes the vectorial Lua function, which takes barycentric coordinates of an element.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State), optional :: conf

lua state

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

number of return values

integer, intent(in) :: ncomp

number of components in the resulting vector

Return Value real(kind=rk), (n,ncomp)

return value

private function tem_spatial_lua_for_index(fun_ref, conf, grwPnt, idx, nVals) result(res)

This function invokes the Lua function, which takes tem_grwPoints_type and evaluate a function at a point of given idx in grwPnt.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State) :: conf

lua state

type(tem_grwPoints_type), intent(in) :: grwPnt

growing array of all spatial point of a variable

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

Index position to return a pre-store value or to compute

integer, intent(in) :: nVals

number of return values

Return Value real(kind=rk), (nVals)

return value

private function tem_spatial_lua_vector_for_index(fun_ref, conf, grwPnt, idx, nVals, nComps) result(res)

This function invokes the vectorial Lua function, which takes tem_grwPoints_type and evaluate a function at a point of given idx in grwPnt.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fun_ref

Lua reference to the function to evaluate.

type(flu_State) :: conf

lua state

type(tem_grwPoints_type), intent(in) :: grwPnt

growing array of all spatial point of a variable

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

Index position to return a pre-store value or to compute

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: nComps

number of components per returned value

Return Value real(kind=rk), (nVals,nComps)

return value

private function tem_spatial_for_treeIDs(me, treeIds, tree, n) result(res)

This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given treeIDs

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type) :: me

spatial type for given boundary state

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_vector_for_treeIDs(me, treeIds, tree, n, ncomp) result(res)

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type) :: me

spatial type for given boundary state

integer(kind=long_k), intent(in) :: treeIds(n)

treeIds of elements in given level

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

global treelm mesh

integer, intent(in) :: n

number of return values

integer, intent(in) :: ncomp

number of components in the resulting vector

Return Value real(kind=rk), (n,ncomp)

return value of a function

private function tem_spatial_for_coord(me, coord, n) result(res)

This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given coord

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(in) :: me

spatial type for given boundary state

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

number of return values

Return Value real(kind=rk), (n)

return value of a function

private function tem_spatial_vector_for_coord(me, coord, n, ncomp) result(res)

This function invokes different spatial boundary kinds like constant, lua function or predefined Fortran function for given coord

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type) :: me

spatial type for given boundary state

real(kind=rk), intent(in) :: coord(n,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: n

number of return values

integer, intent(in) :: ncomp

number of components per returned value

Return Value real(kind=rk), (n,ncomp)

return value of a function

private function tem_spatial_scalar_for_index(me, grwPnt, idx, nVals, iLevel) result(res)

This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx in growing array of points. Return value is a scalar.

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(in) :: me

spatial type

type(tem_grwPoints_type), intent(in) :: grwPnt

growing array of all spatial point of a variable

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

Index position to return a pre-store value or to compute

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: iLevel

Level to which the evaluated values to be returned

Return Value real(kind=rk), (nVals)

return value of a function

private function tem_spatial_vector_for_index(me, grwPnt, idx, nVals, iLevel, nComps) result(res)

This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx. Return value is a vector.

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(in) :: me

spatial type

type(tem_grwPoints_type), intent(in) :: grwPnt

growing array of all spatial point of a variable

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

Index position to return a pre-store value or to compute

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: iLevel

Level to which the evaluated values to be returned

integer, intent(in) :: nComps

number of components per returned value

Return Value real(kind=rk), (nVals,nComps)

return value of a function


Subroutines

public subroutine tem_load_spatial(me, conf, parent, key, defaultValue, nComp, errCode)

This subroutine load spatial boundary state variable.

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(out) :: me

spatial boundary state type

type(flu_State) :: conf

lua state type

integer, intent(in) :: parent

aotus parent handle

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

state variable key string defined in lua

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

What should be set s a default value for the quantities if no quantity was given in the lua file

integer, intent(in), optional :: nComp

number of components of the variable

integer, intent(out), optional :: errCode

Error code from lua loading

private subroutine load_spatial_asConst(const, conf, errCode, parent, key, nComp)

Load spatial as constant

Arguments

Type IntentOptional Attributes Name
real(kind=rk), allocatable :: const(:)

value to be filled

type(flu_State) :: conf

lua state type

integer, intent(out) :: errCode

errCode = -1, if spatial function is not defined as constant

integer, intent(in) :: parent

aotus parent handle

character(len=*), intent(in) :: key

key is either "local_key" or "const"

integer, intent(in) :: nComp

number of components of the variable

private subroutine load_spatial_predefined(me, conf, thandle, nComp)

Load predefined spatial function

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(inout) :: me

spatial fun information

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

spatial function handle

integer, intent(in) :: nComp

Number of components

private subroutine load_spatial_parabol(me, conf, thandle, nComp)

This subroutine load 3d parabola type variables from LUA file.

Read more…

Arguments

Type IntentOptional Attributes Name
type(spatial_parabol_type), intent(out) :: me

parabola3d spatial datas

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

integer, intent(in) :: nComp

Number of components

private subroutine load_spatial_random(me, conf, thandle)

Reading the definition for a random distribution function.

Read more…

Arguments

Type IntentOptional Attributes Name
type(spatial_random_type), intent(out) :: me

random spatial specification

type(flu_State) :: conf

lua state type

integer, intent(in) :: thandle

aotus parent handle

private subroutine tem_spatial_scalar_storeVal(me, coord, nVals, iLevel)

This routine evaluate scalar spatial function and store its value in growing array

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(inout) :: me

spatial type for given boundary state

real(kind=rk), intent(in) :: coord(nVals,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: iLevel

Level to which the evaluated values to be stored

private subroutine tem_spatial_vector_storeVal(me, coord, nVals, iLevel, nComps)

This routine evaluate vector spatial function and store its value in growing array with access Array Of Structure pattern (iVal-1)*nComps + iComp

Arguments

Type IntentOptional Attributes Name
type(tem_spatial_type), intent(inout) :: me

spatial type for given boundary state

real(kind=rk), intent(in) :: coord(nVals,3)

barycentric Ids of an elements. 1st index goes over number of elements and 2nd index goes over x,y,z coordinates

integer, intent(in) :: nVals

number of return values

integer, intent(in) :: iLevel

Level to which the evaluated values to be stored

integer, intent(in) :: nComps

number of components per returned value