neperfepx / neper

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

-transform cut fails #208

Closed kimauth closed 3 years ago

kimauth commented 3 years ago

Generating a tessellation with 100 cells as follows doesn't seem to work, while 99 or 101 cells are not a problem.

neper -T -dim 2 -n 100 -transform "cut(ecylinder(1.0, 0.5, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.25,  0.02))"

gives the following output:


========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.1.1
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt
Info   : Running on 8 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2020, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/auth/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -dim 2 -n 100 -transform cut(ecylinder(1.0, 0.5, 0.0,
         0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.25,  0.02))
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :   - Setting seeds...
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   : Transforming tessellation...
Warning:   - Cutting (experimental)...
Info   :     > ecylinder(1.0, 0.5, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.25,  0.02)...
Error  : You have discovered a bug in Neper!  Please file an issue at
         https://github.com/rquey/neper/issues.  Thank you.

Aborted

When removing the cut, it works fine again: neper -T -dim 2 -n 100

Thanks for an awesome program!

rquey commented 3 years ago

That is due to the "experimental" character of -transform cut. Sometimes, it does not work when the cutting primitive has a size similar to the grain size. -n 100 -id 2 works in your case...