diff --git a/src/faOptions/faOption/faOption.C b/src/faOptions/faOption/faOption.C index 708f73885113285098a924d9105967a6391ff50e..9f98da33fe5691a5e9ae556d20a2024ed863d34b 100644 --- a/src/faOptions/faOption/faOption.C +++ b/src/faOptions/faOption/faOption.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,17 +40,6 @@ namespace Foam } -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -void Foam::fa::option::constructMeshObjects() -{ - regionMeshPtr_.reset(new faMesh(mesh_)); - - vsmPtr_.reset(new volSurfaceMapping(regionMeshPtr_())); -} - - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fa::option::option @@ -67,16 +56,15 @@ Foam::fa::option::option patch_(patch), dict_(dict), coeffs_(dict.optionalSubDict(modelType + "Coeffs")), - active_(dict.getOrDefault<Switch>("active", true)), fieldNames_(), applied_(), regionName_(dict.get<word>("region")), regionMeshPtr_(nullptr), - vsmPtr_(nullptr) + vsmPtr_(nullptr), + active_(dict.getOrDefault("active", true)), + log(true) { - constructMeshObjects(); - - Info<< incrIndent << indent << "Source: " << name_ << endl << decrIndent; + Log << incrIndent << indent << "Source: " << name_ << endl << decrIndent; } diff --git a/src/faOptions/faOption/faOption.H b/src/faOptions/faOption/faOption.H index 253c26e2b1536ab21fb5e0340378cbfb899aaeb7..c8d69e473f999b9de9a202f7fbda15599033aee5 100644 --- a/src/faOptions/faOption/faOption.H +++ b/src/faOptions/faOption/faOption.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -75,13 +75,12 @@ SourceFiles #ifndef faOption_H #define faOption_H -#include "faMatrices.H" -#include "areaFields.H" +#include "faMatricesFwd.H" +#include "areaFieldsFwd.H" #include "dictionary.H" -#include "Switch.H" -#include "runTimeSelectionTables.H" #include "fvMesh.H" #include "volSurfaceMapping.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -124,27 +123,35 @@ protected: //- Dictionary containing source coefficients dictionary coeffs_; - //- Source active flag - Switch active_; - //- Field names to apply source to - populated by derived models wordList fieldNames_; //- Applied flag list - corresponds to each fieldNames_ entry List<bool> applied_; - //- Region name + //- Region name (finite-area) word regionName_; - //- Pointer to the region mesh database - autoPtr<faMesh> regionMeshPtr_; +private: - //-Volume-to surface mapping - autoPtr<volSurfaceMapping> vsmPtr_; + // Private Data + + //- Demand-driven: pointer to region mesh database + mutable autoPtr<faMesh> regionMeshPtr_; + + //- Demand-driven: volume-to-surface mapping + mutable autoPtr<volSurfaceMapping> vsmPtr_; + + //- Source active flag + bool active_; public: + //- Switch write log to Info + bool log; + + //- Runtime type information TypeName("option"); @@ -188,7 +195,6 @@ public: //- on the freestore from an Istream class iNew { - //- Reference to the patch const fvPatch& patch_; @@ -239,37 +245,37 @@ public: // Access //- Return const access to the source name - inline const word& name() const; + inline const word& name() const noexcept; //- Return const access to the mesh database - inline const fvMesh& mesh() const; + inline const fvMesh& mesh() const noexcept; //- Return const access to fvPatch - inline const fvPatch& patch() const; + inline const fvPatch& patch() const noexcept; //- Return dictionary - inline const dictionary& coeffs() const; + inline const dictionary& coeffs() const noexcept; //- Return const access to the source active flag - inline bool active() const; + inline bool active() const noexcept; //- Set the applied flag to true for field index fieldi inline void setApplied(const label fieldi); - //- Return the region mesh database + //- The region name + inline const word& regionName() const noexcept; + + //- Return the region mesh database (demand-driven) inline const faMesh& regionMesh() const; - //- Return volSurfaceMapping + //- Return volSurfaceMapping (demand-driven) inline const volSurfaceMapping& vsm() const; - //- Region name - inline const word& regionName() const; - // Edit - //- Return access to the source active flag - inline Switch& active(); + //- Change source active flag, return previous value + inline bool active(const bool on) noexcept; // Checks diff --git a/src/faOptions/faOption/faOptionI.H b/src/faOptions/faOption/faOptionI.H index a541123f2752e01909762b7faed3d1420c7cdd2e..42ef920af60712fbbb6d692c4e559006c5a1d5e2 100644 --- a/src/faOptions/faOption/faOptionI.H +++ b/src/faOptions/faOption/faOptionI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------ License This file is part of OpenFOAM. @@ -27,49 +27,51 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::word& Foam::fa::option::name() const +inline const Foam::word& Foam::fa::option::name() const noexcept { return name_; } -inline const Foam::fvMesh& Foam::fa::option::mesh() const +inline const Foam::fvMesh& Foam::fa::option::mesh() const noexcept { return mesh_; } -inline const Foam::fvPatch& Foam::fa::option::patch() const +inline const Foam::fvPatch& Foam::fa::option::patch() const noexcept { return patch_; } -inline const Foam::dictionary& Foam::fa::option::coeffs() const +inline const Foam::dictionary& Foam::fa::option::coeffs() const noexcept { return coeffs_; } -inline bool Foam::fa::option::active() const +inline bool Foam::fa::option::active() const noexcept { return active_; } -inline void Foam::fa::option::setApplied(const label fieldi) +inline bool Foam::fa::option::active(const bool on) noexcept { - applied_[fieldi] = true; + bool old(active_); + active_ = on; + return old; } -inline Foam::Switch& Foam::fa::option::active() +inline void Foam::fa::option::setApplied(const label fieldi) { - return active_; + applied_[fieldi] = true; } -inline const Foam::word& Foam::fa::option::regionName() const +inline const Foam::word& Foam::fa::option::regionName() const noexcept { return regionName_; } @@ -77,31 +79,21 @@ inline const Foam::word& Foam::fa::option::regionName() const inline const Foam::faMesh& Foam::fa::option::regionMesh() const { - if (regionMeshPtr_.valid()) + if (!regionMeshPtr_) { - return regionMeshPtr_(); + regionMeshPtr_.reset(new faMesh(mesh_)); } - else - { - FatalErrorInFunction - << "Region mesh not available" << abort(FatalError); - } - return *(new faMesh(mesh_)); + return *regionMeshPtr_; } inline const Foam::volSurfaceMapping& Foam::fa::option::vsm() const { - if (vsmPtr_.valid()) - { - return vsmPtr_(); - } - else + if (!vsmPtr_) { - FatalErrorInFunction - << "vsmPtr not available" << abort(FatalError); + vsmPtr_.reset(new volSurfaceMapping(this->regionMesh())); } - return *(new volSurfaceMapping(regionMeshPtr_())); + return *vsmPtr_; } diff --git a/src/faOptions/faOption/faOptionList.C b/src/faOptions/faOption/faOptionList.C index 80de3cf682efd2dbed3808cd6dd4c3699f4041a4..b722e457a6f91031ec4e6ca79f3b3fcd5b4ee342 100644 --- a/src/faOptions/faOption/faOptionList.C +++ b/src/faOptions/faOption/faOptionList.C @@ -92,7 +92,7 @@ Foam::fa::optionList::optionList const dictionary& dict ) : - PtrList<option>(), + PtrList<fa::option>(), mesh_(p.boundaryMesh().mesh()), patch_(p), checkTimeIndex_(mesh_.time().startTimeIndex() + 2) @@ -103,7 +103,7 @@ Foam::fa::optionList::optionList Foam::fa::optionList::optionList(const fvPatch& p) : - PtrList<option>(), + PtrList<fa::option>(), mesh_(p.boundaryMesh().mesh()), patch_(p), checkTimeIndex_(mesh_.time().startTimeIndex() + 2) diff --git a/src/faOptions/faOption/faOptionList.H b/src/faOptions/faOption/faOptionList.H index 290dc794a6596c960307fee872f9109fec70bad2..a479c9719667fea3bebc34f301462b6db50bfd72 100644 --- a/src/faOptions/faOption/faOptionList.H +++ b/src/faOptions/faOption/faOptionList.H @@ -46,10 +46,9 @@ SourceFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Forward Declarations namespace Foam { - -// Forward declaration of friend functions and operators namespace fa { class optionList; @@ -66,7 +65,7 @@ namespace fa class optionList : - public PtrList<option> + public PtrList<fa::option> { protected: @@ -118,7 +117,7 @@ public: // Constructors - //- Construct null + //- Construct from patch optionList(const fvPatch& p); //- Construct from mesh and dictionary @@ -126,8 +125,7 @@ public: //- Destructor - virtual ~optionList() - {} + virtual ~optionList() = default; // Member Functions diff --git a/src/faOptions/faOption/faOptionListTemplates.C b/src/faOptions/faOption/faOptionListTemplates.C index 1a954bcce453918c6aad227c2aba433930bd5001..96a266e5a38105d20979dbfbf8f88d55b4e5c5ac 100644 --- a/src/faOptions/faOption/faOptionListTemplates.C +++ b/src/faOptions/faOption/faOptionListTemplates.C @@ -26,6 +26,7 @@ License \*---------------------------------------------------------------------------*/ #include "profiling.H" +#include "areaFields.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/faOptions/faceSetOption/faceSetOption.H b/src/faOptions/faceSetOption/faceSetOption.H index edbf26ed53b90f7b6b9a29da625338ca722dd07c..559cacdae264fa444b8d29ca4818081b3fd843c3 100644 --- a/src/faOptions/faceSetOption/faceSetOption.H +++ b/src/faOptions/faceSetOption/faceSetOption.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -102,7 +102,7 @@ namespace fa class faceSetOption : - public option + public fa::option { public: diff --git a/src/faOptions/sources/derived/contactHeatFluxSource/contactHeatFluxSource.H b/src/faOptions/sources/derived/contactHeatFluxSource/contactHeatFluxSource.H index 699c5214c0c52407e96d3d9ebbbc1b1c0c9c9c24..b5aeb34bb39ddf51ddac2520bc73832d5b3520cb 100644 --- a/src/faOptions/sources/derived/contactHeatFluxSource/contactHeatFluxSource.H +++ b/src/faOptions/sources/derived/contactHeatFluxSource/contactHeatFluxSource.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -98,7 +98,7 @@ namespace fa class contactHeatFluxSource : - public faceSetOption, + public fa::faceSetOption, public temperatureCoupledBase { // Private Data diff --git a/src/faOptions/sources/derived/externalFileSource/externalFileSource.C b/src/faOptions/sources/derived/externalFileSource/externalFileSource.C index f5a95479d23288d4df5861a6b943fcbbd405d045..81e93caa40eae7e80f831d807f34bacf220e1c1b 100644 --- a/src/faOptions/sources/derived/externalFileSource/externalFileSource.C +++ b/src/faOptions/sources/derived/externalFileSource/externalFileSource.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,8 +26,8 @@ License \*---------------------------------------------------------------------------*/ #include "externalFileSource.H" -#include "faMatrices.H" -#include "faCFD.H" +#include "fam.H" +#include "faScalarMatrix.H" #include "zeroGradientFaPatchFields.H" #include "addToRunTimeSelectionTable.H" diff --git a/src/faOptions/sources/derived/externalFileSource/externalFileSource.H b/src/faOptions/sources/derived/externalFileSource/externalFileSource.H index 6d6c0ec2dadfd0feed004bf0a6808d07a1709959..974f23925a100a23fe66c1796aa5d0c983c018ab 100644 --- a/src/faOptions/sources/derived/externalFileSource/externalFileSource.H +++ b/src/faOptions/sources/derived/externalFileSource/externalFileSource.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -89,7 +89,7 @@ namespace fa class externalFileSource : - public faceSetOption + public fa::faceSetOption { // Private Data diff --git a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C index 478fc81b5cecb3f82c4b78f4e05cf0ded6076f02..22c8404e198428af53acfc82d9ebccfb070b372a 100644 --- a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C +++ b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.C @@ -26,7 +26,8 @@ License \*---------------------------------------------------------------------------*/ #include "externalHeatFluxSource.H" -#include "addToRunTimeSelectionTable.H" +#include "fam.H" +#include "faScalarMatrix.H" #include "physicoChemicalConstants.H" #include "zeroGradientFaPatchFields.H" #include "addToRunTimeSelectionTable.H" diff --git a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.H b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.H index 97873b29ffd9fbd0178c9c12e896960646424624..26e8385276e7a47a3334c74ff4cc2d72025cd68a 100644 --- a/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.H +++ b/src/faOptions/sources/derived/externalHeatFluxSource/externalHeatFluxSource.H @@ -121,7 +121,6 @@ SourceFiles #include "Function1.H" #include "areaFields.H" #include "faceSetOption.H" -#include "faCFD.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -136,7 +135,7 @@ namespace fa class externalHeatFluxSource : - public faceSetOption + public fa::faceSetOption { public: diff --git a/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C b/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C index 2d9cfc63218bb8a7993052feb939d735caa5d8e8..a752b74eff6e023ebf017e61a149c28a141ba05b 100644 --- a/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C +++ b/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.C @@ -26,8 +26,8 @@ License \*---------------------------------------------------------------------------*/ #include "jouleHeatingSource.H" -#include "faMatrices.H" -#include "faCFD.H" +#include "fam.H" +#include "faScalarMatrix.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // diff --git a/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H b/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H index 4a5a279a145362059d9906fdd3dd5fc1f647c723..e3c99f68d1bc1aa0ea2384b56241433f325f362d 100644 --- a/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H +++ b/src/faOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -156,7 +156,7 @@ namespace fa class jouleHeatingSource : - public faceSetOption + public fa::faceSetOption { // Private Data diff --git a/src/finiteArea/faMatrices/faMatricesFwd.H b/src/finiteArea/faMatrices/faMatricesFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..7383f960d0e0a09ddc95b995d33d85c11078c0a3 --- /dev/null +++ b/src/finiteArea/faMatrices/faMatricesFwd.H @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2021 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/>. + +Description + Forward declarations of standard faMatrix types/specializations. + +\*---------------------------------------------------------------------------*/ + +#ifndef faMatricesFwd_H +#define faMatricesFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class faMatrix; + +typedef faMatrix<scalar> faScalarMatrix; +typedef faMatrix<vector> faVectorMatrix; +typedef faMatrix<sphericalTensor> faSphericalTensorMatrix; +typedef faMatrix<symmTensor> faSymmTensorMatrix; +typedef faMatrix<tensor> faTensorMatrix; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C index e2c5e73ed7edf9c63060c0a995f1a15f6a06e1ee..4614b1b8acc5e09e524e107598b20f406648883e 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.C @@ -58,9 +58,9 @@ Foam::fv::option::option mesh_(mesh), dict_(dict), coeffs_(dict.optionalSubDict(modelType + "Coeffs")), - active_(dict_.getOrDefault<Switch>("active", true)), fieldNames_(), applied_(), + active_(dict_.getOrDefault("active", true)), log(true) { Log << incrIndent << indent << "Source: " << name_ << endl << decrIndent; @@ -101,7 +101,7 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New ) << exit(FatalIOError); } - return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh)); + return autoPtr<fv::option>(cstrIter()(name, modelType, coeffs, mesh)); } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H index e1859a714da3f46219afd6dc34f5e82c89d5a99b..84539964ac498733f4724d67f547b3546ecc9aef 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOption.H @@ -113,23 +113,25 @@ protected: //- Dictionary containing source coefficients dictionary coeffs_; - //- Source active flag - Switch active_; - //- Field names to apply source to - populated by derived models wordList fieldNames_; //- Applied flag list - corresponds to each fieldNames_ entry List<bool> applied_; + //- Source active flag + bool active_; + public: + //- Switch write log to Info + bool log; + + //- Runtime type information TypeName("option"); - //- Switch write log to Info - bool log; // Declare run-time constructor selection table @@ -219,16 +221,16 @@ public: // Access //- Return const access to the source name - inline const word& name() const; + inline const word& name() const noexcept; //- Return const access to the mesh database - inline const fvMesh& mesh() const; + inline const fvMesh& mesh() const noexcept; //- Return dictionary - inline const dictionary& coeffs() const; + inline const dictionary& coeffs() const noexcept; - //- Return const access to the source active flag - inline bool active() const; + //- True if source is active + inline bool active() const noexcept; //- Set the applied flag to true for field index fieldi inline void setApplied(const label fieldi); @@ -236,8 +238,8 @@ public: // Edit - //- Return access to the source active flag - inline Switch& active(); + //- Change source active flag, return previous value + inline bool active(const bool on) noexcept; // Checks diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H index f15e73aa172d547ba2ac7a5265e9ebb2b8f8d7ab..586024e2e6bdf31f0e420956167c339654af4e60 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,39 +28,41 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::word& Foam::fv::option::name() const +inline const Foam::word& Foam::fv::option::name() const noexcept { return name_; } -inline const Foam::fvMesh& Foam::fv::option::mesh() const +inline const Foam::fvMesh& Foam::fv::option::mesh() const noexcept { return mesh_; } -inline const Foam::dictionary& Foam::fv::option::coeffs() const +inline const Foam::dictionary& Foam::fv::option::coeffs() const noexcept { return coeffs_; } -inline bool Foam::fv::option::active() const +inline bool Foam::fv::option::active() const noexcept { return active_; } -inline void Foam::fv::option::setApplied(const label fieldi) +inline bool Foam::fv::option::active(const bool on) noexcept { - applied_[fieldi] = true; + bool old(active_); + active_ = on; + return old; } -inline Foam::Switch& Foam::fv::option::active() +inline void Foam::fv::option::setApplied(const label fieldi) { - return active_; + applied_[fieldi] = true; } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C index 78f4a6fa58a25c18b68bfc93d33d1eebb2d2f313..2fe08194b560182ac3ab1f444adb89351243fba1 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.C @@ -89,7 +89,7 @@ void Foam::fv::optionList::checkApplied() const Foam::fv::optionList::optionList(const fvMesh& mesh, const dictionary& dict) : - PtrList<option>(), + PtrList<fv::option>(), mesh_(mesh), checkTimeIndex_(mesh_.time().startTimeIndex() + 2) { @@ -99,7 +99,7 @@ Foam::fv::optionList::optionList(const fvMesh& mesh, const dictionary& dict) Foam::fv::optionList::optionList(const fvMesh& mesh) : - PtrList<option>(), + PtrList<fv::option>(), mesh_(mesh), checkTimeIndex_(mesh_.time().startTimeIndex() + 2) {} diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H index a6cd374fae4c438968738b671d484339535a8798..1cbca46098bc8e6a50a2f3a905e3197bb4e39f26 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionList.H @@ -69,7 +69,7 @@ namespace fv class optionList : - public PtrList<option> + public PtrList<fv::option> { protected: diff --git a/src/fvOptions/cellSetOption/cellSetOption.H b/src/fvOptions/cellSetOption/cellSetOption.H index 32f1609518e7aaa00fc24f02932c08b9debf5c0f..02b2931fdc908451016d44fd2a14908a973e00cd 100644 --- a/src/fvOptions/cellSetOption/cellSetOption.H +++ b/src/fvOptions/cellSetOption/cellSetOption.H @@ -117,7 +117,7 @@ namespace fv class cellSetOption : - public option + public fv::option { public: diff --git a/src/fvOptions/interRegionOption/interRegionOption.H b/src/fvOptions/interRegionOption/interRegionOption.H index 3496f0b70c5bcea40f8060f994c6b31dd928250f..315f9808b726aa90713029330b3821aedff6442b 100644 --- a/src/fvOptions/interRegionOption/interRegionOption.H +++ b/src/fvOptions/interRegionOption/interRegionOption.H @@ -87,7 +87,7 @@ namespace fv class interRegionOption : - public option + public fv::option { protected: diff --git a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H index d40d1ed239977ab28955ee2054aa3e814e1347c7..361853bd8e7c8c95fab3b83ddd2e9255c991da40 100644 --- a/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H +++ b/src/fvOptions/sources/derived/buoyancyEnergy/buoyancyEnergy.H @@ -118,7 +118,7 @@ namespace fv class buoyancyEnergy : - public option + public fv::option { // Private Data diff --git a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H index 0ef9438b85bce14f47118119a09a956528a1379c..07f785ab337f983a041d962f2155489e4e5a01ce 100644 --- a/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H +++ b/src/fvOptions/sources/derived/buoyancyForce/buoyancyForce.H @@ -110,7 +110,7 @@ namespace fv class buoyancyForce : - public option + public fv::option { // Private Data diff --git a/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H b/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H index b2ea0e06ad076ed7f521dff0a4e70287ac5a2287..d748dcdab84dec42084d8e866dc58ba50a7793ce 100644 --- a/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H +++ b/src/fvOptions/sources/derived/jouleHeatingSource/jouleHeatingSource.H @@ -175,7 +175,7 @@ namespace fv class jouleHeatingSource : - public option + public fv::option { // Private Data diff --git a/src/fvOptions/sources/derived/multiphaseStabilizedTurbulence/multiphaseStabilizedTurbulence.H b/src/fvOptions/sources/derived/multiphaseStabilizedTurbulence/multiphaseStabilizedTurbulence.H index 4d0e7db9e7564a14f18699735146f24789f34392..033669bfd4fa0ab9e9ccdf149f839ed5c9e51ca2 100644 --- a/src/fvOptions/sources/derived/multiphaseStabilizedTurbulence/multiphaseStabilizedTurbulence.H +++ b/src/fvOptions/sources/derived/multiphaseStabilizedTurbulence/multiphaseStabilizedTurbulence.H @@ -133,7 +133,7 @@ namespace fv class multiphaseStabilizedTurbulence : - public option + public fv::option { // Private Data diff --git a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H index 8ea0073ba4c3d80d965d338a64007aff64718a21..234d7d7caf361e68508dd1e594b652a35eca5a3f 100644 --- a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H +++ b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H @@ -108,7 +108,7 @@ namespace fv template<class Type> class PhaseLimitStabilization : - public option + public fv::option { // Private Data diff --git a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H index 6541bb805bd17beffd8afb703b919fa35afe97c2..5a6007bb0929d3b4cc7c4076f090ff1e94f00eda 100644 --- a/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H +++ b/src/fvOptions/sources/derived/tabulatedAccelerationSource/tabulatedAccelerationSource.H @@ -87,7 +87,7 @@ namespace fv class tabulatedAccelerationSource : - public option + public fv::option { protected: diff --git a/src/fvOptions/sources/derived/viscousDissipation/viscousDissipation.H b/src/fvOptions/sources/derived/viscousDissipation/viscousDissipation.H index 805bf12c11edf072ce24bfa2e857846904b19b7b..b8740163c52442611b9e26d1e876f2f73cf94a5a 100644 --- a/src/fvOptions/sources/derived/viscousDissipation/viscousDissipation.H +++ b/src/fvOptions/sources/derived/viscousDissipation/viscousDissipation.H @@ -111,7 +111,7 @@ namespace fv class viscousDissipation : - public option + public fv::option { // Private Data diff --git a/src/thermophysicalModels/radiation/fvOptions/radiation/radiation.H b/src/thermophysicalModels/radiation/fvOptions/radiation/radiation.H index 723b53b2e4305c3fc3b24e6ab6b02d41923599d5..f70449ab59ad3dcabe51b243f6c4be9ec96988ec 100644 --- a/src/thermophysicalModels/radiation/fvOptions/radiation/radiation.H +++ b/src/thermophysicalModels/radiation/fvOptions/radiation/radiation.H @@ -80,7 +80,7 @@ namespace fv class radiation : - public option + public fv::option { // Private Data diff --git a/src/waveModels/fvOptions/multiphaseMangrovesSource/multiphaseMangrovesSource.H b/src/waveModels/fvOptions/multiphaseMangrovesSource/multiphaseMangrovesSource.H index 6d040ba0963a2017935b6c7cf5e32042fe5f8779..5c5cc232ebb2c7353775cb6879646e489f02e222 100644 --- a/src/waveModels/fvOptions/multiphaseMangrovesSource/multiphaseMangrovesSource.H +++ b/src/waveModels/fvOptions/multiphaseMangrovesSource/multiphaseMangrovesSource.H @@ -50,7 +50,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations class MangrovesModel; namespace fv @@ -62,7 +62,7 @@ namespace fv class multiphaseMangrovesSource : - public option + public fv::option { // Private Member Functions diff --git a/src/waveModels/fvOptions/multiphaseMangrovesTurbulenceModel/multiphaseMangrovesTurbulenceModel.H b/src/waveModels/fvOptions/multiphaseMangrovesTurbulenceModel/multiphaseMangrovesTurbulenceModel.H index 3be8a42214fd0bccd6d53355b1da4588cc8a0943..ae9c4911565ddcfb260805c2a0567cbb4c10a0fd 100644 --- a/src/waveModels/fvOptions/multiphaseMangrovesTurbulenceModel/multiphaseMangrovesTurbulenceModel.H +++ b/src/waveModels/fvOptions/multiphaseMangrovesTurbulenceModel/multiphaseMangrovesTurbulenceModel.H @@ -59,7 +59,7 @@ namespace fv class multiphaseMangrovesTurbulenceModel : - public option + public fv::option { // Private Member Functions