tem_tracking_module Module

Tracking enables the simulation to extract values of variables from within arbitrary parts of the mesh.

There maybe multiple tracking objects defined and each one needs to define the location to track (by a shape subtable), the variables to track (variable subtable). The points in time when the values should be evaluated need to be defined by a time_control object, see tem_timeControl_module for details. And finally the format of the output needs to be given in the output subtable. Each tracking object also gets a label to uniquely identify it, and a folder acts as a prefix, that gets prepended to all file names. Further it is possible to define some reduction operation, for example to build the average for the tracked variables over the complete shape, see tem_reduction_spatial_module.

The tracking table might describe a single tracking object, or it may be a table of tracking objects. If there are multiple tracking objects these must be simply listed, without keywords in the form of:

  tracking = {
    {label = 'atrack', ...},
    {label = 'btrack', ...},
    {label = 'ctrack', ...},
  }

If the table does not have this form, it will be assumed, that a single tracking object is defined.

Overview on the settings for the tracking object:

  • label: A string to identify the tracking object, will be used to name files. Defaults to 'unnamed_track'.
  • variable: A bable of variable names that should be tracked. Needs to be one of the available variables and has to be provided, ther is no default.
  • folder: Actually a prefix that will be prepended to filenames. If it is to be a directory, it has to end in the path seperator and the directory has to exist already! Default: empty string, which results in the tracking files being written into the current working directory.
  • reduction: A spatial reduction that is to be applied across the complete shape to arrive at a single value, see tem_reduction_spatial_module for details. If reductions are defined, there needs to be one for each variable that is tracked by this tracking object. Default is to not do any reduction.
  • output: The description of how the data is to be written. There are three main options to format the output: ascii, vtk and harvester. The ascii format is useful for timeseries at a single point, that provides the point in time along with the respective variable values in an ASCII text file, easily processed by plotting tools. The vtk format is useful for larger shapes, like a slice through the domain. It provides the mesh information along with the values of the tracked variables. The harvester format writes the data of the subsection of the mesh that corresponds to the tree in the same binary format as used for restarting. The resulting data can then be processed by the harvesting tool of the solver to create visualizations. See the hvs_output_module for details on this subtable and other format options. This option has to be defined for each tracking object, there is no default.
  • shape: Defines the part of the domain that is to be tracked by the object. There are various shapes available to define parts of the domain, but the most basic and common ones are points, lines and boxes, which we subsumize under the name canoND. Please see tem_shape_module for details.

A simple, single tracking object definition without reduction looks like this:

  tracking = {
    label = 'track_pointA',
    folder = './',
    variable = {'momentum','density','energy'},
    shape = {
      kind = 'canoND',
      object= {
        origin ={0.01, 0, 0}
      }
    },
    time_control = {
      min = 0,
      max = sim_control.time_control.max,
      interval = {iter = 10}
    },
    output = {
      format = 'ascii'
    }
  }

This tracks the variables momentum, density and energy at a single point over time and writes them every 10 iterations to disk with one line per point in time.

See the dedicated tracking page for more examples and further hints.


Uses

Used by

  • module~~tem_tracking_module~~UsedByGraph module~tem_tracking_module tem_tracking_module program~tem_tracking_test tem_tracking_test program~tem_tracking_test->module~tem_tracking_module

Contents


Derived Types

type, public :: tem_trackingControl_type

General information about the tracking entities This data type is set in tem_load_tracking, then updated in tem_init_tracker_subTree After load balancing, it is reset in tem_reload_tracking

Components

TypeVisibilityAttributesNameInitial
logical, private :: active =.false.

output status, activated?

integer, private :: nActive =0

number of tracking entities active on this process

integer, private :: nDefined =0

Total number of tracking entities defined in config file

type, public :: tem_tracking_config_type

Contains all config information about tracking Content in tracking config must NOT change!

Components

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

log object labels

character(len=pathLen), private :: prefix

folder to store files to

character(len=labelLen), private, allocatable:: varName(:)

array of requested variable labels

type(tem_timeControl_type), private :: timeControl

stores time control parameters

type(tem_shape_type), private, allocatable:: geometry(:)

tracking shapes

logical, private :: track_complete_element

originally set to true. But if false the exact polynomial is evaluated at

type(hvs_output_config_type), private :: output_config

Data loaded from output table

type(tem_reduction_spatial_config_type), private :: redSpatial_config

Spatial reduction config which is loaded from disk

Tracking entity definition

Components

