From 5618a2b0d2868bccf0fdc8a673942490ba5d0da7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 27 Feb 2024 09:18:25 +0100 Subject: [PATCH] changed: put SupportsFaceTag in separate header this way we don't have to pull in alugrid and polyhedralgrid in simulator objects that does not use them --- CMakeLists_files.cmake | 1 + flow/flow_blackoil_alugrid.cpp | 6 +++ flow/flow_blackoil_polyhedralgrid.cpp | 6 +++ .../aquifers/BlackoilAquiferModel.hpp | 39 ++-------------- opm/simulators/aquifers/SupportsFaceTag.hpp | 45 +++++++++++++++++++ 5 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 opm/simulators/aquifers/SupportsFaceTag.hpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 52bb2fff8..205163805 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -484,6 +484,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/aquifers/AquiferNumerical.hpp opm/simulators/aquifers/BlackoilAquiferModel.hpp opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp + opm/simulators/aquifers/SupportsFaceTag.hpp opm/simulators/linalg/bda/amgclSolverBackend.hpp opm/simulators/linalg/bda/BdaBridge.hpp opm/simulators/linalg/bda/BdaResult.hpp diff --git a/flow/flow_blackoil_alugrid.cpp b/flow/flow_blackoil_alugrid.cpp index ff71e74a7..5445e10ee 100644 --- a/flow/flow_blackoil_alugrid.cpp +++ b/flow/flow_blackoil_alugrid.cpp @@ -65,6 +65,12 @@ struct Vanguard { using type = Opm::AluGridVanguard; }; } + +template<> +class SupportsFaceTag> + : public std::bool_constant +{}; + } int main(int argc, char** argv) diff --git a/flow/flow_blackoil_polyhedralgrid.cpp b/flow/flow_blackoil_polyhedralgrid.cpp index 96d717aa0..8d7de0320 100644 --- a/flow/flow_blackoil_polyhedralgrid.cpp +++ b/flow/flow_blackoil_polyhedralgrid.cpp @@ -67,6 +67,12 @@ namespace Properties { using type = Opm::EclPolyhedralGridVanguard; }; } + +template<> +class SupportsFaceTag> + : public std::bool_constant +{}; + } int main(int argc, char** argv) diff --git a/opm/simulators/aquifers/BlackoilAquiferModel.hpp b/opm/simulators/aquifers/BlackoilAquiferModel.hpp index 7b67e004f..1138c41af 100644 --- a/opm/simulators/aquifers/BlackoilAquiferModel.hpp +++ b/opm/simulators/aquifers/BlackoilAquiferModel.hpp @@ -20,7 +20,6 @@ along with OPM. If not, see . */ - #ifndef OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED #define OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED @@ -33,50 +32,19 @@ #include #include #include +#include #include -#include -#include -#if HAVE_DUNE_ALUGRID -#include -#endif - #include #include #include #include -namespace Opm -{ +namespace Opm { -template -class SupportsFaceTag - : public std::bool_constant -{}; - - -template<> -class SupportsFaceTag - : public std::bool_constant -{}; - - -template<> -class SupportsFaceTag> - : public std::bool_constant -{}; - -#if HAVE_DUNE_ALUGRID -template<> -class SupportsFaceTag> - : public std::bool_constant -{}; -#endif - - -/// Class for handling the blackoil well model. +/// Class for handling the blackoil aquifer model. template class BlackoilAquiferModel { @@ -143,7 +111,6 @@ private: void computeConnectionAreaFraction() const; }; - } // namespace Opm #include "BlackoilAquiferModel_impl.hpp" diff --git a/opm/simulators/aquifers/SupportsFaceTag.hpp b/opm/simulators/aquifers/SupportsFaceTag.hpp new file mode 100644 index 000000000..851c3d303 --- /dev/null +++ b/opm/simulators/aquifers/SupportsFaceTag.hpp @@ -0,0 +1,45 @@ +/* + File adapted from BlackoilWellModel.hpp + + Copyright 2017 TNO - Heat Transfer & Fluid Dynamics, Modelling & Optimization of the Subsurface + Copyright 2017 Statoil ASA. + + This file is part of the Open Porous Media project (OPM). + + OPM 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. + + OPM 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 OPM. If not, see . +*/ + + +#ifndef OPM_SUPPORTS_FACETAG_HEADER_INCLUDED +#define OPM_SUPPORTS_FACETAG_HEADER_INCLUDED + +namespace Dune { class CpGrid; } + +namespace Opm { + +template +class SupportsFaceTag + : public std::bool_constant +{}; + + +template<> +class SupportsFaceTag + : public std::bool_constant +{}; + + +} // namespace Opm + +#endif // OPM_SUPPORT_FACETAG_HEADER_INCLUDED