Commit b539e6b1 authored by andy's avatar andy
Browse files

Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

parents d844c376 8dda57dd
......@@ -121,7 +121,7 @@ List<Vb::Point> rayShooting::initialPoints() const
geometryToConformTo().findSurfaceNearest
(
fC,
sqr(SMALL),
sqr(pert),
surfHitStart,
hitSurfaceStart
);
......@@ -145,63 +145,62 @@ List<Vb::Point> rayShooting::initialPoints() const
hitSurfaceEnd
);
vectorField normEnd(1, vector::min);
geometryToConformTo().getNormal
(
hitSurfaceEnd,
List<pointIndexHit>(1, surfHitEnd),
normEnd
);
if
(
surfHitEnd.hit()
&& ((normStart[0] & normEnd[0]) < 0)
)
if (surfHitEnd.hit())
{
line<point, point> l(fC, surfHitEnd.hitPoint());
vectorField normEnd(1, vector::min);
geometryToConformTo().getNormal
(
hitSurfaceEnd,
List<pointIndexHit>(1, surfHitEnd),
normEnd
);
if (Pstream::parRun())
if ((normStart[0] & normEnd[0]) < 0)
{
// Clip the line in parallel
pointIndexHit procIntersection =
decomposition().findLine
(
l.start() + l.vec()*SMALL,
l.end() - l.vec()*maxRayLength_
);
if (procIntersection.hit())
line<point, point> l(fC, surfHitEnd.hitPoint());
if (Pstream::parRun())
{
l =
line<point, point>
// Clip the line in parallel
pointIndexHit procIntersection =
decomposition().findLine
(
l.start(),
procIntersection.hitPoint()
l.start() + l.vec()*SMALL,
l.end() - l.vec()*maxRayLength_
);
if (procIntersection.hit())
{
l =
line<point, point>
(
l.start(),
procIntersection.hitPoint()
);
}
}
}
Foam::point midPoint(l.centre());
Foam::point midPoint(l.centre());
const scalar minDistFromSurfaceSqr =
minimumSurfaceDistanceCoeffSqr_
*sqr(cellShapeControls().cellSize(midPoint));
const scalar minDistFromSurfaceSqr =
minimumSurfaceDistanceCoeffSqr_
*sqr(cellShapeControls().cellSize(midPoint));
if
(
magSqr(midPoint - l.start()) > minDistFromSurfaceSqr
&& magSqr(midPoint - l.end()) > minDistFromSurfaceSqr
)
{
if (randomiseInitialGrid_)
if
(
magSqr(midPoint - l.start()) > minDistFromSurfaceSqr
&& magSqr(midPoint - l.end()) > minDistFromSurfaceSqr
)
{
midPoint.x() += pert*(rndGen().scalar01() - 0.5);
midPoint.y() += pert*(rndGen().scalar01() - 0.5);
midPoint.z() += pert*(rndGen().scalar01() - 0.5);
if (randomiseInitialGrid_)
{
midPoint.x() += pert*(rndGen().scalar01() - 0.5);
midPoint.y() += pert*(rndGen().scalar01() - 0.5);
midPoint.z() += pert*(rndGen().scalar01() - 0.5);
}
initialPoints.append(toPoint(midPoint));
}
initialPoints.append(toPoint(midPoint));
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment