neperfepx / neper

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

Using a seed-file (seeds.txt) for tessellation - You have discovered a bug in Neper! #575

Closed CodingChristoph closed 1 year ago

CodingChristoph commented 2 years ago

Describe the bug

The bug appeared as a bug message, when I was running the tessellation module of neper. Seeds were generated in the way that they should produce a cube (edge-lengths 2) with 768 seeds. The seeds are placed such that they should generate a surface of the cube with periodic voronoi-cell-corners on the cube-surface (i.e., the seeds are placed periodically).

Just to avoid the possible discussion: Yes, I am aware that there is the option -periodicity all for the tessellation module. But for reasons of efficiency in my code, the cube-geometry with periodic voronoi-cells is the most advantaged opinion. The seeds.txt file should generate a cube with periodic structure.

For reasons of testing or something else, I am available - just needs a message.

To Reproduce

You will find the command that was used below. Also, the seeds.txt file is attached.

$ neper -T -n 768 -dim 3 -domain "cube(2,2,2)" -morphooptiini "coo:file(seeds.txt),weight:0"

========================    N   e   p   e   r    =======================
========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 3.5.3-209-neper-fepx
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt
Info   : Running on 8 threads.
Info   : <http://neper.info>
Info   : Copyright (C) 2003-2020, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/christoph/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -n 768 -dim 3 -domain cube(2,2,2) -morphooptiini
         coo:file(seeds.txt),weight:0
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 file an issue at
         https://github.com/rquey/neper/issues.  Thank you.

Bests and thank you in advance!

Attached seeds.txt file is: seeds.txt

seeds.txt

uncleyuan001 commented 1 year ago

Have you resolve your issue, sir? I encontere Encountered the same problem, I want to generate a regular tess with seeds arrange in a specific order, but failed and given the same error information

rquey commented 1 year ago

The seed coordinates must be randomized to avoid degenerated configurations (more than 4 cells meeting at a single vextex):

$ gsl-randist 3 768 flat -1e-4 1e-4 > z
$ gsl-randist 2 768 flat -1e-4 1e-4 > y
$ gsl-randist 1 768 flat -1e-4 1e-4 > x
$ paste seeds.txt x y z | awk '{print $1+$4,$2+$5,$3+$6}' > seeds2.txt
$ neper -T -n 768 -dim 3 -domain "cube(2,2,2)" -morphooptiini "coo:file(seeds2.txt),weight:0"

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.5.0
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   : Loading initialization file `/home/rquey/.neperrc'...
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] -tesrformat ascii
Info   : [com line] -n 768 -dim 3 -domain cube(2,2,2) -morphooptiini
         coo:file(seeds2.txt),weight:0
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :   - Setting seeds... 
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   : Writing results...
Info   :     [o] Writing file `n768-id1.tess'...
Info   :     [o] Wrote file `n768-id1.tess'.
Info   : Elapsed time: 0.117 secs.
========================================================================

image