ENH: Modification of the start point for ray shooting to avoid self-hit in distorted meshes

This commit is contained in:
sergio
2017-01-31 16:06:44 -08:00
committed by Mark Olesen
parent 64c91f2a52
commit eca9fefa42

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -264,15 +264,13 @@ void Foam::faceShading::calculate()
{
includeAllFacesPerPatch[patchI].insert
(
faceI //pp.start()
faceI
);
}
}
}
}
labelList triSurfaceToAgglom(5*nFaces);
triSurface localSurface = triangulate
(
includePatches,
@ -294,9 +292,10 @@ void Foam::faceShading::calculate()
dict
);
surfacesMesh.searchableSurface::write();
triSurfaceToAgglom.resize(surfacesMesh.size());
if (debug)
{
surfacesMesh.searchableSurface::write();
}
scalar maxBounding = 5.0*mag(mesh_.bounds().max() - mesh_.bounds().min());
@ -324,7 +323,7 @@ void Foam::faceShading::calculate()
const vector d(direction_*maxBounding);
start.append(fc - SMALL*d);
start.append(fc - 0.001*d);
startIndex.append(myFaceId);
@ -355,7 +354,7 @@ void Foam::faceShading::calculate()
(
mesh_.time().path()/"allVisibleFaces.obj",
end,
Cfs
start
);
}