CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Change in triangle::intersection breaks stitchMesh in 1.5 and 1.6 (https://www.cfd-online.com/Forums/openfoam-bugs/67316-change-triangle-intersection-breaks-stitchmesh-1-5-1-6-a.html)

gschaider August 11, 2009 16:47

Change in triangle::intersection breaks stitchMesh in 1.5 and 1.6
 
2 Attachment(s)
This problem seems to have been introduced between 1.4.1 and 1.5: in earlier versions of OF even when the triangle was not hit the pointHit returned by triangle::intersection got some value. In 1.5 and 1.6 vector::zero is returned. Nevertheless this point value is then used in triangle::ray to calculate the distance to this point. I guess usually this distance is not used, but in slidingInterface::projectPoints() (approx line 303 of the source file) this distance is used to discard points. Consequently stitchMesh fails (Usually complaining about "Duplicate point found in cut face.") for some meshes

After applying the attached patches to 1.5.x and 1.6 and recompiling stitchMesh happily stitched meshes on which previously it failed.

I don't know whether these patches affect other utilities as well

If you want a mesh to verify the bug/fix, I can provide you with one

Bernhard

mattijs August 12, 2009 06:12

Thanks. I would like to leave the fast intersection() routine intact since it is used all over so want to recalculate the intersection with plane inside the ray() routine. Can you try attached triangleI.H and/or post the testcase?

mattijs August 12, 2009 06:19

1 Attachment(s)
Missing attachment.

gschaider August 12, 2009 09:26

Quote:

Originally Posted by mattijs (Post 226052)
Thanks. I would like to leave the fast intersection() routine intact since it is used all over so want to recalculate the intersection with plane inside the ray() routine. Can you try attached triangleI.H and/or post the testcase?

Yep. That fixes it. I'll mail you about the testcase

mattijs August 12, 2009 10:25

I've pushed the fix to 1.6.x and 1.5.x.

CYMa February 11, 2010 09:46

compiled stitchMesh.C
 
Quote:

Originally Posted by gschaider (Post 225995)
This problem seems to have been introduced between 1.4.1 and 1.5: in earlier versions of OF even when the triangle was not hit the pointHit returned by triangle::intersection got some value. In 1.5 and 1.6 vector::zero is returned. Nevertheless this point value is then used in triangle::ray to calculate the distance to this point. I guess usually this distance is not used, but in slidingInterface::projectPoints() (approx line 303 of the source file) this distance is used to discard points. Consequently stitchMesh fails (Usually complaining about "Duplicate point found in cut face.") for some meshes

After applying the attached patches to 1.5.x and 1.6 and recompiling stitchMesh happily stitched meshes on which previously it failed.

I don't know whether these patches affect other utilities as well

If you want a mesh to verify the bug/fix, I can provide you with one

Bernhard

Hallo,
Bernhard,,may you send me your recompiled stitchMesh.C,because i really donīt know where this patch should be put in the cold file..
Thank you very much! My e-mail is xgli@iwt.uni-bremen.de

gschaider February 12, 2010 07:27

Quote:

Originally Posted by CYMa (Post 245731)
Hallo,
Bernhard,,may you send me your recompiled stitchMesh.C,because i really donīt know where this patch should be put in the cold file..
Thank you very much! My e-mail is xgli@iwt.uni-bremen.de

The patch discussed above goes somewhere (don't know exactly where, but the find-command is your friend) in $FOAM_SRC. You will have to recompile your OF-installation. As far as I remember no changes to stitchMesh itself were necessary.
The relevant patches should be in 1.5.x and 1.6.x so if you got one of those, everything's OK

Bernhard

CYMa February 12, 2010 09:21

Thank you very much,,,I will have a try....
 
:)Thank you very much,,,I will have a try....
Quote:

Originally Posted by gschaider (Post 245831)
The patch discussed above goes somewhere (don't know exactly where, but the find-command is your friend) in $FOAM_SRC. You will have to recompile your OF-installation. As far as I remember no changes to stitchMesh itself were necessary.
The relevant patches should be in 1.5.x and 1.6.x so if you got one of those, everything's OK

Bernhard



All times are GMT -4. The time now is 19:50.