neperfepx / neper

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

Tessalation modul chrashes #645

Closed bgrueber closed 1 year ago

bgrueber commented 1 year ago

Problem Desscription

Running tesselation with given sphericity distribution leads to program abort. Parameter of distribution have been evaluated from given experimental data.

To Reproduce

$ neper -T -n 981 -domain "cube(3,3,3)" 
        -morpho "diameq:lognormal(mean=-0.44837,sigma=0.18556),sphericity:lognormal(mean=-0.77614,sigma=0.21643)" 
        -morphooptistop val=2.0e-4 -statcell vol,area,diameq,sphericity -stattess area,size -format tess,stl -o output

========================    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 16 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info   : Ignoring initialization file.
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -n 981 -domain cube(3,3,3) -morpho
         diameq:lognormal(mean=-0.44837,sigma=0.18556),1-sphericity:lognormal(mean=-0.77614,sigma=0.21643)
         -morphooptistop val=2.0e-4 -statcell vol,area,diameq,sphericity
         -stattess area,size -format tess,stl -o
         Neper_EPP120_CS_981_LogNormal
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :   - Setting seeds... 100%
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   :     >  (*pTOpt).curval[1] is not-a-number.
Error  : You have discovered a bug in Neper!  Please file an issue at
         https://github.com/rquey/neper/issues.  Thank you.
rquey commented 1 year ago

You are providing negative values for the average diameq and sphericity distributions. Neper is unhappy about this...

bgrueber commented 1 year ago

You are providing negative values for the average diameq and sphericity distributions. Neper is unhappy about this...

In case of a log-normal distribution, negative values for the parameter mean are not unsusual. When not giving the sphericity distrubution, neper runs the tesselation with the same parameter (negative mean value for the log normal distribution of diameq) without any problem.

rquey commented 1 year ago

The diameq and sphericity values are positive.

lognormal expects the mean and standard deviations of the variable iitself (diameq or sphericity) - not of its natural logarithm, and must therefore be positive.

bgrueber commented 1 year ago

Thank you for the explanation. Using the avarage and standart deviation seems to be working.