Short cut for swept volumes in triangular faces

This commit is contained in:
Hrvoje Jasak 2011-12-12 16:17:33 +00:00
parent 174de76792
commit b1a9712945

View file

@ -641,6 +641,29 @@ Foam::scalar Foam::face::sweptVol
const pointField& newPoints
) const
{
// For a triangle do the swept volume directly.
// Sandeep Menon, 19/Oct/2011
if (size() == 3)
{
return
(
triPointRef
(
oldPoints[operator[](0)],
oldPoints[operator[](1)],
oldPoints[operator[](2)]
).sweptVol
(
triPointRef
(
newPoints[operator[](0)],
newPoints[operator[](1)],
newPoints[operator[](2)]
)
)
);
}
scalar sv = 0;
// Calculate the swept volume by breaking the face into triangles and