ENH: relocate zero_one to pTraits, allows reuse for scalar clamping

ENH: add pTraits and IO for std::int8_t

STYLE: cull some implicitly available includes

- pTraits.H is included by label/scalar etc
- zero.H is included by UList

STYLE: cull redundant forward declarations for Istream/Ostream
This commit is contained in:
Mark Olesen
2023-02-22 18:25:33 +01:00
parent f3d447579a
commit d88272f031
102 changed files with 475 additions and 427 deletions

View File

@ -49,16 +49,13 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class Istream;
class Ostream;
namespace functionObjects
{
// Forward Declarations
class eulerianParticle;
}
// Forward declaration of friend functions and operators
// Forward Declarations
Istream& operator>>(Istream&, functionObjects::eulerianParticle&);
Ostream& operator<<(Ostream&, const functionObjects::eulerianParticle&);

View File

@ -92,15 +92,13 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class Istream;
class Ostream;
// Forward Declarations
class objectRegistry;
namespace functionObjects
{
// Forward declaration of friend functions and operators
// Forward Declarations
class fieldAverageItem;
Istream& operator>>(Istream&, fieldAverageItem&);
Ostream& operator<<(Ostream&, const fieldAverageItem&);

View File

@ -670,7 +670,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
// Uniformity index
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
return clamp(ui, 0, 1);
return clamp(ui, zero_one{});
}
default:
@ -756,7 +756,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
// Uniformity index
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
return vector(clamp(ui, 0, 1), 0, 0);
return vector(clamp(ui, zero_one{}), 0, 0);
}
default:

View File

@ -152,7 +152,7 @@ Description
For option 6, the following relation is used:
\f[
fCoWeight = clamp((Co - Co1)/(Co2 - Co1), 0, 1)
fCoWeight = clamp((Co - Co1)/(Co2 - Co1), zero_one{});
\f]
where