This page explains the basics of mfs scripting language that will be used to specify MUPFES inputs. The final purpose of mfs scripting is to set values to parameters that will be later used for running simulations. Depending on the type of the parameter, a single statement or a grouped statement is used.
Single statements are used to set a value to a single parameter. They can be used inside the Grouped statements as well. All the required MUPFES inputs at the lowest level will eventually break down to Single statements. Single statements can be optional (hence have a default value) or mandatory. A Single statement has three components:
For example consider:
Number of spatial dimensions: 2
In this example, keyword is Number of spatial dimensions
, separator is :
, and value is 2
. This statement sets the number of spatial dimensions to 2.
Keywords are case sensitive, but not sensitive to the trailing spaces and tabs.
Separator is always a colon punctuation, i.e. ":
". Spaces following a separator are ignored.
Values can have six types:
A Logical value can take: "1
", "T
", "t
", "true
", or "True
" to define true and "0
", "F
", "f
", "false
", or "False
" to define false. You may have comments following a Logical value. For example this statement turns off the Warning
output:
Warning: f # Turning off warnings
An Integer value can take only integer quantities. You may have comments following an Integer value. Integer values may have upper or lower limits. The first example above sets the integer value of 2
to the Number of spatial dimensions
. This keyword has a upper limit of 3 and lower limit of 2, i.e. only 3D and 3D simulations are allowed.
A Real value can take any real formatted number. You may have comments following a Real value. Real values also have upper and lower limits and bounds. The difference between a bound and a limit is that value may take a limit but not a bound. In the following example Density
that is set to 10.12
, has a lower bound of 0
. Hence it can not take a value of 0
.
Density: 1.012e+1 # This keyword doesn't take 0.0 and negative values
A String value is a set of characters that are delimited by space, tab, new line, or a punctuation. The following example sets histor.dat
to the Name of simulation history file
parameter and ignores the the following comments:
Name of simulation history file: histor.dat # This will be the name of a file
A Path is similar to a String with this difference that it is delimited only by a new line or a curly bracket, i.e. {
and }
. Among all types of values, Path is the only one that you are not allowed to have a comment following the value. Keyword of a Path value always ends with word path
. Statements containing a Path value can be repeated more than once. In this case, the Path of the first statement that points to a existing file that can be opened is considered. In the following example, if./MESH/rectangle/rect.coordinates
file exists, it will be taken as a value, otherwise ~/My_meshes/rectangle/rect.coordinates
will be taken as a value.
Coordinates file path: ./MESH/rectangle/rect.coordinates
# Other statements here
Coordinates file path: ~/My_meshes/rectangle/rect.coordinates
An Enumeration value can take a particular set of characters. You may have comments following a Enumeration value. For example there are three possible values for Format of saved files
keyword that are none
, VTK
, and VTKB
.
Format of saved files: VTKB # Here I can use none/VTK/VTKB
Please refer to this table for a complete set of single statements, their default values (in case they are optional), their types, and their bounds/limits.
Grouped statements are used in the case that the keyword represents a structure that contains multiple other parameters. Hence a Grouped statement may contain several other Single or Grouped statements. Curly brackets, i.e. {
and }
, are used to mark the scope of a Grouped statement.
Consider the following example:
Domain: 1 {
Density: 0.1
Poisson ratio: 0.35
}
In this example, Domain
is the keyword of Grouped statement (i.e. entity to be specified) and 1
is its value, referring to a domain identified by integer 1
. Within this Grouped statement, two Single statements are used. In the first Density
is set to 0.1
and in the second Poisson ratio
is set to 0.35
. In a simulation this Grouped statement will set those physical quantities to a part of the mesh that is tagged by 1
. An statement can be moved within a Grouped statements scope and it will yet considered as a part of that Grouped statement.