tem_reduction_transient_module Module

Transient reduction enables the definition of quantities that are reduced over a given interval of iterations. It is mainly meant to provide temporally averaged values, but minimum, maximum and sum are also available. For this a double buffer is used, where the current inverval is first filled with the intermediate computation, while the resulting reduced value resides in the other storage place. This double buffer is provided for all elements in the domain. When the value of the transient reduction is requested (via the getElement function) the previously completed interval is returned. This means the data is only useful after the first completed interval and remains constant until the next interval is completed.

A variable providing the temporal average of a variable called pressure would for example be defined as follows:

  variable = {
    {
       name = 'press_timeavg',
       ncomponents = 1,
       vartype = "operation",
       operation = {
         kind='reduction_transient',
         input_varname={'pressure'},
         reduction_transient = {
           kind    = 'average',
           nrecord = 1000
         }
       }
    }
  }

Note that each transient variable definition increases the memory consumption by two reals for every degree of freedom of the input variable in the domain.


Uses

  • module~~tem_reduction_transient_module~~UsesGraph module~tem_reduction_transient_module tem_reduction_transient_module module~tem_aux_module tem_aux_module module~tem_reduction_transient_module->module~tem_aux_module module~env_module env_module module~tem_reduction_transient_module->module~env_module module~tem_logging_module tem_logging_module module~tem_reduction_transient_module->module~tem_logging_module module~tem_time_module tem_time_module module~tem_reduction_transient_module->module~tem_time_module module~aot_table_module aot_table_module module~tem_reduction_transient_module->module~aot_table_module module~aotus_module aotus_module module~tem_reduction_transient_module->module~aotus_module module~tem_aux_module->module~env_module module~tem_aux_module->module~tem_logging_module module~tem_aux_module->module~aot_table_module module~tem_aux_module->module~aotus_module module~tem_revision_module tem_revision_module module~tem_aux_module->module~tem_revision_module module~tem_comm_env_module tem_comm_env_module module~tem_aux_module->module~tem_comm_env_module module~flu_binding flu_binding module~tem_aux_module->module~flu_binding module~tem_tools_module tem_tools_module module~tem_aux_module->module~tem_tools_module module~tem_lua_requires_module tem_lua_requires_module module~tem_aux_module->module~tem_lua_requires_module mpi mpi module~tem_aux_module->mpi module~env_module->module~aotus_module module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~env_module->mpi module~tem_logging_module->module~env_module module~tem_logging_module->module~aot_table_module module~tem_logging_module->module~aotus_module module~tem_time_module->module~env_module module~tem_time_module->module~aot_table_module module~tem_time_module->module~aotus_module module~aot_out_module aot_out_module module~tem_time_module->module~aot_out_module module~tem_time_module->mpi module~tem_comm_env_module->mpi module~tem_tools_module->module~env_module module~tem_lua_requires_module->module~env_module module~tem_lua_requires_module->module~aot_table_module module~tem_lua_requires_module->module~aotus_module module~tem_lua_requires_module->module~flu_binding iso_c_binding iso_c_binding module~tem_lua_requires_module->iso_c_binding

