mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add static set/get dimensionSet::checking() method
- encapsulates toggling STYLE: noexcept for some Time methods
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2019 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,13 +50,12 @@ bool Foam::functionObjects::log::calc()
|
||||
{
|
||||
const volScalarField& x = lookupObject<volScalarField>(fieldName_);
|
||||
|
||||
// Cache the current debug setting for dimensionSet
|
||||
const bool dimensionSetDebug = dimensionSet::debug;
|
||||
|
||||
// Switch-off dimension checking if requested
|
||||
const bool oldDimChecking = dimensionSet::checking();
|
||||
|
||||
if (!checkDimensions_)
|
||||
{
|
||||
dimensionSet::debug = 0;
|
||||
dimensionSet::checking(false);
|
||||
}
|
||||
|
||||
bool stored = store
|
||||
@ -68,7 +67,7 @@ bool Foam::functionObjects::log::calc()
|
||||
// Reinstate dimension checking
|
||||
if (!checkDimensions_)
|
||||
{
|
||||
dimensionSet::debug = dimensionSetDebug;
|
||||
dimensionSet::checking(oldDimChecking);
|
||||
}
|
||||
|
||||
return stored;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,13 +49,12 @@ bool Foam::functionObjects::pow::calc()
|
||||
{
|
||||
const volScalarField& x = lookupObject<volScalarField>(fieldName_);
|
||||
|
||||
// Cache the current debug setting for dimensionSet
|
||||
const bool dimensionSetDebug = dimensionSet::debug;
|
||||
|
||||
// Switch-off dimension checking if requested
|
||||
const bool oldDimChecking = dimensionSet::checking();
|
||||
|
||||
if (!checkDimensions_)
|
||||
{
|
||||
dimensionSet::debug = 0;
|
||||
dimensionSet::checking(false);
|
||||
}
|
||||
|
||||
bool stored = store
|
||||
@ -67,7 +66,7 @@ bool Foam::functionObjects::pow::calc()
|
||||
// Reinstate dimension checking
|
||||
if (!checkDimensions_)
|
||||
{
|
||||
dimensionSet::debug = dimensionSetDebug;
|
||||
dimensionSet::checking(oldDimChecking);
|
||||
}
|
||||
|
||||
return stored;
|
||||
|
||||
Reference in New Issue
Block a user