neperfepx / neper

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

Tessellation cutting fails #112

Closed J-AKAZ closed 3 years ago

J-AKAZ commented 3 years ago
neper -T -n 1000 -morpho gg -domain "cube(0.6,0.6,1.4):translate(-0.3,-0.3,-0.7)" \
>   -transform "cut(cylinder(-0.9,0,0,0,1,0,0.8),cylinder(0.9,0,0,0,1,0,0.8),cylinder(0,-0.9,0,1,0,0,0.8),cylinder(0,0.9,0,1,0,0,0.8))" -o gene_cut_3

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.1.2
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt
Info   : Running on 12 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2020, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/g20281/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -n 1000 -morpho gg -domain
         cube(0.6,0.6,1.4):translate(-0.3,-0.3,-0.7) -transform
         cut(cylinder(-0.9,0,0,0,1,0,0.8),cylinder(0.9,0,0,0,1,0,0.8),cylinder(0,-0.9,0,1,0,0,0.8),cylinder(0,0.9,0,1,0,0,0.8))
         -o gene_cut_3
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :   - Setting seeds... 100%
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   :     > Initial solution: f   =0.960902677
Info   :     > Iteration 142063: fmin=0.000022971 f=0.000022971  
Info   :     > Reached `eps' criterion.
Info   : Transforming tessellation...
Warning:   - Cutting (experimental)...
Info   :     > cylinder(-0.9,0,0,0,1,0,0.8)...
Info   :     > cylinder(0.9,0,0,0,1,0,0.8)...
Info   :     > cylinder(0,-0.9,0,1,0,0,0.8)...
Info   :     > cylinder(0,0.9,0,1,0,0,0.8)...
Info   :     [o] Writing file `tess.debug'...
face = 4313
edges = 7737 1865 1866 1892 1931 2442 2463 2464 2468 2470 3541 3554 3578 4470 5464 6562 6565 6570 6582 6585 6736 6737 6738 6750 6788 6854 6953 6954 6957 6960 6961 1864 7739 7742 7743 7848 7979 7985 8038 8039 8041 8042 8043 8113 8118 8119 8120 8209 8210 8214 8216 8217 8218 8238 8239 8244
Info   :     [o] Wrote file `tess.debug'.
Error  : You have discovered a bug in Neper!
rquey commented 3 years ago

This is stange. On my computer, optimization ends with Info : > Iteration 137523: fmin=0.000022857 f=0.000022857, and tessellation completes without bugs.

Your optimization goes a little further (different Nlopt???), and so the tessellation is different, and the cutting operations are different. Cutting is experimental, so failure is not unexpected. Try with a different -id.

J-AKAZ commented 3 years ago

Thanks for your reply. Can you explain more about trying with different -id?

rquey commented 3 years ago

The -id option changes the seed of the random number generator used to initialize the tessellation. -id 1, -id 2, etc. will yield different tessellations (of the same properties). See the doc...