Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertices not on the same plane given by face_eq (specific to large seed weights) #497

Open
jijn opened this issue Jun 15, 2022 · 1 comment

Comments

@jijn
Copy link

jijn commented Jun 15, 2022

To Reproduce

$ neper -T -n 5 -morpho "centroid:file(points.txt)" -domain "cube(4,4,5)" -o Test

========================    N   e   p   e   r    =======================
Info   : A software package for polycrystal generation and meshing.
Info   : Version 4.4.2-19
Info   : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info   : Running on 12 threads.
Info   : <https://neper.info>
Info   : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info   : No initialization file found (`/home/xxxx/.neperrc').
Info   : ---------------------------------------------------------------
Info   : MODULE  -T loaded with arguments:
Info   : [ini file] (none)
Info   : [com line] -n 5 -morpho centroid:file(points.txt) -domain
         cube(4,4,5) -o Test
Info   : ---------------------------------------------------------------
Info   : Reading input data...
Info   : Creating domain...
Info   : Creating tessellation...
Info   :     [i] Parsing file `points.txt'...
Info   :     [i] Parsed file `points.txt'.
Info   :   - Setting seeds... 100%
Info   :   - Generating crystal orientations...
Info   :   - Running tessellation...
Info   :     > Initial solution: f   =0.095730898
Info   :     > Iteration    456: fmin=0.069831257 f=0.069831257
Info   :     > Final solution  : f   =0.069831257 (456 iterations)
Info   :     > Reached `eps' criterion.
Info   : Writing results...
Info   :     [o] Writing file `Test.tess'...
Info   :     [o] Wrote file `Test.tess'.
Info   : Elapsed time: 0.176 secs.
========================================================================

where points.txt is

3 2 2
1 3 2
1 1 2
2.1 2.1 3.6
1.9 2.0 0.62

The tess file generated is
Test.txt

Describe the bug
Taking face 4 as an example:

face_eq_d = -0.930434190184
face_eq_a = -0.947110782127
face_eq_b = 0.320850519182
face_eq_c = -0.006009219495

Vertex 9 is included in this face's vertex list, whose coordinate is

x = 1.804092808037
y = 1.735334891387
z = 0.980879348070

However, vertex 9 does not satisfy the face equation:
a*x+b*y+c*z-d = -0.22735277871012516

Similarly, vertex 8 not satisfy face_eq 4. Vertices 9 and 14 not satisfy face_eq 10. Vertices 9 and 10 not satisfy face_eq 6.

@rquey
Copy link
Member

rquey commented Jun 21, 2022

Thanks for the bug report.

This bug is very specific to your inputs and won't occur in the general case.

If you add -statseed x,y,z,w, you will see that optimization leads to very large z coordinate and weight for the last seed. I think it then generates some error in the computation of the vertex coordinates...

The problem comes from the fact that your first three points have the same z coordinate, and only the last point has a lower z coordinate. For some reasons, optimization tends to make the three faces between each of the first three points and the last point coplanar (hence the parameters of the last seed).

A workaround to your problem is to use -morphooptidof x,y,z (to exclude the seed weights from the optimization parameters), or -morphooptideltamax <value> to constrain the range of possible values for the seed coordinates and weights. This will lead to different tessellations... Another possibility would be to revise your input.

@rquey rquey changed the title Vertices not on the same plane given by face_eq Vertices not on the same plane given by face_eq (specific to large seed weights) Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants