Bug: PostFeko crashes with critical error when using Dataset.ExportMatFile() via script editor
I found a bug that causes POSTFEKO to crash with a critical error when exporting a dataset using the script editor's DataSet: ExportMatFile() function. It only occurs when we export the dataset for composite structures (i.e., made up of metallic and dielectric regions). The export function works perfectly in purely metallic or purely dielectric cases.
app = pf.GetApplication() app:NewProject() app:OpenFile([[project_location\coated_sphere.fek]]) -- Set up the file details absPath = [[\project_location\]] -- HIGHLY recommended to hard code the absolute path! -- Find all possible data files names = pf.SurfaceCurrentsAndCharges.GetNames() --Get current as a dataset currents = pf.SurfaceCurrentsAndCharges.GetDataSet(names[1]) --Export to .mat file --DataSet:ExportMatFile currents:ExportMatFile("coated_sphere_FEKO_data.mat", "currents")
The critical error is as follows:
POSTFEKO 2020-372425 (x64)
e:\installation\utilities\luascript\include\common_DataValueVariantCastToVisitor.h (75): Assertion failed: 0
Thanks!
Answers
-
Hi Ricardo,
Thanks for reporting! However, Feko 2020 is of course no longer up-to-date. Perhaps you have the opportunity to test it with Feko 2024?
Best regards,
Torben0 -
Hi Torben,
Thank you for the suggestion! My school updated the FEKO version to FEKO 2024.0.0.
Unfortunately, the bug persists. When I exported the currents, FEKO crashed with a critical error. Please see the screenshot below.
I reproduced the bug by using the POSTFEKO script template (New -> Session Script -> Surface Currents) and adding the export line before the return line, as:-- To get started try the following script: names = pf.SurfaceCurrentsAndCharges.GetNames() printlist(names) currents = pf.SurfaceCurrentsAndCharges.GetDataSet(names[1]) print(currents) currents:ExportMatFile("export_coated_sphere.mat", "currents") return currents
The crash doesn't return an error in this version. As before, I tried the same approach with a dielectric sphere model, and it worked.
0 -
Hi Ricardo,
as you probably know, Feko Development is now taking care of the issue, and I will post here when the bug is fixed.
Best regards,
Torben0