Skip to content
Snippets Groups Projects
Commit 10b0c3cf authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

ENH: shm: blockLevel through ray-shooting

parent 773548c2
No related branches found
No related tags found
2 merge requests!695OpenFOAM v2406,!642ENH: shm: blockLevel through ray-shooting
...@@ -555,8 +555,21 @@ private: ...@@ -555,8 +555,21 @@ private:
label& nRefine label& nRefine
) const; ) const;
//- Mark cells for surface proximity based refinement. //- Mark faces for additional proximity based testing. Extends
label markProximityRefinementWave // testFaces
void markProximityCandidateFaces
(
const labelList& blockedSurfaces,
const List<scalarList>& regionToBlockSize,
const labelList& neiLevel,
const pointField& neiCc,
labelList& testFaces
) const;
//- Mark cells for surface proximity based refinement. Uses
// ray-shooting from markInternalGapRefinement.
label markFakeGapRefinement
( (
const scalar planarCos, const scalar planarCos,
const labelList& blockedSurfaces, const labelList& blockedSurfaces,
......
This diff is collapsed.
...@@ -1954,6 +1954,59 @@ void Foam::refinementSurfaces::findNearestIntersection ...@@ -1954,6 +1954,59 @@ void Foam::refinementSurfaces::findNearestIntersection
} }
void Foam::refinementSurfaces::findNearestIntersection
(
// const labelList& surfacesToTest,
const pointField& start,
const pointField& end,
labelList& surface1,
labelList& region1,
List<pointIndexHit>& hitInfo1,
vectorField& normal1
) const
{
// Initialize arguments
surface1.setSize(start.size());
surface1 = -1;
region1.setSize(start.size());
region1 = -1;
hitInfo1.setSize(start.size());
hitInfo1 = pointIndexHit();
normal1.setSize(start.size());
normal1 = Zero;
// Current end of segment to test.
pointField nearest(end);
// Work array
List<pointIndexHit> nearestInfo(start.size());
labelList region;
vectorField normal;
forAll(surfaces_, surfI)
{
const searchableSurface& geom = allGeometry_[surfaces_[surfI]];
// See if any intersection between start and current nearest
geom.findLine(start, nearest, nearestInfo);
geom.getRegion(nearestInfo, region);
geom.getNormal(nearestInfo, normal);
forAll(nearestInfo, pointI)
{
if (nearestInfo[pointI].hit())
{
surface1[pointI] = surfI;
region1[pointI] = region[pointI];
hitInfo1[pointI] = nearestInfo[pointI];
normal1[pointI] = normal[pointI];
nearest[pointI] = nearestInfo[pointI].point();
}
}
}
}
void Foam::refinementSurfaces::findNearestIntersection void Foam::refinementSurfaces::findNearestIntersection
( (
const pointField& start, const pointField& start,
......
...@@ -437,6 +437,17 @@ public: ...@@ -437,6 +437,17 @@ public:
vectorField& normal vectorField& normal
) const; ) const;
//- Find nearest (to start only) intersection of edge
void findNearestIntersection
(
const pointField& start,
const pointField& end,
labelList& surfaces,
labelList& regions,
List<pointIndexHit>&,
vectorField& normal
) const;
//- Find nearest (to start only) intersection of edge //- Find nearest (to start only) intersection of edge
void findNearestIntersection void findNearestIntersection
( (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment