|
[Sponsors] |
January 4, 2016, 10:30 |
Ray intersecting BoundaryMesh
|
#1 |
Member
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16 |
Hi,
I try to compute the intersection point of a given line (2 points) and the polyBoundaryMesh of my OF case. Following this thread (http://www.cfd-online.com/Forums/ope...-openfoam.html), I'm using an object of type Foam::indexedOctree<treeDataTriSurface>. I construct the required triSurface from the STLs used to generate the mesh. Unfortunately, the STLs are not exactly identical to the BoundaryMesh, causing errors. Therefore, I tried to construct a Foam::indexedOctree<treeDataPrimitivePatch> from the BoundaryMesh patches to use as a basis, but failed. It should look something like this: Code:
Foam::indexedOctree<treeDataPrimitivePatch>& octree1(???); Foam::pointIndexHit pHit = octree1.findLine(insideP, outsideP); Thanks a lot! David Last edited by David*; January 21, 2016 at 10:17. |
|
February 16, 2016, 04:50 |
|
#2 |
Member
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16 |
sorry for reply, the edit button is gone...
I fixed it using Code:
#include "volFields.H" // Diverse fields called by fvCFD.H #include "fvCFD.H" // OpenFOAM Finite Volume tools #include "treeDataFace.H" // Search faces using namespace Foam; ... Foam::point outsideP(xEnd, yEnd, zEnd); Foam::point insideP(xStart, yStart, zStart); const Foam::fvPatchList& patches = mesh.boundary(); forAll(patches, patchI) { const polyPatch& polyPatch1 = patches[patchI].patch(); treeBoundBox allBoundingBox(polyPatch1.points()); const indexedOctree<treeDataFace> octree1 ( treeDataFace(false, polyPatch1), allBoundingBox, // overall search domain 8, // maxLevel 10, // leafsize 3.0 // duplicity ); pointIndexHit pHit = octree1.findLine(insideP, outsideP); ... } David |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solar Ray Tracing and non conformal interface | AlexBene | FLUENT | 2 | July 16, 2018 05:33 |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 11:05 |
Ray tracing | gorlcjstk | FLUENT | 0 | August 4, 2011 08:04 |
ray intersection with a curved surface | gama | Main CFD Forum | 0 | August 3, 2006 14:53 |
Self intersecting | Carlos Saraiva | Siemens | 0 | January 23, 2003 08:33 |