Crash in mesh_converter, not saving init file

Dear all,
I am using mesh_converter to get init file from a Silvaco TCAD potential map.

Despite warnings due to sub-optimal output mesh mesh_converter seems to arrive at the end of its task but then there is a crash:

|17:37:00.205| (WARNING) Found 102 mesh vertices within initial search radius of 2um.
                         This might indicate that the output mesh granularity is too low and field features might be missed.
                         Consider increasing output mesh granularity.
|17:38:39.772|  (STATUS) Interpolating new mesh: 281250 of 281250, 100% 
|17:38:39.791|    (INFO) New mesh created in 6568 seconds.
|17:38:39.791|    (INFO) Preparing data for storage...
|17:38:40.122|   (FATAL) Fatal internal error
                         unit 1 not found
                         Cannot continue.

I get the same error for version 2.3.1 and 2.3.2.

This is the configuration file I use:
https://cernbox.cern.ch/index.php/s/9osGGT37cLo0ex4
The dat and grd files are here:
https://cernbox.cern.ch/index.php/s/iE8bOWmbbhvDfnx
https://cernbox.cern.ch/index.php/s/NUmWTP06Bc5PELs

The command is run like this:

mesh_converter -f mirrored_shifted_Ramo_Potential-3D-map-rd53a-50x50-100um -l run_flip_comparison.log

Any help will be greatly appreciated.

Best regards,
Marco Bomben

Hi @mbomben

thanks for your report, there are three issues, two to be fixed by me, one by you:

  • We don’t check for the correctness of the unit before launching the interpolation. This causes the exception at the end of the run.

  • The log file is opened too late in the code. The exception closes the scope in which we have opened the file, and therefore logging the exception leads to a hard crash.

  • The unit 1 does not exist. We cannot start parsing digits as units, because that would bring all sort of trouble. For example, is 121 now actually 12 in units of 1 or is it 121 in base units? If you want to have “no units”, just write

    observable_units = ""
    

    which should do the job and will also prevent the other two issues to happen. I will add this to the manual.

The other two issues I have resolved here: MeshConverter: Check Units before Run (!876) · Merge requests · Allpix Squared / Allpix Squared · GitLab

PS: have you already checked out the new interpolation = false mode of the converter? It will simply take the nearest point of the input mesh and therefore is muuuuch faster. :slight_smile:

All the best,
Simon

Thanks a lot @simonspa ! I have fixed the units and not the mesh is correctly saved.
I will try the

interpolation = false

option, thanks. Does it deliver a map with the same accuracy with the one without that option?

Cheers,
Marco

Hi @mbomben

the accuracy of course depends on your initial input field. If the meshing of the input is fine enough then I would not expect a degradation of the accuracy of the output mesh. In the end it depends on the sizes of the tetrahedrons we are building for the interpolation. If they are small in volume (dense input mesh) and we are always close to one corner, the output should be quite similar.

Cheers,
Simon

Thanks a lot @simonspa !

Feel free to close the issue.

Cheers,
Marco