From 5c3ffcae0efd6343cb6c7908b5688d7c431084ab Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Mon, 9 Dec 2013 09:47:54 +0000 Subject: [PATCH] ENH: surface film model refactoring --- .../{subModelBaseI.H => filmSubModelBaseI.H} | 10 +- .../submodels/subModelBase.C | 70 --------- .../submodels/subModelBase.H | 135 ------------------ .../submodels/subModelBaseTemplates.C | 56 -------- 4 files changed, 2 insertions(+), 269 deletions(-) rename src/regionModels/surfaceFilmModels/submodels/{subModelBaseI.H => filmSubModelBaseI.H} (88%) delete mode 100644 src/regionModels/surfaceFilmModels/submodels/subModelBase.C delete mode 100644 src/regionModels/surfaceFilmModels/submodels/subModelBase.H delete mode 100644 src/regionModels/surfaceFilmModels/submodels/subModelBaseTemplates.C diff --git a/src/regionModels/surfaceFilmModels/submodels/subModelBaseI.H b/src/regionModels/surfaceFilmModels/submodels/filmSubModelBaseI.H similarity index 88% rename from src/regionModels/surfaceFilmModels/submodels/subModelBaseI.H rename to src/regionModels/surfaceFilmModels/submodels/filmSubModelBaseI.H index 5bd2b2be252..aa04eeb2a4c 100644 --- a/src/regionModels/surfaceFilmModels/submodels/subModelBaseI.H +++ b/src/regionModels/surfaceFilmModels/submodels/filmSubModelBaseI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,18 +34,12 @@ namespace surfaceFilmModels // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -inline const surfaceFilmModel& subModelBase::owner() const +inline const surfaceFilmModel& filmSubModelBase::owner() const { return owner_; } -inline const dictionary& subModelBase::coeffs() const -{ - return coeffs_; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace surfaceFilmModels diff --git a/src/regionModels/surfaceFilmModels/submodels/subModelBase.C b/src/regionModels/surfaceFilmModels/submodels/subModelBase.C deleted file mode 100644 index b2283172b39..00000000000 --- a/src/regionModels/surfaceFilmModels/submodels/subModelBase.C +++ /dev/null @@ -1,70 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -\*---------------------------------------------------------------------------*/ - -#include "subModelBase.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -subModelBase::subModelBase(const surfaceFilmModel& owner) -: - owner_(owner), - coeffs_(dictionary::null) -{} - - -subModelBase::subModelBase -( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict -) -: - owner_(owner), - coeffs_(dict.subOrEmptyDict(type + "Coeffs")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -subModelBase::~subModelBase() -{} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/subModelBase.H b/src/regionModels/surfaceFilmModels/submodels/subModelBase.H deleted file mode 100644 index 74a5fdbecea..00000000000 --- a/src/regionModels/surfaceFilmModels/submodels/subModelBase.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -Class - Foam::subModelBase - -Description - Base class for surface film sub-models - -SourceFiles - subModelBaseI.H - subModelBase.C - -\*---------------------------------------------------------------------------*/ - -#ifndef subModelBase_H -#define subModelBase_H - -#include "surfaceFilmModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class subModelBase Declaration -\*---------------------------------------------------------------------------*/ - -class subModelBase -{ -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - subModelBase(const subModelBase&); - - //- Disallow default bitwise assignment - void operator=(const subModelBase&); - - -protected: - - // Protected data - - //- Reference to the owner surface film model - const surfaceFilmModel& owner_; - - //- Model coefficients dictionary - dictionary coeffs_; - - -public: - - // Constructors - - //- Construct null - subModelBase(const surfaceFilmModel& owner); - - //- Construct from type name, dictionary and surface film model - subModelBase - ( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~subModelBase(); - - - // Member Functions - - // Access - - virtual const word& type() const = 0; - - //- Return the reference to the owner surface film model - inline const surfaceFilmModel& owner() const; - - //- Return the model coefficients dictionary - inline const dictionary& coeffs() const; - - template<class FilmType> - inline const FilmType& filmType() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "subModelBaseI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "subModelBaseTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/subModelBaseTemplates.C b/src/regionModels/surfaceFilmModels/submodels/subModelBaseTemplates.C deleted file mode 100644 index b7252b310a6..00000000000 --- a/src/regionModels/surfaceFilmModels/submodels/subModelBaseTemplates.C +++ /dev/null @@ -1,56 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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/>. - -\*---------------------------------------------------------------------------*/ - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class FilmType> -const FilmType& subModelBase::filmType() const -{ - if (!isA<FilmType>(owner_)) - { - FatalErrorIn("FilmType& subModelBase::film() const") - << "Model " << type() << " requested film type " - << FilmType::typeName << " but film is type " << owner_.type() - << abort(FatalError); - } - - return refCast<const FilmType>(owner_); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // -- GitLab