calculate temporal average command

Purpose

This command accesses the variables stored by another command and averages them over time.

Note

This command is supported by Aspherix GPU.

Syntax

calculate temporal_average keyword value

The use of at least one of the following keyword/value pairs is obligatory:

object value = object-ID
  object-ID = ID (without prefix) of the command/variable storing scalar, vector and/or array values to be averaged
scalars values = scalar_list
  scalar_list = list of IDs of commands/variables storing scalar values to be averaged

One or more of the following keyword/value pairs are optional. Note that moving_average and running_average are mutually exclusive, and that window_size can only be used (and is then obligatory) if moving_average yes.

id value = command-ID
  command-ID = user-assigned name for the command call
particle_group value = group-ID
  group-ID = particle group this command acts on
write_every_time values = dt
  dt = time interval at which data are written to file
file value = filename
  filename = name of file where the averages are written
moving_average value = yes or no
  yes = output moving average of individual averages
  no = output individual averages
window_size value = window-size
  window-size = number of averages to consider for moving average
running_average value = yes or no
  yes = output running average of individual averages
  no = output individual averages

Examples

calculate temporal_average object myMesh scalars {myVariable, myMesh[1], myMesh[2], myMesh[3]}

Description

This command accesses all internal scalar, vector and array values/properties stored by another command/variable (identified by the object keyword) and/or a list of scalar values (identified by the scalars keyword) and averages them over time. Note that if the object stores its internal values as an array, the scalars keyword can not be used. The resulting averages are written to a file (which name is defined by the file keyword) every output time interval (identified by the write_every_time keyword).

If the optional keyword id is used, a custom ID is set for the command. The command can then be referenced by other commands.

The particle_group keyword sets the group the command will consider during averaging. Particles not in that group will be ignored.

The input values are sampled at every simulation timestep, whereas the average is computed every write_every_time or write_output_timestep time units. The input is used for calculating the average for the same time.

If moving_average is set to yes, the last window_size individual averages computed over the write_every_time timespan are averaged again and written to the file, resulting in an even smoother average.

If running_average is set to yes, the average over all individual averages is computed and written to the file.

If the write_every_time keyword is not specified, the check time interval is defined by the write_output_timestep command. If the output time interval is not specified by these commands, then the data is printed to file, by default, every 1000 time steps.

Further information

This command is a wrapper for the fix_ave_time command.

When using the output_settings command the global output of the command is automatically written to the simulation_data.csv / result_monitor.csv file.

Restrictions

The scalar values can not be of type id_object.property.