triangle, triFace, face: Rationalized normal for consistency with the rest of OpenFOAM

For compatibility with all the mesh and related classes in OpenFOAM The 'normal'
function of the 'triangle', 'triFace' and 'face' classes now returns the unit
normal vector rather than the vector area which is now provided by the 'area'
function.
This commit is contained in:
Henry Weller
2018-04-06 13:57:36 +01:00
parent 1fd4ecb024
commit 43b35a5173
65 changed files with 288 additions and 1037 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,10 +190,10 @@ bool correctOrientation(const pointField& points, const cellShape& shape)
{
const face& f = faces[i];
vector n(f.normal(points));
const vector a(f.area(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) & a) < 0)
{
// Incorrectly oriented
return false;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -223,7 +223,7 @@ 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));
vector fn(tri.area(points));
if (((fc - cc) & fn) < 0)
{

View File

@ -88,7 +88,7 @@ void Foam::starMesh::createCoupleMatches()
scalar faceAreaAngle =
mag
(
-(masterFace.normal(points_) & slaveFace.normal(points_))/
-(masterFace.area(points_) & slaveFace.area(points_))/
(masterFace.mag(points_)*slaveFace.mag(points_) + vSmall)
);
@ -162,7 +162,7 @@ void Foam::starMesh::createCoupleMatches()
List<SLList<label>> slaveEdgePoints(slaveEdges.size());
// Find common plane
vector n = masterFace.normal(points_);
vector n = masterFace.area(points_);
n /= mag(n) + vSmall;
// Loop through all edges of the master face. For every edge,
@ -891,7 +891,7 @@ void Foam::starMesh::createCoupleMatches()
// 2 for slave
label startEdgeFound = 0;
vector masterProjDir = -newMasterFace.normal(points_);
vector masterProjDir = -newMasterFace.area(points_);
forAll(newSlaveEdges, edgeI)
{
@ -934,7 +934,7 @@ void Foam::starMesh::createCoupleMatches()
if (startEdgeFound == 0)
{
vector slaveProjDir = -newSlaveFace.normal(points_);
vector slaveProjDir = -newSlaveFace.area(points_);
forAll(newMasterEdges, edgeI)
{
@ -999,7 +999,7 @@ void Foam::starMesh::createCoupleMatches()
// complete; resize it to the number of active points
// and exit.
vector planeNormal = newMasterFace.normal(points_);
vector planeNormal = newMasterFace.area(points_);
planeNormal /= mag(planeNormal) + vSmall;
#ifdef DEBUG_RIGHT_HAND_WALK
@ -1309,7 +1309,7 @@ void Foam::starMesh::createCoupleMatches()
// Project all points of the intersected face
// onto the master face to ensure closedness
vector pointProjectionNormal = -masterFace.normal(points_);
vector pointProjectionNormal = -masterFace.area(points_);
forAll(intersectedFace, intPointi)
{
@ -1343,8 +1343,8 @@ void Foam::starMesh::createCoupleMatches()
if
(
(
masterFace.normal(points_)
& intersectedFace.normal(points_)
masterFace.area(points_)
& intersectedFace.area(points_)
) < vSmall
)
{