STYLE: IOstreams with float/double instead of floatScalar/doubleScalar

- consistent with defining IO of int32_t/int64_t and with recent
  changes to ensightFile. Using the primitives directly instead of
  typedefs to them makes the code somewhat less opaque.
This commit is contained in:
Mark Olesen 2022-07-22 15:37:34 +02:00
parent a4a8f77b7b
commit 6320bab2b5
30 changed files with 122 additions and 127 deletions

View File

@ -28,15 +28,14 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
using namespace Foam; #include "scalar.H"
#include "floatScalar.H"
#include "doubleScalar.H"
#include "complex.H" #include "complex.H"
#include "Matrix.H" #include "Matrix.H"
#include "Random.H" #include "Random.H"
#include <chrono> #include <chrono>
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Total number of unit tests // Total number of unit tests

View File

@ -38,8 +38,7 @@ Description
#include "DiagonalMatrix.H" #include "DiagonalMatrix.H"
#include "RectangularMatrix.H" #include "RectangularMatrix.H"
#include "floatScalar.H" #include "scalar.H"
#include "doubleScalar.H"
#include "complex.H" #include "complex.H"
#include "TestTools.H" #include "TestTools.H"

View File

@ -44,8 +44,7 @@ Note
#include "RectangularMatrix.H" #include "RectangularMatrix.H"
#include "SquareMatrix.H" #include "SquareMatrix.H"
#include "floatScalar.H" #include "scalar.H"
#include "doubleScalar.H"
#include "complex.H" #include "complex.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "TestTools.H" #include "TestTools.H"

View File

@ -45,8 +45,7 @@ Note
#include "scalarMatrices.H" #include "scalarMatrices.H"
#include "RectangularMatrix.H" #include "RectangularMatrix.H"
#include "SquareMatrix.H" #include "SquareMatrix.H"
#include "floatScalar.H" #include "scalar.H"
#include "doubleScalar.H"
#include "complex.H" #include "complex.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "TestTools.H" #include "TestTools.H"

View File

@ -46,8 +46,7 @@ Note
#include "RectangularMatrix.H" #include "RectangularMatrix.H"
#include "SquareMatrix.H" #include "SquareMatrix.H"
#include "SymmetricSquareMatrix.H" #include "SymmetricSquareMatrix.H"
#include "floatScalar.H" #include "scalar.H"
#include "doubleScalar.H"
#include "complex.H" #include "complex.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "Random.H" #include "Random.H"

View File

