From f0e07930e3eaebada9dcb5402bb2ef8eca9bbbe8 Mon Sep 17 00:00:00 2001 From: Benjamin Faigle <benjamin.faigle@posteo.de> Date: Mon, 28 Jan 2013 17:03:30 +0000 Subject: [PATCH] Make TimeManagerMaxTimeStepSize a general feature by: -moving the property to NumericalModel -removing it from implicit properties and ~defaults -moving query from implicitproblem.hh to the same method in timeManager.hh reviewed by Klaus git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10110 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/common/basicproperties.hh | 10 ++++++++++ dumux/common/timemanager.hh | 3 ++- dumux/implicit/common/implicitproblem.hh | 3 +-- dumux/implicit/common/implicitproperties.hh | 6 ------ dumux/implicit/common/implicitpropertydefaults.hh | 3 --- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dumux/common/basicproperties.hh b/dumux/common/basicproperties.hh index 9d34445ddf..e6247e5911 100644 --- a/dumux/common/basicproperties.hh +++ b/dumux/common/basicproperties.hh @@ -74,6 +74,13 @@ NEW_PROP_TAG(ModelParameterGroup); //! Property which provides a GridCreator (manages grids) NEW_PROP_TAG(GridCreator); +/*! + * \brief Specify the maximum size of a time integration [s]. + * + * The default is to not limit the step size. + */ +NEW_PROP_TAG(TimeManagerMaxTimeStepSize); + //! Property to define the output level NEW_PROP_TAG(VtkOutputLevel); @@ -86,6 +93,9 @@ NEW_PROP_TAG(VtkOutputLevel); //! Set the default type of scalar values to double SET_TYPE_PROP(NumericModel, Scalar, double); +//! use an unlimited time step size by default +SET_SCALAR_PROP(NumericModel, TimeManagerMaxTimeStepSize, std::numeric_limits<typename GET_PROP_TYPE(TypeTag,Scalar)>::max()); + //! Set the ParameterTree property SET_PROP(NumericModel, ParameterTree) { diff --git a/dumux/common/timemanager.hh b/dumux/common/timemanager.hh index 191da8a709..972bfa5854 100644 --- a/dumux/common/timemanager.hh +++ b/dumux/common/timemanager.hh @@ -244,7 +244,8 @@ public: return 0.0; return - std::min(episodeMaxTimeStepSize(), + std::min(std::min(episodeMaxTimeStepSize(), + GET_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, MaxTimeStepSize)), std::max<Scalar>(0.0, endTime() - time())); }; diff --git a/dumux/implicit/common/implicitproblem.hh b/dumux/implicit/common/implicitproblem.hh index 97979e658c..0f0af3616d 100644 --- a/dumux/implicit/common/implicitproblem.hh +++ b/dumux/implicit/common/implicitproblem.hh @@ -563,8 +563,7 @@ public: */ Scalar nextTimeStepSize(const Scalar dt) { - return std::min(GET_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, MaxTimeStepSize), - newtonCtl_.suggestTimeStepSize(dt)); + return newtonCtl_.suggestTimeStepSize(dt); }; /*! diff --git a/dumux/implicit/common/implicitproperties.hh b/dumux/implicit/common/implicitproperties.hh index 308fb942a4..5b9574598a 100644 --- a/dumux/implicit/common/implicitproperties.hh +++ b/dumux/implicit/common/implicitproperties.hh @@ -95,12 +95,6 @@ NEW_PROP_TAG(ImplicitEnableJacobianRecycling); //! elements where at least one vertex is above the specified //! tolerance NEW_PROP_TAG(ImplicitEnablePartialReassemble); -/*! - * \brief Specify the maximum size of a time integration [s]. - * - * The default is to not limit the step size. - */ -NEW_PROP_TAG(TimeManagerMaxTimeStepSize); /*! * \brief Specify which kind of method should be used to numerically diff --git a/dumux/implicit/common/implicitpropertydefaults.hh b/dumux/implicit/common/implicitpropertydefaults.hh index ea67ef0142..1b5a3cf5c3 100644 --- a/dumux/implicit/common/implicitpropertydefaults.hh +++ b/dumux/implicit/common/implicitpropertydefaults.hh @@ -108,9 +108,6 @@ SET_TYPE_PROP(ImplicitBase, BoundaryTypes, Dumux::BoundaryTypes<GET_PROP_VALUE(TypeTag, NumEq)>); -//! use an unlimited time step size by default -SET_SCALAR_PROP(ImplicitBase, TimeManagerMaxTimeStepSize, 1e100); - //! use forward differences to calculate the jacobian by default SET_INT_PROP(ImplicitBase, ImplicitNumericDifferenceMethod, +1); -- GitLab