From ae9889697e905eb8ece7453a66cc327749dfa517 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 19 May 2016 09:39:45 +0100 Subject: [PATCH] Scalar: Documented 'posPart' and 'negPart' --- src/OpenFOAM/primitives/Scalar/Scalar.H | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.H b/src/OpenFOAM/primitives/Scalar/Scalar.H index 502a57c3b..280dd4bc7 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.H +++ b/src/OpenFOAM/primitives/Scalar/Scalar.H @@ -139,12 +139,16 @@ inline Scalar neg(const Scalar s) } +//- Return the positive part of s inline Scalar posPart(const Scalar s) { return (s > 0)? s: 0; } +//- Return the negative part of s. +// Note: this function returns the actual negative part of s as a +// negative number and does not change the sign inline Scalar negPart(const Scalar s) { return (s < 0)? s: 0;