@ -232,13 +232,13 @@ vtk::outputOptions getOutputOptions(const argList& args)
if (!args.found("ascii")) if (!args.found("ascii"))
{ {
if (sizeof(floatScalar) != 4 || sizeof(label) != 4) if (sizeof(float) != 4 || sizeof(label) != 4)
{ {
opts.ascii(true); opts.ascii(true);
WarningInFunction WarningInFunction
<< "Using ASCII rather than legacy binary VTK format since " << "Using ASCII rather than legacy binary VTK format since "
<< "floatScalar and/or label are not 4 bytes in size." << "float and/or label are not 4 bytes in size."
<< nl << endl; << nl << endl;
} }
else else

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -156,11 +156,11 @@ public:
//- Read a label //- Read a label
virtual Istream& read(label&) = 0; virtual Istream& read(label&) = 0;
//- Read a floatScalar //- Read a float
virtual Istream& read(floatScalar&) = 0; virtual Istream& read(float&) = 0;
//- Read a doubleScalar //- Read a double
virtual Istream& read(doubleScalar&) = 0; virtual Istream& read(double&) = 0;
//- Read binary block //- Read binary block
virtual Istream& read(char*, std::streamsize) = 0; virtual Istream& read(char*, std::streamsize) = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2021 OpenCFD Ltd. Copyright (C) 2016-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -147,11 +147,11 @@ public:
//- Write int64_t //- Write int64_t
virtual Ostream& write(const int64_t val) = 0; virtual Ostream& write(const int64_t val) = 0;
//- Write floatScalar //- Write float
virtual Ostream& write(const floatScalar val) = 0; virtual Ostream& write(const float val) = 0;
//- Write doubleScalar //- Write double
virtual Ostream& write(const doubleScalar val) = 0; virtual Ostream& write(const double val) = 0;
//- Write binary block. //- Write binary block.
virtual Ostream& write(const char* data, std::streamsize count) = 0; virtual Ostream& write(const char* data, std::streamsize count) = 0;

View File

@ -156,11 +156,11 @@ public:
//- Read a label //- Read a label
Istream& read(label& val); Istream& read(label& val);
//- Read a floatScalar //- Read a float
Istream& read(floatScalar& val); Istream& read(float& val);
//- Read a doubleScalar //- Read a double
Istream& read(doubleScalar& val); Istream& read(double& val);
//- Read binary block with 8-byte alignment. //- Read binary block with 8-byte alignment.
Istream& read(char* data, std::streamsize count); Istream& read(char* data, std::streamsize count);

View File

@ -359,7 +359,7 @@ Foam::Istream& Foam::UIPstreamBase::read(token& t)
// Float // Float
case token::tokenType::FLOAT : case token::tokenType::FLOAT :
{ {
floatScalar val; float val;
if (read(val)) if (read(val))
{ {
t = val; t = val;
@ -374,7 +374,7 @@ Foam::Istream& Foam::UIPstreamBase::read(token& t)
// Double // Double
case token::tokenType::DOUBLE : case token::tokenType::DOUBLE :
{ {
doubleScalar val; double val;
if (read(val)) if (read(val))
{ {
t = val; t = val;
@ -432,14 +432,14 @@ Foam::Istream& Foam::UIPstreamBase::read(label& val)
} }
Foam::Istream& Foam::UIPstreamBase::read(floatScalar& val) Foam::Istream& Foam::UIPstreamBase::read(float& val)
{ {
readFromBuffer(val); readFromBuffer(val);
return *this; return *this;
} }
Foam::Istream& Foam::UIPstreamBase::read(doubleScalar& val) Foam::Istream& Foam::UIPstreamBase::read(double& val)
{ {
readFromBuffer(val); readFromBuffer(val);
return *this; return *this;

View File

@ -173,11 +173,11 @@ public:
//- Write int64_t as a label //- Write int64_t as a label
virtual Ostream& write(const int64_t val); virtual Ostream& write(const int64_t val);
//- Write floatScalar //- Write float
virtual Ostream& write(const floatScalar val); virtual Ostream& write(const float val);
//- Write doubleScalar //- Write double
virtual Ostream& write(const doubleScalar val); virtual Ostream& write(const double val);
//- Write binary block with 8-byte alignment. //- Write binary block with 8-byte alignment.
virtual Ostream& write(const char* data, std::streamsize count); virtual Ostream& write(const char* data, std::streamsize count);

View File

@ -304,7 +304,7 @@ Foam::Ostream& Foam::UOPstreamBase::write(const int64_t val)
} }
Foam::Ostream& Foam::UOPstreamBase::write(const floatScalar val) Foam::Ostream& Foam::UOPstreamBase::write(const float val)
{ {
putChar(token::tokenType::FLOAT); putChar(token::tokenType::FLOAT);
writeToBuffer(val); writeToBuffer(val);
@ -312,7 +312,7 @@ Foam::Ostream& Foam::UOPstreamBase::write(const floatScalar val)
} }
Foam::Ostream& Foam::UOPstreamBase::write(const doubleScalar val) Foam::Ostream& Foam::UOPstreamBase::write(const double val)
{ {
putChar(token::tokenType::DOUBLE); putChar(token::tokenType::DOUBLE);
writeToBuffer(val); writeToBuffer(val);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -1001,7 +1001,7 @@ Foam::Istream& Foam::ISstream::read(label& val)
} }
Foam::Istream& Foam::ISstream::read(floatScalar& val) Foam::Istream& Foam::ISstream::read(float& val)
{ {
is_ >> val; is_ >> val;
setState(is_.rdstate()); setState(is_.rdstate());
@ -1009,7 +1009,7 @@ Foam::Istream& Foam::ISstream::read(floatScalar& val)
} }
Foam::Istream& Foam::ISstream::read(doubleScalar& val) Foam::Istream& Foam::ISstream::read(double& val)
{ {
is_ >> val; is_ >> val;
setState(is_.rdstate()); setState(is_.rdstate());

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef ISstream_H #ifndef Foam_ISstream_H
#define ISstream_H #define Foam_ISstream_H
#include "Istream.H" #include "Istream.H"
#include "fileName.H" #include "fileName.H"
@ -183,11 +183,11 @@ public:
//- Read a label //- Read a label
virtual Istream& read(label& val); virtual Istream& read(label& val);
//- Read a floatScalar //- Read a float
virtual Istream& read(floatScalar& val); virtual Istream& read(float& val);
//- Read a doubleScalar //- Read a double
virtual Istream& read(doubleScalar& val); virtual Istream& read(double& val);
//- Read binary block //- Read binary block
virtual Istream& read(char* buf, std::streamsize count); virtual Istream& read(char* buf, std::streamsize count);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -196,7 +196,7 @@ Foam::Ostream& Foam::OSstream::write(const int64_t val)
} }
Foam::Ostream& Foam::OSstream::write(const floatScalar val) Foam::Ostream& Foam::OSstream::write(const float val)
{ {
os_ << val; os_ << val;
setState(os_.rdstate()); setState(os_.rdstate());
@ -204,7 +204,7 @@ Foam::Ostream& Foam::OSstream::write(const floatScalar val)
} }
Foam::Ostream& Foam::OSstream::write(const doubleScalar val) Foam::Ostream& Foam::OSstream::write(const double val)
{ {
os_ << val; os_ << val;
setState(os_.rdstate()); setState(os_.rdstate());

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef OSstream_H #ifndef Foam_OSstream_H
#define OSstream_H #define Foam_OSstream_H
#include "Ostream.H" #include "Ostream.H"
#include "fileName.H" #include "fileName.H"
@ -155,11 +155,11 @@ public:
//- Write int64_t //- Write int64_t
virtual Ostream& write(const int64_t val); virtual Ostream& write(const int64_t val);
//- Write floatScalar //- Write float
virtual Ostream& write(const floatScalar val); virtual Ostream& write(const float val);
//- Write doubleScalar //- Write double
virtual Ostream& write(const doubleScalar val); virtual Ostream& write(const double val);
//- Write binary block //- Write binary block
virtual Ostream& write(const char* data, std::streamsize count); virtual Ostream& write(const char* data, std::streamsize count);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -140,14 +140,14 @@ Foam::Ostream& Foam::prefixOSstream::write(const int64_t val)
} }
Foam::Ostream& Foam::prefixOSstream::write(const floatScalar val) Foam::Ostream& Foam::prefixOSstream::write(const float val)
{ {
checkWritePrefix(); checkWritePrefix();
return OSstream::write(val); return OSstream::write(val);
} }
Foam::Ostream& Foam::prefixOSstream::write(const doubleScalar val) Foam::Ostream& Foam::prefixOSstream::write(const double val)
{ {
checkWritePrefix(); checkWritePrefix();
return OSstream::write(val); return OSstream::write(val);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2020-2021 OpenCFD Ltd. Copyright (C) 2020-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef prefixOSstream_H #ifndef Foam_prefixOSstream_H
#define prefixOSstream_H #define Foam_prefixOSstream_H
#include "OSstream.H" #include "OSstream.H"
@ -143,11 +143,11 @@ public:
//- Write int64_t //- Write int64_t
virtual Ostream& write(const int64_t val); virtual Ostream& write(const int64_t val);
//- Write floatScalar //- Write float
virtual Ostream& write(const floatScalar val); virtual Ostream& write(const float val);
//- Write doubleScalar //- Write double
virtual Ostream& write(const doubleScalar val); virtual Ostream& write(const double val);
//- Write binary block //- Write binary block
virtual Ostream& write(const char* buf, std::streamsize count); virtual Ostream& write(const char* buf, std::streamsize count);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -530,14 +530,14 @@ Foam::Istream& Foam::ITstream::read(label&)
} }
Foam::Istream& Foam::ITstream::read(floatScalar&) Foam::Istream& Foam::ITstream::read(float&)
{ {
NotImplemented; NotImplemented;
return *this; return *this;
} }
Foam::Istream& Foam::ITstream::read(doubleScalar&) Foam::Istream& Foam::ITstream::read(double&)
{ {
NotImplemented; NotImplemented;
return *this; return *this;

View File

@ -304,11 +304,11 @@ public:
//- Read a label //- Read a label
virtual Istream& read(label&); virtual Istream& read(label&);
//- Read a floatScalar //- Read a float
virtual Istream& read(floatScalar&); virtual Istream& read(float&);
//- Read a doubleScalar //- Read a double
virtual Istream& read(doubleScalar&); virtual Istream& read(double&);
//- Read binary block //- Read binary block
// \note Not implemented // \note Not implemented

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -125,7 +125,7 @@ Foam::Ostream& Foam::OTstream::write(const int64_t val)
} }
Foam::Ostream& Foam::OTstream::write(const floatScalar val) Foam::Ostream& Foam::OTstream::write(const float val)
{ {
append(token(val)); // tokenType::FLOAT append(token(val)); // tokenType::FLOAT
@ -133,7 +133,7 @@ Foam::Ostream& Foam::OTstream::write(const floatScalar val)
} }
Foam::Ostream& Foam::OTstream::write(const doubleScalar val) Foam::Ostream& Foam::OTstream::write(const double val)
{ {
append(token(val)); // tokenType::DOUBLE append(token(val)); // tokenType::DOUBLE

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef OTstream_H #ifndef Foam_OTstream_H
#define OTstream_H #define Foam_OTstream_H
#include "token.H" #include "token.H"
#include "Ostream.H" #include "Ostream.H"
@ -146,11 +146,11 @@ public:
//- Write int64_t as a label //- Write int64_t as a label
virtual Ostream& write(const int64_t val); virtual Ostream& write(const int64_t val);
//- Write floatScalar //- Write float
virtual Ostream& write(const floatScalar val); virtual Ostream& write(const float val);
//- Write doubleScalar //- Write double
virtual Ostream& write(const doubleScalar val); virtual Ostream& write(const double val);
//- Write binary block with 8-byte alignment. //- Write binary block with 8-byte alignment.
virtual Ostream& write(const char* data, std::streamsize count); virtual Ostream& write(const char* data, std::streamsize count);

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd. Copyright (C) 2019-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,8 +40,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef dummyISstream_H #ifndef Foam_dummyISstream_H
#define dummyISstream_H #define Foam_dummyISstream_H
#include "StringStream.H" #include "StringStream.H"
@ -108,15 +108,15 @@ public:
return *this; return *this;
} }
//- Read a floatScalar //- Read a float
virtual Istream& read(floatScalar&) virtual Istream& read(float&)
{ {
NotImplemented; NotImplemented;
return *this; return *this;
} }
//- Read a doubleScalar //- Read a double
virtual Istream& read(doubleScalar&) virtual Istream& read(double&)
{ {
NotImplemented; NotImplemented;
return *this; return *this;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -307,8 +307,8 @@ private:
int flagVal; // bitmask - stored as int, not enum int flagVal; // bitmask - stored as int, not enum
punctuationToken punctuationVal; punctuationToken punctuationVal;
label labelVal; label labelVal;
floatScalar floatVal; float floatVal;
doubleScalar doubleVal; double doubleVal;
// Pointers // Pointers
word* wordPtr; word* wordPtr;
@ -365,10 +365,10 @@ public:
inline explicit token(const label val, label lineNum=0) noexcept; inline explicit token(const label val, label lineNum=0) noexcept;
//- Construct float token //- Construct float token
inline explicit token(const floatScalar val, label lineNum=0) noexcept; inline explicit token(const float val, label lineNum=0) noexcept;
//- Construct double token //- Construct double token
inline explicit token(const doubleScalar val, label lineNum=0) noexcept; inline explicit token(const double val, label lineNum=0) noexcept;
//- Copy construct word token //- Copy construct word token
inline explicit token(const word& w, label lineNum=0); inline explicit token(const word& w, label lineNum=0);
@ -531,11 +531,11 @@ public:
//- Return float value. //- Return float value.
// Report FatalIOError and return \b 0 if token is not FLOAT // Report FatalIOError and return \b 0 if token is not FLOAT
inline floatScalar floatToken() const; inline float floatToken() const;
//- Return double value. //- Return double value.
// Report FatalIOError and return \b 0 if token is not DOUBLE // Report FatalIOError and return \b 0 if token is not DOUBLE
inline doubleScalar doubleToken() const; inline double doubleToken() const;
//- Return float or double value. //- Return float or double value.
// Report FatalIOError and return \b 0 if token is not a // Report FatalIOError and return \b 0 if token is not a
@ -607,10 +607,10 @@ public:
inline void operator=(const label val); inline void operator=(const label val);
//- Copy assign from float //- Copy assign from float
inline void operator=(const floatScalar val); inline void operator=(const float val);
//- Copy assign from double //- Copy assign from double
inline void operator=(const doubleScalar val); inline void operator=(const double val);
//- Copy assign from word content //- Copy assign from word content
inline void operator=(const word& w); inline void operator=(const word& w);
@ -636,8 +636,8 @@ public:
inline bool operator==(const token& tok) const; inline bool operator==(const token& tok) const;
inline bool operator==(const punctuationToken p) const noexcept; inline bool operator==(const punctuationToken p) const noexcept;
inline bool operator==(const label val) const noexcept; inline bool operator==(const label val) const noexcept;
inline bool operator==(const floatScalar val) const noexcept; inline bool operator==(const float val) const noexcept;
inline bool operator==(const doubleScalar val) const noexcept; inline bool operator==(const double val) const noexcept;
inline bool operator==(const std::string& s) const; inline bool operator==(const std::string& s) const;
@ -646,8 +646,8 @@ public:
inline bool operator!=(const token& tok) const; inline bool operator!=(const token& tok) const;
inline bool operator!=(const punctuationToken p) const noexcept; inline bool operator!=(const punctuationToken p) const noexcept;
inline bool operator!=(const label val) const noexcept; inline bool operator!=(const label val) const noexcept;
inline bool operator!=(const floatScalar val) const noexcept; inline bool operator!=(const float val) const noexcept;
inline bool operator!=(const doubleScalar val) const noexcept; inline bool operator!=(const double val) const noexcept;
inline bool operator!=(const std::string& s) const; inline bool operator!=(const std::string& s) const;
@ -677,11 +677,11 @@ public:
//- Return float value. //- Return float value.
// \deprecated(2020-01) - floatToken() // \deprecated(2020-01) - floatToken()
floatScalar floatScalarToken() const { return floatToken(); } float floatScalarToken() const { return floatToken(); }
//- Return double value. //- Return double value.
// \deprecated(2020-01) - doubleToken() // \deprecated(2020-01) - doubleToken()
doubleScalar doubleScalarToken() const { return doubleToken(); } double doubleScalarToken() const { return doubleToken(); }
//- Deprecated(2017-11) transfer word pointer to the token //- Deprecated(2017-11) transfer word pointer to the token
// \deprecated(2017-11) - use move assign from word // \deprecated(2017-11) - use move assign from word

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd. Copyright (C) 2017-2022 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -174,7 +174,7 @@ inline Foam::token::token(const label val, label lineNum) noexcept
} }
inline Foam::token::token(const floatScalar val, label lineNum) noexcept inline Foam::token::token(const float val, label lineNum) noexcept
: :
data_(), data_(),
type_(tokenType::FLOAT), type_(tokenType::FLOAT),
@ -184,7 +184,7 @@ inline Foam::token::token(const floatScalar val, label lineNum) noexcept
} }
inline Foam::token::token(const doubleScalar val, label lineNum) noexcept inline Foam::token::token(const double val, label lineNum) noexcept
: :
data_(), data_(),
type_(tokenType::DOUBLE), type_(tokenType::DOUBLE),
@ -528,7 +528,7 @@ inline bool Foam::token::isFloat() const noexcept
} }
inline Foam::floatScalar Foam::token::floatToken() const inline float Foam::token::floatToken() const
{ {
if (type_ == tokenType::FLOAT) if (type_ == tokenType::FLOAT)
{ {
@ -546,7 +546,7 @@ inline bool Foam::token::isDouble() const noexcept
} }
inline Foam::doubleScalar Foam::token::doubleToken() const inline double Foam::token::doubleToken() const
{ {
if (type_ == tokenType::DOUBLE) if (type_ == tokenType::DOUBLE)
{ {
@ -817,7 +817,7 @@ inline void Foam::token::operator=(const label val)
} }
inline void Foam::token::operator=(const floatScalar val) inline void Foam::token::operator=(const float val)
{ {
reset(); reset();
type_ = tokenType::FLOAT; type_ = tokenType::FLOAT;
@ -825,7 +825,7 @@ inline void Foam::token::operator=(const floatScalar val)
} }
inline void Foam::token::operator=(const doubleScalar val) inline void Foam::token::operator=(const double val)
{ {
reset(); reset();
type_ = tokenType::DOUBLE; type_ = tokenType::DOUBLE;
@ -955,7 +955,7 @@ inline bool Foam::token::operator==(const label val) const noexcept
} }
inline bool Foam::token::operator==(const floatScalar val) const noexcept inline bool Foam::token::operator==(const float val) const noexcept
{ {
return return
( (
@ -965,7 +965,7 @@ inline bool Foam::token::operator==(const floatScalar val) const noexcept
} }
inline bool Foam::token::operator==(const doubleScalar val) const noexcept inline bool Foam::token::operator==(const double val) const noexcept
{ {
return return
( (
@ -993,13 +993,13 @@ inline bool Foam::token::operator!=(const label val) const noexcept
} }
inline bool Foam::token::operator!=(const floatScalar val) const noexcept inline bool Foam::token::operator!=(const float val) const noexcept
{ {
return !operator==(val); return !operator==(val);
} }
inline bool Foam::token::operator!=(const doubleScalar val) const noexcept inline bool Foam::token::operator!=(const double val) const noexcept
{ {
return !operator==(val); return !operator==(val);
} }

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef doubleScalar_H #ifndef Foam_doubleScalar_H
#define doubleScalar_H #define Foam_doubleScalar_H
#include "scalarFwd.H" #include "scalarFwd.H"
#include "doubleFloat.H" #include "doubleFloat.H"

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef floatScalar_H #ifndef Foam_floatScalar_H
#define floatScalar_H #define Foam_floatScalar_H
#include "scalarFwd.H" #include "scalarFwd.H"
#include "doubleFloat.H" #include "doubleFloat.H"

View File

@ -1,7 +1,7 @@
// Compatibility include // Compatibility include
#ifndef doubleTensor_H #ifndef FoamCompat_doubleTensor_H
#define doubleTensor_H #define FoamCompat_doubleTensor_H
#include "tensor.H" #include "tensor.H"

View File

@ -1,7 +1,7 @@
// Compatibility include // Compatibility include
#ifndef floatTensor_H #ifndef FoamCompat_floatTensor_H
#define floatTensor_H #define FoamCompat_floatTensor_H
#include "tensor.H" #include "tensor.H"

View File

@ -2460,7 +2460,7 @@ Foam::triSurface Foam::triSurfaceTools::delaunay2D(const List<vector2D>& pts)
{ {
// Vertices in geompack notation. Note that could probably just use // Vertices in geompack notation. Note that could probably just use
// pts.begin() if double precision. // pts.begin() if double precision.
List<doubleScalar> geompackVertices(2*pts.size()); List<double> geompackVertices(2*pts.size());
label doubleI = 0; label doubleI = 0;
for (const vector2D& pt : pts) for (const vector2D& pt : pts)
{ {