diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index ed6e59bcfd146e4905ffbe00f4da15cd16026646..452ae6fb68e117eced6acd176d8b646cd3417c1a 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -48,7 +48,9 @@ NEW_PROP_TAG(ModelTraits); //!< Traits class encapsulating model spec NEW_PROP_TAG(Problem); //!< Property to specify the type of a problem which has to be solved NEW_PROP_TAG(PointSource); //!< Property defining the type of point source used NEW_PROP_TAG(PointSourceHelper); //!< Property defining the class that computes which sub control volume point sources belong to +// TODO: Remove deprecated property VtkOutputFields NEW_PROP_TAG(VtkOutputFields); //!< A class helping models to define default vtk output parameters +NEW_PROP_TAG(IOFields); //!< A class helping models to define input and output fields NEW_PROP_TAG(BaseLocalResidual); //!< The type of the base class of the local residual (specific to a discretization scheme) NEW_PROP_TAG(JacobianMatrix); //!< Type of the global jacobian matrix NEW_PROP_TAG(SolutionVector); //!< Vector containing all primary variable vector of the grid diff --git a/dumux/common/properties/model.hh b/dumux/common/properties/model.hh index ab3b92df8757746a1eeb313e09ddb29425e2d253..ce267a1174f6efe856f573673426be2c5dd0480f 100644 --- a/dumux/common/properties/model.hh +++ b/dumux/common/properties/model.hh @@ -25,10 +25,11 @@ #define DUMUX_MODEL_PROPERTIES_HH #include <dune/common/fvector.hh> +#include <dune/common/deprecated.hh> #include <dumux/common/properties.hh> #include <dumux/common/balanceequationopts.hh> -#include <dumux/io/defaultvtkoutputfields.hh> +#include <dumux/io/defaultiofields.hh> // Forward declaration namespace Dune { class ParameterTree; } @@ -54,8 +55,13 @@ 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(ModelProperties, VtkOutputFields, DefaultVtkOutputFields); +//! \todo this property is deprecated use IOFields instead! +SET_PROP(ModelProperties, VtkOutputFields) { + using type DUNE_DEPRECATED_MSG("This property is deprecated use property IOFields instead") = typename GET_PROP_TYPE(TypeTag, IOFields); +}; + +//! Set the default to an implementation throwing a NotImplemented error +SET_TYPE_PROP(ModelProperties, IOFields, DefaultIOFields); //! Set the default class for the balance equation options SET_TYPE_PROP(ModelProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>); diff --git a/dumux/io/CMakeLists.txt b/dumux/io/CMakeLists.txt index 2dd3c0be73533b1af8fc2d5a78554fd7a9046447..334ce60e140c265078f57246ce92bb3e88b62f28 100644 --- a/dumux/io/CMakeLists.txt +++ b/dumux/io/CMakeLists.txt @@ -5,7 +5,7 @@ add_subdirectory(xml) install(FILES adaptivegridrestart.hh container.hh -defaultvtkoutputfields.hh +defaultiofields.hh fieldnames.hh gnuplotinterface.hh loadsolution.hh diff --git a/dumux/io/defaultvtkoutputfields.hh b/dumux/io/defaultiofields.hh similarity index 72% rename from dumux/io/defaultvtkoutputfields.hh rename to dumux/io/defaultiofields.hh index 11ed8ff6f5770e4ff8bdf051de0b8f990f9fd276..b54c2802be0da3eeecd2177edc46930d128835bf 100644 --- a/dumux/io/defaultvtkoutputfields.hh +++ b/dumux/io/defaultiofields.hh @@ -19,28 +19,33 @@ /*! * \file * \ingroup InputOutput - * \brief Adds vtk output fields specific to a model, this is the default if a + * \brief Adds output fields to a given output module, this is the default if a model doesn't implement this functionality */ -#ifndef DUMUX_DEFAULT_VTK_OUTPUT_FIELDS_HH -#define DUMUX_DEFAULT_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_IO_DEFAULT_IO_FIELDS_HH +#define DUMUX_IO_DEFAULT_IO_FIELDS_HH #include <dune/common/exceptions.hh> -namespace Dumux -{ +namespace Dumux { /*! * \ingroup InputOutput - * \brief Adds vtk output fields specific to a model + * \brief Adds output fields to a given output module */ -class DefaultVtkOutputFields +class DefaultIOFields { public: - template<class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template<class OutputModule> + static void initOutputModule(OutputModule& out) + { + DUNE_THROW(Dune::NotImplemented, "This model doesn't implement default output fields!"); + } + + template <class FluidSystem = void, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - DUNE_THROW(Dune::NotImplemented, "This model doesn't implement default vtk fields!"); + DUNE_THROW(Dune::NotImplemented, "This model doesn't implement primaryVariableName!"); } };