tem_reduction_spatial_module Module

This module applies reductions to a set of quantities

This module takes a set of input quantities and reduces them according to the chosen reduceType. You can choose between the following reduceTypes:

  • average: Average of all occurring values
  • sum: Sum of all occurring values
  • max: Maximum of all occurring values
  • min: Minimum of all occurring values
  • l2norm: L2 norm of all values, i.e. L_2(x) = sqrt( sum( x_i^2 ))
  • linfnorm: L_inf norm of all values, i.e. L_inf(x) = max( | x_i | )
 reduction = {
               'norm' -- 'average' or 'sum'
             }

The table of reductions has to correspond to the number of entries in the tracking variable table. For each variable, specify a reduction as

 tracking = {
   variable = {'pressure', 'velMag', 'density'},
   reduction = { 'average', 'max', l2norm' }
 }

Usage of this module


The tracking module handles the reductions. In the solver, the reduction must then be inkoved in the compute loop

Embedding in Treelm


Reductions are usually defined in tracking objects. Thus, the tracking module handles the loading and closing of the reductions. The following steps need to be performed within the tracking module

  • Treelm: Load the configuration from the lua file with tem_load_spatial_reduction
  • Treelm: Initialize the reductions with tem_init_reduction
  • Solver:
    • Open the reduction in the current time step tem_reduction_spatial_open
    • invoke the append reduceType to the array on which the reduction will be applied with tem_append_reduction This can be performed for a number of chunks
    • Close the reduction with tem_reduction_spatial_close

Uses

  • module~~tem_reduction_spatial_module~~UsesGraph module~tem_reduction_spatial_module tem_reduction_spatial_module aot_out_module aot_out_module module~tem_reduction_spatial_module->aot_out_module aot_table_module aot_table_module module~tem_reduction_spatial_module->aot_table_module aotus_module aotus_module module~tem_reduction_spatial_module->aotus_module module~env_module env_module module~tem_reduction_spatial_module->module~env_module module~tem_aux_module tem_aux_module module~tem_reduction_spatial_module->module~tem_aux_module module~tem_comm_env_module tem_comm_env_module module~tem_reduction_spatial_module->module~tem_comm_env_module module~tem_geometry_module tem_geometry_module module~tem_reduction_spatial_module->module~tem_geometry_module module~tem_logging_module tem_logging_module module~tem_reduction_spatial_module->module~tem_logging_module module~tem_tools_module tem_tools_module module~tem_reduction_spatial_module->module~tem_tools_module module~tem_topology_module tem_topology_module module~tem_reduction_spatial_module->module~tem_topology_module module~tem_varsys_module tem_varSys_module module~tem_reduction_spatial_module->module~tem_varsys_module module~treelmesh_module treelmesh_module module~tem_reduction_spatial_module->module~treelmesh_module mpi mpi module~tem_reduction_spatial_module->mpi module~env_module->aotus_module module~env_module->mpi flu_binding flu_binding module~env_module->flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~tem_aux_module->aot_table_module module~tem_aux_module->aotus_module module~tem_aux_module->module~env_module module~tem_aux_module->module~tem_comm_env_module module~tem_aux_module->module~tem_logging_module module~tem_aux_module->module~tem_tools_module module~tem_aux_module->mpi module~tem_aux_module->flu_binding module~soi_revision_module soi_revision_module module~tem_aux_module->module~soi_revision_module module~tem_lua_requires_module tem_lua_requires_module module~tem_aux_module->module~tem_lua_requires_module module~tem_comm_env_module->mpi module~tem_geometry_module->module~env_module module~tem_geometry_module->module~tem_logging_module module~tem_geometry_module->module~tem_tools_module module~tem_geometry_module->module~tem_topology_module module~tem_geometry_module->module~treelmesh_module module~tem_geometry_module->mpi module~tem_debug_module tem_debug_module module~tem_geometry_module->module~tem_debug_module module~tem_float_module tem_float_module module~tem_geometry_module->module~tem_float_module module~tem_param_module tem_param_module module~tem_geometry_module->module~tem_param_module module~tem_property_module tem_property_module module~tem_geometry_module->module~tem_property_module module~tem_subtree_type_module tem_subTree_type_module module~tem_geometry_module->module~tem_subtree_type_module module~tem_logging_module->aot_table_module module~tem_logging_module->aotus_module module~tem_logging_module->module~env_module module~tem_tools_module->module~env_module module~tem_topology_module->module~env_module module~tem_varsys_module->aot_out_module module~tem_varsys_module->aot_table_module module~tem_varsys_module->aotus_module module~tem_varsys_module->module~env_module module~tem_varsys_module->module~tem_aux_module module~tem_varsys_module->module~tem_logging_module module~tem_varsys_module->module~treelmesh_module iso_c_binding iso_c_binding module~tem_varsys_module->iso_c_binding module~tem_dyn_array_module tem_dyn_array_module module~tem_varsys_module->module~tem_dyn_array_module module~tem_time_module tem_time_module module~tem_varsys_module->module~tem_time_module module~treelmesh_module->aot_table_module module~treelmesh_module->aotus_module module~treelmesh_module->module~env_module module~treelmesh_module->module~tem_aux_module module~treelmesh_module->module~tem_logging_module module~treelmesh_module->module~tem_tools_module module~treelmesh_module->module~tem_topology_module module~treelmesh_module->mpi module~tem_global_module tem_global_module module~treelmesh_module->module~tem_global_module module~treelmesh_module->module~tem_property_module module~tem_sparta_module tem_Sparta_module module~treelmesh_module->module~tem_sparta_module module~tem_debug_module->aot_table_module module~tem_debug_module->module~env_module module~tem_debug_module->module~tem_logging_module module~tem_debug_module->module~tem_tools_module module~tem_debug_module->flu_binding module~tem_dyn_array_module->module~env_module module~tem_float_module->module~env_module module~tem_global_module->aot_out_module module~tem_global_module->aot_table_module module~tem_global_module->aotus_module module~tem_global_module->module~env_module module~tem_global_module->module~tem_aux_module module~tem_global_module->module~tem_logging_module module~tem_global_module->mpi module~tem_prophead_module tem_prophead_module module~tem_global_module->module~tem_prophead_module module~tem_lua_requires_module->aot_table_module module~tem_lua_requires_module->aotus_module module~tem_lua_requires_module->module~env_module module~tem_lua_requires_module->flu_binding module~tem_lua_requires_module->iso_c_binding module~tem_param_module->module~env_module module~tem_property_module->module~env_module module~tem_property_module->mpi module~tem_property_module->module~tem_prophead_module module~tem_sparta_module->module~env_module module~tem_sparta_module->module~tem_aux_module module~tem_sparta_module->module~tem_logging_module module~tem_sparta_module->mpi module~tem_sparta_module->module~tem_float_module module~tem_subtree_type_module->module~env_module module~tem_subtree_type_module->module~tem_aux_module module~tem_subtree_type_module->module~tem_logging_module module~tem_subtree_type_module->module~treelmesh_module module~tem_subtree_type_module->mpi module~tem_subtree_type_module->module~tem_global_module module~tem_subtree_type_module->module~tem_property_module module~tem_time_module->aot_out_module module~tem_time_module->aot_table_module module~tem_time_module->aotus_module module~tem_time_module->module~env_module module~tem_time_module->mpi module~tem_prophead_module->aot_out_module module~tem_prophead_module->aot_table_module module~tem_prophead_module->aotus_module module~tem_prophead_module->module~env_module module~tem_prophead_module->mpi

Used by

  • module~~tem_reduction_spatial_module~~UsedByGraph module~tem_reduction_spatial_module tem_reduction_spatial_module module~hvs_ascii_module hvs_ascii_module module~hvs_ascii_module->module~tem_reduction_spatial_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_reduction_spatial_module module~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_reduction_spatial_module module~hvs_output_module hvs_output_module module~tem_tracking_module->module~hvs_output_module module~tem_simcontrol_module tem_simControl_module module~tem_tracking_module->module~tem_simcontrol_module module~hvs_output_module->module~hvs_ascii_module module~tem_abortcriteria_module tem_abortCriteria_module module~tem_abortcriteria_module->module~tem_convergence_module module~tem_simcontrol_module->module~tem_convergence_module module~tem_simcontrol_module->module~tem_abortcriteria_module module~tem_general_module tem_general_module module~tem_general_module->module~tem_abortcriteria_module module~tem_general_module->module~tem_simcontrol_module

Interfaces

public interface tem_reduction_spatial_dump

public interface tem_reduction_spatial_out

  • private subroutine tem_reduction_spatial_out_vector(me, conf)

    Allows the output of array of reduction to lua out

    Arguments

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

    reduction to write into the lua file

    type(aot_out_type), intent(inout) :: conf

    aotus type handling the output to the file in lua format

  • private subroutine tem_reduction_spatial_out_single(me, conf)

    Allows the output of the single reduction to lua out.

    The data is written into the file, the lunit is connected to. It is formatted as a Lua table.

    Arguments

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

    reduction to write into the lua file

    type(aot_out_type), intent(inout) :: conf

    aotus type handling the output to the file in lua format


Derived Types

type, public ::  tem_reduction_spatial_type

This data type is providing the input for the reduction routines It must be filled by the solver, before the reduction is called It exists on each process

Components

Type Visibility Attributes Name Initial
integer, public :: nComponents

amount of components of the quantity to reduce

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

the result from the reduction operation size: nComponents

integer, public :: nElems

how many elements have been included into the reduction (so far)

real(kind=rk), public :: Vloc

local part of total volume of intersected elements

character(len=labelLen), public :: reduceType = ''

Which operation to perform on the list of elements

Components

Type Visibility Attributes Name Initial
character(len=labelLen), public, allocatable :: reduceType(:)

Which operation to perform on the list of elements

logical, public :: active = .false.

Subroutines

public subroutine tem_load_reduction_spatial(conf, redSpatial_config, parent, key)

read configuration file

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: conf

handle for lua file

type(tem_reduction_spatial_config_type), intent(out) :: redSpatial_config

the reduction file to fill

integer, intent(in), optional :: parent

handle for reduce table

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

which key to open

public subroutine tem_reduction_spatial_init(me, redSpatial_config, varSys, varPos)

Initialize reduction objects according to the variable systems

Arguments

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

array of reductions to initialize

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

global variable system defined in solver

integer, intent(in) :: varPos(:)

position of variable to reduce in the global varSys

public subroutine tem_reduction_spatial_open(me, varSys, varPos)

Prepare the reduction data type

Read more…

Arguments

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

The reduction type to work on. All definitions should be present in here

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

global variable system defined in solver

integer, intent(in) :: varPos(:)

public subroutine tem_reduction_spatial_append(me, chunk, nElems, varSys, varPos, tree, treeID, nDofs)

Local chunk-wise reduction

Read more…

Arguments

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

The reduction type to work on. All definitions should be present in here

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

chunk of results to reduce

integer, intent(in) :: nElems

number of elements the chunk has

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

global variable system defined in solver

integer, intent(in) :: varPos(:)

position of variable to reduce in the global varSys

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

the global tree

integer(kind=long_k), intent(in), optional :: treeID(nElems)

The list of treeIDs of the current chunk

integer, intent(in), optional :: nDofs

Number of degrees of freedom.

public subroutine tem_reduction_spatial_close(me, proc)

Perform the global reduction

Read more…

Arguments

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

The reduction type to work on. All definitions should be present in here

type(tem_comm_env_type), intent(in) :: proc

communicator for processes participating in this reduction

public subroutine tem_reduction_spatial_toChunk(me, chunk, nChunkElems)

Transfer reduction results to array chunk

Arguments

Type IntentOptional Attributes Name
type(tem_reduction_spatial_type), intent(in) :: me(:)
real(kind=rk), intent(inout) :: chunk(:)
integer, intent(out) :: nChunkElems

Number of element after spatial reduction = 1

private subroutine tem_load_reduction_single(conf, reduceType, handle, key, pos, iError)

Read a single entry of reductions from the lua file

Arguments

Type IntentOptional Attributes Name
type(flu_State), intent(inout) :: conf

handle for lua file

character(len=labelLen), intent(out) :: reduceType

reduction type to be filled

integer, intent(in), optional :: handle

handle for reduce table

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

which key to open

integer, intent(in), optional :: pos

position to load from in config file

integer, intent(out) :: iError

error from aotus

private subroutine tem_reduction_spatial_dump_vector(me, outUnit)

Dumps array of reduction to given unit

Arguments

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

reduction to write into the lua file

integer, intent(in) :: outUnit

unit to write to

private subroutine tem_reduction_spatial_dump_single(me, outUnit)

Dump single reduction to given unit

Arguments

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

reduction to write into the lua file

integer, intent(in) :: outUnit

unit to write to

private subroutine tem_reduction_spatial_out_vector(me, conf)

Allows the output of array of reduction to lua out

Arguments

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

reduction to write into the lua file

type(aot_out_type), intent(inout) :: conf

aotus type handling the output to the file in lua format

private subroutine tem_reduction_spatial_out_single(me, conf)

Allows the output of the single reduction to lua out.

Read more…

Arguments

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

reduction to write into the lua file

type(aot_out_type), intent(inout) :: conf

aotus type handling the output to the file in lua format