mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0. This is consistent with the common mathematical definition of the "pos" function: https://en.wikipedia.org/wiki/Sign_(mathematics) However the previous implementation in which 1 was also returned for a 0 argument is useful in many situations so the "pos0" has been added which returns 1 if the argument is greater or equal to 0. Additionally the "neg0" has been added which returns 1 if if the argument is less than or equal to 0.
This commit is contained in:
@ -207,7 +207,7 @@ void Foam::CLASS::updateCoeffs()
|
||||
(
|
||||
"phi"
|
||||
);
|
||||
this->valueFraction() = 1.0 - pos(phip);
|
||||
this->valueFraction() = 1.0 - pos0(phip);
|
||||
|
||||
PARENT::updateCoeffs();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user