There are currently four types of variables that the user may use in the
USER_common_variables file:
-
- &AliasVariableName& references an alias variable, to be defined in the alias section (pure string replacement definitions), see ALIAS and ConstructClause
- $AcronymVariableName$ refers to an acronym; MESHFREE assigns consecutive integer values to the $...$-variables given by the user
- %MFvariableName% refers to a variable predefined by MESHFREE, also representing integer values; among others, the index variables (see __Indices__) and the constant (see __Constants__) are of this type. The user cannot define these variables, with the exception of UserDefinedIndices.
- @SYSTEMvariable@ contain system or software information
- ScalarVariable scalar variable, that can be evaluated in every timestep, see valA().
Variable Types
Alias Variable: &AliasVariableName&
Alias variables are defined by the user in the alias section of the
USER_common_variables file. The values of these variables are strings. At any position where the variable is referenced by
&AliasVariableName&, the string is placed.
Example 1: Define the scaler alias variable v_inflow to be "10.0".
begin_alias{"ModelParameter"}
#giving an intuitive name - no further meaning
"v_inflow" = "10.0"
#defines the alias variable
begin_alias{"ModelParameter"}
This definition can be used, for example in a boundary condition:
&v_inflow& is then string-replaced with the definition "10.0" and becomes:
Example 2: Define the vectorial alias variable Class and use it to define different geometry parts (see
AliasForGeometryItems).
begin_alias{}
"Class" = "inflow, wall, outflow"
# definition of geometry class
...
"&Class(1)&" = " BC$BC_in$ ..."
# definition of inflow alias
"&Class(2)&" = " BC$BC_wall$ ..."
# definition of wall alias
"&Class(3)&" = " BC$BC_out$ ..."
# definition of outflow alias
end_alias
Good to know:
-
- The alias definition plays a central role in connecting the definition of model parameters to boundary elements: see AliasForGeometryItems.
- The alias definition can contain nested statements, in particular, an alias definition can contain a reference to another alias variable. It is important that these definitions can be uniquely resolved.
- Execution control for statements in the USER_common_variables can be done based on the value of an alias variable, see Selection.
- The usage of wildcards in the name of the alias variable is also possible in AliasForGeometryItems.
Acronym Variable: $AcronymVariableName$
Acronym variables (or soft variables) are defined by the user by using them in a left hand side expression. They can then be referred to by
$AcronymVariableName$. Internally, in
MESHFREE they are handled as integers, but for the user their actual value is not of importance as these variables are used as labels.
Example 3: Defines an integration to determine the total mass. The soft variable
$MassTotal$ is also automatically initialized then.
If one now wants to use the integration in another place, e.g. an equation, then it can be referred to using the soft variable
$MassTotal$:
... [ ... integ($MassTotal$) ... ] ...
Attention: An acronym can only be with one type of statement, e.g. equations, curve, boundary condition or material. The following definition is not allowed:
MESHFREE Internal Variable: %MFvariableName%
MESHFREE internal variables are predefined in
MESHFREE, also internally stored as integer values. These are
Example 4: In an equation accessing the attribute density of a point in an equation, by using the index
%ind_r% :
System Variable: @SYSTEMvariable@
A system variable contains system or software information. Currently, the following features are implemented:
-
- @VERSION@ - returns a string with the version number of MESHFREE
- @DATE@, @DATEb@, @DATE.@ - returns a string with the date at MESHFREE startup in the format yyyy-mm-dd, yyyymmdd (ISO 8601 extended and basic calendar date formats), or yyyy.mm.dd, respectively.
- @TIME@, @TIMEb@, @TIME.@ - returns a string with the time at MESHFREE startup in the format hh:mm:ss, hhmmss (ISO 8601 extended and basic time formats), or hh.mm.ss, respectively.
- @TIMESTAMP@ - returns a string with the date and time at MESHFREE startup in the format yyyymmddThhmmss, for example 20210721T133005 (ISO 8601 basic format)
- @CLPARAM@ - returns the string passed via the CommandLine option --clparam or -clp
- @ENV(NameOfEnvironmentVariable)@ - returns the value of the environment variable with the given name
- @nMPI@ - returns the number of MPI-processes the simulation is launched with
- @CV(cv_variable)@ - returns the status of a variable from common_variables
- @[equation_strng]@ - evaluates the given equation, see Equations
- @"AliasVariable"@ - returns the number of elements in an alias variable
@"MyVariable"@ would deliver the number of 8
- @alias(i)@ - delivers the alias variable name of the i-th alias enclosed in &.
If in the example above, "MyVariable" would be the first alias, then "@alias(1)@" would represent "&MyVariable&" .
Example 5: if USER is the environment variable for the user, then one could incorporate system information in the following way in the save path
SAVE_path in the following way:
SAVE_path = 'results___version=@VERSION@___user=@ENV(USER)@___MPI=@[real(%MPI_NbProcesses%)]@_OMP= @[real(%OMP_NbProcesses%)]@___'
# save path containing the user name,
# the MESHFREE-version
# the number of MPI and OMP processes
see
valA().
Logging and Warnings
Please see
PrePostProcessing.