diff --git a/dumux/common/parameters.hh b/dumux/common/parameters.hh index 9dee178993366a7b70f56454c6da1d924e7669bd..e0ecb56027fcaa16c6beda4c9d0d3c58447df521 100644 --- a/dumux/common/parameters.hh +++ b/dumux/common/parameters.hh @@ -331,7 +331,8 @@ private: defaultParams["Vtk.AddProcessRank"] = "true"; // parameters in the mpfa group - defaultParams["Mpfa.Q"] = "0.0"; + defaultParams["Mpfa.Q"] = "0.0"; // DEPRECATED, REMOVE AFTER 3.2 + defaultParams["MPFA.Q"] = "0.0"; // merge the global default tree but do not overwrite if the parameter already exists mergeTree_(params, defaultParams, false); diff --git a/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh index b4e0d84987a0b906b30e24823d658c61c13dfb46..498edc65209d6026eecde8092a124b66cee00d70 100644 --- a/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvelementgeometry.hh @@ -343,7 +343,22 @@ private: const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx); // the quadrature point parameterizaion to be used on scvfs - static const auto q = getParam<CoordScalar>("Mpfa.Q"); + static const auto q = []{ // REMOVE deprecated version after release 3.2 + CoordScalar q = 0.0; + bool hasOldParamName = hasParam("Mpfa.Q"); + if (hasOldParamName) { + std::cerr << "Deprecation warning: Parameter Mpfa.Q is deprecated, use MPFA.Q (uppercase MPFA)" << std::endl; + q = getParam<CoordScalar>("Mpfa.Q"); + } + bool hasNewParamName = hasParam("MPFA.Q"); + if (hasNewParamName) { + q = getParam<CoordScalar>("MPFA.Q"); + } + if (hasOldParamName | hasNewParamName) + return q; + else + return getParam<CoordScalar>("MPFA.Q"); + }(); // reserve memory for the scv faces const auto numLocalScvf = scvFaceIndices.size(); @@ -430,7 +445,22 @@ private: const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdxGlobal); // the quadrature point parameterizaion to be used on scvfs - static const auto q = getParam<CoordScalar>("Mpfa.Q"); + static const auto q = []{ // REMOVE deprecated version after release 3.2 + CoordScalar q = 0.0; + bool hasOldParamName = hasParam("Mpfa.Q"); + if (hasOldParamName) { + std::cerr << "Deprecation warning: Parameter Mpfa.Q is deprecated, use MPFA.Q (uppercase MPFA)" << std::endl; + q = getParam<CoordScalar>("Mpfa.Q"); + } + bool hasNewParamName = hasParam("MPFA.Q"); + if (hasNewParamName) { + q = getParam<CoordScalar>("MPFA.Q"); + } + if (hasOldParamName | hasNewParamName) + return q; + else + return getParam<CoordScalar>("MPFA.Q"); + }(); // for network grids we only want to do one scvf per half facet // this approach assumes conforming grids at branching facets diff --git a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh index 70131a9314eeccde3ef7ae1d5313085f5a7b5045..9f6f851b9fb44d098b4918db25f15010ff739755 100644 --- a/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh +++ b/dumux/discretization/cellcentered/mpfa/fvgridgeometry.hh @@ -278,7 +278,22 @@ public: secondaryInteractionVolumeVertices_[vIdxGlobal] = true; // the quadrature point parameterizarion to be used on scvfs - static const auto q = getParam<CoordScalar>("Mpfa.Q"); + static const auto q = []{ // REMOVE deprecated version after release 3.2 + CoordScalar q = 0.0; + bool hasOldParamName = hasParam("Mpfa.Q"); + if (hasOldParamName) { + std::cerr << "Deprecation warning: Parameter Mpfa.Q is deprecated, use MPFA.Q (uppercase MPFA)" << std::endl; + q = getParam<CoordScalar>("Mpfa.Q"); + } + bool hasNewParamName = hasParam("MPFA.Q"); + if (hasNewParamName) { + q = getParam<CoordScalar>("MPFA.Q"); + } + if (hasOldParamName | hasNewParamName) + return q; + else + return getParam<CoordScalar>("MPFA.Q"); + }(); // make the scv face (for non-boundary scvfs on network grids, use precalculated outside indices) const auto& outsideScvIndices = [&] ()