Skip to content
Snippets Groups Projects
Commit 41880c27 authored by Mark Olesen's avatar Mark Olesen
Browse files

added triFace::reverseFace() for symmetry with face class

parent fa69fd66
Branches
Tags
......@@ -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
(
......
......@@ -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,
......
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