TypeVisibilityAttributesNameInitial
type(tem_varMap_type), private :: varMap

Contains name and position of variables to track in global varSys number of found variables can be accessed by me%varMap%varPos%nVals

type(tem_subTree_type), private :: subTree

sub-tree resulting from the elements within the tracking shape The sub-tree also holds the sub-communicator This data needs to be UPDATED after balance

type(hvs_output_file_type), private :: output_file

Description for output file formats

integer, private :: pntConfig

Pointer to config array in tem_tracking_type

type, public :: tem_tracking_type

Components

TypeVisibilityAttributesNameInitial
type(tem_trackingControl_type), private :: control

General information about the tracking entities

type(tem_tracking_config_type), private, allocatable:: config(:)

tracking header for collecting the properties from the lua file

type(tem_tracking_instance_type), private, allocatable:: instance(:)

Instances of tracking type active on this process


Functions

public function tem_tracking_has_triggered(timeControl, simControl, proc) result(triggered)

Decision on whether the giving tracker should be written in the current iteration.

Arguments

TypeIntentOptionalAttributesName
type(tem_timeControl_type), intent(inout) :: timeControl
type(tem_simControl_type), intent(in) :: simControl
type(tem_comm_env_type), intent(inout) :: proc

Return Value logical


Subroutines

public subroutine tem_load_tracking(me, conf, parent)

Read the tracker configuration from the main lua file

Read more…

Arguments

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

list of the trackingeentities to create

type(flu_state) :: conf

handle of the lua config file

integer, optional :: parent

if the tracking table is a child-table of some other table, use the parent as a reference

public subroutine tem_init_tracker_subTree(me, tree, solver, bc_prop, stencil, prefix)

Routine creates subTree for each tracking object and removes tracking objects on process which do not include any elements to track

Read more…

Arguments

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

tracking entities

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

Global mesh from which the elements are identified and then stored to sub-meshes inside the trackers

type(tem_solveHead_type), intent(in) :: solver

Global solver information

type(tem_BC_prop_type), intent(in) :: bc_prop

bc property that used to identify elements of certain BCs

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

stencil used to create subTree of boundary type

character(len=labelLen), intent(in), optional :: prefix

Prefix for output filename Usually: solver%simName

public subroutine tem_init_tracker(me, tree, solver, varSys, nDofs, globProc, solSpec_unit)

Initialize the tracker entities: * create varMap, i.e. map requested variables to global variable system * initialize spatial reduction * initialize hvs output

Arguments

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

tracking entities

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

Global mesh from which the elements are identified and then stored to sub-meshes inside the trackers

type(tem_solveHead_type), intent(in) :: solver

Global solver information

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

solver-provided variable systems

integer, intent(in), optional :: nDofs

The number of dofs for each scalar variable of the equation system

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

Process description to use.

integer, intent(in), optional :: solSpec_unit

Solver specific unit for restart header

public subroutine tem_tracking_getData(varMap, subTree, varsys, mesh, time, nDofs, res)

A routine to obtain tracked data.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_varMap_type) :: varMap

varMap from tem_tracking_instance_type

type(tem_subTree_type) :: subTree

subTree from tem_tracking_instance_type

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

Variable system describing available data.

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

Mesh definition of the input data.

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

Time information for the current data.

integer, intent(in) :: nDofs

Number of degrees of freedom.

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

Tracked data, has to match the subtree definition.

The memory layout is like this: 1. All variable components 2. nDofs 3. nElems (subtree%nElems)

public subroutine tem_tracker(track, simControl, varSys, tree)

This routine runs over each tracking object and dump requested quantities if timeControl is active on current time

Arguments

TypeIntentOptionalAttributesName
type(tem_tracking_type), intent(inout) :: track

tracking object containing all tracking relevant information

type(tem_simControl_type), intent(in) :: simControl

Simulation control contains current simulation time and status bits

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

global variable system

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

global tree

public subroutine tem_tracking_finalize(me)

Close all the units of the tracking objects

Arguments

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

tracker object to close

public subroutine tem_tracking_print_last_VTK_files(track)

Print the filenames of the last written VTK files on the screen.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_tracking_type), intent(in) :: track

List of tracking entities

private subroutine tem_load_trackingConfig(config, conf, sub_handle)

Read the tracker variables from tracking subtables defined in configuration from the main lua file

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_tracking_config_type), intent(out) :: config

list of the tracking entities to create

type(flu_state) :: conf

handle of the lua config file

integer, intent(in) :: sub_handle

table sub-handle for the tracking table