File Format
The input file format for PySPG simply consists on lines of text. The first non-blank
character of each line is treated as the iteration type, and depending
upon this, a different amount of parameters is needed: the different iteration
types and parameters are shown in the following table. Please note that
each argument is separed by any blank (spaces or tabs).
-
-
+ var_name min_val
max_val step
-
Iterates linearly the variable var_name starting with
min_val and finishing at max_val using step as step
-
* var_name min_val
max_val step
-
Iterates geometricaly the variable var_name starting with
min_val and finishing at max_val using step as step
-
. var_name
value1 value2
value3
- The variable var_name takes consequtively the values
value1, value2, ...
-
: var_name value
-
The variable var_name is kept fixed at value value
To the variable var_name it is given a value computed as formula. This formula can have any of the variables defined in the para.dat file.
-
# repetitions
-
The other variables do no change, while the simulation is repeated
repetitions times
Examples
- A simulation in which D=0.4,
k=0.2 are kept fixed and a varies linearly between 1 and 5 with a
step of .2.
:D 0.4
:k 0.2
+a 1 5 .2
- Now, D=0.4, k varies linearly between
0 and 3 step 0.25 anda varies geometrically beginning with 0.1 and
finishng at 12.8 step 2.
:D 0.4
+k 0.0 3.0 0.25
*a 0.1 12.8 2.
- Finally, D=0.4, and D=0.6, The other
parameters as in the previous example (the step of k is set to 1.). But
the simulation mustbe repeated 100 times
.D 0.4 0.6
+k 0.0 3.0 1.
*a 0.1 12.8 2.
# 100
Storage of data
For each varying iterator type (i.e not ":" nor "#") a directory is created with
the variable nameand its value. EXCEPT FOR THE LAST ITERATOR.
Examples
- For the file in Example 1: the output
files are left in the CWD -just one varying iterator-
- For the file in Example 2: the
following directories are created
|
+-- k-0.0
+-- k-0.25
+-- k-0.5
+-- k-0.75
+-- k-1.0
+-- k-1.25
+-- k-1.5
+-- k-1.75
+-- k-2.0
+-- k-2.25
+-- k-2.5
+-- k-2.75
+-- k-3.0
And the output files are generated in each directory
- For the file in Example 3: the
following directories are created
|
+-- D-0.4
+------ k-0.0
+------ k-1.0
+------ k-2.0
+------ k-3.0
+-- D-0.6
+------ k-0.0
+------ k-1.0
+------ k-2.0
+------ k-3.0
THE OUTPUT (SDOUT) IS REDIRECTED TO A FILE YOU DEFINE. BY DEFAULT IS "out.dat".
So
if you just use write(*,*), printf(...) or whatever be the
equivalent code of your language all the output will be appended to that file in
the corresponding directory
Syntactic sugar
If you know python, it will be interesting for you to know that math is imported and that the way expressions are evaluated are through eval(). If you do not know python, first let me recommend you to learn it. Second, the first sentence of this paragraph means that you can use
even expresions like these
+D 0. pi pi/20.
+k sin(pi/4) exp(3**2) 0.5
WARNING!!!
It is completely fundamental for you to remember that ANY BLANK (TAB or SPACES) IS TREATED AS SEPARATOR
So, for example,
+D 0. pi pi/ 20.
will give an error. Such errors are easy to find. Easier (at least) than the work would imply coding a version of PySPG aware of them.
Howerer, if you have suggestions on this topic, contact me.
Go back to the documentation page