mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: distinguish between face areaNormal/unitNormal in the code
This commit is contained in:
@ -188,19 +188,17 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
||||
bool correctOrientation(const pointField& points, const cellShape& shape)
|
||||
{
|
||||
// Get centre of shape.
|
||||
point cc(shape.centre(points));
|
||||
const point cc(shape.centre(points));
|
||||
|
||||
// Get outwards pointing faces.
|
||||
faceList faces(shape.faces());
|
||||
|
||||
forAll(faces, i)
|
||||
for (const face& f : faces)
|
||||
{
|
||||
const face& f = faces[i];
|
||||
|
||||
vector n(f.normal(points));
|
||||
const vector areaNorm(f.areaNormal(points));
|
||||
|
||||
// Check if vector from any point on face to cc points outwards
|
||||
if (((points[f[0]] - cc) & n) < 0)
|
||||
if (((points[f[0]] - cc) & areaNorm) < 0)
|
||||
{
|
||||
// Incorrectly oriented
|
||||
return false;
|
||||
|
||||
@ -225,9 +225,10 @@ int main(int argc, char *argv[])
|
||||
// Determine orientation of tri v.s. cell centre.
|
||||
point cc(cll.centre(points));
|
||||
point fc(tri.centre(points));
|
||||
vector fn(tri.normal(points));
|
||||
|
||||
if (((fc - cc) & fn) < 0)
|
||||
const vector areaNorm(tri.areaNormal(points));
|
||||
|
||||
if (((fc - cc) & areaNorm) < 0)
|
||||
{
|
||||
// Boundary face points inwards. Flip.
|
||||
boundaryFaces[facei].flip();
|
||||
|
||||
Reference in New Issue
Block a user