Used by

  • module~~tem_reduction_transient_module~~UsedByGraph module~tem_reduction_transient_module tem_reduction_transient_module module~tem_operation_module tem_operation_module module~tem_operation_module->module~tem_reduction_transient_module module~tem_operation_var_module tem_operation_var_module module~tem_operation_var_module->module~tem_reduction_transient_module module~tem_operation_var_module->module~tem_operation_module module~tem_variable_module tem_variable_module module~tem_operation_var_module->module~tem_variable_module module~tem_logical_operation_var_module tem_logical_operation_var_module module~tem_operation_var_module->module~tem_logical_operation_var_module module~tem_varmap_module tem_varMap_module module~tem_operation_var_module->module~tem_varmap_module module~tem_variable_module->module~tem_reduction_transient_module module~tem_derived_module tem_derived_module module~tem_derived_module->module~tem_operation_var_module module~tem_derived_module->module~tem_variable_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_derived_module->module~tem_spacetime_var_module program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->module~tem_variable_module program~tem_varsys_stfunvar_test->module~tem_derived_module module~tem_spacetime_var_module->module~tem_variable_module program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->module~tem_variable_module program~tem_variable_evaltype_test->module~tem_derived_module program~tem_varsys_test tem_varSys_test program~tem_varsys_test->module~tem_variable_module program~tem_varsys_test->module~tem_spacetime_var_module program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->module~tem_variable_module program~tem_logical_opertor_test->module~tem_derived_module program~tem_logical_opertor_test->module~tem_logical_operation_var_module program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->module~tem_variable_module program~tem_variable_extract_test->module~tem_derived_module program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->module~tem_variable_module program~tem_variable_combine_test->module~tem_derived_module module~tem_bc_module tem_bc_module module~tem_bc_module->module~tem_operation_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_variable_module program~tem_varsys_opvar_test->module~tem_derived_module module~tem_logical_operation_var_module->module~tem_operation_module module~tem_varmap_module->module~tem_spacetime_var_module module~tem_depend_module tem_depend_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~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_varmap_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_varmap_module

Contents


Derived Types

Contains transient reduction info loaded from variable table for reduction_transient operation kind

Components

TypeVisibilityAttributesNameInitial
character(len=labelLen), private :: reduceType

Type of time reduction operation

integer, private :: nRecord =0

number of interations to record

all data needed for a transient reduction, operation to perform and necessary data from previous timesteps

Components

TypeVisibilityAttributesNameInitial
type(tem_reduction_transient_config_type), private :: config

reduction info loaded from config file

integer, private :: nTimes =0

Number of "recorded" previous iterations

integer, private :: nEntries =0

Number of values to store in the double buffer val

integer, private :: nComponents =0

number of components

integer, private :: nDofs

Number of degrees of freedom

integer, private :: curr

Index of the storage for the currently filling (incomplete) position in val

integer, private :: last

Index of the storage location with the previously completed interval holding the reduced value over that interval.

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

Double buffer to store data from previous timesteps size (nComponentsnDofstree%nElems,2) 2nd index is used to maintain last valid reduced value when nRecord is reached. It will be swapped to avoid copy operations


Subroutines

public subroutine tem_reduction_transient_load(me, conf, parent)

Read time reduction info from reduction_transient operation variable

Arguments

TypeIntentOptionalAttributesName
type(tem_reduction_transient_config_type), intent(out) :: me

time reduction

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

handle for lua file

integer, intent(in) :: parent

operation table handle

public subroutine tem_reduction_transient_init(me, nElems, nComponents, nDofs)

Initialize time reduction.

Arguments

TypeIntentOptionalAttributesName
type(tem_reduction_transient_type), intent(inout) :: me

current time reduction

integer, intent(in) :: nElems

Number of elements in tree

integer, intent(in) :: nComponents

nComponents of operation variable

integer, intent(in) :: nDofs

Number of degrees of freedom

public subroutine tem_reduction_transient_reset(me)

Reset time reduction.

Arguments

TypeIntentOptionalAttributesName
type(tem_reduction_transient_type), intent(inout) :: me

current time reduction

public subroutine tem_reduction_transient_update(me, res)

Apply time reduction on given res

Arguments

TypeIntentOptionalAttributesName
type(tem_reduction_transient_type), intent(inout) :: me

Time reduction data to update

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

Current values of the variable to reduce.

public subroutine tem_reduction_transient_getElement(me, elemPos, nElems, nDofs, res)

This routine returns the time reduced value for given elemPos

Arguments

TypeIntentOptionalAttributesName
type(tem_reduction_transient_type), intent(in) :: me

current time reduction

integer, intent(in) :: elemPos(:)

Position of elements in global tree is same as me%val

integer, intent(in) :: nElems

Number of elements to return

integer, intent(in) :: nDofs

Number of degrees of freedom to return

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

Result array