neperfepx / neper

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

Model visualization is returning an error #746

Closed kshankar7 closed 10 months ago

kshankar7 commented 10 months ago

I created a structured mesh (following the guidelines in https://neper.info/doc/fileformat.html#mesh-file-msh) and was successful when I do not assign grain ids to the mesh tag1 & tag2 and set them to the same value of 1 for all elements. When I assign a grain id to each element (same value for tag1 and tag2). My intention is visualize the mesh. While the first mesh produces an image, the second one does not and returns an error. Can you help. Both the mesh files are attached and the image output from the first command is shown below.

Successful command neper -V tet4_without_grain_id.msh -print img

Unsuccessful command neper -V tet4_with_grain_id.msh -print img

tet4_mesh.zip

img

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.5.1-127-devel
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info   : Running on 96 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/kshankar/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -V loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] tet4_with_grain_id.msh -print img
Info   : ---------------------------------------------------------------
Info   :   - Reading arguments...
Info   : Loading mesh...
Info   :     [i] Parsing file `tet4_with_grain_id.msh'...
Info   :     [i] Parsed file `tet4_with_grain_id.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 10 months ago

It fails to reconstruct the topology. The workaround to this is to add

$Topology
0
$EndTopology

at the top of your file, as described in Mesh File(.msh).

Then:

neper -V tet4_with_grain_id.msh -print img

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.6.1-8
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info   : Running on 16 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info   : Loading initialization file `/home/rquey/.neperrc'...
Info   : ---------------------------------------------------------------
Info   : MODULE  -V loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] tet4_with_grain_id.msh -print img
Info   : ---------------------------------------------------------------
Info   :   - Reading arguments...
Info   : Loading mesh...
Info   :     [i] Parsing file `tet4_with_grain_id.msh'...
Info   :     [i] Parsed file `tet4_with_grain_id.msh'.
Info   : Printing image...
Info   :   - Printing mesh...
Info   :     > Reducing data...
Info   :       . 3D...
Info   :       . 2D...
Info   :       . Number of 3D elt faces reduced by  95% (to 1200).
Info   :       . Number of 3D elt edges reduced by  50% (to 1800).
Info   :   - Generating png file (1200x900 pixels)...
Info   :     [o] Writing file `img.png'...
Info   :     [o] Wrote file `img.png'.
Info   : Printing scale...
Info   : Elapsed time: 1.027 secs.
========================================================================

img

kshankar7 commented 10 months ago

Thank you. It works, but I still have issues with the following command (trying to increase the tet order, with topology included as outlined above). Let me try to see if there are similar workarounds (for the same mesh files) Successful Command neper -M -loadmesh tet4_without_grain_id.msh -order 2 -o tet10_without_grain_id

Unsuccessful Command neper -M -loadmesh tet4_with_grain_id.msh -order 2 -o tet10_with_grain_id

rquey commented 10 months ago

Can you share a smaller mesh? (2 x 2 x 2 polycrystal)

kshankar7 commented 10 months ago

Sure (sorry for the delay, had to go to a class). Please find attached. Small small_mesh.zip

rquey commented 10 months ago

It is the same mesh. Anyway, here is a problem:

neper -V tet4_with_grain_id.msh -showelset "id==1" -print img

d

A grain must be a contiguous set of elements (with no holes), otherwise, Neper fails to reconstruct the topology.

Groups may be what you need.