ALIAS
alias definitions within a begin_alias-end_alias-block
Note: All names of geometry parts need to be assigned to special aliases (see
AliasForGeometryItems).
An alias block contains replacement definitions, i.e. what a certain string occurring in
USER_common_variables will
be replaced with.
begin_alias{}
"alias1" = " String to replace &alias1& "
...
"aliasN" = " String to replace &aliasN& "
end_alias
If
MESHFREE encounters one of the text strings given in the alias block on the left hand side during read-in of
USER_common_variables,
then they will by replaced by the string given on the right hand side.
In order to exclude misinterpretations, text strings to be replaced have to be put in between &...& icons.
Note: -
- Definition and referencing of vectorial aliases is also possible. The entries have to be of the same
type, i.e. string or number.
- Referencing aliases on the left hand side of another alias definition is also possible.
- See also ConstructClause. For calculations that only need to be done once at the beginning of the simulation, this is often preferable.
- See also Variables.
Example 1: classical definition
begin_alias{}
"EqunForBC" = "[ Y%ind_x(1)%/Y%ind_h% * &Param& ]"
"Param" = "23.452444 * &Scaling& "
"Scaling" = "0.001 "
end_alias
During read-in of
USER_common_variables the line
BC_T(
$TemCond$) =
&EqunForBC&
will be replaced by:
BC_T($TemCond$) = [ Y
%ind_x(1)%/Y
%ind_h% * 23.452444 * 0.001 ]
Example 2: implicit usage of alias
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
During read-in of
USER_common_variables &Class(i)& will be replaced by the respective entry of Class.
Example 3: multiple alias and overwriting
Whenever an alias is defined again, using the standard definition symbol "=", it will not be overwritten. Instead, a new alias with an incremented index in curly braces is created.
To overwrite an alias definition, one may use the strong definition symbol ":=", like in the following example
Example 4: re-evaluation of aliases at every time cycle
begin_alias{}
"variable_A" = "0"
# time step counter initialization
"variable_B" = CONSTRUCT(
%CONSTRUCT_COG%, "geoItem" )
# COG of some geometry
end_alias
# ... other inputs ...
-> "variable_A" = [
&variable_A& + 1 ]
# increment variable_A
-> "variable_B" = CONSTRUCT(
%CONSTRUCT_COG%, "geoItem" )
#re-evaluation of COG of some geometry
In order to retrieve the numerical values of the alias variables, use the function
valA() .