diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H index 27bf7365d6..3846f4036e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,7 +58,6 @@ SourceFiles namespace Foam { - /*---------------------------------------------------------------------------*\ Class cellShapeControl Declaration \*---------------------------------------------------------------------------*/ @@ -121,7 +121,7 @@ public: // Access - inline const scalar& defaultCellSize() const; + inline scalar defaultCellSize() const; inline cellShapeControlMesh& shapeControlMesh(); @@ -131,7 +131,7 @@ public: inline const cellSizeAndAlignmentControls& sizeAndAlignment() const; - inline const scalar& minimumCellSize() const; + inline scalar minimumCellSize() const; // Query diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControlI.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControlI.H index 2d458abda1..b333052f9a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControlI.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControlI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2015 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,7 +42,7 @@ Foam::cellShapeControl::shapeControlMesh() const } -inline const Foam::scalar& Foam::cellShapeControl::defaultCellSize() const +inline Foam::scalar Foam::cellShapeControl::defaultCellSize() const { return defaultCellSize_; } @@ -61,7 +62,7 @@ Foam::cellShapeControl::sizeAndAlignment() const } -inline const Foam::scalar& Foam::cellShapeControl::minimumCellSize() const +inline Foam::scalar Foam::cellShapeControl::minimumCellSize() const { return minimumCellSize_; } diff --git a/src/dynamicMesh/attachDetach/attachDetach.C b/src/dynamicMesh/attachDetach/attachDetach.C index 66cfb0a676..eb05ece4de 100644 --- a/src/dynamicMesh/attachDetach/attachDetach.C +++ b/src/dynamicMesh/attachDetach/attachDetach.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -212,7 +213,7 @@ void Foam::attachDetach::checkDefinition() if ( !triggersOK - || (triggerTimes_.empty() && !manualTrigger()) + || (triggerTimes_.empty() && !manualTrigger_) ) { FatalErrorInFunction @@ -249,9 +250,9 @@ Foam::attachDetach::attachDetach masterPatchID_(masterPatchName, mme.mesh().boundaryMesh()), slavePatchID_(slavePatchName, mme.mesh().boundaryMesh()), triggerTimes_(triggerTimes), - manualTrigger_(manualTrigger), triggerIndex_(0), state_(UNKNOWN), + manualTrigger_(manualTrigger), trigger_(false), pointMatchMapPtr_(nullptr) { @@ -285,9 +286,9 @@ Foam::attachDetach::attachDetach mme.mesh().boundaryMesh() ), triggerTimes_(dict.lookup("triggerTimes")), - manualTrigger_(dict.lookup("manualTrigger")), triggerIndex_(0), state_(UNKNOWN), + manualTrigger_(dict.get("manualTrigger")), trigger_(false), pointMatchMapPtr_(nullptr) { @@ -337,7 +338,7 @@ bool Foam::attachDetach::setDetach() const bool Foam::attachDetach::changeTopology() const { - if (manualTrigger()) + if (manualTrigger_) { if (debug) { @@ -473,7 +474,7 @@ void Foam::attachDetach::writeDict(Ostream& os) const os.writeEntry("masterPatchName", masterPatchID_.name()); os.writeEntry("slavePatchName", slavePatchID_.name()); os.writeEntry("triggerTimes", triggerTimes_); - os.writeEntry("manualTrigger", manualTrigger()); + os.writeEntry("manualTrigger", Switch::name(manualTrigger_)); os.writeEntry("active", active()); os.endBlock(); diff --git a/src/dynamicMesh/attachDetach/attachDetach.H b/src/dynamicMesh/attachDetach/attachDetach.H index 5249142b22..a818ddb856 100644 --- a/src/dynamicMesh/attachDetach/attachDetach.H +++ b/src/dynamicMesh/attachDetach/attachDetach.H @@ -88,15 +88,15 @@ class attachDetach //- List of trigger times scalarField triggerTimes_; - //- Use manual trigger - Switch manualTrigger_; - //- Trigger time index mutable label triggerIndex_; //- State of the modifier mutable modifierState state_; + //- Use manual trigger + bool manualTrigger_; + //- Attach/detach trigger mutable bool trigger_; @@ -197,7 +197,8 @@ public: return state_ == ATTACHED; } - const Switch& manualTrigger() const + //- Is manually triggered? + bool manualTrigger() const { return manualTrigger_; } diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H index 631bf65c48..7f5ab4212d 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -126,9 +127,7 @@ public: inline const dictionary& meshQualityCoeffDict() const; - - inline const Switch& controlMeshQuality() const; - + inline Switch controlMeshQuality() const; inline const scalar& minLen() const; diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H index d1873ab8aa..cbf6382066 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettingsI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,8 +47,7 @@ Foam::polyMeshFilterSettings::meshQualityCoeffDict() const } -inline const Foam::Switch& -Foam::polyMeshFilterSettings::controlMeshQuality() const +inline Foam::Switch Foam::polyMeshFilterSettings::controlMeshQuality() const { return controlMeshQuality_; } diff --git a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifier.H b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifier.H index 69aafaff6d..3a28da946b 100644 --- a/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifier.H +++ b/src/dynamicMesh/polyTopoChange/polyMeshModifier/polyMeshModifier.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -180,7 +181,8 @@ public: // Activation and deactivation - const Switch& active() const + //- If modifier activate? + Switch active() const { return active_; } diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C index 3148c82178..d9fd52e7d9 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -40,7 +40,7 @@ Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF), - relative_(0), + relative_(false), inletValue_(p.size(), Zero) {} @@ -67,7 +67,7 @@ Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField ) : fixedValueFvPatchVectorField(p, iF, dict), - relative_(dict.lookup("relative")), + relative_(dict.get("relative")), inletValue_("inletValue", dict, p.size()) {} diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H index fb8c00e819..4b998a3fca 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,7 +60,6 @@ Description U_{p,srf} | SRF velocity \endvartable - Usage \table Property | Description | Required | Default value @@ -187,8 +187,8 @@ public: // Access - //- Return const access to the relative flag - const Switch& relative() const + //- Is supplied inlet value relative to the SRF? + bool relative() const { return relative_; } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 005fff0792..b713b8e9df 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -56,7 +56,9 @@ Foam::functionObjects::fieldValue::fieldValue writeFile(obr_, name, valueType, dict), scaleFactor_(1.0), dict_(dict), - regionName_(word::null) + regionName_(word::null), + fields_(), + writeFields_(false) { read(dict); } @@ -74,7 +76,9 @@ Foam::functionObjects::fieldValue::fieldValue writeFile(obr_, name, valueType, dict), scaleFactor_(1.0), dict_(dict), - regionName_(word::null) + regionName_(word::null), + fields_(), + writeFields_(false) { read(dict); } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H index 55f2da62ef..db8fa31a06 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,7 +48,6 @@ SourceFiles #include "fvMeshFunctionObject.H" #include "writeFile.H" -#include "Switch.H" #include "Field.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,7 +85,7 @@ protected: wordList fields_; //- Output field values flag - Switch writeFields_; + bool writeFields_; // Protected Member Functions @@ -167,7 +166,7 @@ public: inline const wordList& fields() const; //- Return the output field values flag - inline const Switch& writeFields() const; + inline bool writeFields() const; //- Read from dictionary virtual bool read(const dictionary& dict); diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValueI.H b/src/functionObjects/field/fieldValues/fieldValue/fieldValueI.H index 2835975780..f667fe087f 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValueI.H +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValueI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,8 +46,7 @@ inline const Foam::wordList& Foam::functionObjects::fieldValue::fields() const } -inline const Foam::Switch& -Foam::functionObjects::fieldValue::writeFields() const +inline bool Foam::functionObjects::fieldValue::writeFields() const { return writeFields_; } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C index fbed5b4f31..4d7d74323a 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C @@ -70,13 +70,6 @@ Foam::HeatTransferModel::~HeatTransferModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -const Foam::Switch& Foam::HeatTransferModel::BirdCorrection() const -{ - return BirdCorrection_; -} - - template Foam::scalar Foam::HeatTransferModel::htc ( diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index b875ce894d..b9eb0ee48d 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,7 +61,7 @@ class HeatTransferModel : public CloudSubModelBase { - // Private data + // Private Data //- Apply Bird's correction to the htc const Switch BirdCorrection_; @@ -119,10 +120,11 @@ public: // Member Functions - // Access - - //- Return the Bird htc correction flag - const Switch& BirdCorrection() const; + //- The Bird HTC correction flag + bool BirdCorrection() const + { + return BirdCorrection_; + } // Evaluation diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H index 530921c21e..f77c4b2955 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H @@ -108,7 +108,7 @@ public: const scalar f0, const scalar Pr, const scalar pMin, - const Switch& constantVolume, + const bool constantVolume, const scalar sigma0, const scalar mu0 ); diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H index 7cd64d5781..696be5b394 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -77,7 +78,7 @@ inline Foam::SprayParcel::constantProperties::constantProperties const scalar f0, const scalar Pr, const scalar pMin, - const Switch& constantVolume, + const bool constantVolume, const scalar sigma0, const scalar mu0 ) diff --git a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H index f8186691b3..9956ca9a5e 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -64,7 +65,7 @@ protected: // Protected data - Switch solveOscillationEq_; + bool solveOscillationEq_; scalar y0_; scalar yDot0_; @@ -128,7 +129,7 @@ public: // Access - inline const Switch& solveOscillationEq() const + inline bool solveOscillationEq() const { return solveOscillationEq_; } diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/layerParameters/layerParameters.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/layerParameters/layerParameters.C index 8a0544920f..b4953b9c54 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/layerParameters/layerParameters.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/layerParameters/layerParameters.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -104,9 +104,11 @@ Foam::layerParameters::layerParameters ) : dict_(dict), - numLayers_(boundaryMesh.size(), -1), + dryRun_(dryRun), relativeSizes_(meshRefinement::get(dict, "relativeSizes", dryRun)), + additionalReporting_(dict.getOrDefault("additionalReporting", false)), layerSpec_(ILLEGAL), + numLayers_(boundaryMesh.size(), -1), firstLayerThickness_(boundaryMesh.size(), -123), finalLayerThickness_(boundaryMesh.size(), -123), thickness_(boundaryMesh.size(), -123), @@ -140,7 +142,6 @@ Foam::layerParameters::layerParameters ), nLayerIter_(meshRefinement::get