From f676fae5a49a469f17ce1578aff66fddfe79b2e3 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 5 Dec 2017 15:56:56 +0100 Subject: [PATCH] [properties] Rename BasicProperties to ModelProperties * only PMFlowTypeTag and FreeFlowTypeTag inherit from the ModelProperties --- dumux/common/properties/grid.hh | 3 +-- .../common/properties/{basic.hh => model.hh} | 22 +++++++++++++------ dumux/freeflow/properties.hh | 4 ++-- .../fluidsystems/defaultcomponents.hh | 8 +++---- dumux/porousmediumflow/properties.hh | 4 ++-- 5 files changed, 24 insertions(+), 17 deletions(-) rename dumux/common/properties/{basic.hh => model.hh} (74%) diff --git a/dumux/common/properties/grid.hh b/dumux/common/properties/grid.hh index 847ff50c77..41614e1fbb 100644 --- a/dumux/common/properties/grid.hh +++ b/dumux/common/properties/grid.hh @@ -26,7 +26,6 @@ #define DUMUX_GRID_PROPERTIES_HH #include <dumux/common/properties.hh> -#include <dumux/common/properties/basic.hh> #include <dune/common/parametertree.hh> #include <dune/common/fvector.hh> @@ -43,7 +42,7 @@ namespace Dumux namespace Properties { //! Type tag for numeric models. -NEW_TYPE_TAG(GridProperties, INHERITS_FROM(BasicProperties)); +NEW_TYPE_TAG(GridProperties); //! Use the leaf grid view if not defined otherwise SET_TYPE_PROP(GridProperties, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView); diff --git a/dumux/common/properties/basic.hh b/dumux/common/properties/model.hh similarity index 74% rename from dumux/common/properties/basic.hh rename to dumux/common/properties/model.hh index fcfa1f70a9..66ad84faf1 100644 --- a/dumux/common/properties/basic.hh +++ b/dumux/common/properties/model.hh @@ -26,6 +26,8 @@ #ifndef DUMUX_BASIC_PROPERTIES_HH #define DUMUX_BASIC_PROPERTIES_HH +#include <dune/common/fvector.hh> + #include <dumux/common/balanceequationopts.hh> #include <dumux/common/properties.hh> @@ -38,28 +40,34 @@ namespace Dumux namespace Properties { //! Type tag for numeric models. -NEW_TYPE_TAG(BasicProperties); +NEW_TYPE_TAG(ModelProperties); //! Set the default type of scalar values to double -SET_TYPE_PROP(BasicProperties, Scalar, double); +SET_TYPE_PROP(ModelProperties, Scalar, double); //! Set the default number of equations to one -SET_INT_PROP(BasicProperties, NumEq, 1); +SET_INT_PROP(ModelProperties, NumEq, 1); + +//! Set the default vector with size number of equations to a field vector +SET_TYPE_PROP(ModelProperties, NumEqVector, Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), GET_PROP_VALUE(TypeTag, NumEq)>); + +//! Set the default primary variable vector to a vector of size of number of equations +SET_TYPE_PROP(ModelProperties, PrimaryVariables, typename GET_PROP_TYPE(TypeTag, NumEqVector)); //! use the global group as default for the model's parameter group -SET_STRING_PROP(BasicProperties, ModelParameterGroup, ""); +SET_STRING_PROP(ModelProperties, ModelParameterGroup, ""); //! do not specific any model-specific default parameters here -SET_PROP(BasicProperties, ModelDefaultParameters) +SET_PROP(ModelProperties, ModelDefaultParameters) { static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { } }; //! Set the default to a function throwing a NotImplemented error -SET_TYPE_PROP(BasicProperties, VtkOutputFields, DefaultVtkOutputFields); +SET_TYPE_PROP(ModelProperties, VtkOutputFields, DefaultVtkOutputFields); //! Set the default class for the balance equation options -SET_TYPE_PROP(BasicProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>); +SET_TYPE_PROP(ModelProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>); } // namespace Properties } // namespace Dumux diff --git a/dumux/freeflow/properties.hh b/dumux/freeflow/properties.hh index e73a4e28d8..bbc20644c9 100644 --- a/dumux/freeflow/properties.hh +++ b/dumux/freeflow/properties.hh @@ -27,7 +27,7 @@ #define DUMUX_FREE_FLOW_PROPERTIES_HH #include <dumux/common/properties.hh> -#include <dumux/common/properties/basic.hh> +#include <dumux/common/properties/model.hh> #include <dumux/discretization/staggered/freeflow/facevariables.hh> #include <dumux/implicit/staggered/primaryvariables.hh> @@ -38,7 +38,7 @@ namespace Dumux namespace Properties { //! Type tag for models involving flow in porous media -NEW_TYPE_TAG(FreeFlow, INHERITS_FROM(BasicProperties)); +NEW_TYPE_TAG(FreeFlow, INHERITS_FROM(ModelProperties)); SET_PROP(FreeFlow, NumEq) { diff --git a/dumux/material/fluidsystems/defaultcomponents.hh b/dumux/material/fluidsystems/defaultcomponents.hh index 7871f63e0b..eae15ebbb7 100644 --- a/dumux/material/fluidsystems/defaultcomponents.hh +++ b/dumux/material/fluidsystems/defaultcomponents.hh @@ -27,7 +27,7 @@ #warning "DefaultComponents is deprecated. Specify fluid system via template parameters and not using the property system!" -#include <dumux/common/properties/numericmodel.hh> +#include <dumux/common/properties/model.hh> #include <dumux/common/properties.hh> #include <dumux/material/components/h2o.hh> @@ -55,7 +55,7 @@ NEW_PROP_TAG(EnableComplicatedFluidSystem); NEW_PROP_TAG(Components); //! Specifies default component names and initializes the H2O fluid properties -SET_PROP(NumericModel, DefaultComponents) +SET_PROP(ModelProperties, DefaultComponents) { private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; @@ -84,7 +84,7 @@ public: }; //! Initialize the components with default behavior -SET_PROP(NumericModel, Components) : public GET_PROP(TypeTag, DefaultComponents) {}; +SET_PROP(ModelProperties, Components) : public GET_PROP(TypeTag, DefaultComponents) {}; /*! * \brief Enables a detailed description of the fluidsystem @@ -94,7 +94,7 @@ SET_PROP(NumericModel, Components) : public GET_PROP(TypeTag, DefaultComponents) * Typically, such high demands on accuracy are not needed, so this property * is set to "false" as the default. */ -SET_BOOL_PROP(NumericModel, EnableComplicatedFluidSystem, false); +SET_BOOL_PROP(ModelProperties, EnableComplicatedFluidSystem, false); } // namespace Properties } // namespace Dumux diff --git a/dumux/porousmediumflow/properties.hh b/dumux/porousmediumflow/properties.hh index 3733377178..0ea77266aa 100644 --- a/dumux/porousmediumflow/properties.hh +++ b/dumux/porousmediumflow/properties.hh @@ -26,7 +26,7 @@ #ifndef DUMUX_POROUSMEDIUM_FLOW_PROPERTIES_HH #define DUMUX_POROUSMEDIUM_FLOW_PROPERTIES_HH -#include <dumux/common/properties/basic.hh> +#include <dumux/common/properties/model.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/porousmediumflow/implicit/fluxvariables.hh> @@ -44,7 +44,7 @@ namespace Dumux namespace Properties { //! Type tag for models involving flow in porous media -NEW_TYPE_TAG(PorousMediumFlow, INHERITS_FROM(BasicProperties)); +NEW_TYPE_TAG(PorousMediumFlow, INHERITS_FROM(ModelProperties)); //! The flux variables for models involving flow in porous media SET_TYPE_PROP(PorousMediumFlow, FluxVariables, PorousMediumFluxVariables<TypeTag>); -- GitLab