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_var_module tem_spacetime_var_module module~tem_spacetime_var_module->module~tem_spatial_module module~tem_spacetime_fun_module tem_spacetime_fun_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_spacetime_fun_module->module~tem_spatial_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_derived_module tem_derived_module module~tem_derived_module->module~tem_spacetime_var_module module~tem_derived_module->module~tem_spacetime_fun_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 program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->module~tem_spacetime_fun_module program~tem_varsys_stfunvar_test->module~tem_derived_module program~tem_varsys_stfunvar_test->module~tem_variable_module program~tem_varsys_derivevar_test tem_varSys_deriveVar_test program~tem_varsys_derivevar_test->module~tem_spacetime_fun_module program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->module~tem_spacetime_fun_module program~tem_variable_evaltype_test->module~tem_derived_module program~tem_variable_evaltype_test->module~tem_variable_module program~tem_varsys_test tem_varSys_test program~tem_varsys_test->module~tem_spacetime_var_module program~tem_varsys_test->module~tem_spacetime_fun_module program~tem_varsys_test->module~tem_variable_module module~tem_varmap_module tem_varMap_module module~tem_varmap_module->module~tem_spacetime_var_module module~tem_varmap_module->module~tem_spacetime_fun_module module~tem_surfacedata_module tem_surfaceData_module module~tem_surfacedata_module->module~tem_spacetime_fun_module program~tem_spacetime_fun_test tem_spacetime_fun_test program~tem_spacetime_fun_test->module~tem_spacetime_fun_module program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->module~tem_spacetime_fun_module program~tem_logical_opertor_test->module~tem_derived_module program~tem_logical_opertor_test->module~tem_variable_module program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->module~tem_spacetime_fun_module program~tem_variable_extract_test->module~tem_derived_module program~tem_variable_extract_test->module~tem_variable_module program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->module~tem_spacetime_fun_module program~tem_variable_combine_test->module~tem_derived_module program~tem_variable_combine_test->module~tem_variable_module module~tem_face_module tem_face_module module~tem_face_module->module~tem_spacetime_fun_module module~tem_variable_module->module~tem_spacetime_fun_module module~tem_bc_module tem_bc_module module~tem_bc_module->module~tem_spacetime_fun_module module~tem_bc_module->module~tem_varmap_module program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->module~tem_spacetime_fun_module program~tem_varsys_opvar_test->module~tem_derived_module program~tem_varsys_opvar_test->module~tem_variable_module program~tem_face_test~3 tem_face_test program~tem_face_test~3->module~tem_face_module module~tem_depend_module->module~tem_varmap_module module~tem_restart_module tem_restart_module module~tem_restart_module->module~tem_varmap_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_varmap_module module~hvs_output_module->module~tem_restart_module program~tem_face_test tem_face_test program~tem_face_test->module~tem_face_module program~tem_face_test~2 tem_face_test program~tem_face_test~2->module~tem_face_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_operation_var_module->module~tem_varmap_module module~tem_operation_var_module->module~tem_variable_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_varmap_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 program~tem_tracking_test tem_tracking_test program~tem_tracking_test->module~tem_tracking_module

Contents


Variables

TypeVisibilityAttributesNameInitial
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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

    TypeIntentOptionalAttributesName
    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

TypeVisibilityAttributesNameInitial
character(len=LabelLen), private :: kindRead more…
real(kind=rk), private, allocatable:: const(:)

constant spatial value for nComponents

integer, private :: lua_fun_ref =0

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

type(flu_state), private :: conf
type(ic_gausspulse_type), private :: gausspulse

defines gausspulse

type(ic_2dcrvp_type), private :: crvp

2d co-rotating vortex pair

type(ic_tgv_type), private :: tgv

Taylor-Green vortex type

type(spatial_parabol_type), private :: parabol

Parabol type

type(spatial_random_type), private :: random

Random type

type(spatial_hopf_type), private :: hopf

Hopf Fibration type

type(tem_miescatter_field_type), private :: mie_fun

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

type(tem_heaviside_gibbs_type), private :: heaviside_gibbs_fun

Spatial function for Heaviside function including Gibbs oscillations.

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

store spatial value on each level

type(tem_spongeLayer_plane_type), private :: spongePlane

type for the plane sponge layer

type(tem_spongeLayer_box_type), private :: spongeBox

type for the box sponge layer

type(tem_spongeLayer_radial_type), private :: spongeRadial

type for the radial sponge layer

type(tem_pmlLayer_type), private :: pml

type for the pml damping medium

type(tem_cylindricalWave_type), private :: cylindricalWave

type for a scalar cylindrical wave.

type(tem_polygon_material_type), private :: polygon_material

Description of a material definition by a polygon.

real(kind=rk), private :: rect_ly

range of x and y dimention for rectangular function

real(kind=rk), private :: rect_lz
logical, private :: 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

TypeVisibilityAttributesNameInitial
type(grw_realarray_type), private :: 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

TypeVisibilityAttributesNameInitial
type(tem_shape_type), private :: geometry

define point, line or plane spatial profile

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

magnitude of the spatial value

type, private :: spatial_random_type

Defines a random spatial distribution within a given interval.

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: val_min

Minimal value to produce

real(kind=rk), private :: val_max

Maximal value to produce

real(kind=rk), private :: 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

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: radius

Minimal value to produce

real(kind=rk), private :: 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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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