ENH: make ITstream positioning methods noexcept

ENH: add rank() method for compound tokens

ENH: add IOstream::minPrecision(unsigned)

- reduced typing, more expressive, no namespace ambiguity with max()

    new: IOstream::minPrecision(10);
    old: IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));

STYLE: namespace qualify min/max for some buffer sizing [clang/hipp]
This commit is contained in:
Mark Olesen
2024-02-29 09:40:42 +01:00
parent 5a70be0846
commit b98f53ceca
51 changed files with 271 additions and 207 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2022 OpenCFD Ltd.
Copyright (C) 2019-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -231,8 +231,8 @@ int main(int argc, char *argv[])
polyMesh& mesh = *meshPtr;
// Set the precision of the points data to 10
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
// More precision (for points data)
IOstream::minPrecision(10);
Info<< nl << "Writing polyMesh with "
<< mesh.cellZones().size() << " cellZones" << endl;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2023 OpenCFD Ltd.
Copyright (C) 2016-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -289,8 +289,8 @@ int main(int argc, char *argv[])
// Handle cyclic patches
#include "handleCyclicPatches.H"
// Set the precision of the points data to 10
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
// More precision (for points data)
IOstream::minPrecision(10);
Info<< nl << "Writing polyMesh with "
<< mesh.cellZones().size() << " cellZones";

View File

@ -67,8 +67,8 @@ scalar getMergeDistance
const scalar mergeTol =
args.getOrDefault<scalar>("mergeTol", defaultMergeTol);
scalar writeTol =
Foam::pow(scalar(10), -scalar(IOstream::defaultPrecision()));
const scalar writeTol =
std::pow(scalar(10), -scalar(IOstream::defaultPrecision()));
Info<< "Merge tolerance : " << mergeTol << nl
<< "Write tolerance : " << writeTol << endl;