FEKO ParameterSweep Guide
FEKO ParameterSweep Guide
FEKO
William Miyahira
July 22, 2021
Next, define the phase of the voltage source to be the variable phase.
When you are ready to run the sweep, save your work. Then, on the Home tab of the
top menu go to Application macro and select Parameter Sweep: Create models.
When selected, a menu will pop up that allows you to select which parameter(s) you
want to sweep and which values that parameter will take during the sweep. Here I choose a
linearly spaced grid going from 0 → 180 with three samples. Thus, the variable phase will
take on values 0, 90, and 180 when ran.
When you are done selecting the sweep variables and their ranges, select Next. Another
menu will pop up that asks where you would like FEKO to put the files generated for the
sweep, as well as whether you would like to run the models when Finish is selected. FEKO
will automatically add the parameter sweep folder to your current directory to put the sweep
files, but you can choose whichever directory you want by selecting Browse...
Once Finish is selected, FEKO will generate n models, with n being the number of
sweep samples (in this example, n = 3) and put them all in the chosen directory.
A *.bat file will then open and run the generated FEKO files sequentially. When all the
models have finished running, text will appear that asks if you’d like to merge the results in
POSTFEKO. Type y or Y on the keyboard to choose this option.
Another menu will appear asking which *.xml file you want to use to merge the results
of the sweep. This file is automatically generated by FEKO along with the sweep models
and basically just tells POSTFEKO which files to merge. Luckily it’s already chosen, so
we just have to select Next.
And that’s it! The results for the sweep are merged and you can view the results. Below
I show the reflection coefficient as a function of phase.
Parameter Sweeps on the HPC
Running a parameter sweep on the W&M HPC is very similar to running it locally. Just
follow all the steps as before up to the Output pop-up menu, but now make sure Run Feko
Solver is NOT selected. This will still create all of the sweep files and put them in your
desired directory, but it won’t automatically run the *.bat file to solve the models.
Submitting a Job
Next, transfer the sweep *.cfx files (labeled by feko model name {01,02,...}.cfx) onto your
W&M HPC account. To see how to use the HPC, see ShuangLi Du’s guide on the lab website
(bottom of the Docs page). You will also need the runfeko sweep script (and starttime
and endtime files if you want to know when your job starts/ends). This script can be
found in my Snapdragon folder: \\Snapdragon\Common\William\HPC\runfeko files. The
runfeko sweep script is shown below:
Here’s what you will have to change:
The name (not necessary, but makes it easier to keep track of multiple jobs), number
of nodes, and walltime of your job
The FEKO TPDIR. Change this to your hpc username and wherever you want to put
the Temp folder. Here I made a folder called temp in my scr20 directory.
The number of sweeps. This should be equal to the number of sweep models you have.
For the phase sweep example I set this number to 03.
Additionally, don’t forget to have the name of your file match the name in the script
(i.e. replace input in lines 19-21 with your file name).
If you are also interested in how long it takes to run your job, you can include the
starttime and endtime files found the same Snapdragon folder. When your job has finished
running it will output a text file showing the start and end times of your job. Note that you
can also include these files for any other job you submit, just make sure you let the HPC
know by including lines 13 and 25 in the above script. Also of note is that even if you have
these lines in your script, there is no penalty for not including the corresponding starttime
and endtime files in your HPC directory, you just won’t get the run time information.
Now just submit this job to the HPC as you normally would (qsub runfeko sweeps)
and transfer the files from your HPC account to your desired directory in Snapdragon (or
wherever else).
And that’s it! It will open up the merged POSTFEKO file and you can view your
results as a function of the sweep parameter(s).
1. First, create a folder called Temp in the disk you want to use for the FEKO TMPDIR.
2. Next, locate the file FEKOenvironmentFromSetup.lua. This will be on the hard disk used
to install FEKO, and should be located in the folder: C:\Program Files\Altair\2019\feko.
3. Open the file using a text editor such as Notepad++ that allows you to edit the code.
4. On the last line you see where we choose to set the FEKO TMPDIR. All you need to do
here is change the current disk (C in this case) to the new disk.
5. With the change made, save the file. It will as if you want to run Notepad++ in admin-
istrator mode. Select “Yes” to save.
6. You might have to close and reopen FEKO to solidify the change. You can see if it’s
been made by going into the Feko terminal and running “set”. Here I’ve changed it from
C→E, as verified in the Feko terminal.