neperfepx / neper

Polycrystal generation and meshing
http://neper.info
GNU General Public License v3.0
215 stars 53 forks source link

Not able to load hex-mesh in modul -M with -loadmesh #923

Closed schmid02 closed 1 month ago

schmid02 commented 1 month ago

Description

I wanted to reload a mesh with the option -loadmesh in the -M modul to write out a .stelt-file. With a mesh out of tet-elements it worked fine, but with a mesh out of hex-elements it fails.

To Reproduce

neper -T -n 10
neper -M n10-id1.tess -elttype hex -o hex
neper -M -loadmesh hex.msh
========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.9.1-2
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info   : Running on 8 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/schmid/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -M loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -loadmesh hex.msh
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   :   - Reading arguments...
Info   : Loading input data...
Info   : Loading result mesh...
Info   :     [i] Parsing file `hex.msh'...
Info   :     [i] Parsed file `hex.msh'.
Info   :   - Reconstructing mesh...
Info   :     > Reconstructing 2D mesh... 100%
Info   :     > Reconstructing 1D mesh... 100%
Info   :     > Reconstructing 0D mesh... 100%
Error  : You have discovered a bug in Neper!  Please file an issue at
         https://github.com/rquey/neper/issues.  Thank you.

Aborted (core dumped)
rquey commented 1 month ago

Add this to the header of your file:

$Topology
0
$EndTopology

as described in Mesh File (.msh):

$Topology

$EndTopology [...] $Topology denotes the beginning of an optional topology field. is a boolean indicating whether the topology is to be reconstructed upon parsing or not (use 0 to solve parsing issues). $EndTopology denotes the end of an optional topology field.