diff --git a/dumux/implicit/common/implicitproblem.hh b/dumux/implicit/common/implicitproblem.hh index 2d0769972b9eb00bbbfb143895407d2a20318e1c..6e74bc2cd143a84096d7f797a4cda08fb74bfab7 100644 --- a/dumux/implicit/common/implicitproblem.hh +++ b/dumux/implicit/common/implicitproblem.hh @@ -680,6 +680,21 @@ public: const GlobalPosition &bBoxMax() const { return bBoxMax_; } + /*! + * \brief Determines if globalPos is a corner of the grid, this is needed for + * the multidomain models. + * + * \param globalPos The global position + * \param eps The epsilon for comparing the locations + */ + bool isCornerPoint(const GlobalPosition &globalPos, Scalar eps = 1e-8) + { + return ((globalPos[0] < asImp_().bBoxMin()[0] + eps && globalPos[1] < asImp_().bBoxMin()[1] + eps) + || (globalPos[0] < asImp_().bBoxMin()[0] + eps && globalPos[1] > asImp_().bBoxMax()[1] - eps) + || (globalPos[0] > asImp_().bBoxMax()[0] - eps && globalPos[1] < asImp_().bBoxMin()[1] + eps) + || (globalPos[0] > asImp_().bBoxMax()[0] - eps && globalPos[1] > asImp_().bBoxMax()[1] - eps)); + } + /*! * \brief Returns the mapper for vertices to indices for constant grids. */ diff --git a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh index df114ef356427ad0dbe2649409832288052d0183..e9dad48372cf2fbd5663911f6639882cff1666c8 100644 --- a/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/2p2cnisubproblem.hh @@ -205,6 +205,15 @@ public: outfile.close(); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc Dumux::ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc Dumux::ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -408,19 +417,6 @@ public: } } - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - // \} private: @@ -451,12 +447,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_; diff --git a/test/multidomain/2cnistokes2p2cni/stokes2cnisubproblem.hh b/test/multidomain/2cnistokes2p2cni/stokes2cnisubproblem.hh index 228e370cd5519ca20262adfdf38bf68e399ac519..7a73268f7548e997453c5a424abe610151eb7ca4 100644 --- a/test/multidomain/2cnistokes2p2cni/stokes2cnisubproblem.hh +++ b/test/multidomain/2cnistokes2p2cni/stokes2cnisubproblem.hh @@ -173,6 +173,15 @@ public: initializationTime_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, InitTime); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc Dumux::ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc Dumux::ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -370,22 +379,6 @@ public: } // \} - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - if ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))) - return true; - else - return false; - } - //! \brief Returns the reference velocity. const Scalar refVelocity() const { return refVelocity_ + variation_(sinusVAmplitude_, sinusVPeriod_); } @@ -458,12 +451,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - const Scalar height_() const { return bBoxMax_[1] - bBoxMin_[1]; } diff --git a/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh b/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh index 9d7f8ebbba5a0b5f46539cedee0f9cff9c556464..5f413336dcc2e580790e72dc2f91dfdeec350acd 100644 --- a/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh +++ b/test/multidomain/2cnizeroeq2p2cni/2p2cnisubproblem.hh @@ -194,6 +194,15 @@ public: outfile.close(); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc Dumux::ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc Dumux::ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -334,19 +343,6 @@ public: } } - /*! - * \brief Determine if we are on a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - // \} private: @@ -375,12 +371,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_; diff --git a/test/multidomain/2cnizeroeq2p2cni/zeroeq2cnisubproblem.hh b/test/multidomain/2cnizeroeq2p2cni/zeroeq2cnisubproblem.hh index b2e3d1b1be4d7a1ed71ae1e3b689b11ff32f0a24..e76f41abd0c02937cce0335994279886f12b0d18 100644 --- a/test/multidomain/2cnizeroeq2p2cni/zeroeq2cnisubproblem.hh +++ b/test/multidomain/2cnizeroeq2p2cni/zeroeq2cnisubproblem.hh @@ -170,7 +170,7 @@ public: refTemperature_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, FreeFlow, RefTemperature); } - // functions have to be overwritten, otherwise they remain uninitialised + // functions have to be overwritten, otherwise they remain uninitialized //! \copydoc Dumux::ImplicitProblem::bBoxMin() const GlobalPosition &bBoxMin() const { return bBoxMin_; } @@ -278,19 +278,6 @@ public: // \} - /*! - * \brief Determine if we are on a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - //! \brief Returns the velocity at the inflow. const Scalar refVelocity() const { @@ -356,12 +343,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_; diff --git a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh index e8ba6ea621bafd269b4d4fe63186ca6b552fac74..253cfa3535e04d34657d0d69962e7dce106fd61c 100644 --- a/test/multidomain/2cstokes2p2c/2p2csubproblem.hh +++ b/test/multidomain/2cstokes2p2c/2p2csubproblem.hh @@ -176,6 +176,15 @@ public: outfile.close(); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -369,19 +378,6 @@ public: } } - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - // \} private: /*! @@ -408,12 +404,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_; diff --git a/test/multidomain/2cstokes2p2c/stokes2csubproblem.hh b/test/multidomain/2cstokes2p2c/stokes2csubproblem.hh index 37f045bc0b1b723bdafbca8c9ad3953011ab41d1..69f83590c43a671739005d10c449fdf77fbc986d 100644 --- a/test/multidomain/2cstokes2p2c/stokes2csubproblem.hh +++ b/test/multidomain/2cstokes2p2c/stokes2csubproblem.hh @@ -168,6 +168,15 @@ public: initializationTime_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, InitTime); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -344,22 +353,6 @@ public: } // \} - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - if ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) || - (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))) - return true; - else - return false; - } - //! \brief Returns the reference velocity. const Scalar refVelocity() const { return refVelocity_ + variation_(sinusVAmplitude_, sinusVPeriod_); } @@ -431,12 +424,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - // the height of the free-flow domain const Scalar height_() const { return bBoxMax_[1] - bBoxMin_[1]; } diff --git a/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh b/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh index 904dcfecd00da7ddb94264185d24872acc49a58d..073ebd4ee66aeff8f1b5cc678fb799ed1c0a691f 100644 --- a/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh +++ b/test/multidomain/2czeroeq2p2c/2p2csubproblem.hh @@ -174,6 +174,15 @@ public: outfile.close(); } + // functions have to be overwritten, otherwise they remain uninitialized + //! \copydoc ImplicitProblem::bBoxMin() + const GlobalPosition &bBoxMin() const + { return bBoxMin_; } + + //! \copydoc ImplicitProblem::bBoxMax() + const GlobalPosition &bBoxMax() const + { return bBoxMax_; } + /*! * \name Problem parameters */ @@ -328,19 +337,6 @@ public: } } - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - private: // Internal method for the initial condition (reused for the dirichlet conditions!) void initial_(PrimaryVariables &values, @@ -363,12 +359,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_; diff --git a/test/multidomain/2czeroeq2p2c/zeroeq2csubproblem.hh b/test/multidomain/2czeroeq2p2c/zeroeq2csubproblem.hh index 9beed5ef22b42f95f10900872e947275f6564882..85c93f996e12e16240d1c720b8ee5a4422b94ef4 100644 --- a/test/multidomain/2czeroeq2p2c/zeroeq2csubproblem.hh +++ b/test/multidomain/2czeroeq2p2c/zeroeq2csubproblem.hh @@ -170,7 +170,7 @@ public: refTemperature_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, FreeFlow, RefTemperature); } - // functions have to be overwritten, otherwise they remain uninitialised + // functions have to be overwritten, otherwise they remain uninitialized //! \copydoc ImplicitProblem::bBoxMin() const GlobalPosition &bBoxMin() const { return bBoxMin_; } @@ -295,19 +295,6 @@ public: // \} - /*! - * \brief Determines if globalPos is a corner of the grid - * - * \param globalPos The global position - */ - bool isCornerPoint(const GlobalPosition &globalPos) - { - return ((onLeftBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onLeftBoundary_(globalPos) && onUpperBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onLowerBoundary_(globalPos)) - || (onRightBoundary_(globalPos) && onUpperBoundary_(globalPos))); - } - //! \brief Returns the velocity at the inflow. const Scalar refVelocity() const { @@ -386,12 +373,6 @@ private: bool onUpperBoundary_(const GlobalPosition &globalPos) const { return globalPos[1] > bBoxMax_[1] - eps_; } - bool onBoundary_(const GlobalPosition &globalPos) const - { - return (onLeftBoundary_(globalPos) || onRightBoundary_(globalPos) - || onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)); - } - static constexpr Scalar eps_ = 1e-8; GlobalPosition bBoxMin_; GlobalPosition bBoxMax_;