Hi Owen,
glad to help.
What I mean by the second option is that if you have a model in which you need to sweep several parameters, for example, depth, width, dielectric constant or even the shape of the target, you can generate a file which contains this information and then read from the script this file and configure the simulation according to your needs.
For example, if you have three parameters, (width, height, depth) , and you want to use two configurations you could write a simple text file
with following content (what's between the line segments)
--------
width height depth
0.1 0.3 0.2
0.3 0.5 0.6
--------
Then from the script you can read the file using the np.genfromtxt
#python:
sim_table = np.genfromtxt('textfile.txt', skip_header=1)
width = sim_table[current_model_run-1, 0]
height
= sim_table[current_model_run-1, 1]
depth= sim_table[current_model_run-1, 2]
#end_python:
Then you can run the script with the option "-n 2" to run both combinations, one for each row of the txt file. This is better than option 1) because you don't have to change the .in file if you need to change the parameters, you just have to change the txt file. And the Txt file also serves as a log for the setup which may help.
---------
A more advanced alternative would be, instead storing the configuration in a .txt file, to use a more complex data structure, for example, you could use the pickle module in python. Then you can read from the pickle file the configurations and cycle through them with the
current_model_run variable.
Best regards,
Andrés