Robert Funnell wrote:
Hmm, that's a good bit of additional code, especially since a good tolerance will depend on the scale of the mesh, and I don't think with much benefit (see below). Also, for the phase field calculations I do, where there's a lot of action right at the interfaces and zero gradients everywhere else, this special case is all over the place; though not everyone is doing phase field. :-)Adam C Powell IV wrote:Note that it is possible to have one of these three divisions by zero and still produce a triangle or two; one can even have C1=C2<q and C0=C3>q and get two triangles, so we can't just test for any zeroes and skip the whole thing. ...But you could test for any zeroes (maybe by precomputing the 4 denominators and checking whether their product is 0?) and then handle that special case (presumably relatively rare and therefore causing little performance penalty) with explicit checks for each denominator. With floating-points the checks against 0 should probably involve a finite tolerance, to avoid underflows and overflows.
I really don't think so. The edge intercept is inf (or NaN?), which is not between zero and one, so no intercept, no triangle intersecting that edge. I don't think that will have any effect on the resulting triangulation, or its utility for volume calculations... I think -mieee is the way to go.... It just seems easier to do it this way, and because it's just for graphics, I don't really care about the divide by zero.I'm not sure what happens to the graphics (might it cause a visual artefact at some point?) but someone might try to use the programme's output for some further analysis (e.g., volume calculations) rather than just visualization.
Stefan, regarding trying out PETScGraphics, I recommend "apt-get install petscgraphics1-demo", which should drag in all the dependencies (including rsh-server!), then just run chts, or on an SMP box, "mpirun -np X /usr/bin/chts". Oh- except I haven't uploaded alpha yet (will try Chris' "$ARCH==alpha*-*-linux-*" test).
Thanks all for the feedback. Zeen, -- -Adam P. GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6Welcome to the best software in the world today cafe! <http://lyre.mit.edu/%7Epowell/The_Best_Stuff_In_The_World_Today_Cafe.ogg>