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:
@ -81,7 +81,7 @@ namespace ListPolicy
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Override on a per-type basis
|
// Override on a per-type basis
|
||||||
template<> struct short_length<short> : std::integral_constant<short,20> {};
|
template<> struct short_length<short> : std::integral_constant<int,20> {};
|
||||||
|
|
||||||
} // End namespace ListPolicy
|
} // End namespace ListPolicy
|
||||||
} // End namespace Detail
|
} // End namespace Detail
|
||||||
|
|||||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
|||||||
Random rnd(4567);
|
Random rnd(4567);
|
||||||
for (scalar& val : someField)
|
for (scalar& val : someField)
|
||||||
{
|
{
|
||||||
val = rnd.position(-0.2, 1.2);
|
val = rnd.position(scalar(-0.2), scalar(1.2));
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
@ -171,6 +171,7 @@ int main(int argc, char *argv[])
|
|||||||
// nope << " : " << clamp(val, zero_one{})
|
// nope << " : " << clamp(val, zero_one{})
|
||||||
// nope << " : " << clamp(val, scalarMinMax(zero_one{}))
|
// nope << " : " << clamp(val, scalarMinMax(zero_one{}))
|
||||||
<< " : " << clamp(val, 0, 1)
|
<< " : " << clamp(val, 0, 1)
|
||||||
|
<< " : " << clamp(val, zero_one{})
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ Description
|
|||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "string.H"
|
#include "string.H"
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "nil.H"
|
#include "zero.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
#include "PstreamBuffers.H"
|
#include "PstreamBuffers.H"
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
@ -82,8 +82,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
nil x;
|
zero x;
|
||||||
cout<<"nil:" << sizeof(x) << nl;
|
cout<<"zero:" << sizeof(x) << nl;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
|
|||||||
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef edgeStats_H
|
#ifndef Foam_edgeStats_H
|
||||||
#define edgeStats_H
|
#define Foam_edgeStats_H
|
||||||
|
|
||||||
#include "direction.H"
|
#include "direction.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
@ -45,9 +45,8 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward Declarations
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
class Ostream;
|
|
||||||
class twoDPointCorrector;
|
class twoDPointCorrector;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -62,7 +62,7 @@ namespace Foam
|
|||||||
// Volume porosity -> blockage
|
// Volume porosity -> blockage
|
||||||
inline scalar getPorosity(const dictionary& dict)
|
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
|
// Direction porosities -> blockage
|
||||||
@ -74,7 +74,7 @@ inline vector getPorosities(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
for (scalar& val : blockage)
|
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);
|
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))
|
if (writeOBJ && (mag(cutCell.faceArea()) >= 1e-14))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -50,7 +50,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -50,7 +50,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -42,22 +42,21 @@ $(chars)/lists/charUList.C
|
|||||||
primitives/direction/directionIO.C
|
primitives/direction/directionIO.C
|
||||||
|
|
||||||
ints = primitives/ints
|
ints = primitives/ints
|
||||||
|
$(ints)/uint/uintIO.C
|
||||||
$(ints)/uint8/uint8.C
|
$(ints)/uint8/uint8.C
|
||||||
$(ints)/uint8/uint8IO.C
|
|
||||||
$(ints)/uint16/uint16.C
|
$(ints)/uint16/uint16.C
|
||||||
$(ints)/uint32/uint32.C
|
$(ints)/uint32/uint32.C
|
||||||
$(ints)/uint32/uint32IO.C
|
$(ints)/uint32/uint32IO.C
|
||||||
$(ints)/uint64/uint64.C
|
$(ints)/uint64/uint64.C
|
||||||
$(ints)/uint64/uint64IO.C
|
$(ints)/uint64/uint64IO.C
|
||||||
$(ints)/uint/uintIO.C
|
$(ints)/uLabel/uLabel.C
|
||||||
|
$(ints)/int/intIO.C
|
||||||
$(ints)/int16/int16.C
|
$(ints)/int16/int16.C
|
||||||
$(ints)/int32/int32.C
|
$(ints)/int32/int32.C
|
||||||
$(ints)/int32/int32IO.C
|
$(ints)/int32/int32IO.C
|
||||||
$(ints)/int64/int64.C
|
$(ints)/int64/int64.C
|
||||||
$(ints)/int64/int64IO.C
|
$(ints)/int64/int64IO.C
|
||||||
$(ints)/int/intIO.C
|
|
||||||
$(ints)/label/label.C
|
$(ints)/label/label.C
|
||||||
$(ints)/uLabel/uLabel.C
|
|
||||||
$(ints)/lists/labelList.C
|
$(ints)/lists/labelList.C
|
||||||
$(ints)/lists/labelIOList.C
|
$(ints)/lists/labelIOList.C
|
||||||
$(ints)/lists/labelListIOList.C
|
$(ints)/lists/labelListIOList.C
|
||||||
|
|||||||
@ -48,7 +48,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
template<class Type> class dynamicIndexedOctree;
|
template<class Type> class dynamicIndexedOctree;
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Ostream& operator<<(Ostream&, const dynamicIndexedOctree<Type>&);
|
Ostream& operator<<(Ostream&, const dynamicIndexedOctree<Type>&);
|
||||||
|
|||||||
@ -53,7 +53,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
template<class Type> class indexedOctree;
|
template<class Type> class indexedOctree;
|
||||||
template<class Type> Ostream& operator<<(Ostream&, const indexedOctree<Type>&);
|
template<class Type> Ostream& operator<<(Ostream&, const indexedOctree<Type>&);
|
||||||
|
|
||||||
|
|||||||
@ -47,9 +47,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
template<class LListBase, class T> class ILList;
|
template<class LListBase, class T> class ILList;
|
||||||
|
|
||||||
template<class LListBase, class T> Istream& operator>>
|
template<class LListBase, class T> Istream& operator>>
|
||||||
|
|||||||
@ -48,10 +48,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
template<class LListBase, class T> class LList;
|
template<class LListBase, class T> class LList;
|
||||||
|
|
||||||
template<class LListBase, class T>
|
template<class LListBase, class T>
|
||||||
|
|||||||
@ -49,8 +49,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
template<class LListBase, class T> class UILList;
|
template<class LListBase, class T> class UILList;
|
||||||
|
|
||||||
template<class LListBase, class T>
|
template<class LListBase, class T>
|
||||||
|
|||||||
@ -57,7 +57,6 @@ SourceFiles
|
|||||||
#include "ListPolicy.H"
|
#include "ListPolicy.H"
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
|
||||||
#include <vector> // i.e, std::vector
|
#include <vector> // i.e, std::vector
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -66,8 +65,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
class labelRange;
|
class labelRange;
|
||||||
|
|
||||||
template<class T> class List;
|
template<class T> class List;
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
#include "pTraits.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -31,10 +31,9 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef ListPolicy_H
|
#ifndef Foam_ListPolicy_H
|
||||||
#define ListPolicy_H
|
#define Foam_ListPolicy_H
|
||||||
|
|
||||||
#include "label.H"
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -43,9 +42,9 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
|
class keyType;
|
||||||
class word;
|
class word;
|
||||||
class wordRe;
|
class wordRe;
|
||||||
class keyType;
|
|
||||||
|
|
||||||
namespace Detail
|
namespace Detail
|
||||||
{
|
{
|
||||||
@ -58,11 +57,11 @@ namespace ListPolicy
|
|||||||
//
|
//
|
||||||
// Default definition: 10
|
// Default definition: 10
|
||||||
template<class T>
|
template<class T>
|
||||||
struct short_length : std::integral_constant<label,10> {};
|
struct short_length : std::integral_constant<int,10> {};
|
||||||
|
|
||||||
// Could override on a per-type basis
|
// Can override on a per-type basis
|
||||||
// Eg,
|
// Eg,
|
||||||
// template<> struct short_length<label> : std::integral_constant<label,20> {};
|
// template<> struct short_length<label> : std::integral_constant<int,20> {};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -75,19 +74,19 @@ struct short_length : std::integral_constant<label,10> {};
|
|||||||
template<class T>
|
template<class T>
|
||||||
struct no_linebreak : std::is_arithmetic<T> {};
|
struct no_linebreak : std::is_arithmetic<T> {};
|
||||||
|
|
||||||
// Specialization for word, wordRe, keyType
|
// Specialization for word-like classes
|
||||||
// These elements are normally fairly short, so ok to output a few (eg, 10)
|
// These elements are normally fairly short, so ok to output a few (eg, 10)
|
||||||
// of them on a single line.
|
// of them on a single line.
|
||||||
|
|
||||||
|
//- Suppress line-breaks for keyType
|
||||||
|
template<> struct no_linebreak<keyType> : std::true_type {};
|
||||||
|
|
||||||
//- Suppress line-breaks for word
|
//- Suppress line-breaks for word
|
||||||
template<> struct no_linebreak<word> : std::true_type {};
|
template<> struct no_linebreak<word> : std::true_type {};
|
||||||
|
|
||||||
//- Suppress line-breaks for wordRe
|
//- Suppress line-breaks for wordRe
|
||||||
template<> struct no_linebreak<wordRe> : std::true_type {};
|
template<> struct no_linebreak<wordRe> : std::true_type {};
|
||||||
|
|
||||||
//- Suppress line-breaks for keyType
|
|
||||||
template<> struct no_linebreak<keyType> : std::true_type {};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -51,8 +51,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
template<class T, class BaseType> class CompactIOList;
|
template<class T, class BaseType> class CompactIOList;
|
||||||
|
|
||||||
template<class T, class BaseType> Istream& operator>>
|
template<class T, class BaseType> Istream& operator>>
|
||||||
|
|||||||
@ -31,23 +31,25 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef InfoProxy_H
|
#ifndef Foam_InfoProxy_H
|
||||||
#define InfoProxy_H
|
#define Foam_InfoProxy_H
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
|
template<class T> class InfoProxy;
|
||||||
|
template<class T> Ostream& operator<<(Ostream&, const InfoProxy<T>&);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class InfoProxy Declaration
|
Class InfoProxy Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class T> class InfoProxy;
|
|
||||||
template<class T> Ostream& operator<<(Ostream&, const InfoProxy<T>&);
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class InfoProxy
|
class InfoProxy
|
||||||
{
|
{
|
||||||
|
|||||||
@ -32,8 +32,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef memoryStreamBuffer_H
|
#ifndef Foam_memoryStreamBuffer_H
|
||||||
#define memoryStreamBuffer_H
|
#define Foam_memoryStreamBuffer_H
|
||||||
|
|
||||||
#include "UList.H"
|
#include "UList.H"
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@ -44,9 +44,6 @@ Description
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class memorybuf Declaration
|
Class memorybuf Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -101,6 +101,7 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class dlLibraryTable;
|
class dlLibraryTable;
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "dimensionedType.H"
|
#include "dimensionedType.H"
|
||||||
#include "pTraits.H"
|
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|||||||
@ -43,7 +43,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class dictionary;
|
class dictionary;
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
|
|||||||
@ -52,8 +52,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef profiling_H
|
#ifndef Foam_profiling_H
|
||||||
#define profiling_H
|
#define Foam_profiling_H
|
||||||
|
|
||||||
#include "profilingTrigger.H"
|
#include "profilingTrigger.H"
|
||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
@ -69,7 +69,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Ostream;
|
|
||||||
class cpuInfo;
|
class cpuInfo;
|
||||||
class memInfo;
|
class memInfo;
|
||||||
class profilingInformation;
|
class profilingInformation;
|
||||||
|
|||||||
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef MatrixTools_H
|
#ifndef Foam_MatrixTools_H
|
||||||
#define MatrixTools_H
|
#define Foam_MatrixTools_H
|
||||||
|
|
||||||
#include "Matrix.H"
|
#include "Matrix.H"
|
||||||
|
|
||||||
@ -44,9 +44,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Namespace MatrixTools Declaration
|
Namespace MatrixTools Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -294,6 +294,13 @@ inline bool notEqual(const Scalar a, const Scalar b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Clamp scalar value to a 0-1 range
|
||||||
|
inline Scalar clamp(const Scalar val, const Foam::zero_one)
|
||||||
|
{
|
||||||
|
return (val < 0) ? 0 : (1 < val) ? 1 : val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fast implementation, and with scalar promotion of upper/lower limits
|
// Fast implementation, and with scalar promotion of upper/lower limits
|
||||||
inline Scalar clamp(const Scalar& val, const Scalar& lower, const Scalar& upper)
|
inline Scalar clamp(const Scalar& val, const Scalar& lower, const Scalar& upper)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,12 +35,13 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef Foam_doubleScalar_H
|
#ifndef Foam_primitives_double_H
|
||||||
#define Foam_doubleScalar_H
|
#define Foam_primitives_double_H
|
||||||
|
|
||||||
#include "scalarFwd.H"
|
#include "scalarFwd.H"
|
||||||
#include "doubleFloat.H"
|
#include "doubleFloat.H"
|
||||||
#include "direction.H"
|
#include "direction.H"
|
||||||
|
#include "pTraits.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -35,12 +35,13 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef Foam_floatScalar_H
|
#ifndef Foam_primitives_float_H
|
||||||
#define Foam_floatScalar_H
|
#define Foam_primitives_float_H
|
||||||
|
|
||||||
#include "scalarFwd.H"
|
#include "scalarFwd.H"
|
||||||
#include "doubleFloat.H"
|
#include "doubleFloat.H"
|
||||||
#include "direction.H"
|
#include "direction.H"
|
||||||
|
#include "pTraits.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -32,8 +32,8 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef products_H
|
#ifndef Foam_products_H
|
||||||
#define products_H
|
#define Foam_products_H
|
||||||
|
|
||||||
#include "direction.H"
|
#include "direction.H"
|
||||||
#include "pTraits.H"
|
#include "pTraits.H"
|
||||||
|
|||||||
@ -35,18 +35,17 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef bool_H
|
#ifndef Foam_primitives_bool_H
|
||||||
#define bool_H
|
#define Foam_primitives_bool_H
|
||||||
|
|
||||||
|
#include "pTraits.H"
|
||||||
|
#include "direction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
//- Read bool from stream using Foam::Switch(Istream&)
|
//- Read bool from stream using Foam::Switch(Istream&)
|
||||||
@ -58,18 +57,12 @@ Ostream& operator<<(Ostream& os, const bool b);
|
|||||||
//- Read bool from stream using Foam::Switch(Istream&)
|
//- Read bool from stream using Foam::Switch(Istream&)
|
||||||
bool readBool(Istream& is);
|
bool readBool(Istream& is);
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<bool>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
//- Template specialisation for pTraits\<bool\>
|
||||||
|
|
||||||
#include "pTraits.H"
|
|
||||||
#include "direction.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Template specialisation for pTraits<bool>
|
|
||||||
template<>
|
template<>
|
||||||
class pTraits<bool>
|
class pTraits<bool>
|
||||||
{
|
{
|
||||||
@ -121,16 +114,10 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator bool() const noexcept
|
operator bool() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator bool&() noexcept
|
operator bool&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -38,15 +38,13 @@ SourceFiles
|
|||||||
#ifndef Foam_primitives_char_H
|
#ifndef Foam_primitives_char_H
|
||||||
#define Foam_primitives_char_H
|
#define Foam_primitives_char_H
|
||||||
|
|
||||||
|
#include "pTraits.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Read single character
|
//- Read single character
|
||||||
@ -76,16 +74,9 @@ inline bool isspace(char c) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<char>
|
||||||
} // End namespace Foam
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "pTraits.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
//- Template specialisation for pTraits\<char\>
|
//- Template specialisation for pTraits\<char\>
|
||||||
template<>
|
template<>
|
||||||
@ -115,16 +106,10 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator char() const noexcept
|
operator char() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator char&() noexcept
|
operator char&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -38,8 +38,8 @@ See also
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef wchar_H
|
#ifndef Foam_primitives_wchar_H
|
||||||
#define wchar_H
|
#define Foam_primitives_wchar_H
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@ -44,7 +44,6 @@ SourceFiles
|
|||||||
#include "zero.H"
|
#include "zero.H"
|
||||||
#include "contiguous.H"
|
#include "contiguous.H"
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -224,10 +223,10 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class pTraits<complex> Declaration
|
Specialization pTraits<complex>
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Template specialisation for pTraits<complex>
|
//- Template specialisation for pTraits<complex>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<complex>
|
class pTraits<complex>
|
||||||
{
|
{
|
||||||
@ -288,16 +287,10 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator complex() const noexcept
|
operator complex() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator complex&() noexcept
|
operator complex&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,21 +36,19 @@ Note
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef primitives_direction_H
|
#ifndef Foam_primitives_direction_H
|
||||||
#define primitives_direction_H
|
#define Foam_primitives_direction_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "pTraits.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
typedef uint8_t direction;
|
typedef uint8_t direction;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Foam::Istream& Foam::operator>>(Istream& is, direction& val)
|
|||||||
if (!t.good())
|
if (!t.good())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(is)
|
FatalIOErrorInFunction(is)
|
||||||
<< "Bad token - could not get direction"
|
<< "Bad token - could not get uint8/direction"
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
is.setBad();
|
is.setBad();
|
||||||
return is;
|
return is;
|
||||||
@ -60,7 +60,7 @@ Foam::Istream& Foam::operator>>(Istream& is, direction& val)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(is)
|
FatalIOErrorInFunction(is)
|
||||||
<< "Wrong token type - expected label (direction), found "
|
<< "Wrong token type - expected label (uint8/direction), found "
|
||||||
<< t.info()
|
<< t.info()
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
is.setBad();
|
is.setBad();
|
||||||
|
|||||||
@ -100,7 +100,7 @@ protected:
|
|||||||
//- that forms the basis of many more complex ramp functions
|
//- that forms the basis of many more complex ramp functions
|
||||||
inline scalar linearRamp(const scalar t) const
|
inline scalar linearRamp(const scalar t) const
|
||||||
{
|
{
|
||||||
return clamp((t - start_)/duration_, 0, 1);
|
return clamp((t - start_)/duration_, zero_one{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,9 +50,9 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class SHA1;
|
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
class SHA1;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class SHA1Digest Declaration
|
Class SHA1Digest Declaration
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
#ifndef Foam_primitives_int_H
|
#ifndef Foam_primitives_int_H
|
||||||
#define Foam_primitives_int_H
|
#define Foam_primitives_int_H
|
||||||
|
|
||||||
|
#include "int8.H"
|
||||||
#include "int16.H"
|
#include "int16.H"
|
||||||
#include "int32.H"
|
#include "int32.H"
|
||||||
#include "int64.H"
|
#include "int64.H"
|
||||||
|
|||||||
@ -27,7 +27,7 @@ Primitive
|
|||||||
int16_t
|
int16_t
|
||||||
|
|
||||||
Description
|
Description
|
||||||
16bit signed integer. I/O is done via an int32.
|
16bit signed integer. I/O is done as an int32.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
int16.C
|
int16.C
|
||||||
@ -38,6 +38,9 @@ SourceFiles
|
|||||||
#define Foam_primitives_int16_H
|
#define Foam_primitives_int16_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "direction.H"
|
||||||
|
#include "pTraits.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -45,10 +48,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of int16 value
|
//- A word representation of int16 value
|
||||||
|
|||||||
@ -52,10 +52,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of int32 value
|
//- A word representation of int32 value
|
||||||
@ -76,6 +72,12 @@ struct nameOp<int32_t>
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline int32_t mag(const int32_t val)
|
||||||
|
{
|
||||||
|
return ::abs(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Read int32_t from stream
|
//- Read int32_t from stream
|
||||||
@ -131,6 +133,10 @@ Ostream& operator<<(Ostream& os, const int32_t val);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<int32_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Template specialization for pTraits<int32_t>
|
//- Template specialization for pTraits<int32_t>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<int32_t>
|
class pTraits<int32_t>
|
||||||
@ -187,25 +193,13 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator int32_t() const noexcept
|
operator int32_t() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator int32_t&() noexcept
|
operator int32_t&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline int32_t mag(const int32_t val)
|
|
||||||
{
|
|
||||||
return ::abs(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -52,10 +52,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of int64 value
|
//- A word representation of int64 value
|
||||||
@ -76,6 +72,12 @@ struct nameOp<int64_t>
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline int64_t mag(const int64_t val)
|
||||||
|
{
|
||||||
|
return ::labs(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Read int64_t from stream
|
//- Read int64_t from stream
|
||||||
@ -130,6 +132,10 @@ Ostream& operator<<(Ostream& os, const int64_t val);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<int64_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Template specialization for pTraits<int64_t>
|
//- Template specialization for pTraits<int64_t>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<int64_t>
|
class pTraits<int64_t>
|
||||||
@ -186,25 +192,13 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator int64_t() const noexcept
|
operator int64_t() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator int64_t&() noexcept
|
operator int64_t&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline int64_t mag(const int64_t val)
|
|
||||||
{
|
|
||||||
return ::labs(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
105
src/OpenFOAM/primitives/ints/int8/int8.C
Normal file
105
src/OpenFOAM/primitives/ints/int8/int8.C
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2023 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "int8.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const char* const Foam::pTraits<int8_t>::typeName = "int8";
|
||||||
|
const char* const Foam::pTraits<int8_t>::componentNames[] = { "" };
|
||||||
|
|
||||||
|
const int8_t Foam::pTraits<int8_t>::zero = 0;
|
||||||
|
const int8_t Foam::pTraits<int8_t>::one = 1;
|
||||||
|
const int8_t Foam::pTraits<int8_t>::min = INT8_MIN;
|
||||||
|
const int8_t Foam::pTraits<int8_t>::max = INT8_MAX;
|
||||||
|
const int8_t Foam::pTraits<int8_t>::rootMin = INT8_MIN;
|
||||||
|
const int8_t Foam::pTraits<int8_t>::rootMax = INT8_MAX;
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::pTraits<int8_t>::pTraits(Istream& is)
|
||||||
|
{
|
||||||
|
is >> p_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// int8_t Foam::readInt8(Istream& is)
|
||||||
|
// {
|
||||||
|
// int8_t val(0);
|
||||||
|
// is >> val;
|
||||||
|
//
|
||||||
|
// return val;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
Foam::Istream& Foam::operator>>(Istream& is, int8_t& val)
|
||||||
|
{
|
||||||
|
token t(is);
|
||||||
|
|
||||||
|
if (!t.good())
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(is)
|
||||||
|
<< "Bad token - could not get int8"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
is.setBad();
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accept separated '-' (or '+') while expecting a number.
|
||||||
|
// This can arise during dictionary expansions (Eg, -$value)
|
||||||
|
|
||||||
|
if (t.isLabel())
|
||||||
|
{
|
||||||
|
val = int8_t(t.labelToken());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(is)
|
||||||
|
<< "Wrong token type - expected label (int8), found "
|
||||||
|
<< t.info() << exit(FatalIOError);
|
||||||
|
is.setBad();
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
is.check(FUNCTION_NAME);
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const int8_t val)
|
||||||
|
{
|
||||||
|
os.write(label(val));
|
||||||
|
os.check(FUNCTION_NAME);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
154
src/OpenFOAM/primitives/ints/int8/int8.H
Normal file
154
src/OpenFOAM/primitives/ints/int8/int8.H
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2023 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Primitive
|
||||||
|
int8_t
|
||||||
|
|
||||||
|
Description
|
||||||
|
8bit signed integer
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
int8.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef Foam_primitives_int8_H
|
||||||
|
#define Foam_primitives_int8_H
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <climits>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "direction.H"
|
||||||
|
#include "pTraits.H"
|
||||||
|
#include "word.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- A word representation of uint8 value
|
||||||
|
inline word name(const int8_t val)
|
||||||
|
{
|
||||||
|
return word(std::to_string(int(val)), false); // Needs no stripping
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- A word representation of uint8 value
|
||||||
|
template<>
|
||||||
|
struct nameOp<int8_t>
|
||||||
|
{
|
||||||
|
word operator()(const int8_t val) const
|
||||||
|
{
|
||||||
|
return word(std::to_string(int(val)), false); // Needs no stripping
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- Read from stream (as label)
|
||||||
|
Istream& operator>>(Istream& is, int8_t& val);
|
||||||
|
|
||||||
|
//- Write to stream (as label)
|
||||||
|
Ostream& operator<<(Ostream& os, const int8_t val);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<int8_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
//- Template specialization for pTraits<int8_t>
|
||||||
|
template<>
|
||||||
|
class pTraits<int8_t>
|
||||||
|
{
|
||||||
|
int8_t p_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
|
//- Component type
|
||||||
|
typedef int8_t cmptType;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Constants
|
||||||
|
|
||||||
|
//- Dimensionality of space
|
||||||
|
static constexpr direction dim = 3;
|
||||||
|
|
||||||
|
//- Rank of int8_t is 0
|
||||||
|
static constexpr direction rank = 0;
|
||||||
|
|
||||||
|
//- Number of components in int8_t is 1
|
||||||
|
static constexpr direction nComponents = 1;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Data Members
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
static const char* const componentNames[];
|
||||||
|
static const int8_t zero;
|
||||||
|
static const int8_t one;
|
||||||
|
static const int8_t min;
|
||||||
|
static const int8_t max;
|
||||||
|
static const int8_t rootMax;
|
||||||
|
static const int8_t rootMin;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Copy construct from primitive
|
||||||
|
explicit pTraits(int8_t val) noexcept
|
||||||
|
:
|
||||||
|
p_(val)
|
||||||
|
{}
|
||||||
|
|
||||||
|
//- Read construct from Istream
|
||||||
|
explicit pTraits(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the value
|
||||||
|
operator int8_t() const noexcept { return p_; }
|
||||||
|
|
||||||
|
//- Access the value
|
||||||
|
operator int8_t&() noexcept { return p_; }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -27,7 +27,7 @@ Primitive
|
|||||||
uint16_t
|
uint16_t
|
||||||
|
|
||||||
Description
|
Description
|
||||||
16bit unsigned integer. I/O is done via an int32.
|
16bit unsigned integer. I/O is done as an int32.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
uint16.C
|
uint16.C
|
||||||
@ -38,6 +38,9 @@ SourceFiles
|
|||||||
#define Foam_primitives_uint16_H
|
#define Foam_primitives_uint16_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "direction.H"
|
||||||
|
#include "pTraits.H"
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -45,10 +48,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of uint16 value
|
//- A word representation of uint16 value
|
||||||
|
|||||||
@ -52,10 +52,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of uint32 value
|
//- A word representation of uint32 value
|
||||||
@ -120,6 +116,11 @@ inline bool read(const std::string& str, uint32_t& val)
|
|||||||
Istream& operator>>(Istream& is, uint32_t& val);
|
Istream& operator>>(Istream& is, uint32_t& val);
|
||||||
Ostream& operator<<(Ostream& os, const uint32_t val);
|
Ostream& operator<<(Ostream& os, const uint32_t val);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<uint32_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Template specialization for pTraits<uint32_t>
|
//- Template specialization for pTraits<uint32_t>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<uint32_t>
|
class pTraits<uint32_t>
|
||||||
@ -173,16 +174,10 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator uint32_t() const noexcept
|
operator uint32_t() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator uint32_t&() noexcept
|
operator uint32_t&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -52,10 +52,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of uint64 value
|
//- A word representation of uint64 value
|
||||||
@ -129,6 +125,10 @@ Ostream& operator<<(Ostream& os, const uint64_t val);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<uint64_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Template specialization for pTraits<uint64_t>
|
//- Template specialization for pTraits<uint64_t>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<uint64_t>
|
class pTraits<uint64_t>
|
||||||
@ -182,16 +182,10 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the value
|
//- Return the value
|
||||||
operator uint64_t() const noexcept
|
operator uint64_t() const noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Access the value
|
//- Access the value
|
||||||
operator uint64_t&() noexcept
|
operator uint64_t&() noexcept { return p_; }
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "uint8.H"
|
#include "uint8.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -48,4 +49,17 @@ Foam::pTraits<uint8_t>::pTraits(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
uint8_t Foam::readUint8(Istream& is)
|
||||||
|
{
|
||||||
|
uint8_t val(0);
|
||||||
|
is >> val;
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
// IO operators are identical to direction, which is uint8_t
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -31,7 +31,6 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
uint8.C
|
uint8.C
|
||||||
uint8IO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -51,10 +50,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- A word representation of uint8 value
|
//- A word representation of uint8 value
|
||||||
@ -83,7 +78,9 @@ uint8_t readUint8(Istream& is);
|
|||||||
// IO operators are identical to direction, which is uint8_t
|
// IO operators are identical to direction, which is uint8_t
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Specialization pTraits<uint8_t>
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
//- Template specialization for pTraits<uint8_t>
|
//- Template specialization for pTraits<uint8_t>
|
||||||
template<>
|
template<>
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | www.openfoam.com
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
Copyright (C) 2020 OpenCFD Ltd.
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "uint8.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
uint8_t Foam::readUint8(Istream& is)
|
|
||||||
{
|
|
||||||
uint8_t val(0);
|
|
||||||
is >> val;
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IO operators are identical to direction, which is uint8_t
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -37,8 +37,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef Random_H
|
#ifndef Foam_Random_H
|
||||||
#define Random_H
|
#define Foam_Random_H
|
||||||
|
|
||||||
#include "Rand48.H"
|
#include "Rand48.H"
|
||||||
#include "label.H"
|
#include "label.H"
|
||||||
|
|||||||
@ -47,8 +47,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
class labelRanges;
|
class labelRanges;
|
||||||
Istream& operator>>(Istream& is, labelRanges& ranges);
|
Istream& operator>>(Istream& is, labelRanges& ranges);
|
||||||
Ostream& operator<<(Ostream& is, const labelRanges& ranges);
|
Ostream& operator<<(Ostream& is, const labelRanges& ranges);
|
||||||
|
|||||||
@ -56,7 +56,6 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class scalarRange;
|
class scalarRange;
|
||||||
class Ostream;
|
|
||||||
template<class T> class MinMax;
|
template<class T> class MinMax;
|
||||||
|
|
||||||
Ostream& operator<<(Ostream& os, const scalarRange& range);
|
Ostream& operator<<(Ostream& os, const scalarRange& range);
|
||||||
|
|||||||
@ -35,8 +35,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef sliceRange_H
|
#ifndef Foam_sliceRange_H
|
||||||
#define sliceRange_H
|
#define Foam_sliceRange_H
|
||||||
|
|
||||||
#include "label.H"
|
#include "label.H"
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -47,8 +47,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
template<class T> class List;
|
template<class T> class List;
|
||||||
template<class T, unsigned N> class FixedList;
|
template<class T, unsigned N> class FixedList;
|
||||||
|
|
||||||
|
|||||||
@ -54,11 +54,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
class spatialTransform;
|
class spatialTransform;
|
||||||
Istream& operator>>(Istream&, spatialTransform&);
|
Istream& operator>>(Istream&, spatialTransform&);
|
||||||
Ostream& operator<<(Ostream&, const spatialTransform&);
|
Ostream& operator<<(Ostream&, const spatialTransform&);
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
||||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -62,8 +61,8 @@ Description
|
|||||||
#ifndef Foam_contiguous_H
|
#ifndef Foam_contiguous_H
|
||||||
#define Foam_contiguous_H
|
#define Foam_contiguous_H
|
||||||
|
|
||||||
#include "scalarFwd.H"
|
|
||||||
#include "labelFwd.H"
|
#include "labelFwd.H"
|
||||||
|
#include "scalarFwd.H"
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -75,26 +74,17 @@ namespace Foam
|
|||||||
|
|
||||||
// Base definition for (integral | floating-point) as contiguous
|
// Base definition for (integral | floating-point) as contiguous
|
||||||
template<class T>
|
template<class T>
|
||||||
struct is_contiguous
|
struct is_contiguous : std::is_arithmetic<T> {};
|
||||||
:
|
|
||||||
std::is_arithmetic<T>
|
|
||||||
{};
|
|
||||||
|
|
||||||
|
|
||||||
// Base definition for 'label'
|
// Base definition for 'label'
|
||||||
template<class T>
|
template<class T>
|
||||||
struct is_contiguous_label
|
struct is_contiguous_label : std::is_same<T, label> {};
|
||||||
:
|
|
||||||
std::is_same<T, label>
|
|
||||||
{};
|
|
||||||
|
|
||||||
|
|
||||||
// Base definition for 'scalar'
|
// Base definition for 'scalar'
|
||||||
template<class T>
|
template<class T>
|
||||||
struct is_contiguous_scalar
|
struct is_contiguous_scalar : std::is_same<T, scalar> {};
|
||||||
:
|
|
||||||
std::is_same<T, scalar>
|
|
||||||
{};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -51,7 +51,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class one;
|
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
@ -63,11 +62,11 @@ class one
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- The value type
|
||||||
typedef one value_type;
|
typedef one value_type;
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class minus;
|
class minus;
|
||||||
class null;
|
|
||||||
|
|
||||||
//- Default construct
|
//- Default construct
|
||||||
constexpr one() noexcept {}
|
constexpr one() noexcept {}
|
||||||
@ -113,6 +112,7 @@ class one::minus
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- The value type
|
||||||
typedef minus value_type;
|
typedef minus value_type;
|
||||||
|
|
||||||
//- Default construct
|
//- Default construct
|
||||||
@ -148,27 +148,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class one::null Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
//- A Foam::one class with a null output adapter.
|
|
||||||
class one::null
|
|
||||||
:
|
|
||||||
public one
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef null value_type;
|
|
||||||
|
|
||||||
//- Default construct
|
|
||||||
constexpr null() noexcept {}
|
|
||||||
|
|
||||||
//- Construct from Istream consumes no content.
|
|
||||||
explicit constexpr null(Istream&) noexcept {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Global one (1)
|
//- Global one (1)
|
||||||
@ -188,12 +167,6 @@ inline constexpr Istream& operator>>(Istream& is, one::minus&) noexcept
|
|||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Write to Ostream emits no content.
|
|
||||||
inline constexpr Ostream& operator<<(Ostream& os, const one::null&) noexcept
|
|
||||||
{
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
class Istream;
|
||||||
|
class Ostream;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class pTraits Declaration
|
Class pTraits Declaration
|
||||||
@ -76,6 +77,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class zero_one Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
//- Represents 0/1 range or concept. Used for tagged dispatch or clamping
|
||||||
|
class zero_one {};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -52,8 +52,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class zero;
|
|
||||||
class zero_one;
|
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
@ -65,6 +63,7 @@ class zero
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- The value type
|
||||||
typedef zero value_type;
|
typedef zero value_type;
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
@ -133,24 +132,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class zero_one Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
//- Represents 0/1 concept, eg for tagged dispatch
|
|
||||||
class zero_one
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef zero_one value_type;
|
|
||||||
|
|
||||||
//- Default construct
|
|
||||||
constexpr zero_one() noexcept {}
|
|
||||||
|
|
||||||
//- Construct from Istream consumes no content.
|
|
||||||
explicit constexpr zero_one(Istream&) noexcept {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Global zero (0)
|
//- Global zero (0)
|
||||||
|
|||||||
@ -49,7 +49,6 @@ Author
|
|||||||
#include "tmp.H"
|
#include "tmp.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "dimensionedTypes.H"
|
#include "dimensionedTypes.H"
|
||||||
#include "zero.H"
|
|
||||||
#include "className.H"
|
#include "className.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -110,7 +110,7 @@ public:
|
|||||||
gradcf = stabilise(gradcf, SMALL);
|
gradcf = stabilise(gradcf, SMALL);
|
||||||
|
|
||||||
scalar phict = 1 - 0.5*gradf/gradcf;
|
scalar phict = 1 - 0.5*gradf/gradcf;
|
||||||
scalar limiter = clamp(phict/k_, 0, 1);
|
scalar limiter = clamp(phict/k_, zero_one{});
|
||||||
|
|
||||||
return lerp(udWeight, cdWeight, limiter);
|
return lerp(udWeight, cdWeight, limiter);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,10 +52,8 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class eddy;
|
class eddy;
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
bool operator==(const eddy& a, const eddy& b);
|
bool operator==(const eddy& a, const eddy& b);
|
||||||
bool operator!=(const eddy& a, const eddy& b);
|
bool operator!=(const eddy& a, const eddy& b);
|
||||||
|
|||||||
@ -40,7 +40,6 @@ SourceFiles
|
|||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
#include "fvMatrix.H"
|
#include "fvMatrix.H"
|
||||||
#include "zero.H"
|
|
||||||
#include "one.H"
|
#include "one.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -49,7 +49,6 @@ SourceFiles
|
|||||||
#include "tmp.H"
|
#include "tmp.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "dimensionedTypes.H"
|
#include "dimensionedTypes.H"
|
||||||
#include "zero.H"
|
|
||||||
#include "className.H"
|
#include "className.H"
|
||||||
#include "lduPrimitiveMeshAssembly.H"
|
#include "lduPrimitiveMeshAssembly.H"
|
||||||
#include "lduMesh.H"
|
#include "lduMesh.H"
|
||||||
|
|||||||
@ -49,7 +49,6 @@ SourceFiles
|
|||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
#include "primitiveFieldsFwd.H"
|
#include "primitiveFieldsFwd.H"
|
||||||
#include "geometricOneField.H"
|
#include "geometricOneField.H"
|
||||||
#include "zero.H"
|
|
||||||
#include "zeroField.H"
|
#include "zeroField.H"
|
||||||
#include "UPtrList.H"
|
#include "UPtrList.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public:
|
|||||||
faceFlux, phiP, phiN, gradcP, gradcN, d
|
faceFlux, phiP, phiN, gradcP, gradcN, d
|
||||||
);
|
);
|
||||||
|
|
||||||
return clamp(phict/k_, 0, 1);
|
return clamp(phict/k_, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ public:
|
|||||||
faceFlux, phiP, phiN, gradcP, gradcN, d
|
faceFlux, phiP, phiN, gradcP, gradcN, d
|
||||||
);
|
);
|
||||||
|
|
||||||
return clamp(r, 0, 1);
|
return clamp(r, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public:
|
|||||||
((faceFlux - phiU)/stabilise(phiCD - phiU, SMALL) + k_);
|
((faceFlux - phiU)/stabilise(phiCD - phiU, SMALL) + k_);
|
||||||
|
|
||||||
// Limit the limiter between upwind and central
|
// Limit the limiter between upwind and central
|
||||||
return clamp(PLimiter, 0, 1);
|
return clamp(PLimiter, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -141,7 +141,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Limit the limiter between linear and upwind
|
// Limit the limiter between linear and upwind
|
||||||
return clamp(limiter, 0, 1);
|
return clamp(limiter, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -143,7 +143,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Limit the limiter between linear and upwind
|
// Limit the limiter between linear and upwind
|
||||||
return clamp(limiter, 0, 1);
|
return clamp(limiter, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ public:
|
|||||||
scalar limiter = 1 - k_*(dN - df)*(dP - df)/max(sqr(dN + dP), SMALL);
|
scalar limiter = 1 - k_*(dN - df)*(dP - df)/max(sqr(dN + dP), SMALL);
|
||||||
|
|
||||||
// Limit the limiter between linear and upwind
|
// Limit the limiter between linear and upwind
|
||||||
return clamp(limiter, 0, 1);
|
return clamp(limiter, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ public:
|
|||||||
scalar limiter = 1 - k_*(dN - df)*(dP - df)/max(sqr(dN + dP), SMALL);
|
scalar limiter = 1 - k_*(dN - df)*(dP - df)/max(sqr(dN + dP), SMALL);
|
||||||
|
|
||||||
// Limit the limiter between linear and upwind
|
// Limit the limiter between linear and upwind
|
||||||
return clamp(limiter, 0, 1);
|
return clamp(limiter, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public:
|
|||||||
faceFlux, phiP, phiN, gradcP, gradcN, d
|
faceFlux, phiP, phiN, gradcP, gradcN, d
|
||||||
);
|
);
|
||||||
|
|
||||||
return clamp(twoByk_*r, 0, 1);
|
return clamp(twoByk_*r, zero_one{});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Description
|
|||||||
face-based Courant number and the lower and upper Courant number limits
|
face-based Courant number and the lower and upper Courant number limits
|
||||||
supplied:
|
supplied:
|
||||||
\f[
|
\f[
|
||||||
weight = 1 - clamp((Co - Co1)/(Co2 - Co1), 0, 1)
|
weight = 1 - clamp((Co - Co1)/(Co2 - Co1), zero_one{})
|
||||||
\f]
|
\f]
|
||||||
where
|
where
|
||||||
\vartable
|
\vartable
|
||||||
|
|||||||
@ -49,16 +49,13 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
namespace functionObjects
|
namespace functionObjects
|
||||||
{
|
{
|
||||||
|
// Forward Declarations
|
||||||
class eulerianParticle;
|
class eulerianParticle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
Istream& operator>>(Istream&, functionObjects::eulerianParticle&);
|
Istream& operator>>(Istream&, functionObjects::eulerianParticle&);
|
||||||
Ostream& operator<<(Ostream&, const functionObjects::eulerianParticle&);
|
Ostream& operator<<(Ostream&, const functionObjects::eulerianParticle&);
|
||||||
|
|
||||||
|
|||||||
@ -92,15 +92,13 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
class objectRegistry;
|
class objectRegistry;
|
||||||
|
|
||||||
namespace functionObjects
|
namespace functionObjects
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
class fieldAverageItem;
|
class fieldAverageItem;
|
||||||
Istream& operator>>(Istream&, fieldAverageItem&);
|
Istream& operator>>(Istream&, fieldAverageItem&);
|
||||||
Ostream& operator<<(Ostream&, const fieldAverageItem&);
|
Ostream& operator<<(Ostream&, const fieldAverageItem&);
|
||||||
|
|||||||
@ -670,7 +670,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
|
|||||||
// Uniformity index
|
// Uniformity index
|
||||||
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
|
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
|
||||||
|
|
||||||
return clamp(ui, 0, 1);
|
return clamp(ui, zero_one{});
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -756,7 +756,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
|
|||||||
// Uniformity index
|
// Uniformity index
|
||||||
const scalar ui = 1 - numer/(2*mag(mean*areaTotal) + ROOTVSMALL);
|
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:
|
default:
|
||||||
|
|||||||
@ -152,7 +152,7 @@ Description
|
|||||||
For option 6, the following relation is used:
|
For option 6, the following relation is used:
|
||||||
|
|
||||||
\f[
|
\f[
|
||||||
fCoWeight = clamp((Co - Co1)/(Co2 - Co1), 0, 1)
|
fCoWeight = clamp((Co - Co1)/(Co2 - Co1), zero_one{});
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
where
|
where
|
||||||
|
|||||||
@ -147,7 +147,7 @@ void Foam::fv::solidificationMeltingSource::update(const volScalarField& Cp)
|
|||||||
scalar Cpc = Cp[celli];
|
scalar Cpc = Cp[celli];
|
||||||
scalar alpha1New = alpha1_[celli] + relax_*Cpc*(Tc - Tmelt_)/L_;
|
scalar alpha1New = alpha1_[celli] + relax_*Cpc*(Tc - Tmelt_)/L_;
|
||||||
|
|
||||||
alpha1_[celli] = clamp(alpha1New, 0, 1);
|
alpha1_[celli] = clamp(alpha1New, zero_one{});
|
||||||
deltaT_[i] = Tc - Tmelt_;
|
deltaT_[i] = Tc - Tmelt_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,16 +95,13 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
namespace distributionModels
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
// Forward Declarations
|
||||||
class binned;
|
class binned;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
Istream& operator>>(Istream&, distributionModels::binned&);
|
Istream& operator>>(Istream&, distributionModels::binned&);
|
||||||
Ostream& operator<<(Ostream&, const distributionModels::binned&);
|
Ostream& operator<<(Ostream&, const distributionModels::binned&);
|
||||||
|
|
||||||
|
|||||||
@ -106,17 +106,13 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
namespace distributionModels
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
// Forward Declarations
|
||||||
class general;
|
class general;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
Istream& operator>>(Istream&, distributionModels::general&);
|
Istream& operator>>(Istream&, distributionModels::general&);
|
||||||
Ostream& operator<<(Ostream&, const distributionModels::general&);
|
Ostream& operator<<(Ostream&, const distributionModels::general&);
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ Foam::forceSuSp Foam::DistortedSphereDragForce<CloudType>::calcCoupled
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Limit the drop distortion to y=0 (sphere) and y=1 (disk)
|
// Limit the drop distortion to y=0 (sphere) and y=1 (disk)
|
||||||
const scalar y = clamp(p.y(), 0, 1);
|
const scalar y = clamp(p.y(), zero_one{});
|
||||||
|
|
||||||
// (LMR:Eq. 10)
|
// (LMR:Eq. 10)
|
||||||
return
|
return
|
||||||
|
|||||||
@ -361,7 +361,7 @@ Foam::scalar Foam::SprayParcel<ParcelType>::chi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return clamp(chi, 0, 1);
|
return clamp(chi, zero_one{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -257,7 +257,7 @@ void Foam::lumpedPointMovement::readDict(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
relax_ = dict.getOrDefault<scalar>("relax", 1);
|
relax_ = dict.getOrDefault<scalar>("relax", 1);
|
||||||
relax_ = clamp(relax_, 0, 1);
|
relax_ = clamp(relax_, zero_one{});
|
||||||
|
|
||||||
forcesDict_.merge(dict.subOrEmptyDict("forces"));
|
forcesDict_.merge(dict.subOrEmptyDict("forces"));
|
||||||
|
|
||||||
|
|||||||
@ -77,10 +77,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class lumpedPointState Declaration
|
Class lumpedPointState Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -58,8 +58,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
class gradingDescriptor;
|
class gradingDescriptor;
|
||||||
class gradingDescriptors;
|
class gradingDescriptors;
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class gradingDescriptors;
|
class gradingDescriptors;
|
||||||
Istream& operator>>(Istream& is, gradingDescriptors& gd);
|
Istream& operator>>(Istream& is, gradingDescriptors& gd);
|
||||||
|
|
||||||
|
|||||||
@ -37,14 +37,14 @@ SourceFiles
|
|||||||
#ifndef PointIntegrateData_H
|
#ifndef PointIntegrateData_H
|
||||||
#define PointIntegrateData_H
|
#define PointIntegrateData_H
|
||||||
|
|
||||||
|
#include "UList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
template<class DataType> class PointIntegrateData;
|
template<class DataType> class PointIntegrateData;
|
||||||
|
|
||||||
template<class DataType>
|
template<class DataType>
|
||||||
|
|||||||
@ -38,11 +38,10 @@ SourceFiles
|
|||||||
#ifndef patchEdgeFaceInfo_H
|
#ifndef patchEdgeFaceInfo_H
|
||||||
#define patchEdgeFaceInfo_H
|
#define patchEdgeFaceInfo_H
|
||||||
|
|
||||||
#include "point.H"
|
|
||||||
#include "label.H"
|
#include "label.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
|
#include "point.H"
|
||||||
#include "tensor.H"
|
#include "tensor.H"
|
||||||
#include "pTraits.H"
|
|
||||||
#include "primitivePatch.H"
|
#include "primitivePatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -48,8 +48,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
template<class DataType> class PointData;
|
template<class DataType> class PointData;
|
||||||
|
|
||||||
template<class DataType>
|
template<class DataType>
|
||||||
|
|||||||
@ -41,11 +41,10 @@ SourceFiles
|
|||||||
#ifndef Foam_pointEdgePoint_H
|
#ifndef Foam_pointEdgePoint_H
|
||||||
#define Foam_pointEdgePoint_H
|
#define Foam_pointEdgePoint_H
|
||||||
|
|
||||||
#include "point.H"
|
|
||||||
#include "label.H"
|
#include "label.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
|
#include "point.H"
|
||||||
#include "tensor.H"
|
#include "tensor.H"
|
||||||
#include "pTraits.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef edgeMeshTools_H
|
#ifndef Foam_edgeMeshTools_H
|
||||||
#define edgeMeshTools_H
|
#define Foam_edgeMeshTools_H
|
||||||
|
|
||||||
#include "tmp.H"
|
#include "tmp.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
@ -46,12 +46,12 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward Declarations
|
||||||
class edgeMesh;
|
class edgeMesh;
|
||||||
class extendedEdgeMesh;
|
class extendedEdgeMesh;
|
||||||
class extendedFeatureEdgeMesh;
|
class extendedFeatureEdgeMesh;
|
||||||
class triSurface;
|
class triSurface;
|
||||||
class Time;
|
class Time;
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Namespace edgeMeshTools Declaration
|
Namespace edgeMeshTools Declaration
|
||||||
|
|||||||
@ -614,7 +614,7 @@ void Foam::MassTransferPhaseSystem<BasePhaseSystem>::alphaTransfer
|
|||||||
scalar dmdt21 = dmdtNet[celli];
|
scalar dmdt21 = dmdtNet[celli];
|
||||||
scalar coeffs12Cell = coeffs12[celli];
|
scalar coeffs12Cell = coeffs12[celli];
|
||||||
|
|
||||||
scalar alpha1Limited = clamp(alpha1[celli], 0, 1);
|
scalar alpha1Limited = clamp(alpha1[celli], zero_one{});
|
||||||
|
|
||||||
// exp.
|
// exp.
|
||||||
SuPhase1[celli] += coeffs1[celli]*dmdt21;
|
SuPhase1[celli] += coeffs1[celli]*dmdt21;
|
||||||
@ -657,7 +657,7 @@ void Foam::MassTransferPhaseSystem<BasePhaseSystem>::alphaTransfer
|
|||||||
scalar dmdt12 = -dmdtNet[celli];
|
scalar dmdt12 = -dmdtNet[celli];
|
||||||
scalar coeffs21Cell = -coeffs12[celli];
|
scalar coeffs21Cell = -coeffs12[celli];
|
||||||
|
|
||||||
scalar alpha2Limited = clamp(alpha2[celli], 0, 1);
|
scalar alpha2Limited = clamp(alpha2[celli], zero_one{});
|
||||||
|
|
||||||
// exp
|
// exp
|
||||||
SuPhase2[celli] += coeffs2[celli]*dmdt12;
|
SuPhase2[celli] += coeffs2[celli]*dmdt12;
|
||||||
|
|||||||
@ -57,15 +57,10 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
namespace RBD
|
namespace RBD
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
class rigidBodyInertia;
|
class rigidBodyInertia;
|
||||||
Istream& operator>>(Istream&, rigidBodyInertia&);
|
Istream& operator>>(Istream&, rigidBodyInertia&);
|
||||||
Ostream& operator<<(Ostream&, const rigidBodyInertia&);
|
Ostream& operator<<(Ostream&, const rigidBodyInertia&);
|
||||||
|
|||||||
@ -47,15 +47,10 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
namespace RBD
|
namespace RBD
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward Declarations
|
||||||
class rigidBodyModelState;
|
class rigidBodyModelState;
|
||||||
Istream& operator>>(Istream&, rigidBodyModelState&);
|
Istream& operator>>(Istream&, rigidBodyModelState&);
|
||||||
Ostream& operator<<(Ostream&, const rigidBodyModelState&);
|
Ostream& operator<<(Ostream&, const rigidBodyModelState&);
|
||||||
|
|||||||
@ -56,8 +56,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef isoSurfaceParams_H
|
#ifndef Foam_isoSurfaceParams_H
|
||||||
#define isoSurfaceParams_H
|
#define Foam_isoSurfaceParams_H
|
||||||
|
|
||||||
#include "boundBox.H"
|
#include "boundBox.H"
|
||||||
#include "Enum.H"
|
#include "Enum.H"
|
||||||
@ -69,7 +69,6 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class dictionary;
|
class dictionary;
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class isoSurfaceSelector Declaration
|
Class isoSurfaceSelector Declaration
|
||||||
|
|||||||
@ -233,7 +233,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
g_ = g.value();
|
g_ = g.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
// scalar ramp = clamp((t.value() - 5)/10, 0, 1);
|
// scalar ramp = clamp((t.value() - 5)/10, zero_one{});
|
||||||
scalar ramp = 1.0;
|
scalar ramp = 1.0;
|
||||||
|
|
||||||
motion_.update
|
motion_.update
|
||||||
|
|||||||
@ -54,8 +54,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
class sixDoFRigidBodyMotionState;
|
class sixDoFRigidBodyMotionState;
|
||||||
Istream& operator>>(Istream&, sixDoFRigidBodyMotionState&);
|
Istream& operator>>(Istream&, sixDoFRigidBodyMotionState&);
|
||||||
Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&);
|
Ostream& operator<<(Ostream&, const sixDoFRigidBodyMotionState&);
|
||||||
|
|||||||
@ -76,8 +76,6 @@ namespace Foam
|
|||||||
class Time;
|
class Time;
|
||||||
class surfMesh;
|
class surfMesh;
|
||||||
class polyBoundaryMesh;
|
class polyBoundaryMesh;
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
template<class Face> class MeshedSurface;
|
template<class Face> class MeshedSurface;
|
||||||
template<class Face> class MeshedSurfaceProxy;
|
template<class Face> class MeshedSurfaceProxy;
|
||||||
|
|||||||
@ -64,8 +64,6 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward Declarations
|
// Forward Declarations
|
||||||
class Time;
|
class Time;
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
template<class Face> class MeshedSurface;
|
template<class Face> class MeshedSurface;
|
||||||
template<class Face> class MeshedSurfaceProxy;
|
template<class Face> class MeshedSurfaceProxy;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user