🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Bug: PostFeko crashes with critical error when using Dataset.ExportMatFile() via script editor

Hello,

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.
The case we studied (attached) was a coated sphere (radius = 0.5m), where the interior is a metal sphere (radius = 0.25m) enveloped by a dielectric sphere (epsilon_r = 2.56). It is illuminated by a plane wave and solved at 250MHz. Below is the LUA code we used to export the surface currents dataset to a .mat file.
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!

Find more posts tagged with

Sort by:
1 - 3 of 31

    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,
    Torben

    Ricardo SendreaUser: "Ricardo Sendrea"
    Altair Community Member
    OP
    Updated by unknown

    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.


    image

    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,
    Torben