From 0c8025fae6dccd39dead898cdcab068cd2c426b3 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Tue, 9 Feb 2016 09:14:04 +0100
Subject: [PATCH] [fix] Add missing deprecation warnings for 2p

---
 .../fluidmatrixinteractions/2p/brookscorey.hh | 75 +++++++++++++++++++
 .../2p/linearmaterial.hh                      | 21 ++++++
 .../2p/regularizedbrookscorey.hh              | 40 ++++++++++
 .../2p/regularizedlinearmaterial.hh           | 35 +++++++++
 .../2p/regularizedvangenuchten.hh             | 40 ++++++++++
 .../2p/vangenuchten.hh                        | 70 +++++++++++++++++
 6 files changed, 281 insertions(+)

diff --git a/dumux/material/fluidmatrixinteractions/2p/brookscorey.hh b/dumux/material/fluidmatrixinteractions/2p/brookscorey.hh
index e9c1b0a4e4..4e2d2d8d01 100644
--- a/dumux/material/fluidmatrixinteractions/2p/brookscorey.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/brookscorey.hh
@@ -95,6 +95,28 @@ public:
         return std::min(std::max(tmp, Scalar(0.0)), Scalar(1.0));
     }
 
+    /*!
+     * \brief The partial derivative of the capillary
+     *        pressure w.r.t. the effective saturation according to Brooks & Corey.
+     *
+     * This is equivalent to
+     * \f$\mathrm{
+     \frac{\partial p_C}{\partial \overline{S}_w} =
+     -\frac{p_e}{\lambda} \overline{S}_w^{-1/\lambda - 1}
+     }\f$
+     *
+     * \param swe Effective saturation of the wetting phase \f$\mathrm{[\overline{S}_w]}\f$
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     * \return Partial derivative of \f$\mathrm{[p_c]}\f$ w.r.t. effective saturation according to Brooks & Corey.
+    */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe);
+    }
+
     /*!
      * \brief The partial derivative of the capillary
      *        pressure w.r.t. the effective saturation according to Brooks & Corey.
@@ -118,6 +140,22 @@ public:
         return - params.pe()/params.lambda() * pow(swe, -1/params.lambda() - 1);
     }
 
+    /*!
+     * \brief The partial derivative of the effective
+     *        saturation w.r.t. the capillary pressure according to Brooks & Corey.
+     *
+     * \param pc Capillary pressure \f$\mathrm{[p_c]}\f$ in \f$\mathrm{[Pa]}\f$.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     * \return Partial derivative of effective saturation w.r.t. \f$\mathrm{[p_c]}\f$ according to Brooks & Corey.
+     */
+    DUNE_DEPRECATED_MSG("dsw_dpc(const Params &params, Scalar pc) is deprecated. Use dswe_dpc(const Params &params, Scalar pc) instead.")
+    static Scalar dsw_dpc(const Params &params, Scalar pc)
+    {
+        return dswe_dpc(params, pc);
+    }
+
     /*!
      * \brief The partial derivative of the effective
      *        saturation w.r.t. the capillary pressure according to Brooks & Corey.
@@ -153,6 +191,24 @@ public:
         return pow(swe, 2.0/params.lambda() + 3);
     }
 
+    /*!
+     * \brief The derivative of the relative permeability for the
+     *        wetting phase with regard to the wetting saturation of the
+     *        medium implied by the Brooks-Corey parameterization.
+     *
+     * \param swe The mobile saturation of the wetting phase.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen,
+     *                  and then the params container is constructed accordingly. Afterwards the values are set there, too.
+     * \return Derivative of the relative permeability of the wetting phase w.r.t. effective wetting phase
+     *                  saturation calculated as implied by Brooks & Corey.
+     */
+    DUNE_DEPRECATED_MSG("dkrw_dsw(const Params &params, Scalar swe) is deprecated. Use dkrw_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dkrw_dsw(const Params &params, Scalar swe)
+    {
+        return dkrw_dswe(params, swe);
+    }
+
     /*!
      * \brief The derivative of the relative permeability for the
      *        wetting phase with regard to the wetting saturation of the
@@ -192,6 +248,25 @@ public:
         return tmp*tmp*(1. - pow(swe, exponent));
     }
 
+    /*!
+     * \brief The derivative of the relative permeability for the
+     *        non-wetting phase in regard to the wetting saturation of
+     *        the medium as implied by the Brooks-Corey
+     *        parameterization.
+     *
+     * \param swe The mobile saturation of the wetting phase.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen,
+     *                  and then the params container is constructed accordingly. Afterwards the values are set there, too.
+     * \return Derivative of the relative permeability of the non-wetting phase w.r.t. effective wetting phase
+     *                  saturation calculated as implied by Brooks & Corey.
+     */
+    DUNE_DEPRECATED_MSG("dkrn_dsw(const Params &params, Scalar swe) is deprecated. Use dkrn_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dkrn_dsw(const Params &params, Scalar swe)
+    {
+        return dkrn_dswe(params, swe);
+    }
+
     /*!
      * \brief The derivative of the relative permeability for the
      *        non-wetting phase in regard to the wetting saturation of
diff --git a/dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh b/dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh
index 8c28cf4268..504b6f56e4 100644
--- a/dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh
@@ -89,6 +89,27 @@ public:
         return 1 - (pc - params.entryPc())/(params.maxPc() - params.entryPc());
     }
 
+    /*!
+     * \brief Returns the partial derivative of the capillary
+     *        pressure w.r.t. the effective saturation.
+     *
+     * This is equivalent to
+     * \f$\mathrm{
+     \frac{\partial p_C}{\partial \overline{S}_w} =
+     - (p_{C,max} - p_{C,min})
+     }\f$
+     * \param swe  Effective saturation of the wetting phase \f$\mathrm{[\overline{S}_w]}\f$ conversion from absolute saturation happened in EffToAbsLaw.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     * \return          Partial derivative of \f$\mathrm{[p_c]}\f$ w.r.t. effective saturation according to linear material relation.
+    */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe);
+    }
+
     /*!
      * \brief Returns the partial derivative of the capillary
      *        pressure w.r.t. the effective saturation.
diff --git a/dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh b/dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh
index cfc2b6f90d..8e8e3a5999 100644
--- a/dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh
@@ -151,6 +151,26 @@ public:
         return BrooksCorey::sw(params, pc);
     }
 
+    /*!
+     * \brief A regularized version of the partial derivative
+     *        of the \f$\mathrm{p_c(\overline{S}_w)}\f$ w.r.t. effective saturation
+     *        according to Brooks & Corey.
+     *
+     * regularized part:
+     *    - low saturation:  use the slope of the regularization point (i.e. no kink).
+     *    - high saturation: connect the high regularization point with \f$\mathrm{\overline{S}_w =1}\f$
+     *                       by a straight line and use that slope (yes, there is a kink :-( ).
+     *
+     * For the non-regularized part:
+     *
+     * \copydetails BrooksCorey::dpc_dsw()
+     */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe)
+    }
+
     /*!
      * \brief A regularized version of the partial derivative
      *        of the \f$\mathrm{p_c(\overline{S}_w)}\f$ w.r.t. effective saturation
@@ -184,6 +204,26 @@ public:
         return BrooksCorey::dpc_dswe(params, swe);
     }
 
+    /*!
+     * \brief A regularized version of the partial derivative
+     *        of the \f$\mathrm{\overline{S}_w(p_c)}\f$ w.r.t. cap.pressure
+     *        according to Brooks & Corey.
+     *
+     *  regularized part:
+     *    - low saturation:  use the slope of the regularization point (i.e. no kink).
+     *    - high saturation: connect the high regularization point with \f$\mathrm{\overline{S}_w =1}\f$
+     *                       by a straight line and use that slope (yes, there is a kink :-( ).
+     *
+     * For the non-regularized part:
+     *
+     * \copydetails BrooksCorey::dsw_dpc()
+     */
+    DUNE_DEPRECATED_MSG("dsw_dpc(const Params &params, Scalar pc) is deprecated. Use dswe_dpc(const Params &params, Scalar pc) instead.")
+    static Scalar dsw_dpc(const Params &params, Scalar pc)
+    {
+        return dswe_dpc(params, pc);
+    }
+
     /*!
      * \brief A regularized version of the partial derivative
      *        of the \f$\mathrm{\overline{S}_w(p_c)}\f$ w.r.t. cap.pressure
diff --git a/dumux/material/fluidmatrixinteractions/2p/regularizedlinearmaterial.hh b/dumux/material/fluidmatrixinteractions/2p/regularizedlinearmaterial.hh
index b1382fe381..5d49626bb7 100644
--- a/dumux/material/fluidmatrixinteractions/2p/regularizedlinearmaterial.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/regularizedlinearmaterial.hh
@@ -102,6 +102,26 @@ public:
         return LinearMaterial::sw(params, pc);
     }
 
+    /*!
+     * \brief Returns the partial derivative of the capillary
+     *        pressure to the effective saturation.
+     *
+     * This is equivalent to
+     * \f$\mathrm{
+     \frac{\partial p_C}{\partial \overline{S}_w} =
+     - (p_{C,max} - p_{C,min})
+     }\f$
+     * \param swe Effective saturation of the wetting phase \f$\mathrm{\overline{S}_w}\f$ conversion from absolute saturation happened in EffToAbsLaw.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+    */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe);
+    }
+
     /*!
      * \brief Returns the partial derivative of the capillary
      *        pressure to the effective saturation.
@@ -121,6 +141,21 @@ public:
         return LinearMaterial::dpc_dswe(params, swe);
     }
 
+    /*!
+     * \brief Returns the partial derivative of the effective
+     *        saturation to the capillary pressure.
+     *
+     * \param pc Capillary pressure \f$\mathrm{p_C}\f$ in \f$\mathrm{[Pa]}\f$
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     */
+    DUNE_DEPRECATED_MSG("dsw_dpc(const Params &params, Scalar pc) is deprecated. Use dswe_dpc(const Params &params, Scalar pc) instead.")
+    static Scalar dsw_dpc(const Params &params, Scalar pc)
+    {
+        return dswe_dpc(params, pc);
+    }
+
     /*!
      * \brief Returns the partial derivative of the effective
      *        saturation to the capillary pressure.
diff --git a/dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh b/dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh
index 30bf0d7c79..bf9133a399 100644
--- a/dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh
@@ -187,6 +187,27 @@ public:
         return sw;
     }
 
+    /*!
+    * \brief A regularized version of the partial derivative
+    *        of the \f$\mathrm{p_c(\overline{S}_w)}\f$ w.r.t. effective saturation
+    *        according to van Genuchten.
+    *
+    * regularized part:
+    *    - low saturation:  use the slope of the regularization point (i.e. no kink).
+    *    - high saturation: connect the high regularization point with \f$\mathrm{\overline{S}_w =1}\f$
+    *                       by a straight line and use that slope (yes, there is a kink :-( ).
+    *
+    *        For not-regularized part:
+    *
+      \copydetails VanGenuchten::dpc_dsw()
+    *
+    */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe);
+    }
+
     /*!
     * \brief A regularized version of the partial derivative
     *        of the \f$\mathrm{p_c(\overline{S}_w)}\f$ w.r.t. effective saturation
@@ -217,6 +238,25 @@ public:
         return VanGenuchten::dpc_dswe(params, swe);
     }
 
+    /*!
+     * \brief A regularized version of the partial derivative
+     *        of the \f$\mathrm{\overline{S}_w(p_c)}\f$ w.r.t. cap.pressure
+     *        according to van Genuchten.
+     *
+     *  regularized part:
+     *    - low saturation:  use the slope of the regularization point (i.e. no kink).
+     *    - high saturation: connect the high regularization point with \f$\mathrm{\overline{S}_w =1}\f$
+     *                       by a straight line and use that slope (yes, there is a kink :-( ).
+     *
+     *        For not-regularized part:
+        \copydetails VanGenuchten::dsw_dpc()
+     */
+    DUNE_DEPRECATED_MSG("dsw_dpc(const Params &params, Scalar pc) is deprecated. Use dswe_dpc(const Params &params, Scalar pc) instead.")
+    static Scalar dsw_dpc(const Params &params, Scalar pc)
+    {
+        return dswe_dpc(params, pc);
+    }
+
     /*!
      * \brief A regularized version of the partial derivative
      *        of the \f$\mathrm{\overline{S}_w(p_c)}\f$ w.r.t. cap.pressure
diff --git a/dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh b/dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh
index 388e9aca0b..492395a025 100644
--- a/dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh
+++ b/dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh
@@ -92,6 +92,28 @@ public:
         return pow(pow(params.vgAlpha()*pc, params.vgn()) + 1, -params.vgm());
     }
 
+    /*!
+     * \brief The partial derivative of the capillary
+     *        pressure w.r.t. the effective saturation according to van Genuchten.
+     *
+     * This is equivalent to
+     * \f$\mathrm{
+     \frac{\partial p_C}{\partial \overline{S}_w} =
+     -\frac{1}{\alpha} (\overline{S}_w^{-1/m} - 1)^{1/n - }
+     \overline{S}_w^{-1/m} / \overline{S}_w / m
+     }\f$
+     *
+     * \param swe Effective saturation of the wetting phase \f$\mathrm{\overline{S}_w}\f$
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+    */
+    DUNE_DEPRECATED_MSG("dpc_dsw(const Params &params, Scalar swe) is deprecated. Use dpc_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dpc_dsw(const Params &params, Scalar swe)
+    {
+        return dpc_dswe(params, swe);
+    }
+
     /*!
      * \brief The partial derivative of the capillary
      *        pressure w.r.t. the effective saturation according to van Genuchten.
@@ -117,6 +139,21 @@ public:
             * powSwe/swe/params.vgm();
     }
 
+    /*!
+     * \brief The partial derivative of the effective
+     *        saturation to the capillary pressure according to van Genuchten.
+     *
+     * \param pc Capillary pressure \f$\mathrm{p_C}\f$ in \f$\mathrm{[Pa]}\f$
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     */
+    DUNE_DEPRECATED_MSG("dsw_dpc(const Params &params, Scalar pc) is deprecated. Use dswe_dpc(const Params &params, Scalar pc) instead.")
+    static Scalar dsw_dpc(const Params &params, Scalar pc)
+    {
+        return dswe_dpc(params, pc);
+    }
+
     /*!
      * \brief The partial derivative of the effective
      *        saturation to the capillary pressure according to van Genuchten.
@@ -152,6 +189,22 @@ public:
         return sqrt(swe)*r*r;
     }
 
+    /*!
+     * \brief The derivative of the relative permeability for the
+     *        wetting phase in regard to the wetting saturation of the
+     *        medium implied by the van Genuchten parameterization.
+     *
+     * \param swe The mobile saturation of the wetting phase.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     */
+    DUNE_DEPRECATED_MSG("dkrw_dsw(const Params &params, Scalar swe) is deprecated. Use dkrw_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dkrw_dsw(const Params &params, Scalar swe)
+    {
+        return dkrw_dswe(params, swe);
+    }
+
     /*!
      * \brief The derivative of the relative permeability for the
      *        wetting phase in regard to the wetting saturation of the
@@ -190,6 +243,23 @@ public:
             pow(1 - pow(swe, 1.0/params.vgm()), 2*params.vgm());
     }
 
+    /*!
+     * \brief The derivative of the relative permeability for the
+     *        non-wetting phase in regard to the wetting saturation of
+     *        the medium as implied by the van Genuchten
+     *        parameterization.
+     *
+     * \param swe The mobile saturation of the wetting phase.
+     * \param params A container object that is populated with the appropriate coefficients for the respective law.
+     *                  Therefore, in the (problem specific) spatialParameters  first, the material law is chosen, and then the params container
+     *                  is constructed accordingly. Afterwards the values are set there, too.
+     */
+    DUNE_DEPRECATED_MSG("dkrn_dsw(const Params &params, Scalar swe) is deprecated. Use dkrn_dswe(const Params &params, Scalar swe) instead.")
+    static Scalar dkrn_dsw(const Params &params, Scalar swe)
+    {
+        return dkrn_dswe(params, swe);
+    }
+
     /*!
      * \brief The derivative of the relative permeability for the
      *        non-wetting phase in regard to the wetting saturation of
-- 
GitLab