calculate minimum command
Purpose
This command calculates the minimum of one or more per-particle style variables in the entire simulation domain / for a group of particles or the minimum of one or more mesh properties for one or meshes (examples).
Note
This command is supported by Aspherix GPU.Syntax
calculate minimum keyword/value pairs
The calculate minimum command can be applied for finding minimum particle or mesh
properties.
Keywords for calculating the minimum of particle properties:
Keywords |
Description |
|---|---|
variable or command that computes a per-particle value |
|
brace-enclosed list of variables or commands that compute per-particle values |
|
region in which the minimum is evaluated |
|
particle group for which the minimum is evaluated |
* The keywords quantity and
quantities are mutually exclusive.
Keywords for calculating the minimum mesh properties:
Keywords |
Description |
|---|---|
brace-enclosed list of mesh ids or
all for all meshesavailable options:
{mesh1,mesh2,etc} or all |
|
brace-enclosed list of mesh properties |
|
brace-enclosed list of weights for each mesh property
available options:
area or volumedefault:
none |
General keywords:
Keywords |
Description |
|---|---|
id |
user-assigned name for the calculate minimum command |
Examples
calculate minimum id minfx quantity fx
calculate minimum id minMyVar quantity v_myVar
calculate minimum id minfx quantity fx particle_group g1 region r1
calculate minimum id min_tags quantities {id_tag1, id_tag2}
calculate minimum id mesh_min meshes {plate,cad} mesh_properties {Temp,liquidContent} property_scaling {area,volume}
Access the calculated values above via:
id_minfx id_minMyVar id_min_tags[1] id_min_tags[2] id_mesh_min[1] or id_mesh_min.Temp id_mesh_min[2] or id_mesh_min.liquidContent
Description
This command determines the minimum of a per-particle style variable, a command that computes per-particle data, or a mesh property of a surface mesh.
Note that the command can determine the minimum for particle or mesh properties exclusively.
Getting the minimum of particle properties
For particle variables/data, the minimum can be calculated for:
the entire simulation domain, or
in a region defined by the
regionkeyword, orin a group of particles defined by the
particle_groupkeyword.
The quantity keyword allows to determine the minimum of a single per-particle variable
or command. The name of the variable/command must come after the keyword.
If you want to get the minimum of more than one variable/command, the quantities
keyword can be used. The variables/commands must come after the keyword within curly braces.
Global per-particle variables that are provided by Aspherix (e.g., positions x, y, z,
forces fx, fy, fz, velocities vx, vy, vz, …) can be used directly,
user-defined variables must be accessed with ‘v_VARNAME’, where VARNAME is the user-defined
name of the variable.
Example for calculating the minimum of internal & user-defined variables
calculate minimum id minZforce quantity fz
variable myVar atom fx*fx
calculate minimum id minSqXforce quantity v_myVar
Alternatively, if you have a command that computes a per-particle scalar or vector, you can
also use this. To do so prepend the commands id with id_, e.g.
id_myCommandId. If the command computes a per-particle vector, you must
specify the component, e.g. id_myVectorCommandId[1].
Getting the minimum of mesh properties
Getting the minimum of mesh properties can be done for the meshes defined with the meshes keyword.
The keyword accepts two formats for the value:
A list of mesh names enclosed in braces:
{mesh1, mesh2}The value
all, which makes the command apply to all meshes in the domain.
The keyword mesh_properties defines the properties for which the minimum is to be obtained.
This applies to all meshes defined in the meshes keyword. The mesh_properties keyword
takes a list of properties enclosed by braces.
The properties can be weighted by using the property_weights keyword. The weighting is done
by multiplying the properties in each mesh element by an element characteristic value.
These values are:
none: no scaling factor is appliedarea: the mesh element property is multiplied by the area of the elementvolume: the mesh element property multiplied by the volume of the element
The mesh element volume is defined as the mesh element area times the mesh element thickness (wall thickness). The mesh thickness can be defined via the mesh_module heattransfer or mesh_module liquidtransfer commands. A thickness of 1 will be used if it was not set explicitly.
The final_update keyword will force a recomputation of the value at
the last integration step of a simulate command. This is
useful if the value is required in the input script between two simulate commands, e.g. for setting a variable.
Output information
The calculate minimum command produces a global scalar (when using quantity) or vector (when
using quantities or meshes). When using the output_settings command, the results are
automatically written to the simulation_data_aspherix.csv / result_monitor.txt file (names same
as in access information below).
The minimum property for a command with id CMDID can be accessed by id_CMDID, the components
of the vector for properties and meshes by id_CMDID[1], id_CMDID[2], etc. For meshes
also dot-access via the property name is possible (e.g., id_CMDID.wear, id_CMDID.area, etc).
With the write_to_file command the information can be written to a separate file, with the status_style command additional quantities can be added to the standard output produced by the output_settings command.
Example for saving calculated minima to a separate text file
calculate minimum id min1 quantity fx
calculate minimum id min2 quantities {fy,fz}
calculate minimum id min3 meshes {mes1} mesh_properties {Temp,wear}
write_to_file file calculate_min_output.txt string "id_min1 id_min2[1] id_min2[2] id_min3[1] id_min3[2]"