diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index 0ce572361677b37589c0cba69f06cbb1ead10bd5..e14e676aa60a44f6e08d11b93e40f2ee24598c58 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -124,6 +124,9 @@ public: //- Return vector normal inline vector normal(const pointField&) const; + //- Return face with reverse direction + inline triFace reverseFace() const; + //- Return swept-volume inline scalar sweptVol ( diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H index 2bced4ccf2d42180714357d2ff2782f568590d44..cba6d8a04c3b08e39f5cb36d1dc8354b2ff2eb9c 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H @@ -78,9 +78,9 @@ inline Foam::triFace::triFace } -inline Foam::triFace::triFace(const UList<label>& l) +inline Foam::triFace::triFace(const UList<label>& lst) : - FixedList<label, 3>(l) + FixedList<label, 3>(lst) {} @@ -96,7 +96,7 @@ inline Foam::label Foam::triFace::collapse() { // we cannot resize a FixedList, so mark duplicates with '-1' // (the lower vertex is retained) - // catch any '-1' - ie, if called twice + // catch any '-1' (eg, if called twice) label n = 3; if (operator[](0) == operator[](1) || operator[](1) == -1) @@ -154,13 +154,13 @@ inline Foam::edgeList Foam::triFace::edges() const edgeList e(3); e[0].start() = operator[](0); - e[0].end() = operator[](1); + e[0].end() = operator[](1); e[1].start() = operator[](1); - e[1].end() = operator[](2); + e[1].end() = operator[](2); e[2].start() = operator[](2); - e[2].end() = operator[](0); + e[2].end() = operator[](0); return e; } @@ -213,7 +213,7 @@ inline Foam::scalar Foam::triFace::mag(const pointField& points) const return ::Foam::mag(normal(points)); } - +// could also delegate to triPointRef(...).normal() inline Foam::vector Foam::triFace::normal(const pointField& points) const { return 0.5* @@ -224,6 +224,13 @@ inline Foam::vector Foam::triFace::normal(const pointField& points) const } +inline Foam::triFace Foam::triFace::reverseFace() const +{ + // The starting points of the original and reverse face are identical. + return triFace(operator[](0), operator[](2), operator[](1)); +} + + inline Foam::scalar Foam::triFace::sweptVol ( const pointField& opts,