Errors during mesh_converter run

I am trying to extract electric field values from tcad files to .init files through allpix squared. I run using “./mesh_converter -f pixel_100V -c pixel_100V.conf”. I am using the following .conf file:

model="init"
region="substrate"
observable="ElectricField"
observable_units=""
radius_step=0.5
max_radius=50
volume_cut=10e-9
dimension=3
divisons=20 20 20
xyz=x y z
mesh_tree=false

The corresponding error I get is:

(FATAL)
Using pixel_100V.conf configuration file
Reading mesh grid from file "pixel_100V.grd"
Parsing grid file: 0%
Fatal internal error
incorrect format, file does not have 'DF-ISE text' header
Cannot continue.

My .grd file does indeed has the “DF-ISE text” sentence, but the program seems to be missing it. If I bypass (by commenting out this section of code) this and run again, I get the following error:

(STATUS)
Parsing grid file: 37%
(FATAL)
Fatal internal error
incorrect nesting of blocks
Cannot continue.

I am unsure on how to proceed. Any help would be really appreciated.

Hi @danush

could you post the header of your grd and dat files in DF-ISE format? They should look similar to this:

DF-ISE text

Info {
  version = 1.1
  type    = grid
  dimension   = 2
  nb_vertices = 1265
  nb_edges    = 3164
  nb_faces    = 0
  nb_elements = 1908
  nb_regions  = 3
  regions     = [ "SiBulk" "n-side" "p-side" ]
  materials   = [ Silicon Contact Contact ]
}

Data {

  CoordSystem {
    translate = [  0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 ]
    transform = [  1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00
 ]
  }

  Vertices (1265) {

Best,
Simon

Hello @simonspa ,

My grd file starts like:

DF-ISE text

Info {
version     =  1
type        = grid
dimension   =  3
nb_vertices =  5293
nb_edges    =  23303
nb_faces    =  30690
nb_elements =  12980
nb_regions  =  3
regions     = [ "substrate" "anode" "cathode" ]
materials     = [ Silicon Contact Contact ]
 }
Data {
CoordSystem {
translate = [  0  0  0 ]
transform = [  1  0  0  0  1  0  0  0  1 ]
 }
Vertices (  5293) {

And my dat file starts like:

DF-ISE text

Info {
  version = 1.0
  type    = dataset
  dimension   = 3
  nb_vertices = 5293
  nb_edges    = 23303
  nb_faces    = 30690
  nb_elements = 12980
  nb_regions  = 3
  datasets    = [ "ElectrostaticPotential" "eDensity" "hDensity" "LatticeTemperature" "ElectricField-Vector" ]
  functions   = [ ElectrostaticPotential eDensity hDensity LatticeTemperature ElectricField ]
}

Data {

  Dataset ("ElectrostaticPotential") {

Thank you.

Hi @danush

then indeed something odd is at works here. Which version of Allpix Squared are you running?

If possible, feel free to send me your DAT and GRD file privately e.g. via mail and I will have a look.

Best,
Simon

Hello @simonspa ,
I cloned the repository yesterday, so it has to be the latest version as of February 19, 2024.

Hi,

I tried running the mesh converter using latest on CVMFS, but I didn’t manage to reproduce the issue on the fields I have access to when using your configuration file, so it might really be something in the fields. I also tried changing the values at the beginning of my .grd file to closer match yours, but still can’t reproduce the error.

I realise this comment is not super helpful, but it might narrow down the issue a bit…

Kind regards,
Håkan

Hello @hwennlof ,

I see, okay. Like you mentioned, it does help me corner the issue. Thank you.