mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -34,8 +34,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef edgeStats_H
|
||||
#define edgeStats_H
|
||||
#ifndef Foam_edgeStats_H
|
||||
#define Foam_edgeStats_H
|
||||
|
||||
#include "direction.H"
|
||||
#include "scalar.H"
|
||||
@ -45,9 +45,8 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
// Forward Declarations
|
||||
class polyMesh;
|
||||
class Ostream;
|
||||
class twoDPointCorrector;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
|
||||
@ -62,7 +62,7 @@ namespace Foam
|
||||
// Volume porosity -> blockage
|
||||
inline scalar getPorosity(const dictionary& dict)
|
||||
{
|
||||
return 1 - clamp(dict.getOrDefault<scalar>("porosity", 0), 0, 1);
|
||||
return 1 - clamp(dict.getOrDefault<scalar>("porosity", 0), zero_one{});
|
||||
}
|
||||
|
||||
// Direction porosities -> blockage
|
||||
@ -74,7 +74,7 @@ inline vector getPorosities(const dictionary& dict)
|
||||
{
|
||||
for (scalar& val : blockage)
|
||||
{
|
||||
val = 1 - clamp(val, 0, 1);
|
||||
val = 1 - clamp(val, zero_one{});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ void setAlpha
|
||||
{
|
||||
cutCell.calcSubCell(cellI, 0.0);
|
||||
|
||||
alpha1[cellI] = clamp(cutCell.VolumeOfFluid(), 0, 1);
|
||||
alpha1[cellI] = clamp(cutCell.VolumeOfFluid(), zero_one{});
|
||||
|
||||
if (writeOBJ && (mag(cutCell.faceArea()) >= 1e-14))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user