neperfepx / neper

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

A bug occurred when generating tessellation using coordinate files. #783

Closed wangkaiyours closed 10 months ago

wangkaiyours commented 10 months ago

Describe the bug

A bug occurred when generating tessellation using coordinate files.

To Reproduce

$ neper -T -dim 3 -domain "cube(0.2,0.15,0.10)" -n 159 -morphooptiini "coo:file(coo1),weight:0" -morpho voronoi

======================== N e p e r ======================= Info : A software package for polycrystal generation and meshing. Info : Version 3.5.2 Info : Built with: gsl|muparser|opengjk|openmp|nlopt Info : Running on 20 threads. Info : http://neper.info Info : Copyright (C) 2003-2020, and GNU GPL'd, by Romain Quey. Info : No initialization file found (`/home/wangk/.neperrc'). Info : --------------------------------------------------------------- Info : MODULE -T loaded with arguments: Info : [ini file] (none) Info : [com line] -dim 3 -domain cube(0.2,0.15,0.10) -n 159 -morphooptiini coo:file(coo1) -morpho voronoi Info : --------------------------------------------------------------- Info : Reading input data... Info : Creating domain... Info : Creating tessellation... Info : - Setting seeds... Info : - Generating crystal orientations... Info : - Running tessellation... Error : You have discovered a bug in Neper! Please Error : You have discovered a fbiulg e ainn iNsespueer ! aPlte Error : Yhottpu hsa:v//gieth udisbc.Error : You have discovered a bug in Neper! Pleacsoe mf/riqleuo veaner eiydss/u ea atn Error : You have discovered a bug in NeError : p her! Please file an issue at b https://github.com/rError : You have discovered aY obu uhg aivne N deipsecro!v a uPgl eian sNe efper! i lPel aqen Error : ase file an issue at Error : se file an issue at hYuError : YYoouu hahvaev ed idscioveError : eeper/issuest. Thtapttps://github.com/rquey/neper/iss s://github.com/rquey/neper/hitstspsured a buge si:n./u/giets.h Tuhba.ncokm /yorrequey/dn seper/issues. Thank you.

nError : You have discovered a bug in Neper! Please file an issue at https://github.com/rquey/neper/issues. Thank you.

Aborted

coo1.txt

rquey commented 10 months ago

First thing is that coo1 should not use commas as field separator. Spaces (or tabs) should be used instead. Second thing is that the points are arranged regularly, which leads to a degenerate configuration. Randomize them a bit:

gsl-randist 1 159 flat -.000001 .000001 > x
gsl-randist 2 159 flat -.000001 .000001 > y
gsl-randist 3 159 flat -.000001 .000001 > z
paste coo1 x y z | awk '{print $1+$4,$2+$5,$3+$6}' > coo2
neper -T -dim 3 -domain "cube(0.2,0.15,0.10)" -n 159 -morphooptiini "coo:file(coo2),weight:0" -morpho voronoi

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.7.1-6
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info   : Running on 20 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  -T loaded with arguments:
Info   : [ini file] -tesrformat ascii
Info   : [com line] -dim 3 -domain cube(0.2,0.15,0.10) -n 159
         -morphooptiini coo:file(coo2),weight:0 -morpho voronoi
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :   - Setting seeds... 
Info   :   - Running tessellation...
Info   : Generating crystal orientations...
Info   : Writing results...
Info   :     [o] Writing file `n159-id1.tess'...
Info   :     [o] Wrote file `n159-id1.tess'.
Info   : Elapsed time: 0.043 secs.
========================================================================
wangkaiyours commented 10 months ago

Thank you for your help, it has indeed solved our problem.