From 80d37e23c483878d0cc84249d402ce1ac73987a7 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Thu, 30 Aug 2018 15:07:09 +0200 Subject: [PATCH 01/26] [io] Add header with IO field names for common physical quantities --- dumux/io/CMakeLists.txt | 1 + dumux/io/fieldnames.hh | 100 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 dumux/io/fieldnames.hh diff --git a/dumux/io/CMakeLists.txt b/dumux/io/CMakeLists.txt index 72dd61cd93..2dd3c0be73 100644 --- a/dumux/io/CMakeLists.txt +++ b/dumux/io/CMakeLists.txt @@ -6,6 +6,7 @@ install(FILES adaptivegridrestart.hh container.hh defaultvtkoutputfields.hh +fieldnames.hh gnuplotinterface.hh loadsolution.hh ploteffectivediffusivitymodel.hh diff --git a/dumux/io/fieldnames.hh b/dumux/io/fieldnames.hh new file mode 100644 index 0000000000..8521da1995 --- /dev/null +++ b/dumux/io/fieldnames.hh @@ -0,0 +1,100 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup InputOutput + * \brief A collection of input/output field names for common physical quantities + */ +#ifndef DUMUX_IO_FIELD_NAMES_HH +#define DUMUX_IO_FIELD_NAMES_HH + +#include + +namespace Dumux { +namespace IOFieldNames { + +//! name of variable pressure +template +std::string pressure(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "p" : "p_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable saturation +template +std::string saturation(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "S" : "S_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable temperature (equilibrium models) +std::string temperature() noexcept +{ return "T"; } + +//! name of variable temperature (non-equilibrium models) +template +std::string fluidTemperature(int phaseIdx) noexcept +{ return "T_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable temperature (non-equilibrium models) +std::string solidTemperature() noexcept +{ return "T_s"; } + +//! name of variable density +template +std::string density(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "rho" : "rho_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable molar density +template +std::string molarDensity(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "rhoMolar" : "rhoMolar_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable mobility +template +std::string mobility(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "mob" : "mob_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable mole fraction +template +std::string moleFraction(int phaseIdx, int compIdx) noexcept +{ return "x^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable mass fraction +template +std::string moleFraction(int phaseIdx, int compIdx) noexcept +{ return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } + +//! name of variable capillary pressure +std::string capillaryPressure() noexcept +{ return "pc"; } + +//! name of variable porosity +std::string porosity() noexcept +{ return "porosity"; } + +//! name of variable phase presence +std::string phasePresence() noexcept +{ return "phase presence"; } + +//! name of solid volume fraction +template +std::string solidVolumeFraction(int compIdx) noexcept +{ return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } + +} // end namespace IO +} // end namespace Dumux + +#endif -- GitLab From ddd7256c2ed05945600db885bac027491d4e52b5 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Thu, 30 Aug 2018 15:20:17 +0200 Subject: [PATCH 02/26] [io] Add new property IOFields to replace VtkOutputFields --- dumux/common/properties.hh | 2 ++ dumux/common/properties/model.hh | 12 ++++++--- dumux/io/CMakeLists.txt | 2 +- ...tvtkoutputfields.hh => defaultiofields.hh} | 25 +++++++++++-------- 4 files changed, 27 insertions(+), 14 deletions(-) rename dumux/io/{defaultvtkoutputfields.hh => defaultiofields.hh} (72%) diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index ed6e59bcfd..452ae6fb68 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 ab3b92df87..ce267a1174 100644 --- a/dumux/common/properties/model.hh +++ b/dumux/common/properties/model.hh @@ -25,10 +25,11 @@ #define DUMUX_MODEL_PROPERTIES_HH #include +#include #include #include -#include +#include // 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); diff --git a/dumux/io/CMakeLists.txt b/dumux/io/CMakeLists.txt index 2dd3c0be73..334ce60e14 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 11ed8ff6f5..b54c2802be 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 -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 - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) + { + DUNE_THROW(Dune::NotImplemented, "This model doesn't implement default output fields!"); + } + + template + 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!"); } }; -- GitLab From 70d1840776a68bdaf492baa299ec11afeadda156 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 31 Aug 2018 12:43:23 +0200 Subject: [PATCH 03/26] [io] fix and generalize fieldnames --- dumux/io/fieldnames.hh | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/dumux/io/fieldnames.hh b/dumux/io/fieldnames.hh index 8521da1995..447251e55e 100644 --- a/dumux/io/fieldnames.hh +++ b/dumux/io/fieldnames.hh @@ -31,9 +31,13 @@ namespace IOFieldNames { //! name of variable pressure template -std::string pressure(int phaseIdx) noexcept +std::string pressure(int phaseIdx = 0) noexcept { return (FluidSystem::numPhases == 1) ? "p" : "p_" + FluidSystem::phaseName(phaseIdx); } +//! name of variable pressure +std::string pressure() noexcept +{ return "p"; } + //! name of variable saturation template std::string saturation(int phaseIdx) noexcept @@ -45,7 +49,7 @@ std::string temperature() noexcept //! name of variable temperature (non-equilibrium models) template -std::string fluidTemperature(int phaseIdx) noexcept +std::string fluidTemperature(int phaseIdx = 0) noexcept { return "T_" + FluidSystem::phaseName(phaseIdx); } //! name of variable temperature (non-equilibrium models) @@ -54,19 +58,31 @@ std::string solidTemperature() noexcept //! name of variable density template -std::string density(int phaseIdx) noexcept +std::string density(int phaseIdx = 0) noexcept { return (FluidSystem::numPhases == 1) ? "rho" : "rho_" + FluidSystem::phaseName(phaseIdx); } +//! name of variable density +std::string density() noexcept +{ return "rho"; } + //! name of variable molar density template -std::string molarDensity(int phaseIdx) noexcept +std::string molarDensity(int phaseIdx = 0) noexcept { return (FluidSystem::numPhases == 1) ? "rhoMolar" : "rhoMolar_" + FluidSystem::phaseName(phaseIdx); } +//! name of variable molar density +std::string molarDensity() noexcept +{ return "rhoMolar"; } + //! name of variable mobility template -std::string mobility(int phaseIdx) noexcept +std::string mobility(int phaseIdx = 0) noexcept { return (FluidSystem::numPhases == 1) ? "mob" : "mob_" + FluidSystem::phaseName(phaseIdx); } +//! name of variable mobility +std::string mobility() noexcept +{ return "mob"; } + //! name of variable mole fraction template std::string moleFraction(int phaseIdx, int compIdx) noexcept @@ -74,7 +90,7 @@ std::string moleFraction(int phaseIdx, int compIdx) noexcept //! name of variable mass fraction template -std::string moleFraction(int phaseIdx, int compIdx) noexcept +std::string massFraction(int phaseIdx, int compIdx) noexcept { return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } //! name of variable capillary pressure @@ -91,10 +107,10 @@ std::string phasePresence() noexcept //! name of solid volume fraction template -std::string solidVolumeFraction(int compIdx) noexcept +std::string solidVolumeFraction(int compIdx = 0) noexcept { return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } -} // end namespace IO +} // end namespace IOFieldNames } // end namespace Dumux #endif -- GitLab From 7f6afd8ab1318f1096c955e5548d5fd6213c01d8 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 31 Aug 2018 12:43:54 +0200 Subject: [PATCH 04/26] [io][1p] add IOFields Adapt and rename OnePVtkOutputFields. Adapt model.hh. --- .../1p/{vtkoutputfields.hh => iofields.hh} | 34 +++++++++++++++---- dumux/porousmediumflow/1p/model.hh | 6 ++-- 2 files changed, 30 insertions(+), 10 deletions(-) rename dumux/porousmediumflow/1p/{vtkoutputfields.hh => iofields.hh} (66%) diff --git a/dumux/porousmediumflow/1p/vtkoutputfields.hh b/dumux/porousmediumflow/1p/iofields.hh similarity index 66% rename from dumux/porousmediumflow/1p/vtkoutputfields.hh rename to dumux/porousmediumflow/1p/iofields.hh index fc5642d524..ad66508d6b 100644 --- a/dumux/porousmediumflow/1p/vtkoutputfields.hh +++ b/dumux/porousmediumflow/1p/iofields.hh @@ -21,22 +21,42 @@ * \ingroup OnePModel * \brief Adds vtk output fields specific to the one phase model */ -#ifndef DUMUX_ONEP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEP_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEP_IO_FIELDS_HH +#define DUMUX_ONEP_IO_FIELDS_HH + +#include + +#include namespace Dumux { +using namespace IOFieldNames; + /*! * \ingroup OnePModel - * \brief Adds vtk output fields specific to the one phase model + * \brief Adds I/O fields specific to the one phase model */ -class OnePVtkOutputFields +class OnePIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) + { + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); }, + pressure()); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); }, "p"); + return pressure(); } }; diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index 51b0bc168a..1de0921a96 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -54,7 +54,7 @@ #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -119,7 +119,7 @@ NEW_TYPE_TAG(OnePNI, INHERITS_FROM(OneP)); /////////////////////////////////////////////////////////////////////////// // properties for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_TYPE_PROP(OneP, VtkOutputFields, OnePVtkOutputFields); //!< default vtk output fields specific to this model +SET_TYPE_PROP(OneP, IOFields, OnePIOFields); //!< default I/O fields specific to this model SET_TYPE_PROP(OneP, LocalResidual, ImmiscibleLocalResidual); //!< the local residual function SET_TYPE_PROP(OneP, ModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model @@ -160,7 +160,7 @@ public: /////////////////////////////////////////////////////////////////////////// //! Add temperature to the output -SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields); +SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields); //! The model traits of the non-isothermal model SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits); -- GitLab From 5c0d4151554ad3d4a6952ff06d59e4cbe12b2a1b Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Fri, 31 Aug 2018 08:37:08 +0200 Subject: [PATCH 05/26] [io][freeflow] Rename vtkoutputfieds to iofields --- dumux/freeflow/compositional/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 56 ++++++++++------ .../freeflow/compositional/kepsilonncmodel.hh | 24 ++++--- dumux/freeflow/compositional/komegancmodel.hh | 24 ++++--- .../compositional/lowrekepsilonncmodel.hh | 24 ++++--- .../compositional/navierstokesncmodel.hh | 24 ++++--- dumux/freeflow/compositional/oneeqncmodel.hh | 24 ++++--- dumux/freeflow/compositional/zeroeqncmodel.hh | 24 ++++--- dumux/freeflow/navierstokes/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 65 +++++++++++++------ dumux/freeflow/navierstokes/model.hh | 18 ++--- dumux/freeflow/nonisothermal/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 52 ++++++++++----- dumux/freeflow/rans/CMakeLists.txt | 2 +- .../rans/{vtkoutputfields.hh => iofields.hh} | 51 ++++++++------- dumux/freeflow/rans/model.hh | 16 ++--- dumux/freeflow/rans/oneeq/CMakeLists.txt | 2 +- .../oneeq/{vtkoutputfields.hh => iofields.hh} | 30 ++++----- dumux/freeflow/rans/oneeq/model.hh | 17 ++--- .../rans/twoeq/kepsilon/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 43 ++++++------ dumux/freeflow/rans/twoeq/kepsilon/model.hh | 16 ++--- .../freeflow/rans/twoeq/komega/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 33 +++++----- dumux/freeflow/rans/twoeq/komega/model.hh | 16 ++--- .../rans/twoeq/lowrekepsilon/CMakeLists.txt | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 34 +++++----- .../rans/twoeq/lowrekepsilon/model.hh | 16 ++--- test/freeflow/navierstokes/test_channel.cc | 4 +- test/freeflow/navierstokes/test_donea.cc | 4 +- test/freeflow/navierstokesnc/test_channel.cc | 4 +- test/freeflow/rans/test_pipe_laufer.cc | 4 +- test/freeflow/ransnc/test_flatplate.cc | 4 +- 33 files changed, 351 insertions(+), 292 deletions(-) rename dumux/freeflow/compositional/{vtkoutputfields.hh => iofields.hh} (54%) rename dumux/freeflow/navierstokes/{vtkoutputfields.hh => iofields.hh} (61%) rename dumux/freeflow/nonisothermal/{vtkoutputfields.hh => iofields.hh} (54%) rename dumux/freeflow/rans/{vtkoutputfields.hh => iofields.hh} (59%) rename dumux/freeflow/rans/oneeq/{vtkoutputfields.hh => iofields.hh} (68%) rename dumux/freeflow/rans/twoeq/kepsilon/{vtkoutputfields.hh => iofields.hh} (62%) rename dumux/freeflow/rans/twoeq/komega/{vtkoutputfields.hh => iofields.hh} (67%) rename dumux/freeflow/rans/twoeq/lowrekepsilon/{vtkoutputfields.hh => iofields.hh} (66%) diff --git a/dumux/freeflow/compositional/CMakeLists.txt b/dumux/freeflow/compositional/CMakeLists.txt index 68fce2bb0b..cf75ae49ba 100644 --- a/dumux/freeflow/compositional/CMakeLists.txt +++ b/dumux/freeflow/compositional/CMakeLists.txt @@ -10,6 +10,6 @@ lowrekepsilonncmodel.hh navierstokesncmodel.hh oneeqncmodel.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh zeroeqncmodel.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/compositional) diff --git a/dumux/freeflow/compositional/vtkoutputfields.hh b/dumux/freeflow/compositional/iofields.hh similarity index 54% rename from dumux/freeflow/compositional/vtkoutputfields.hh rename to dumux/freeflow/compositional/iofields.hh index 8c311dc655..bfdc6dd436 100644 --- a/dumux/freeflow/compositional/vtkoutputfields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -19,52 +19,70 @@ /*! * \file * \ingroup FreeflowNCModel - * \copydoc Dumux::FreeflowNCVtkOutputFields + * \copydoc Dumux::FreeflowNCIOFields */ -#ifndef DUMUX_FREEFLOW_NC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_FREEFLOW_NC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_FREEFLOW_NC_IO_FIELDS_HH +#define DUMUX_FREEFLOW_NC_IO_FIELDS_HH -#include +#include +#include namespace Dumux { /*! * \ingroup FreeflowNCModel - * \brief Adds vtk output fields specific to the FreeflowNC model + * \brief Adds I/O fields specific to the FreeflowNC model */ -template -class FreeflowNCVtkOutputFields +template +class FreeflowNCIOFields { public: - //! Initialize the FreeflowNC specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + //! Initialize the FreeflowNC specific output fields. + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - BaseVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the FreeflowNC specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the FreeflowNC specific output fields. + template + static void initOutputModule(OutputModule& out) { + BaseOutputFields::initOutputModule(out); + + using namespace IOFieldNames; + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; for (int j = 0; j < FluidSystem::numComponents; ++j) { - vtk.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, "X^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); - vtk.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); + out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, massFraction(0, j)); + out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, moleFraction(0, j)); if (j != FluidSystem::getMainComponent(0)) { - vtk.addVolumeVariable([j](const auto& v){ return v.diffusionCoefficient(0, j); }, "D^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); + out.addVolumeVariable([j](const auto& v){ return v.diffusionCoefficient(0, j); }, "D^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); // the eddy diffusivity is recalculated for an arbitrary component which is not the phase component if (ModelTraits::usesTurbulenceModel()) - vtk.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusivity(0, j) - v.diffusionCoefficient(0, j); }, "D_t"); + out.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusivity(0, j) - v.diffusionCoefficient(0, j); }, "D_t"); } } } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + using namespace IOFieldNames; + if (pvIdx <= ModelTraits::dim()) + return BaseOutputFields::template primaryVariableName(pvIdx, state); + else + return ModelTraits::useMoles() ? moleFraction(pvIdx - ModelTraits::dim()) + : massFraction(pvIdx - ModelTraits::dim()); + } }; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 48a5d5c4ec..3d272dd21c 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -30,10 +30,10 @@ #include #include -#include +#include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -136,16 +136,15 @@ public: using type = KEpsilonFluxVariables; }; -//! The specific vtk output fields -SET_PROP(KEpsilonNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilonNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = KEpsilonVtkOutputFields; + using SinglePhaseIOFields = KEpsilonIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; ////////////////////////////////////////////////////////////////////////// @@ -208,17 +207,16 @@ public: using type = KEpsilonFluxVariables; }; -//! The specific vtk output fields -SET_PROP(KEpsilonNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilonNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = KEpsilonVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = KEpsilonIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; // \} diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index 216f8018aa..16c6b97e68 100644 --- a/dumux/freeflow/compositional/komegancmodel.hh +++ b/dumux/freeflow/compositional/komegancmodel.hh @@ -30,10 +30,10 @@ #include #include -#include +#include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -141,16 +141,15 @@ public: using type = KOmegaFluxVariables; }; -//! The specific vtk output fields -SET_PROP(KOmegaNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmegaNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = KOmegaVtkOutputFields; + using SinglePhaseIOFields = KOmegaIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; ////////////////////////////////////////////////////////////////////////// @@ -213,17 +212,16 @@ public: using type = KOmegaFluxVariables; }; -//! The specific vtk output fields -SET_PROP(KOmegaNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmegaNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = KOmegaVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = KOmegaIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; // \} diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 8a69f8cb5d..7242e18100 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -30,10 +30,10 @@ #include #include -#include +#include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -141,16 +141,15 @@ public: using type = LowReKEpsilonFluxVariables; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilonNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilonNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = LowReKEpsilonVtkOutputFields; + using SinglePhaseIOFields = LowReKEpsilonIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; ////////////////////////////////////////////////////////////////////////// @@ -213,17 +212,16 @@ public: using type = LowReKEpsilonFluxVariables; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilonNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilonNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = LowReKEpsilonVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = LowReKEpsilonIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; // \} diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index 8b1e608675..fa1ec5d18b 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -55,14 +55,14 @@ #include #include #include -#include +#include #include #include #include "volumevariables.hh" #include "localresidual.hh" #include "fluxvariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include #include @@ -182,16 +182,15 @@ SET_TYPE_PROP(NavierStokesNC, FluxVariables, FreeflowNCFluxVariables); //! The flux variables cache class, by default the one for free flow SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache); -//! The specific vtk output fields -SET_PROP(NavierStokesNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(NavierStokesNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = NavierStokesVtkOutputFields; + using BaseIOFields = NavierStokesIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; /*! @@ -231,17 +230,16 @@ public: using type = FreeflowNIModelTraits; }; -//! The non-isothermal vtk output fields -SET_PROP(NavierStokesNCNI, VtkOutputFields) +//! The non-isothermal I/O fields +SET_PROP(NavierStokesNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = NavierStokesVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = NavierStokesIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; //! Use Fourier's Law as default heat conduction type diff --git a/dumux/freeflow/compositional/oneeqncmodel.hh b/dumux/freeflow/compositional/oneeqncmodel.hh index 031cabcac5..4d75e899d0 100644 --- a/dumux/freeflow/compositional/oneeqncmodel.hh +++ b/dumux/freeflow/compositional/oneeqncmodel.hh @@ -30,10 +30,10 @@ #include #include -#include +#include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -139,16 +139,15 @@ public: using type = OneEqFluxVariables; }; -//! The specific vtk output fields -SET_PROP(OneEqNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEqNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = OneEqVtkOutputFields; + using SinglePhaseIOFields = OneEqIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; ////////////////////////////////////////////////////////////////////////// @@ -211,17 +210,16 @@ public: using type = OneEqFluxVariables; }; -//! The specific vtk output fields -SET_PROP(OneEqNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEqNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = OneEqVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = OneEqIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; // \} diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index c55ed9b71c..45168b0716 100644 --- a/dumux/freeflow/compositional/zeroeqncmodel.hh +++ b/dumux/freeflow/compositional/zeroeqncmodel.hh @@ -30,10 +30,10 @@ #include #include -#include +#include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -98,16 +98,15 @@ public: using type = ZeroEqVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(ZeroEqNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(ZeroEqNC, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = RANSVtkOutputFields; + using BaseIOFields = RANSIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; ////////////////////////////////////////////////////////////////////////// @@ -152,17 +151,16 @@ public: using type = ZeroEqVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(ZeroEqNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(ZeroEqNCNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = RANSVtkOutputFields; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields; + using BaseIOFields = RANSIOFields; + using NonIsothermalFields = FreeflowNonIsothermalIOFields; public: - using type = FreeflowNCVtkOutputFields; + using type = FreeflowNCIOFields; }; // \} diff --git a/dumux/freeflow/navierstokes/CMakeLists.txt b/dumux/freeflow/navierstokes/CMakeLists.txt index 15433fa743..8d5d0f4cfa 100644 --- a/dumux/freeflow/navierstokes/CMakeLists.txt +++ b/dumux/freeflow/navierstokes/CMakeLists.txt @@ -8,5 +8,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/navierstokes) diff --git a/dumux/freeflow/navierstokes/vtkoutputfields.hh b/dumux/freeflow/navierstokes/iofields.hh similarity index 61% rename from dumux/freeflow/navierstokes/vtkoutputfields.hh rename to dumux/freeflow/navierstokes/iofields.hh index 6a6a156f29..d8b607f5ee 100644 --- a/dumux/freeflow/navierstokes/vtkoutputfields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -19,59 +19,84 @@ /*! * \file * \ingroup NavierStokesModel - * \copydoc Dumux::NavierStokesVtkOutputFields + * \copydoc Dumux::NavierStokesIOFields */ -#ifndef DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH -#define DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_NAVIER_STOKES_IO_FIELDS_HH +#define DUMUX_NAVIER_STOKES_IO_FIELDS_HH #include #include #include +#include +#include + namespace Dumux { /*! * \ingroup NavierStokesModel - * \brief Adds vtk output fields for the Navier-Stokes model + * \brief Adds I/O fields for the Navier-Stokes model */ template -class NavierStokesVtkOutputFields +class NavierStokesIOFields { // Helper type used for tag dispatching (to add discretization-specific fields). template using discMethodTag = std::integral_constant; public: - //! Initialize the Navier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + //! Initialize the Navier-Stokes specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.pressure(); }, "p"); - vtk.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, "rhoMolar"); - vtk.addVolumeVariable([](const auto& v){ return v.density(); }, "rho"); + using namespace IOFieldNames; + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; + out.addVolumeVariable([](const auto& v){ return v.pressure(); }, pressure()); + out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, molarDensity()); + out.addVolumeVariable([](const auto& v){ return v.density(); }, density()); // add discretization-specific fields - additionalOutput_(vtk, discMethodTag{}); + additionalOutput_(out, discMethodTag{}); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + using namespace IOFieldNames; + const std::array velocities = {"v_x", "v_y", "v_z"}; + + if (pvIdx < FVGridGeometry::Grid::dimension) + return velocities[pvIdx]; + else + return pressure(); } private: //! Adds discretization-specific fields (nothing by default). - template - static void additionalOutput_(VtkOutputModule& vtk, AnyMethod) + template + static void additionalOutput_(OutputModule& out, AnyMethod) { } //! Adds discretization-specific fields (velocity vectors on the faces for the staggered discretization). - template - static void additionalOutput_(VtkOutputModule& vtk, discMethodTag) + template + static void additionalOutput_(OutputModule& out, discMethodTag) { - const bool writeFaceVars = getParamFromGroup(vtk.paramGroup(), "Vtk.WriteFaceData", false); + const bool writeFaceVars = getParamFromGroup(out.paramGroup(), "Vtk.WriteFaceData", false); if(writeFaceVars) { auto faceVelocityVector = [](const typename FVGridGeometry::SubControlVolumeFace& scvf, const auto& faceVars) { - using Scalar = typename VtkOutputModule::VolumeVariables::PrimaryVariables::value_type; + using Scalar = typename OutputModule::VolumeVariables::PrimaryVariables::value_type; using VelocityVector = Dune::FieldVector; VelocityVector velocity(0.0); @@ -79,14 +104,14 @@ private: return velocity; }; - vtk.addFaceVariable(faceVelocityVector, "faceVelocity"); + out.addFaceVariable(faceVelocityVector, "faceVelocity"); auto faceNormalVelocity = [](const auto& faceVars) { return faceVars.velocitySelf(); }; - vtk.addFaceVariable(faceNormalVelocity, "v"); + out.addFaceVariable(faceNormalVelocity, "v"); } } }; diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 0cac3cf664..0f3aaad66f 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -52,14 +52,14 @@ #include #include #include -#include +#include #include "localresidual.hh" #include "volumevariables.hh" #include "fluxvariables.hh" #include "fluxvariablescache.hh" #include "indices.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include #include @@ -212,13 +212,13 @@ SET_TYPE_PROP(NavierStokes, FluxVariables, NavierStokesFluxVariables); //! The flux variables cache class, by default the one for free flow SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache); -//! The specific vtk output fields -SET_PROP(NavierStokes, VtkOutputFields) +//! The specific I/O fields +SET_PROP(NavierStokes, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = NavierStokesVtkOutputFields; + using type = NavierStokesIOFields; }; ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Navier-Stokes model @@ -235,15 +235,15 @@ public: using type = FreeflowNIModelTraits; }; -//! The specific non-isothermal vtk output fields -SET_PROP(NavierStokesNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(NavierStokesNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = NavierStokesVtkOutputFields; + using IsothermalFields = NavierStokesIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/nonisothermal/CMakeLists.txt b/dumux/freeflow/nonisothermal/CMakeLists.txt index 32acf8d650..5383f6d397 100644 --- a/dumux/freeflow/nonisothermal/CMakeLists.txt +++ b/dumux/freeflow/nonisothermal/CMakeLists.txt @@ -2,5 +2,5 @@ install(FILES indices.hh localresidual.hh model.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/nonisothermal) diff --git a/dumux/freeflow/nonisothermal/vtkoutputfields.hh b/dumux/freeflow/nonisothermal/iofields.hh similarity index 54% rename from dumux/freeflow/nonisothermal/vtkoutputfields.hh rename to dumux/freeflow/nonisothermal/iofields.hh index 8e6bb42dac..cfe560702a 100644 --- a/dumux/freeflow/nonisothermal/vtkoutputfields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -19,39 +19,57 @@ /*! * \file * \ingroup FreeflowNIModel - * \copydoc Dumux::FreeflowNonIsothermalVtkOutputFields + * \copydoc Dumux::FreeflowNonIsothermalIOFields */ -#ifndef DUMUX_FREEFLOW_NI_OUTPUT_FIELDS_HH -#define DUMUX_FREEFLOW_NI_OUTPUT_FIELDS_HH +#ifndef DUMUX_FREEFLOW_NI_IO_FIELDS_HH +#define DUMUX_FREEFLOW_NI_IO_FIELDS_HH + +#include +#include namespace Dumux { /*! * \ingroup FreeflowNIModel - * \brief Adds vtk output fields specific to non-isothermal free-flow models + * \brief Adds I/O fields specific to non-isothermal free-flow models */ -template -class FreeflowNonIsothermalVtkOutputFields +template +class FreeflowNonIsothermalIOFields { public: - //! Initialize the non-isothermal specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + //! Initialize the non-isothermal specific output fields. + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - IsothermalVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the non-isothermal specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Add the non-isothermal specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); - vtk.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); + IsothermalIOFields::initOutputModule(out); + + using namespace IOFieldNames; + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, temperature()); + out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); if (ModelTraits::usesTurbulenceModel()) - vtk.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); + out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); + } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + using namespace IOFieldNames; + if (pvIdx < ModelTraits::numEq() - 1) + return IsothermalIOFields::template primaryVariableName(pvIdx, state); + else + return temperature(); } }; diff --git a/dumux/freeflow/rans/CMakeLists.txt b/dumux/freeflow/rans/CMakeLists.txt index 100f4e5776..8f2c48e20d 100644 --- a/dumux/freeflow/rans/CMakeLists.txt +++ b/dumux/freeflow/rans/CMakeLists.txt @@ -6,5 +6,5 @@ install(FILES model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans) diff --git a/dumux/freeflow/rans/vtkoutputfields.hh b/dumux/freeflow/rans/iofields.hh similarity index 59% rename from dumux/freeflow/rans/vtkoutputfields.hh rename to dumux/freeflow/rans/iofields.hh index 4f8541bac2..3cf03af53a 100644 --- a/dumux/freeflow/rans/vtkoutputfields.hh +++ b/dumux/freeflow/rans/iofields.hh @@ -19,50 +19,53 @@ /*! * \file * \ingroup RANSModel - * \copydoc Dumux::RANSVtkOutputFields + * \copydoc Dumux::RANSIOFields */ -#ifndef DUMUX_RANS_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RANS_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_RANS_IO_FIELDS_HH +#define DUMUX_RANS_IO_FIELDS_HH -#include +#include +#include namespace Dumux { /*! * \ingroup RANSModel - * \brief Adds vtk output fields for the Reynolds-Averaged Navier-Stokes model + * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ template -class RANSVtkOutputFields : public NavierStokesVtkOutputFields +class RANSIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Navier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - NavierStokesVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the RANS specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the RANS specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.velocity()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max"); - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/dx_"); + NavierStokesIOFields::initOutputModule(out); + + out.addVolumeVariable([](const auto& v){ return v.velocity()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/dx_"); if (dim > 1) - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/dx_"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/dx_"); if (dim > 2) - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/dx_"); - vtk.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel"); - vtk.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu"); - vtk.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t"); - vtk.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w"); - vtk.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+"); - vtk.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/dx_"); + out.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel"); + out.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu"); + out.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t"); + out.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w"); + out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+"); + out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+"); } }; diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index 62232a86d3..4a1f4e4635 100644 --- a/dumux/freeflow/rans/model.hh +++ b/dumux/freeflow/rans/model.hh @@ -40,7 +40,7 @@ #include #include -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -83,13 +83,13 @@ public: using type = RANSModelTraits; }; -//! The specific vtk output fields -SET_PROP(RANS, VtkOutputFields) +//! The specific I/O fields +SET_PROP(RANS, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = RANSVtkOutputFields; + using type = RANSIOFields; }; ////////////////////////////////////////////////////////////////// @@ -111,15 +111,15 @@ public: using type = FreeflowNIModelTraits; }; -//! The specific non-isothermal vtk output fields -SET_PROP(RANSNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(RANSNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = RANSVtkOutputFields; + using IsothermalFields = RANSIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; //! Use Fourier's Law as default heat conduction type diff --git a/dumux/freeflow/rans/oneeq/CMakeLists.txt b/dumux/freeflow/rans/oneeq/CMakeLists.txt index 46d8713f6a..1be711afb0 100644 --- a/dumux/freeflow/rans/oneeq/CMakeLists.txt +++ b/dumux/freeflow/rans/oneeq/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/oneeq) diff --git a/dumux/freeflow/rans/oneeq/vtkoutputfields.hh b/dumux/freeflow/rans/oneeq/iofields.hh similarity index 68% rename from dumux/freeflow/rans/oneeq/vtkoutputfields.hh rename to dumux/freeflow/rans/oneeq/iofields.hh index be9d913e2f..24adbfd3d9 100644 --- a/dumux/freeflow/rans/oneeq/vtkoutputfields.hh +++ b/dumux/freeflow/rans/oneeq/iofields.hh @@ -19,39 +19,39 @@ /*! * \file * \ingroup OneEqModel - * \copydoc Dumux::OneEqVtkOutputFields + * \copydoc Dumux::OneEqIOFields */ -#ifndef DUMUX_ONEEQ_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEEQ_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEEQ_IO_FIELDS_HH +#define DUMUX_ONEEQ_IO_FIELDS_HH -#include +#include namespace Dumux { /*! * \ingroup OneEqModel - * \brief Adds vtk output fields for the one-equation turbulence model by Spalart-Allmaras + * \brief Adds I/O fields for the one-equation turbulence model by Spalart-Allmaras */ template -class OneEqVtkOutputFields : public RANSVtkOutputFields +class OneEqIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averaged Navier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - RANSVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the OneEq specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the OneEq specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); + RANSIOFields::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); } }; diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index 02c14b9a0a..e434db80ae 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -80,12 +80,13 @@ #include #include #include +#include #include "fluxvariables.hh" #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -179,13 +180,13 @@ public: using type = OneEqVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(OneEq, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEq, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = OneEqVtkOutputFields; + using type = OneEqIOFields; }; ////////////////////////////////////////////////////////////////// @@ -225,15 +226,15 @@ public: using type = OneEqVolumeVariables; }; -//! The specific non-isothermal vtk output fields -SET_PROP(OneEqNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(OneEqNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = OneEqVtkOutputFields; + using IsothermalFields = OneEqIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt b/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt index 667725cb2d..2e0405c5a6 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/kepsilon) diff --git a/dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh similarity index 62% rename from dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index 7808fa069c..c05d2de1b5 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -19,44 +19,47 @@ /*! * \file * \ingroup KEpsilonModel - * \copydoc Dumux::KEpsilonVtkOutputFields + * \copydoc Dumux::KEpsilonIOFields */ -#ifndef DUMUX_KEPSILON_VTK_OUTPUT_FIELDS_HH -#define DUMUX_KEPSILON_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_KEPSILON_IO_FIELDS_HH +#define DUMUX_KEPSILON_IO_FIELDS_HH -#include +#include +#include namespace Dumux { /*! * \ingroup KEpsilonModel - * \brief Adds vtk output fields for the k-epsilon turbulence model + * \brief Adds I/O fields for the k-epsilon turbulence model */ template -class KEpsilonVtkOutputFields : public RANSVtkOutputFields +class KEpsilonIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averaged Navier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - RANSVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the KEpsilon specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the KEpsilon specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "epsilon"); - vtk.addVolumeVariable([](const auto& v){ return v.yPlusNominal(); }, "y^+_nom"); - vtk.addVolumeVariable([](const auto& v){ return v.uPlusNominal(); }, "u^+_nom"); - vtk.addVolumeVariable([](const auto& v){ return v.inNearWallRegion(); }, "inNearWallRegion"); - vtk.addVolumeVariable([](const auto& v){ return v.isMatchingPoint(); }, "isMatchingPoint"); + RANSIOFields::initOutputModule(out); + + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "epsilon"); + out.addVolumeVariable([](const auto& v){ return v.yPlusNominal(); }, "y^+_nom"); + out.addVolumeVariable([](const auto& v){ return v.uPlusNominal(); }, "u^+_nom"); + out.addVolumeVariable([](const auto& v){ return v.inNearWallRegion(); }, "inNearWallRegion"); + out.addVolumeVariable([](const auto& v){ return v.isMatchingPoint(); }, "isMatchingPoint"); } }; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index d3bcfd46aa..6c99ba07ce 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -72,7 +72,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -170,13 +170,13 @@ public: using type = KEpsilonVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(KEpsilon, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilon, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = KEpsilonVtkOutputFields; + using type = KEpsilonIOFields; }; ////////////////////////////////////////////////////////////////// @@ -216,15 +216,15 @@ public: using type = KEpsilonVolumeVariables; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KEpsilonNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(KEpsilonNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KEpsilonVtkOutputFields; + using IsothermalFields = KEpsilonIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt index e6d5c4dc03..4463faa9f1 100644 --- a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/komega) diff --git a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh similarity index 67% rename from dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/komega/iofields.hh index 95987da43f..7cc50459c7 100644 --- a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -19,40 +19,41 @@ /*! * \file * \ingroup KOmegaModel - * \copydoc Dumux::KOmegaVtkOutputFields + * \copydoc Dumux::KOmegaIOFields */ -#ifndef DUMUX_KOMEGA_VTK_OUTPUT_FIELDS_HH -#define DUMUX_KOMEGA_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_KOMEGA_IO_FIELDS_HH +#define DUMUX_KOMEGA_IO_FIELDS_HH -#include +#include +#include namespace Dumux { /*! * \ingroup KOmegaModel - * \brief Adds vtk output fields for the Reynolds-Averaged Navier-Stokes model + * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ template -class KOmegaVtkOutputFields : public RANSVtkOutputFields +class KOmegaIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Navier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - RANSVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the KOmegaModel specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the KOmegaModel specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); } }; diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 718d2c1c5a..806c243387 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -79,7 +79,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -177,13 +177,13 @@ public: using type = KOmegaVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(KOmega, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmega, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = KOmegaVtkOutputFields; + using type = KOmegaIOFields; }; /////////////////////////////////////////////////////////////////////////// @@ -224,15 +224,15 @@ public: using type = KOmegaVolumeVariables; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KOmegaNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(KOmegaNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KOmegaVtkOutputFields; + using IsothermalFields = KOmegaIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt b/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt index 5d7f7ab243..4103b27301 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/lowrekepsilon) diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh similarity index 66% rename from dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index 6ba9d9f2fe..289777bf00 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -19,40 +19,42 @@ /*! * \file * \ingroup LowReKEpsilonModel - * \copydoc Dumux::LowReKEpsilonVtkOutputFields + * \copydoc Dumux::LowReKEpsilonIOFields */ -#ifndef DUMUX_LOWREKEPSILON_VTK_OUTPUT_FIELDS_HH -#define DUMUX_LOWREKEPSILON_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_LOWREKEPSILON_IO_FIELDS_HH +#define DUMUX_LOWREKEPSILON_IO_FIELDS_HH -#include +#include +#include namespace Dumux { /*! * \ingroup LowReKEpsilonModel - * \brief Adds vtk output fields for the low-Re k-epsilon turbulence model + * \brief Adds I/O fields for the low-Re k-epsilon turbulence model */ template -class LowReKEpsilonVtkOutputFields : public RANSVtkOutputFields +class LowReKEpsilonIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averagedNavier-Stokes specific vtk output fields. - template - static void init(VtkOutputModule& vtk) + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - RANSVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the LowReKEpsilon specific vtk output fields. - template - static void add(VtkOutputModule& vtk) + //! Initialize the LowReKEpsilon specific output fields. + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); + RANSIOFields::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); } }; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 1fa9cd6cf7..43c36f2896 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -88,7 +88,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -186,13 +186,13 @@ public: using type = LowReKEpsilonVolumeVariables; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilon, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilon, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = LowReKEpsilonVtkOutputFields; + using type = LowReKEpsilonIOFields; }; ////////////////////////////////////////////////////////////////// @@ -232,15 +232,15 @@ public: using type = LowReKEpsilonVolumeVariables; }; -//! The specific non-isothermal vtk output fields -SET_PROP(LowReKEpsilonNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(LowReKEpsilonNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = LowReKEpsilonVtkOutputFields; + using IsothermalFields = LowReKEpsilonIOFields; public: - using type = FreeflowNonIsothermalVtkOutputFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 4ad7012be7..e5be192cb6 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -167,9 +167,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // the assembler with time loop for instationary problem diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index 0cc05bb7c5..fc884e315f 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -137,9 +137,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 3a3fb6dae4..7b3cd95486 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -147,9 +147,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaP(), "deltaP"); vtkWriter.write(0.0); diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 0ddaffc8db..2825c0a39e 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -142,9 +142,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index d4d0e0086a..5f511d5201 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -138,9 +138,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem -- GitLab From b0ee6fa2c1b7cefd9dc6b193a15956c8dda8d220 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 31 Aug 2018 12:47:45 +0200 Subject: [PATCH 06/26] [io] change from `IOFieldNames` to `IOName` See discussion in !1212. --- dumux/io/{fieldnames.hh => name.hh} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename dumux/io/{fieldnames.hh => name.hh} (97%) diff --git a/dumux/io/fieldnames.hh b/dumux/io/name.hh similarity index 97% rename from dumux/io/fieldnames.hh rename to dumux/io/name.hh index 447251e55e..c5d28f2e3c 100644 --- a/dumux/io/fieldnames.hh +++ b/dumux/io/name.hh @@ -21,13 +21,13 @@ * \ingroup InputOutput * \brief A collection of input/output field names for common physical quantities */ -#ifndef DUMUX_IO_FIELD_NAMES_HH -#define DUMUX_IO_FIELD_NAMES_HH +#ifndef DUMUX_IO_NAME_HH +#define DUMUX_IO_NAME_HH #include namespace Dumux { -namespace IOFieldNames { +namespace IOName { //! name of variable pressure template @@ -110,7 +110,7 @@ template std::string solidVolumeFraction(int compIdx = 0) noexcept { return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } -} // end namespace IOFieldNames +} // end namespace IOName } // end namespace Dumux #endif -- GitLab From 966af2003c1aae8991a7c7750fdea46205da5f64 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 31 Aug 2018 12:48:31 +0200 Subject: [PATCH 07/26] [io] change from `IOFieldNames` to `IOName` in the models See discussion in !1212. --- dumux/freeflow/compositional/iofields.hh | 14 +++++++------- dumux/freeflow/navierstokes/iofields.hh | 16 +++++++--------- dumux/freeflow/nonisothermal/iofields.hh | 9 ++++----- dumux/porousmediumflow/1p/iofields.hh | 8 +++----- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index bfdc6dd436..554a89abe8 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -24,9 +24,11 @@ #ifndef DUMUX_FREEFLOW_NC_IO_FIELDS_HH #define DUMUX_FREEFLOW_NC_IO_FIELDS_HH -#include #include +#include +#include + namespace Dumux { @@ -54,12 +56,11 @@ public: { BaseOutputFields::initOutputModule(out); - using namespace IOFieldNames; using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; for (int j = 0; j < FluidSystem::numComponents; ++j) { - out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, massFraction(0, j)); - out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, moleFraction(0, j)); + out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, IOName::massFraction(0, j)); + out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, IOName::moleFraction(0, j)); if (j != FluidSystem::getMainComponent(0)) { @@ -76,12 +77,11 @@ public: template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - using namespace IOFieldNames; if (pvIdx <= ModelTraits::dim()) return BaseOutputFields::template primaryVariableName(pvIdx, state); else - return ModelTraits::useMoles() ? moleFraction(pvIdx - ModelTraits::dim()) - : massFraction(pvIdx - ModelTraits::dim()); + return ModelTraits::useMoles() ? IOName::moleFraction(pvIdx - ModelTraits::dim()) + : IOName::massFraction(pvIdx - ModelTraits::dim()); } }; diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index d8b607f5ee..63fb9f1225 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -25,11 +25,11 @@ #define DUMUX_NAVIER_STOKES_IO_FIELDS_HH #include +#include + #include #include - -#include -#include +#include namespace Dumux { @@ -50,11 +50,10 @@ public: template static void initOutputModule(OutputModule& out) { - using namespace IOFieldNames; using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; - out.addVolumeVariable([](const auto& v){ return v.pressure(); }, pressure()); - out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, molarDensity()); - out.addVolumeVariable([](const auto& v){ return v.density(); }, density()); + out.addVolumeVariable([](const auto& v){ return v.pressure(); }, IOName::pressure()); + out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity()); + out.addVolumeVariable([](const auto& v){ return v.density(); }, IOName::density()); // add discretization-specific fields additionalOutput_(out, discMethodTag{}); @@ -71,13 +70,12 @@ public: template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - using namespace IOFieldNames; const std::array velocities = {"v_x", "v_y", "v_z"}; if (pvIdx < FVGridGeometry::Grid::dimension) return velocities[pvIdx]; else - return pressure(); + return IOName::pressure(); } private: diff --git a/dumux/freeflow/nonisothermal/iofields.hh b/dumux/freeflow/nonisothermal/iofields.hh index cfe560702a..aab75f7562 100644 --- a/dumux/freeflow/nonisothermal/iofields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -24,9 +24,10 @@ #ifndef DUMUX_FREEFLOW_NI_IO_FIELDS_HH #define DUMUX_FREEFLOW_NI_IO_FIELDS_HH -#include #include +#include + namespace Dumux { @@ -54,8 +55,7 @@ public: { IsothermalIOFields::initOutputModule(out); - using namespace IOFieldNames; - out.addVolumeVariable([](const auto& v){ return v.temperature(); }, temperature()); + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, IOName::temperature()); out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); if (ModelTraits::usesTurbulenceModel()) out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); @@ -65,11 +65,10 @@ public: template static std::string primaryVariableName(int pvIdx, int state = 0) { - using namespace IOFieldNames; if (pvIdx < ModelTraits::numEq() - 1) return IsothermalIOFields::template primaryVariableName(pvIdx, state); else - return temperature(); + return IOName::temperature(); } }; diff --git a/dumux/porousmediumflow/1p/iofields.hh b/dumux/porousmediumflow/1p/iofields.hh index ad66508d6b..3e6aeccb5f 100644 --- a/dumux/porousmediumflow/1p/iofields.hh +++ b/dumux/porousmediumflow/1p/iofields.hh @@ -26,12 +26,10 @@ #include -#include +#include namespace Dumux { -using namespace IOFieldNames; - /*! * \ingroup OnePModel * \brief Adds I/O fields specific to the one phase model @@ -43,7 +41,7 @@ public: static void initOutputModule(OutputModule& out) { out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); }, - pressure()); + IOName::pressure()); } template @@ -56,7 +54,7 @@ public: template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - return pressure(); + return IOName::pressure(); } }; -- GitLab From a5402fac65f68a67a3b124218333451f7ff3cd6d Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 31 Aug 2018 12:22:13 +0200 Subject: [PATCH 08/26] [io] remove phase index default, improve comments --- dumux/io/name.hh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/dumux/io/name.hh b/dumux/io/name.hh index c5d28f2e3c..756685aa7f 100644 --- a/dumux/io/name.hh +++ b/dumux/io/name.hh @@ -29,83 +29,83 @@ namespace Dumux { namespace IOName { -//! name of variable pressure +//! I/O name of pressure for multiphase systems template -std::string pressure(int phaseIdx = 0) noexcept +std::string pressure(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "p" : "p_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable pressure +//! I/O name of pressure for singlephase systems std::string pressure() noexcept { return "p"; } -//! name of variable saturation +//! I/O name of saturation template std::string saturation(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "S" : "S_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable temperature (equilibrium models) +//! I/O name of temperature for equilibrium models std::string temperature() noexcept { return "T"; } -//! name of variable temperature (non-equilibrium models) +//! I/O name of temperature for non-equilibrium models template -std::string fluidTemperature(int phaseIdx = 0) noexcept +std::string fluidTemperature(int phaseIdx) noexcept { return "T_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable temperature (non-equilibrium models) +//! I/O name of solid temperature for non-equilibrium models std::string solidTemperature() noexcept { return "T_s"; } -//! name of variable density +//! I/O name of density for multiphase systems template -std::string density(int phaseIdx = 0) noexcept +std::string density(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "rho" : "rho_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable density +//! I/O name of density for singlephase systems std::string density() noexcept { return "rho"; } -//! name of variable molar density +//! I/O name of molar density for multiphase systems template -std::string molarDensity(int phaseIdx = 0) noexcept +std::string molarDensity(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "rhoMolar" : "rhoMolar_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable molar density +//! I/O name of molar density for singlephase systems std::string molarDensity() noexcept { return "rhoMolar"; } -//! name of variable mobility +//! I/O name of mobility for multiphase systems template -std::string mobility(int phaseIdx = 0) noexcept +std::string mobility(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "mob" : "mob_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable mobility +//! I/O name of mobility for singlephase systems std::string mobility() noexcept { return "mob"; } -//! name of variable mole fraction +//! I/O name of mole fraction template std::string moleFraction(int phaseIdx, int compIdx) noexcept { return "x^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable mass fraction +//! I/O name of mass fraction template std::string massFraction(int phaseIdx, int compIdx) noexcept { return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } -//! name of variable capillary pressure +//! I/O name of capillary pressure std::string capillaryPressure() noexcept { return "pc"; } -//! name of variable porosity +//! I/O name of porosity std::string porosity() noexcept { return "porosity"; } -//! name of variable phase presence +//! I/O name of phase presence std::string phasePresence() noexcept { return "phase presence"; } -//! name of solid volume fraction +//! I/O name of solid volume fraction template std::string solidVolumeFraction(int compIdx = 0) noexcept { return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } -- GitLab From 1885effc75e19a54887eeb7df639ebe06403e6d7 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Mon, 3 Sep 2018 10:37:28 +0200 Subject: [PATCH 09/26] [io] adapt all porousmediumflow and geomechanics models Rename `VtkOutputFields` to `IOFields`. Add `primaryVariableName` functions, don't use centralized names yet. Add required template parameters. Adapt properties correspondingly. --- dumux/common/properties.hh | 2 +- .../{vtkoutputfields.hh => iofields.hh} | 25 ++-- dumux/geomechanics/poroelastic/model.hh | 4 +- dumux/porousmediumflow/1p/iofields.hh | 2 +- dumux/porousmediumflow/1p/model.hh | 8 +- .../1pnc/{vtkoutputfields.hh => iofields.hh} | 47 +++++-- dumux/porousmediumflow/1pnc/model.hh | 13 +- dumux/porousmediumflow/1pncmin/model.hh | 21 ++- dumux/porousmediumflow/2p/iofields.hh | 81 +++++++++++ dumux/porousmediumflow/2p/model.hh | 17 ++- dumux/porousmediumflow/2p/vtkoutputfields.hh | 58 -------- .../2p1c/{vtkoutputfields.hh => iofields.hh} | 39 ++++-- dumux/porousmediumflow/2p1c/model.hh | 11 +- dumux/porousmediumflow/2p2c/model.hh | 13 +- dumux/porousmediumflow/2pnc/iofields.hh | 114 +++++++++++++++ dumux/porousmediumflow/2pnc/model.hh | 24 +++- .../porousmediumflow/2pnc/vtkoutputfields.hh | 72 ---------- dumux/porousmediumflow/2pncmin/model.hh | 28 +++- .../3p/{vtkoutputfields.hh => iofields.hh} | 44 ++++-- dumux/porousmediumflow/3p/model.hh | 16 +-- dumux/porousmediumflow/3p3c/iofields.hh | 124 +++++++++++++++++ dumux/porousmediumflow/3p3c/model.hh | 13 +- .../porousmediumflow/3p3c/vtkoutputfields.hh | 61 -------- dumux/porousmediumflow/3pwateroil/iofields.hh | 131 ++++++++++++++++++ dumux/porousmediumflow/3pwateroil/model.hh | 11 +- .../3pwateroil/vtkoutputfields.hh | 63 --------- .../{vtkoutputfields.hh => iofields.hh} | 38 +++-- .../mpnc/{vtkoutputfields.hh => iofields.hh} | 25 ++-- dumux/porousmediumflow/mpnc/model.hh | 8 +- .../{vtkoutputfields.hh => iofields.hh} | 33 +++-- .../porousmediumflow/nonequilibrium/model.hh | 8 +- .../{vtkoutputfields.hh => iofields.hh} | 32 +++-- dumux/porousmediumflow/richards/iofields.hh | 85 ++++++++++++ dumux/porousmediumflow/richards/model.hh | 22 +-- .../richards/vtkoutputfields.hh | 69 --------- dumux/porousmediumflow/richardsnc/iofields.hh | 88 ++++++++++++ dumux/porousmediumflow/richardsnc/model.hh | 6 +- .../richardsnc/vtkoutputfields.hh | 69 --------- .../{vtkoutputfields.hh => iofields.hh} | 39 ++++-- dumux/porousmediumflow/tracer/model.hh | 4 +- .../poroelastic/test_poroelastic.cc | 4 +- .../1p/implicit/compressible/test_1p.cc | 4 +- .../compressible/test_1p_stationary.cc | 4 +- .../1p/implicit/incompressible/test_1pfv.cc | 4 +- .../pointsources/test_1pfv_pointsources.cc | 4 +- .../test_1pfv_pointsources_timedependent.cc | 4 +- .../porousmediumflow/1p/implicit/test_1pfv.cc | 4 +- .../1p/implicit/test_1pfv_fracture2d3d.cc | 4 +- .../1p/implicit/test_1pfv_network1d3d.cc | 4 +- .../1p/implicit/test_1pnifv.cc | 4 +- .../1pnc/implicit/test_1p2c_fv.cc | 4 +- .../implicit/test_1p2cni_conduction_fv.cc | 4 +- .../implicit/test_1p2cni_convection_fv.cc | 4 +- .../1pncmin/implicit/test_1pncminni_fv.cc | 4 +- .../implicit/adaptive/test_2p_adaptive_fv.cc | 4 +- .../2p/implicit/boxdfm/test_2pboxdfm.cc | 4 +- .../cornerpoint/test_2p_cornerpoint.cc | 4 +- .../implicit/fracture/test_2p_fracture_fv.cc | 4 +- .../2p/implicit/incompressible/test_2p_fv.cc | 4 +- .../2p/implicit/nonisothermal/test_2pni_fv.cc | 4 +- .../2p1c/implicit/test_2p1c_fv.cc | 4 +- .../mpnccomparison/2p2c_comparison_problem.hh | 4 +- .../2p2c/implicit/mpnccomparison/iofields.hh | 73 ++++++++++ .../mpnccomparison/test_2p2c_comparison_fv.cc | 4 +- .../mpnccomparison/vtkoutputfields.hh | 66 --------- .../2p2c/implicit/test_2p2c_fv.cc | 4 +- .../2pnc/implicit/test_2pnc_fv.cc | 4 +- .../2pnc/implicit/test_cc2pnc_diffusion.cc | 4 +- .../2pncmin/implicit/test_2pncmin_fv.cc | 4 +- .../3p/implicit/test_3p_fv.cc | 4 +- .../3p/implicit/test_3pni_fv_conduction.cc | 4 +- .../3p/implicit/test_3pni_fv_convection.cc | 4 +- .../3p3c/implicit/test_3p3c_fv.cc | 4 +- .../3pwateroil/implicit/test_box3pwateroil.cc | 4 +- .../co2/implicit/test_co2_fv.cc | 4 +- .../2p2ccomparison/mpnc_comparison_problem.hh | 4 +- .../2p2ccomparison/test_mpnc_comparison_fv.cc | 4 +- .../mpnc/implicit/test_boxmpnckinetic.cc | 4 +- .../implicit/test_boxmpncthermalnonequil.cc | 4 +- .../mpnc/implicit/test_mpnc_obstacle_fv.cc | 4 +- .../implicit/test_ccrichardsanalytical.cc | 4 +- .../richards/implicit/test_richardslens_fv.cc | 4 +- .../implicit/test_richardsniconduction_fv.cc | 4 +- .../implicit/test_richardsniconvection_fv.cc | 4 +- .../implicit/test_richardsnievaporation_fv.cc | 4 +- .../richardsnc/implicit/test_richardsnc_fv.cc | 4 +- .../tracer/1ptracer/test_cctracer.cc | 4 +- .../tracer/constvel/test_tracer.cc | 4 +- .../multicomp/test_tracer_maxwellstefan.cc | 4 +- 89 files changed, 1169 insertions(+), 726 deletions(-) rename dumux/geomechanics/poroelastic/{vtkoutputfields.hh => iofields.hh} (72%) rename dumux/porousmediumflow/1pnc/{vtkoutputfields.hh => iofields.hh} (62%) create mode 100644 dumux/porousmediumflow/2p/iofields.hh delete mode 100644 dumux/porousmediumflow/2p/vtkoutputfields.hh rename dumux/porousmediumflow/2p1c/{vtkoutputfields.hh => iofields.hh} (58%) create mode 100644 dumux/porousmediumflow/2pnc/iofields.hh delete mode 100644 dumux/porousmediumflow/2pnc/vtkoutputfields.hh rename dumux/porousmediumflow/3p/{vtkoutputfields.hh => iofields.hh} (63%) create mode 100644 dumux/porousmediumflow/3p3c/iofields.hh delete mode 100644 dumux/porousmediumflow/3p3c/vtkoutputfields.hh create mode 100644 dumux/porousmediumflow/3pwateroil/iofields.hh delete mode 100644 dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh rename dumux/porousmediumflow/mineralization/{vtkoutputfields.hh => iofields.hh} (61%) rename dumux/porousmediumflow/mpnc/{vtkoutputfields.hh => iofields.hh} (76%) rename dumux/porousmediumflow/nonequilibrium/{vtkoutputfields.hh => iofields.hh} (70%) rename dumux/porousmediumflow/nonisothermal/{vtkoutputfields.hh => iofields.hh} (63%) create mode 100644 dumux/porousmediumflow/richards/iofields.hh delete mode 100644 dumux/porousmediumflow/richards/vtkoutputfields.hh create mode 100644 dumux/porousmediumflow/richardsnc/iofields.hh delete mode 100644 dumux/porousmediumflow/richardsnc/vtkoutputfields.hh rename dumux/porousmediumflow/tracer/{vtkoutputfields.hh => iofields.hh} (65%) create mode 100644 test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh delete mode 100644 test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index 452ae6fb68..32e2967186 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -174,7 +174,7 @@ NEW_PROP_TAG(PressureFormulation); //! the formulation of the pressure e.g most NEW_PROP_TAG(EquilibriumModelTraits); NEW_PROP_TAG(EquilibriumLocalResidual); NEW_PROP_TAG(EquilibriumIndices); -NEW_PROP_TAG(EquilibriumVtkOutputFields); +NEW_PROP_TAG(EquilibriumIOFields); NEW_PROP_TAG(NumEqBalance); NEW_PROP_TAG(EnableThermalNonEquilibrium); NEW_PROP_TAG(EnableChemicalNonEquilibrium); diff --git a/dumux/geomechanics/poroelastic/vtkoutputfields.hh b/dumux/geomechanics/poroelastic/iofields.hh similarity index 72% rename from dumux/geomechanics/poroelastic/vtkoutputfields.hh rename to dumux/geomechanics/poroelastic/iofields.hh index 8a96a6e4be..b6c91ef711 100644 --- a/dumux/geomechanics/poroelastic/vtkoutputfields.hh +++ b/dumux/geomechanics/poroelastic/iofields.hh @@ -19,25 +19,32 @@ /*! * \file * \ingroup PoroElastic - * \brief Adds vtk output fields specific to the poro-elastic model + * \brief Adds I/O fields specific to the poro-elastic model */ -#ifndef DUMUX_POROELASTIC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_POROELASTIC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_POROELASTIC_IO_FIELDS_HH +#define DUMUX_POROELASTIC_IO_FIELDS_HH namespace Dumux { /*! * \ingroup PoroElastic - * \brief Adds vtk output fields specific to the poro-elastic model + * \brief Adds I/O fields specific to the poro-elastic model */ -class PoroElasticVtkOutputFields +class PoroElasticIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, "u"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, "u"); + out.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, "porosity"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); } }; diff --git a/dumux/geomechanics/poroelastic/model.hh b/dumux/geomechanics/poroelastic/model.hh index 4ea6e0494f..e63a4eaf77 100644 --- a/dumux/geomechanics/poroelastic/model.hh +++ b/dumux/geomechanics/poroelastic/model.hh @@ -37,7 +37,7 @@ #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -73,7 +73,7 @@ NEW_TYPE_TAG(PoroElastic, INHERITS_FROM(Elastic)); SET_TYPE_PROP(PoroElastic, LocalResidual, PoroElasticLocalResidual); //! default vtk output fields specific to this model -SET_TYPE_PROP(PoroElastic, VtkOutputFields, PoroElasticVtkOutputFields); +SET_TYPE_PROP(PoroElastic, IOFields, PoroElasticIOFields); //! The deault model traits of the poro-elastic model SET_PROP(PoroElastic, ModelTraits) diff --git a/dumux/porousmediumflow/1p/iofields.hh b/dumux/porousmediumflow/1p/iofields.hh index 3e6aeccb5f..7b59c37ca2 100644 --- a/dumux/porousmediumflow/1p/iofields.hh +++ b/dumux/porousmediumflow/1p/iofields.hh @@ -19,7 +19,7 @@ /*! * \file * \ingroup OnePModel - * \brief Adds vtk output fields specific to the one phase model + * \brief Adds I/O fields specific to the one phase model */ #ifndef DUMUX_ONEP_IO_FIELDS_HH #define DUMUX_ONEP_IO_FIELDS_HH diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index 1de0921a96..e8d2982a42 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "indices.hh" #include "volumevariables.hh" @@ -160,7 +160,11 @@ public: /////////////////////////////////////////////////////////////////////////// //! Add temperature to the output -SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(OnePNI, IOFields) +{ + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; //! The model traits of the non-isothermal model SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits); diff --git a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh b/dumux/porousmediumflow/1pnc/iofields.hh similarity index 62% rename from dumux/porousmediumflow/1pnc/vtkoutputfields.hh rename to dumux/porousmediumflow/1pnc/iofields.hh index 7ac20b20b5..b14f2a7d0a 100644 --- a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh +++ b/dumux/porousmediumflow/1pnc/iofields.hh @@ -19,10 +19,10 @@ /*! * \file * \ingroup OnePNCModel - * \brief Adds vtk output fields specific to the OnePNC model + * \brief Adds I/O fields specific to the OnePNC model */ -#ifndef DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEPNC_IO_FIELDS_HH +#define DUMUX_ONEPNC_IO_FIELDS_HH #include @@ -30,30 +30,49 @@ namespace Dumux { /*! * \ingroup OnePNCModel - * \brief Adds vtk output fields specific to the OnePNC model + * \brief Adds I/O fields specific to the OnePNC model */ -class OnePNCVtkOutputFields +template +class OnePNCIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, "p"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, "rho"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, "mu"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, "delp"); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, "p"); + out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, "rho"); + out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, "mu"); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, "delp"); for (int i = 0; i < VolumeVariables::numComponents(); ++i) - vtk.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, + out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, "x^" + std::string(FluidSystem::componentName(i)) + "_" + std::string(FluidSystem::phaseName(0))); for (int i = 0; i < VolumeVariables::numComponents(); ++i) - vtk.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, + out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, "X^" + std::string(FluidSystem::componentName(i))+ "_" + std::string(FluidSystem::phaseName(0))); } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + const std::string xString = useMoles ? "x" : "X"; + if (pvIdx == 0) + return "p"; + else + return xString + "^" + FluidSystem::componentName(pvIdx) + + "_" + FluidSystem::phaseName(0); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index 0d42f0012c..d293d6330f 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -67,12 +67,12 @@ #include #include #include -#include +#include #include #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -207,14 +207,19 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(OnePNC, VtkOutputFields, OnePNCVtkOutputFields); +SET_TYPE_PROP(OnePNC, IOFields, OnePNCIOFields); /////////////////////////////////////////////////////////////////////////// // properties for the non-isothermal single phase model /////////////////////////////////////////////////////////////////////////// //! the non-isothermal vtk output fields -SET_TYPE_PROP(OnePNCNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(OnePNCNI, IOFields) +{ + using OnePNCIOF = OnePNCIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; //! Use the average for effective conductivities SET_TYPE_PROP(OnePNCNI, diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index a66415fef3..90fc5c57bb 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -76,10 +76,10 @@ v = - \frac{k_{r}}{\mu} \mbox{\bf K} #include #include #include -#include +#include #include -#include +#include #include namespace Dumux { @@ -142,15 +142,26 @@ public: }; //! Use the mineralization vtk output fields -SET_TYPE_PROP(OnePNCMin, VtkOutputFields, MineralizationVtkOutputFields); +SET_PROP(OnePNCMin, IOFields) +{ + using OnePNCIOF = OnePNCIOFields; + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using type = MineralizationIOFields; +}; ////////////////////////////////////////////////////////////////// // Properties for the non-isothermal 2pncmin model ////////////////////////////////////////////////////////////////// //! non-isothermal vtk output -//! non-isothermal vtk output -SET_TYPE_PROP(OnePNCMinNI, VtkOutputFields, EnergyVtkOutputFields>); +SET_PROP(OnePNCMinNI, IOFields) +{ + using OnePNCIOF = OnePNCIOFields; + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using MineralizationIOF = MineralizationIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; //! The non-isothermal model traits SET_PROP(OnePNCMinNI, ModelTraits) diff --git a/dumux/porousmediumflow/2p/iofields.hh b/dumux/porousmediumflow/2p/iofields.hh new file mode 100644 index 0000000000..fe726bd7c2 --- /dev/null +++ b/dumux/porousmediumflow/2p/iofields.hh @@ -0,0 +1,81 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPModel + * \brief Adds I/O fields specific to the two-phase model + */ +#ifndef DUMUX_TWOP_IO_FIELDS_HH +#define DUMUX_TWOP_IO_FIELDS_HH + +#include + +#include + +#include "model.hh" + +namespace Dumux { + +/*! + * \ingroup TwoPModel + * \brief Adds I/O fields specific to the two-phase model + */ +template +class TwoPIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + out.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase0Idx); }, "S_"+FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase1Idx); }, "S_"+FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase0Idx); }, "p_"+FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase1Idx); }, "p_"+FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, "rho_"+FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, "rho_"+FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); },"mob_"+ FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); },"mob_"+ FS::phaseName(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (priVarFormulation == TwoPFormulation::p0s1) + return pvIdx == 0 ? "p_w" : "S_n"; + else + return pvIdx == 0 ? "p_n" : "S_w"; + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 958309b5f1..42287814fa 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -69,12 +69,12 @@ #include #include #include -#include +#include #include "formulation.hh" #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "saturationreconstruction.hh" namespace Dumux @@ -138,6 +138,10 @@ struct TwoPVolumeVariablesTraits using SaturationReconstruction = SR; }; +// forward declaration +template +class TwoPIOFields; + //////////////////////////////// // properties //////////////////////////////// @@ -166,7 +170,7 @@ SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual); // SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits); //! Set the vtk output fields specific to the twop model -SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields); +SET_TYPE_PROP(TwoP, IOFields, TwoPIOFields); //! Set the volume variables property SET_PROP(TwoP, VolumeVariables) @@ -208,7 +212,12 @@ public: SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits>); //! Set the vtk output fields specific to the non-isothermal twop model -SET_TYPE_PROP(TwoPNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(TwoPNI, IOFields) +{ + using TwoPIOF = TwoPIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2p/vtkoutputfields.hh b/dumux/porousmediumflow/2p/vtkoutputfields.hh deleted file mode 100644 index a9e9b380d6..0000000000 --- a/dumux/porousmediumflow/2p/vtkoutputfields.hh +++ /dev/null @@ -1,58 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPModel - * \brief Adds vtk output fields specific to the two-phase model - */ -#ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup TwoPModel - * \brief Adds vtk output fields specific to the two-phase model - */ -class TwoPVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FluidSystem::phase0Idx); }, "S_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FluidSystem::phase1Idx); }, "S_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FluidSystem::phase0Idx); }, "p_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FluidSystem::phase1Idx); }, "p_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rho_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rho_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); },"mob_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); },"mob_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh b/dumux/porousmediumflow/2p1c/iofields.hh similarity index 58% rename from dumux/porousmediumflow/2p1c/vtkoutputfields.hh rename to dumux/porousmediumflow/2p1c/iofields.hh index 2cd6ee93b9..9ca4f77d7d 100644 --- a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh +++ b/dumux/porousmediumflow/2p1c/iofields.hh @@ -19,30 +19,49 @@ /*! * \file * \ingroup TwoPOneCModel - * \copydoc Dumux::TwoPOneCVtkOutputFields + * \copydoc Dumux::TwoPOneCIOFields */ -#ifndef DUMUX_TWOP_ONEC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_ONEC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_TWOP_ONEC_IO_FIELDS_HH +#define DUMUX_TWOP_ONEC_IO_FIELDS_HH -#include +#include namespace Dumux { /*! * \ingroup TwoPOneCModel - * \brief Adds vtk output fields specific to two-phase one-component model. + * \brief Adds I/O fields specific to two-phase one-component model. */ -class TwoPOneCVtkOutputFields +template +class TwoPOneCIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { // use default fields from the 2p model - TwoPVtkOutputFields::init(vtk); + TwoPIOFields::initOutputModule(out); // output additional to TwoP output: - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state) + { + if (priVarFormulation == TwoPFormulation::p0s1) + return (pvIdx == 0) ? "p_w" : + (state == Indices::twoPhases) ? "S_n" : "T"; + else + return (pvIdx == 0) ? "p_n" : + (state == Indices::twoPhases) ? "S_w" : "T"; } }; diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 08f618c27e..55ec945241 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -69,10 +69,10 @@ #include #include #include -#include +#include #include "darcyslaw.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "indices.hh" #include "volumevariables.hh" @@ -217,7 +217,12 @@ SET_TYPE_PROP(TwoPOneCNI, ThermalConductivityModel, ThermalConductivitySomerton< SET_TYPE_PROP(TwoPOneCNI, ModelTraits, TwoPOneCNIModelTraits); //! The non-isothermal vtk output fields. -SET_TYPE_PROP(TwoPOneCNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(TwoPOneCNI, IOFields) +{ + using TwoPOneCIOF = TwoPOneCIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 08f9138bb8..a17a3ec7ed 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -85,7 +85,7 @@ #include #include #include -#include +#include #include #include "volumevariables.hh" @@ -199,7 +199,16 @@ public: }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPTwoCNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(TwoPTwoCNI, IOFields) +{ + static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); + using Indices = TwoPNCIndices; + static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + static constexpr auto setMoleFractionsForFirstPhase = true; + using TwoPNCIOF = TwoPNCIOFields; + using type = EnergyIOFields; +}; //! Somerton is used as default model to compute the effective thermal heat conductivity SET_TYPE_PROP(TwoPTwoCNI, ThermalConductivityModel, ThermalConductivitySomerton); diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh new file mode 100644 index 0000000000..1b6ebbd0f2 --- /dev/null +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -0,0 +1,114 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPNCModel + * \brief Adds I/O fields specific to the twop-nc model + */ +#ifndef DUMUX_TWOP_NC_IO_FIELDS_HH +#define DUMUX_TWOP_NC_IO_FIELDS_HH + +#include + +namespace Dumux +{ + +/*! + * \ingroup TwoPNCModel + * \brief Adds I/O fields specific to the TwoPNC model + */ +template +class TwoPNCIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // use default fields from the 2p model + TwoPIOFields::initOutputModule(out); + + //output additional to TwoP output: + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + out.addVolumeVariable([i](const auto& v){ return v.molarDensity(i); }, + "rhoMolar_" + FluidSystem::phaseName(i)); + + if (VolumeVariables::numComponents() < 3){ + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, + "X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + } + + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state) + { + const std::string xString = useMoles ? "x" : "X"; + + std::string phaseNameSecComps; + if (state == Indices::firstPhaseOnly + || (state == Indices::bothPhases && setMoleFractionsForFirstPhase)) + phaseNameSecComps = FluidSystem::phaseName(FluidSystem::phase0Idx); + else + phaseNameSecComps = FluidSystem::phaseName(FluidSystem::phase1Idx); + + if (pvIdx > 1) + return xString + "^" + FluidSystem::componentName(pvIdx) + "_" + phaseNameSecComps; + + const std::vector p0s1SwitchedPvNames = { + xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), + xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), + "S_n"}; + const std::vector p1s0SwitchedPvNames = { + xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), + xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), + "S_w"}; + + switch (priVarFormulation) + { + case TwoPFormulation::p0s1: + return pvIdx == 0 ? "p_w" : p0s1SwitchedPvNames[state-1]; + case TwoPFormulation::p1s0: + return pvIdx == 0 ? "p_n" : p1s0SwitchedPvNames[state-1]; + default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); + } + } +}; + + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index 120d821ef8..d8d79889eb 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -98,12 +98,12 @@ #include #include #include -#include +#include #include #include "volumevariables.hh" #include "primaryvariableswitch.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "indices.hh" namespace Dumux { @@ -249,7 +249,14 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNC, VtkOutputFields, TwoPNCVtkOutputFields); +SET_PROP(TwoPNC, IOFields) +{ + static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); + using Indices = TwoPNCIndices; + static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); + using type = TwoPNCIOFields; +}; SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual); //!< Use the compositional local residual @@ -295,7 +302,16 @@ public: }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPNCNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(TwoPNCNI, IOFields) +{ + static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); + using Indices = TwoPNCIndices; + static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + static constexpr auto setMoleFractionsForFirstPhase = ModelTraits::setMoleFractionsForFirstPhase(); + using TwoPNCIOF = TwoPNCIOFields; + using type = EnergyIOFields; +}; //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNCNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh deleted file mode 100644 index cf00691846..0000000000 --- a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh +++ /dev/null @@ -1,72 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPNCModel - * \brief Adds vtk output fields specific to the twop-nc model - */ -#ifndef DUMUX_TWOP_NC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_NC_VTK_OUTPUT_FIELDS_HH - -#include - -namespace Dumux -{ - -/*! - * \ingroup TwoPNCModel - * \brief Adds vtk output fields specific to the TwoPNC model - */ -class TwoPNCVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // use default fields from the 2p model - TwoPVtkOutputFields::init(vtk); - - //output additional to TwoP output: - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - vtk.addVolumeVariable([i](const auto& v){ return v.molarDensity(i); }, - "rhoMolar_" + FluidSystem::phaseName(i)); - - if (VolumeVariables::numComponents() < 3){ - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, - "X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); - } -}; - - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index bf6797ee23..84b63f3a1f 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -100,10 +100,10 @@ #include #include #include -#include +#include #include -#include +#include namespace Dumux { namespace Properties { @@ -139,7 +139,16 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNCMin, VtkOutputFields, MineralizationVtkOutputFields); +SET_PROP(TwoPNCMin, IOFields) +{ + static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); + using Indices = TwoPNCIndices; + static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); + using TwoPNCIOF = TwoPNCIOFields; + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using type = MineralizationIOFields; +}; //! The 2pnc model traits define the non-mineralization part SET_PROP(TwoPNCMin, ModelTraits) @@ -190,7 +199,18 @@ public: }; //! non-isothermal vtkoutput -SET_TYPE_PROP(TwoPNCMinNI, VtkOutputFields, EnergyVtkOutputFields>); +SET_PROP(TwoPNCMinNI, IOFields) +{ + static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); + using Indices = TwoPNCIndices; + static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); + static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); + using TwoPNCIOF = TwoPNCIOFields; + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using MineralizationIOF = MineralizationIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p/vtkoutputfields.hh b/dumux/porousmediumflow/3p/iofields.hh similarity index 63% rename from dumux/porousmediumflow/3p/vtkoutputfields.hh rename to dumux/porousmediumflow/3p/iofields.hh index 11c78810d6..a9947e1ad9 100644 --- a/dumux/porousmediumflow/3p/vtkoutputfields.hh +++ b/dumux/porousmediumflow/3p/iofields.hh @@ -19,36 +19,54 @@ /*! * \file * \ingroup ThreePModel - * \brief Adds vtk output fields specific to the three-phase model + * \brief Adds I/O fields specific to the three-phase model */ -#ifndef DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_THREEP_IO_FIELDS_HH +#define DUMUX_THREEP_IO_FIELDS_HH namespace Dumux { /*! * \ingroup ThreePModel - * \brief Adds vtk output fields specific to the three-phase model + * \brief Adds I/O fields specific to the three-phase model */ -class ThreePVtkOutputFields +class ThreePIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { using VolumeVariables = typename VtkOutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - // register standardized vtk output fields + // register standardized output fields for (int i = 0; i < VolumeVariables::numPhases(); ++i) { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); } - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + switch (pvIdx) + { + case 0: return "p_g"; + case 1: return "S_w"; + default: return "S_n"; + } } }; diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index 2156f7b7db..d6f9e405e6 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -66,11 +66,11 @@ #include #include #include -#include +#include #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -186,13 +186,13 @@ public: }; //! Set the vtk output fields specific to this model -SET_PROP(ThreeP, VtkOutputFields) +SET_PROP(ThreeP, IOFields) { private: using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; public: - using type = ThreePVtkOutputFields; + using type = ThreePIOFields; }; ///////////////////////////////////////////////// @@ -209,13 +209,13 @@ public: }; //! Set non-isothermal output fields -SET_PROP(ThreePNI, VtkOutputFields) +SET_PROP(ThreePNI, IOFields) { private: - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using IsothermalFields = ThreePVtkOutputFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using IsothermalFields = ThreePIOFields; public: - using type = EnergyVtkOutputFields; + using type = EnergyIOFields; }; //! Set non-isothermal model traits diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh new file mode 100644 index 0000000000..16c9fe4c70 --- /dev/null +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -0,0 +1,124 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup ThreePThreeCModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +#ifndef DUMUX_THREEPTHREEC_IO_FIELDS_HH +#define DUMUX_THREEPTHREEC_IO_FIELDS_HH + +namespace Dumux { + +/*! + * \ingroup ThreePThreeCModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +template +class ThreePThreeCIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // register standardized out output fields + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "S_w"); + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"S_n"); + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"S_g"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"p_w"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"p_n"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"p_g"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rho_w"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rho_n"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rho_g"); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + + out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); + out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state) + { + switch (state) + { + case Indices::threePhases: + { + const std::vector s1 = {"p_g", + "S_w", + "S_n"}; + return s1[pvIdx]; + } + case Indices::wPhaseOnly: + { + const std::vector s2 = {"p_g", + "x^" + FluidSystem::componentName(FluidSystem::gCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx), + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx)}; + return s2[pvIdx]; + } + case Indices::gnPhaseOnly: + { + const std::vector s3 = {"p_g", + "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx), + "S_n"}; + return s3[pvIdx]; + } + case Indices::wnPhaseOnly: + { + const std::vector s4 = {"p_g", + "x^" + FluidSystem::componentName(FluidSystem::gCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx), + "S_n"}; + return s4[pvIdx]; + } + case Indices::gPhaseOnly: + { + const std::vector s5 = {"p_g", + "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx), + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + return s5[pvIdx]; + } + case Indices::wgPhaseOnly: + { + const std::vector s6 = {"p_g", + "S_w", + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + return s6[pvIdx]; + } + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index 9d5cd0172a..e777112c22 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -84,7 +84,7 @@ #include #include #include -#include +#include #include #include @@ -95,7 +95,7 @@ #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "primaryvariableswitch.hh" #include "localresidual.hh" @@ -272,7 +272,7 @@ public: SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(ThreePThreeC, VtkOutputFields, ThreePThreeCVtkOutputFields); +SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields); //! Use mole fractions in the balance equations by default SET_BOOL_PROP(ThreePThreeC, UseMoles, true); @@ -297,7 +297,12 @@ public: }; //! Set the non-isothermal vktoutputfields -SET_TYPE_PROP(ThreePThreeCNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(ThreePThreeCNI, IOFields) +{ + using ThreePThreeCIOF = ThreePThreeCIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh deleted file mode 100644 index 23905e4e72..0000000000 --- a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh +++ /dev/null @@ -1,61 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup ThreePThreeCModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -#ifndef DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup ThreePThreeCModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -class ThreePThreeCVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh new file mode 100644 index 0000000000..cdb99db5cb --- /dev/null +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -0,0 +1,131 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup ThreePWaterOilModel + * \brief Adds I/O fields specific to the twop model + */ +#ifndef DUMUX_3P2CNI_IO_FIELDS_HH +#define DUMUX_3P2CNI_IO_FIELDS_HH + +namespace Dumux { + +/*! + * \ingroup ThreePWaterOilModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +template +class ThreePWaterOilIOFields +{ + +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // register standardized out output fields + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "S_w"); + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"S_n"); + out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"S_g"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"p_w"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"p_n"); + out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"p_g"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rho_w"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rho_n"); + out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rho_g"); + out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::wPhaseIdx); },"mob_w"); + out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::nPhaseIdx); },"mob_n"); + out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::gPhaseIdx); },"mob_g"); + out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::wPhaseIdx); },"viscos_w"); + out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::nPhaseIdx); },"viscos_n"); + out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::gPhaseIdx); },"viscos_g"); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + + out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); + out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state) + { + switch (state) + { + case Indices::threePhases: + { + const std::vector s1 = {"p_g", + "S_w", + "S_n"}; + return s1[pvIdx]; + } + case Indices::wPhaseOnly: + { + const std::vector s2 = {"p_w", + "T", + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx)}; + return s2[pvIdx]; + } + case Indices::gnPhaseOnly: + { + const std::vector s3 = {"p_g", + "S_n", + "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::nPhaseIdx)}; + return s3[pvIdx]; + } + case Indices::wnPhaseOnly: + { + const std::vector s4 = {"p_w", + "T", + "S_n"}; + return s4[pvIdx]; + } + case Indices::gPhaseOnly: + { + const std::vector s5 = {"p_g", + "T", + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + return s5[pvIdx]; + } + case Indices::wgPhaseOnly: + { + const std::vector s6 = {"p_g", + "S_w", + "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + return s6[pvIdx]; + } + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index f33abc1f82..6e18d90b42 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -81,7 +81,7 @@ #include #include #include -#include +#include #include #include "indices.hh" @@ -89,7 +89,7 @@ #include "volumevariables.hh" #include "localresidual.hh" #include "primaryvariableswitch.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -274,7 +274,12 @@ public: }; //! Set the non-isothermal vkt output fields -SET_TYPE_PROP(ThreePWaterOilNI, VtkOutputFields, EnergyVtkOutputFields); +SET_PROP(ThreePWaterOilNI, IOFields) +{ + using ThreePWaterOilIOF = ThreePWaterOilIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; +}; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh deleted file mode 100644 index 6812904727..0000000000 --- a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh +++ /dev/null @@ -1,63 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup ThreePWaterOilModel - * \brief Adds vtk output fields specific to the twop model - */ -#ifndef DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH -#define DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup ThreePWaterOilModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -class ThreePWaterOilVtkOutputFields -{ - -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){return v.viscosity(i); }, "mu_"+FluidSystem::phaseName(i)); - - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh b/dumux/porousmediumflow/mineralization/iofields.hh similarity index 61% rename from dumux/porousmediumflow/mineralization/vtkoutputfields.hh rename to dumux/porousmediumflow/mineralization/iofields.hh index fc482af544..e6e750f331 100644 --- a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh +++ b/dumux/porousmediumflow/mineralization/iofields.hh @@ -19,36 +19,52 @@ /*! * \file * \ingroup MineralizationModel - * \brief Adds vtk output fields specific to the models considering + * \brief Adds I/O fields specific to the models considering * mineralization processes. */ -#ifndef DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH -#define DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_MINERALIZATION_IO_FIELDS_HH +#define DUMUX_MINERALIZATION_IO_FIELDS_HH namespace Dumux { /*! * \ingroup MineralizationModel - * \brief Adds vtk output fields specific to a NCMin model + * \brief Adds I/O fields specific to a NCMin model */ -template -class MineralizationVtkOutputFields +template +class MineralizationIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - using SolidSystem = typename VtkOutputModule::VolumeVariables::SolidSystem; + using SolidSystem = typename OutputModule::VolumeVariables::SolidSystem; // output of the model without mineralization - NonMineralizationVtkOutputFields::init(vtk); + NonMineralizationIOFields::initOutputModule(out); // additional output for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i) { - vtk.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },"precipitateVolumeFraction^"+ SolidSystem::componentName(i)); + out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },"precipitateVolumeFraction^"+ SolidSystem::componentName(i)); } } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (pvIdx < nonMineralizationNumEq) + return NonMineralizationIOFields::template primaryVariableName(pvIdx, state); + else + return "precipitateVolumeFraction^" + SolidSystem::componentName(pvIdx - nonMineralizationNumEq); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh b/dumux/porousmediumflow/mpnc/iofields.hh similarity index 76% rename from dumux/porousmediumflow/mpnc/vtkoutputfields.hh rename to dumux/porousmediumflow/mpnc/iofields.hh index dc81d040cb..849c7193b9 100644 --- a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh +++ b/dumux/porousmediumflow/mpnc/iofields.hh @@ -19,33 +19,32 @@ /*! * \file * \ingroup MPNCModel - * \brief Adds vtk output fields specific to the twop model + * \brief Adds I/O fields specific to the twop model */ -#ifndef DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_MPNC_IO_FIELDS_HH +#define DUMUX_MPNC_IO_FIELDS_HH namespace Dumux { /*! * \ingroup MPNCModel - * \brief Adds vtk output fields specific to the twop model + * \brief Adds I/O fields specific to the twop model */ -class MPNCVtkOutputFields +class MPNCIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); for (int i = 0; i < VolumeVariables::numPhases(); ++i) { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); for (int j = 0; j < VolumeVariables::numComponents(); ++j) vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh index 4b49402cda..fa459904fb 100644 --- a/dumux/porousmediumflow/mpnc/model.hh +++ b/dumux/porousmediumflow/mpnc/model.hh @@ -108,13 +108,13 @@ #include #include #include -#include +#include #include #include #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "pressureformulation.hh" @@ -299,7 +299,7 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNC, VtkOutputFields, MPNCVtkOutputFields); +SET_TYPE_PROP(MPNC, IOFields, MPNCIOFields); ///////////////////////////////////////////////// // Properties for the non-isothermal mpnc model @@ -326,7 +326,7 @@ public: SET_TYPE_PROP(MPNCNonequil, EquilibriumLocalResidual, MPNCLocalResidual); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNCNonequil, EquilibriumVtkOutputFields, MPNCVtkOutputFields); +SET_TYPE_PROP(MPNCNonequil, EquilibriumIOFields, MPNCIOFields); //! For non-equilibrium with mpnc we have to overwrite the model traits again, //! because the mpnc indices depend on the status of the non-equilibrium model traits diff --git a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh b/dumux/porousmediumflow/nonequilibrium/iofields.hh similarity index 70% rename from dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh rename to dumux/porousmediumflow/nonequilibrium/iofields.hh index 2217179863..04254269e4 100644 --- a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh +++ b/dumux/porousmediumflow/nonequilibrium/iofields.hh @@ -19,7 +19,7 @@ /*! * \file * \ingroup PorousmediumNonEquilibriumModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ #ifndef DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH #define DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH @@ -28,28 +28,35 @@ namespace Dumux { /*! * \ingroup PorousmediumNonEquilibriumModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ -template -class NonEquilibriumVtkOutputFields +template +class NonEquilibriumIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem; + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; - EquilibriumVtkOutputFields::init(vtk); + EquilibriumIOFields::initOutputModule(out); for (int i = 0; i < ModelTraits::numEnergyEqFluid(); ++i) - vtk.addVolumeVariable( [i](const auto& v){ return v.temperatureFluid(i); }, "T_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.temperatureFluid(i); }, "T_" + FluidSystem::phaseName(i) ); for (int i = 0; i < ModelTraits::numEnergyEqSolid(); ++i) - vtk.addVolumeVariable( [i](const auto& v){ return v.temperatureSolid(); }, "T_s" ); + out.addVolumeVariable( [i](const auto& v){ return v.temperatureSolid(); }, "T_s" ); for (int i = 0; i < ModelTraits::numPhases(); ++i){ - vtk.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); - vtk.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); - vtk.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) ); } } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/nonequilibrium/model.hh b/dumux/porousmediumflow/nonequilibrium/model.hh index b4ba31ed5b..f4a5b56aa1 100644 --- a/dumux/porousmediumflow/nonequilibrium/model.hh +++ b/dumux/porousmediumflow/nonequilibrium/model.hh @@ -38,7 +38,7 @@ #include "localresidual.hh" #include "indices.hh" #include "gridvariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" /*! * \ingroup \ingroup PorousmediumNonEquilibriumModel @@ -132,13 +132,13 @@ public: SET_TYPE_PROP(NonEquilibrium, GridVariables, NonEquilibriumGridVariables); //! indices for non-isothermal models -SET_PROP(NonEquilibrium, VtkOutputFields) +SET_PROP(NonEquilibrium, IOFields) { private: - using EquilibriumVtkOutputFields = typename GET_PROP_TYPE(TypeTag, EquilibriumVtkOutputFields); + using EquilibriumIOFields = typename GET_PROP_TYPE(TypeTag, EquilibriumIOFields); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); public: - using type = NonEquilibriumVtkOutputFields; + using type = NonEquilibriumIOFields; }; SET_PROP(NonEquilibrium, NusseltFormulation) diff --git a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh b/dumux/porousmediumflow/nonisothermal/iofields.hh similarity index 63% rename from dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh rename to dumux/porousmediumflow/nonisothermal/iofields.hh index d5c0e6c0b4..21964ab359 100644 --- a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh +++ b/dumux/porousmediumflow/nonisothermal/iofields.hh @@ -19,7 +19,7 @@ /*! * \file * \ingroup NIModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ #ifndef DUMUX_ENERGY_OUTPUT_FIELDS_HH #define DUMUX_ENERGY_OUTPUT_FIELDS_HH @@ -28,18 +28,34 @@ namespace Dumux { /*! * \ingroup NIModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ -template -class EnergyVtkOutputFields +template +class EnergyIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - IsothermalVtkOutputFields::init(vtk); - vtk.addVolumeVariable( [](const auto& v){ return v.temperature(); }, "T"); + IsothermalIOFields::initOutputModule(out); + out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, "T"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (pvIdx < ModelTraits::numEq() - 1) + return IsothermalIOFields::template primaryVariableName(pvIdx, state); + else + return "T"; } }; diff --git a/dumux/porousmediumflow/richards/iofields.hh b/dumux/porousmediumflow/richards/iofields.hh new file mode 100644 index 0000000000..071384df5e --- /dev/null +++ b/dumux/porousmediumflow/richards/iofields.hh @@ -0,0 +1,85 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup RichardsModel + * \brief Adds I/O fields specific to the Richards model. + */ +#ifndef DUMUX_RICHARDS_IO_FIELDS_HH +#define DUMUX_RICHARDS_IO_FIELDS_HH + +#include + +namespace Dumux { + +/*! + * \ingroup RichardsModel + * \brief Adds I/O fields specific to the Richards model. + */ +template +class RichardsIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::liquidPhaseIdx); }, "S_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::gasPhaseIdx); }, "S_"+FS::phaseName(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::liquidPhaseIdx); }, "p_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::gasPhaseIdx); }, "p_"+FS::phaseName(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, "rho_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, "mob_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::liquidPhaseIdx); }, "kr"); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + + static const bool gravity = getParamFromGroup(out.paramGroup(), "Problem.EnableGravity"); + + if(gravity) + out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::liquidPhaseIdx); }, "pressure head"); + if (enableWaterDiffusionInAir) + out.addVolumeVariable([](const auto& v){ return v.moleFraction(1, 0); }, "x^"+FS::componentName(FS::gasCompIdx)+"_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::liquidPhaseIdx); },"water content"); + + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state) + { + if (state == Indices::gasPhaseOnly) + return "x^w_n"; + else + return "p_w"; + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 99321fbda5..642e032535 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -107,11 +107,11 @@ #include #include #include -#include +#include #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "primaryvariableswitch.hh" @@ -191,14 +191,14 @@ NEW_TYPE_TAG(RichardsNI, INHERITS_FROM(Richards)); SET_TYPE_PROP(Richards, LocalResidual, RichardsLocalResidual); //! Set the vtk output fields specific to this model -SET_PROP(Richards, VtkOutputFields) +SET_PROP(Richards, IOFields) { private: - static constexpr bool enableWaterDiffusionInAir + static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); public: - using type = RichardsVtkOutputFields; + using type = RichardsIOFields; }; //! The model traits @@ -296,13 +296,13 @@ public: }; //! Set the vtk output fields specific to th non-isothermal model -SET_PROP(RichardsNI, VtkOutputFields) +SET_PROP(RichardsNI, IOFields) { -private: - static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); - using IsothermalFields = RichardsVtkOutputFields; -public: - using type = EnergyVtkOutputFields; + static constexpr bool enableWaterDiffusionInAir + = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); + using RichardsIOF = RichardsIOFields; + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using type = EnergyIOFields; }; // \} diff --git a/dumux/porousmediumflow/richards/vtkoutputfields.hh b/dumux/porousmediumflow/richards/vtkoutputfields.hh deleted file mode 100644 index 3d6825d085..0000000000 --- a/dumux/porousmediumflow/richards/vtkoutputfields.hh +++ /dev/null @@ -1,69 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup RichardsModel - * \brief Adds vtk output fields specific to the Richards model. - */ -#ifndef DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH - -#include - -namespace Dumux { - -/*! - * \ingroup RichardsModel - * \brief Adds vtk output fields specific to the Richards model. - */ -template -class RichardsVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::liquidPhaseIdx); }, "S_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::gasPhaseIdx); }, "S_"+FluidSystem::phaseName(FluidSystem::gasPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::liquidPhaseIdx); }, "p_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::gasPhaseIdx); }, "p_"+FluidSystem::phaseName(FluidSystem::gasPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::liquidPhaseIdx); }, "rho_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::liquidPhaseIdx); }, "mob_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(FluidSystem::liquidPhaseIdx); }, "kr"); - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - - static const bool gravity = getParamFromGroup(vtk.paramGroup(), "Problem.EnableGravity"); - - if(gravity) - vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(FluidSystem::liquidPhaseIdx); }, "pressure head"); - if (enableWaterDiffusionInAir) - vtk.addVolumeVariable([](const auto& v){ return v.moleFraction(1, 0); }, "x^"+FluidSystem::componentName(FluidSystem::gasCompIdx)+"_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.waterContent(FluidSystem::liquidPhaseIdx); },"water content"); - - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh new file mode 100644 index 0000000000..89209368e0 --- /dev/null +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -0,0 +1,88 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup RichardsNCModel + * \brief Adds I/O fields specific to the Richards model. + */ +#ifndef DUMUX_RICHARDSNC_IO_FIELDS_HH +#define DUMUX_RICHARDSNC_IO_FIELDS_HH + +#include + +namespace Dumux { + +/*! + * \ingroup RichardsNCModel + * \brief Adds I/O fields specific to the Richards model. + */ +template +class RichardsNCIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, "S_"+FS::phaseName(VolumeVariables::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, "S_gas"); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, "p_"+FS::phaseName(VolumeVariables::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, "p_gas"); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, "rho_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, "mob_"+FS::phaseName(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, "kr"); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); + + static const bool gravity = getParamFromGroup(out.paramGroup(), "Problem.EnableGravity"); + if(gravity) + out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, "pressure head"); + out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },"water content"); + + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, + "x^" + FS::componentName(compIdx) + "_" + FS::phaseName(VolumeVariables::liquidPhaseIdx)); + + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + const std::string xString = useMoles ? "x" : "X"; + if (pvIdx == 0) + return "p_" + FluidSystem::phaseName(0); + else + return xString + "^" + FluidSystem::componentName(pvIdx) + + "_" + FluidSystem::phaseName(0); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 812e485435..6499f65f7e 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -82,13 +82,13 @@ #include #include #include -#include +#include #include #include "volumevariables.hh" #include "indices.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -213,7 +213,7 @@ SET_PROP(RichardsNC, FluidState) }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(RichardsNC, VtkOutputFields, RichardsNCVtkOutputFields); +SET_TYPE_PROP(RichardsNC, IOFields, RichardsNCIOFields); //! The model after Millington (1961) is used for the effective diffusivity SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk); diff --git a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh b/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh deleted file mode 100644 index 414b6e3faa..0000000000 --- a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh +++ /dev/null @@ -1,69 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup RichardsNCModel - * \brief Adds vtk output fields specific to the Richards model. - */ -#ifndef DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH - -#include - -namespace Dumux { - -/*! - * \ingroup RichardsNCModel - * \brief Adds vtk output fields specific to the Richards model. - */ -class RichardsNCVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, "S_"+FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, "S_gas"); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, "p_"+FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, "p_gas"); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::liquidPhaseIdx); }, "rho_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::liquidPhaseIdx); }, "mob_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, "kr"); - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); - - static const bool gravity = getParamFromGroup(vtk.paramGroup(), "Problem.EnableGravity"); - if(gravity) - vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, "pressure head"); - vtk.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },"water content"); - - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) - vtk.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, - "x^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/tracer/vtkoutputfields.hh b/dumux/porousmediumflow/tracer/iofields.hh similarity index 65% rename from dumux/porousmediumflow/tracer/vtkoutputfields.hh rename to dumux/porousmediumflow/tracer/iofields.hh index 417b3d015a..e89cca86c3 100644 --- a/dumux/porousmediumflow/tracer/vtkoutputfields.hh +++ b/dumux/porousmediumflow/tracer/iofields.hh @@ -19,10 +19,10 @@ /*! * \file * \ingroup TracerModel - * \brief Adds vtk output fields specific to the tracer model + * \brief Adds I/O fields specific to the tracer model */ -#ifndef DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_TRACER_IO_FIELDS_HH +#define DUMUX_TRACER_IO_FIELDS_HH #include @@ -30,26 +30,41 @@ namespace Dumux { /*! * \ingroup TracerModel - * \brief Adds vtk output fields specific to the tracer model + * \brief Adds I/O fields specific to the tracer model */ -class TracerVtkOutputFields +template +class TracerIOFields { public: - template - static void init(VtkOutputModule& vtk) + template + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - // register standardized vtk output fields + // register standardized out output fields for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) { - vtk.addVolumeVariable( [compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, + out.addVolumeVariable( [compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, "x^" + std::string(FluidSystem::componentName(compIdx))); - vtk.addVolumeVariable( [compIdx](const auto& v){ return v.massFraction(0, compIdx); }, + out.addVolumeVariable( [compIdx](const auto& v){ return v.massFraction(0, compIdx); }, "X^" + std::string(FluidSystem::componentName(compIdx))); } - vtk.addVolumeVariable( [](const auto& v){ return v.density(); }, "rho"); + out.addVolumeVariable( [](const auto& v){ return v.density(); }, "rho"); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template + static std::string primaryVariableName(int pvIdx, int state = 0) + { + const std::string xString = useMoles ? "x" : "X"; + return xString + "^" + FluidSystem::componentName(pvIdx); } }; diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index e6793e455a..b909797476 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -59,7 +59,7 @@ #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" namespace Dumux { @@ -142,7 +142,7 @@ public: SET_TYPE_PROP(Tracer, LocalResidual, TracerLocalResidual); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(Tracer, VtkOutputFields, TracerVtkOutputFields); +SET_TYPE_PROP(Tracer, IOFields, TracerIOFields); //! Set the volume variables property SET_PROP(Tracer, VolumeVariables) diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index 98368995c2..9427b9afc3 100644 --- a/test/geomechanics/poroelastic/test_poroelastic.cc +++ b/test/geomechanics/poroelastic/test_poroelastic.cc @@ -144,10 +144,10 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module and output fields - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); using VtkOutputModule = Dumux::VtkOutputModule; VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); + IOFields::init(vtkWriter); // also, add exact solution to the output SolutionVector xExact(fvGridGeometry->numDofs()); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index e86724c8b4..c6a2f1167e 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc index 3d62ebbb3f..b89fb3ab68 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc @@ -100,11 +100,11 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc index 0f46073e77..aea88cb523 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc @@ -101,8 +101,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index e509f4dc7e..126f98af18 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -107,11 +107,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index 319ada366a..abdb25165a 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -107,11 +107,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv.cc b/test/porousmediumflow/1p/implicit/test_1pfv.cc index 1a388afcb8..4836d470a2 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv.cc @@ -137,11 +137,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields // if we are using a random permeability field with gstat bool isRandomField = getParam("SpatialParams.RandomField", false); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc index da93fd8fcc..1dd3c2ef61 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc index 3b3f754d6f..8bed70d08d 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index 2009502d47..e22f6ed711 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -145,11 +145,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(restartTime); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc index d6eccc18a8..46314767de 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc @@ -114,8 +114,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc index 0f5f7d2acc..7d46b0d667 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc index 5cb98b4f12..a0c7d1242e 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 9b810e7049..5b6853198c 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -137,8 +137,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); // Add model specific output fields vtkWriter.addField(problem->getPerm(), "permeability"); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index a0c294a360..30cd903807 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -183,11 +183,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index 214e85a551..241be821e8 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -148,9 +148,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputModule = BoxDfmVtkOutputModule; - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), fractureGridAdapter, "", Dune::VTK::nonconforming); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index ba0d1bf755..0451780605 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc @@ -146,12 +146,12 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), "", Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc index 4d9d848b03..d63d240c42 100644 --- a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc +++ b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc @@ -120,11 +120,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index b7c94c4de9..11a5af224a 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -155,7 +155,7 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); // use non-conforming output for the test with interface solver const auto ncOutput = getParam("Problem.UseNonConformingOutput", false); @@ -163,7 +163,7 @@ int main(int argc, char** argv) try ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 2727e473c2..259eaf3ed7 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 3dd8850bd6..3f4f3bcbbd 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -111,8 +111,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh index 6375775b7d..a5e708c2e8 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh @@ -36,7 +36,7 @@ #include #include "2p2c_comparison_spatialparams.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { /*! @@ -82,7 +82,7 @@ public: SET_BOOL_PROP(TwoPTwoCComparison, UseMoles, true); -SET_TYPE_PROP(TwoPTwoCComparison, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields); +SET_TYPE_PROP(TwoPTwoCComparison, IOFields, TwoPTwoCMPNCIOFields); } // end namespace Properties diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh new file mode 100644 index 0000000000..5db6b4d1d1 --- /dev/null +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh @@ -0,0 +1,73 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPTwoCModel + * \brief Adds I/O fields specific to the twop model + */ +#ifndef DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH +#define DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH + +namespace Dumux { + +/*! + * \ingroup TwoPTwoCModel + * \brief Adds I/O fields specific to the two-phase two-component model + */ +class TwoPTwoCMPNCIOFields +{ +public: + template + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + // register standardized output fields + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); }, "S_"+ FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); }, "S_"+ FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); }, "p_"+ FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); }, "p_"+ FS::phaseName(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, "rho_"+ FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, "rho_"+ FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); }, "mob_"+ FS::phaseName(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); }, "mob_"+ FS::phaseName(FS::phase1Idx)); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X^"+ FS::componentName(j) + "_" + FS::phaseName(i)); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FS::componentName(j) + "_" + FS::phaseName(i)); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } +}; + +} // end namespace Dumux + +#endif diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 15b3e79759..758858d5e1 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc @@ -132,11 +132,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh deleted file mode 100644 index c9b21f177a..0000000000 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh +++ /dev/null @@ -1,66 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPTwoCModel - * \brief Adds vtk output fields specific to the twop model - */ -#ifndef DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup TwoPTwoCModel - * \brief Adds vtk output fields specific to the two-phase two-component model - */ -class TwoPTwoCMPNCVtkOutputFields -{ -public: - template - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase0Idx); }, "S_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase1Idx); }, "S_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase0Idx); }, "p_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase1Idx); }, "p_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rho_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rho_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); }, "mob_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); }, "mob_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } -}; - -} // end namespace Dumux - -#endif diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index d40a89200e..d003d787f0 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -120,11 +120,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc index a0c86b5fbc..e3996f8a36 100644 --- a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc +++ b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields problem->addVtkFields(vtkWriter); //!< Add problem specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc index 71cf087a2c..36bb4bd978 100644 --- a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc +++ b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc @@ -129,11 +129,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 83fad384a0..0b934cbd0d 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -143,11 +143,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields //add specific output vtkWriter.addField(problem->getPermeability(), "Permeability"); // update the output fields before write diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/test_3p_fv.cc index d6ebdec51b..61ad19d8f8 100644 --- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc +++ b/test/porousmediumflow/3p/implicit/test_3p_fv.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc index 9eff45fdfd..3e551dad4d 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc index e1e436da3d..ab8d28813f 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc index c0f0b39452..f8df5d4f26 100644 --- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc +++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc index 20f467c2e9..56c09e3e30 100644 --- a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc +++ b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc @@ -133,11 +133,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/co2/implicit/test_co2_fv.cc b/test/porousmediumflow/co2/implicit/test_co2_fv.cc index 3caebab423..0508d733a7 100644 --- a/test/porousmediumflow/co2/implicit/test_co2_fv.cc +++ b/test/porousmediumflow/co2/implicit/test_co2_fv.cc @@ -110,11 +110,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh index 68840b937d..6e7c521ac6 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include @@ -77,7 +77,7 @@ SET_TYPE_PROP(MPNCComparison, // decide which type to use for floating values (double / quad) SET_TYPE_PROP(MPNCComparison, Scalar, double); SET_BOOL_PROP(MPNCComparison, UseMoles, true); -SET_TYPE_PROP(MPNCComparison, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields); +SET_TYPE_PROP(MPNCComparison, IOFields, TwoPTwoCMPNCIOFields); } // end namespace Dumux /*! diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc index fc7387f487..50ceb74ac9 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc index b404a85961..91192a6410 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc @@ -137,11 +137,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc index c133779e78..75d46437f3 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc index b545d6e4b1..dfeff2e18c 100644 --- a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc index 68b566589c..ba5d771d24 100644 --- a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc +++ b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index c145f63b0d..8c5538bbad 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -116,11 +116,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // get some time loop parameters diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc index 3b41a9ac59..19b5ae00a4 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc index 59879c9d36..a4ffcd675c 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc index cf93612ae3..9406cf8b9b 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc @@ -104,11 +104,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc index ff649d03be..19a56d7a8c 100644 --- a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc +++ b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc @@ -132,11 +132,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 757a2c39ab..6e88731670 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -226,8 +226,8 @@ int main(int argc, char** argv) try //! intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, tracerProblem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TracerTypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TracerTypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index 088255115a..4fc0775236 100644 --- a/test/porousmediumflow/tracer/constvel/test_tracer.cc +++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc @@ -122,8 +122,8 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc index 7cbbff30cb..c14359cc1c 100644 --- a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc +++ b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop -- GitLab From 7f67d53c6f5d4dd77bcd05b6ad78b7d54ef39824 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Wed, 5 Sep 2018 10:17:35 +0200 Subject: [PATCH 10/26] [io] fix output for some freeflow models --- dumux/freeflow/compositional/iofields.hh | 10 ++++++---- dumux/freeflow/navierstokes/iofields.hh | 2 +- dumux/freeflow/rans/twoeq/komega/iofields.hh | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index 554a89abe8..514afc43cd 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -77,11 +77,13 @@ public: template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - if (pvIdx <= ModelTraits::dim()) - return BaseOutputFields::template primaryVariableName(pvIdx, state); + // priVars: v_0, ..., v_dim-1, p, x_0, ..., x_numComp-1, otherPv ..., T + if (pvIdx > ModelTraits::dim() && pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return ModelTraits::useMoles() ? IOName::moleFraction(0, pvIdx - ModelTraits::dim()) + : IOName::massFraction(0, pvIdx - ModelTraits::dim()); else - return ModelTraits::useMoles() ? IOName::moleFraction(pvIdx - ModelTraits::dim()) - : IOName::massFraction(pvIdx - ModelTraits::dim()); + return BaseOutputFields::template primaryVariableName(pvIdx, state); + } }; diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index 63fb9f1225..0d1fa6f3e9 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -52,7 +52,7 @@ public: { using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; out.addVolumeVariable([](const auto& v){ return v.pressure(); }, IOName::pressure()); - out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity()); + out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity()); out.addVolumeVariable([](const auto& v){ return v.density(); }, IOName::density()); // add discretization-specific fields diff --git a/dumux/freeflow/rans/twoeq/komega/iofields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh index 7cc50459c7..ea1c338bac 100644 --- a/dumux/freeflow/rans/twoeq/komega/iofields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -52,6 +52,8 @@ public: template static void initOutputModule(OutputModule& out) { + RANSIOFields::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); } -- GitLab From 3d903929f12a2e82239e5f6d53816900e114eb0c Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Wed, 5 Sep 2018 23:15:22 +0200 Subject: [PATCH 11/26] [io] use IOName throughout IOFields and FluidSystems Add names to `IOName`. Adapt names in some reference solutions. --- dumux/geomechanics/poroelastic/iofields.hh | 8 +- dumux/io/name.hh | 56 +++++++++++- dumux/material/fluidsystems/1pgas.hh | 3 +- dumux/material/fluidsystems/1pliquid.hh | 3 +- dumux/material/fluidsystems/2p1c.hh | 6 +- dumux/material/fluidsystems/2pimmiscible.hh | 9 +- dumux/material/fluidsystems/3pimmiscible.hh | 7 +- dumux/material/fluidsystems/brine.hh | 4 +- dumux/material/fluidsystems/brineair.hh | 6 +- dumux/material/fluidsystems/brineco2.hh | 6 +- dumux/material/fluidsystems/h2oair.hh | 6 +- .../material/fluidsystems/h2oairmesitylene.hh | 8 +- dumux/material/fluidsystems/h2oairxylene.hh | 8 +- dumux/material/fluidsystems/h2oheavyoil.hh | 8 +- dumux/material/fluidsystems/h2on2.hh | 6 +- dumux/material/fluidsystems/h2on2o2.hh | 6 +- dumux/material/fluidsystems/liquidphase2c.hh | 3 +- dumux/material/fluidsystems/spe5.hh | 7 +- dumux/porousmediumflow/1pnc/iofields.hh | 26 +++--- dumux/porousmediumflow/2p/iofields.hh | 35 +++++--- dumux/porousmediumflow/2p/model.hh | 8 +- dumux/porousmediumflow/2p1c/iofields.hh | 18 ++-- dumux/porousmediumflow/2pnc/iofields.hh | 67 ++++++++------- dumux/porousmediumflow/2pnc/model.hh | 8 +- dumux/porousmediumflow/3p/iofields.hh | 29 ++++--- dumux/porousmediumflow/3p3c/iofields.hh | 74 ++++++++-------- dumux/porousmediumflow/3pwateroil/iofields.hh | 85 ++++++++++--------- .../mineralization/iofields.hh | 7 +- dumux/porousmediumflow/mpnc/iofields.hh | 31 +++++-- .../nonequilibrium/iofields.hh | 9 +- .../nonisothermal/iofields.hh | 7 +- dumux/porousmediumflow/richards/iofields.hh | 49 +++++++---- dumux/porousmediumflow/richards/model.hh | 2 +- dumux/porousmediumflow/richardsnc/iofields.hh | 48 +++++++---- dumux/porousmediumflow/richardsnc/model.hh | 2 +- dumux/porousmediumflow/tracer/iofields.hh | 12 +-- .../2p2c/implicit/mpnccomparison/iofields.hh | 38 ++++++--- test/references/3pwateroilbox-reference.vtu | 6 +- .../richardsanalyticalcc-reference.vtu | 2 +- .../richardslensbox-reference-parallel.vtu | 2 +- test/references/richardslensbox-reference.vtu | 2 +- .../richardslenscc-reference-parallel.vtu | 2 +- test/references/richardslenscc-reference.vtu | 2 +- .../richardsniconductionbox-reference.vtu | 2 +- .../richardsniconductioncc-reference.vtu | 2 +- .../richardsniconvectionbox-reference.vtu | 2 +- .../richardsniconvectioncc-reference.vtu | 2 +- .../richardswelltracerbox-reference.vtu | 2 +- .../richardswelltracercc-reference.vtu | 2 +- test/references/rosi2c-soil-reference.vtu | 2 +- .../test_boxrichardsevaporation-reference.vtu | 2 +- .../test_ccrichardsevaporation-reference.vtu | 2 +- ...dded_1d3d_1p2c_richards2c_3d-reference.vtu | 2 +- .../test_embedded_1p_richards_box_3d.vtu | 2 +- .../test_embedded_1p_richards_tpfa_3d.vtu | 2 +- 55 files changed, 473 insertions(+), 282 deletions(-) diff --git a/dumux/geomechanics/poroelastic/iofields.hh b/dumux/geomechanics/poroelastic/iofields.hh index b6c91ef711..262475c5b6 100644 --- a/dumux/geomechanics/poroelastic/iofields.hh +++ b/dumux/geomechanics/poroelastic/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_POROELASTIC_IO_FIELDS_HH #define DUMUX_POROELASTIC_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -36,8 +38,10 @@ public: template static void initOutputModule(OutputModule& out) { - out.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, "u"); - out.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, + IOName::displacement()); + out.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, + IOName::porosity()); } template diff --git a/dumux/io/name.hh b/dumux/io/name.hh index 756685aa7f..e44c7019ae 100644 --- a/dumux/io/name.hh +++ b/dumux/io/name.hh @@ -38,11 +38,15 @@ std::string pressure(int phaseIdx) noexcept std::string pressure() noexcept { return "p"; } -//! I/O name of saturation +//! I/O name of saturation for multiphase systems template std::string saturation(int phaseIdx) noexcept { return (FluidSystem::numPhases == 1) ? "S" : "S_" + FluidSystem::phaseName(phaseIdx); } +//! I/O name of saturation for singlephase systems +std::string saturation() noexcept +{ return "S"; } + //! I/O name of temperature for equilibrium models std::string temperature() noexcept { return "T"; } @@ -65,6 +69,15 @@ std::string density(int phaseIdx) noexcept std::string density() noexcept { return "rho"; } +//! I/O name of viscosity for multiphase systems +template +std::string viscosity(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "mu" : "mu_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of viscosity for singlephase systems +std::string viscosity() noexcept +{ return "mu"; } + //! I/O name of molar density for multiphase systems template std::string molarDensity(int phaseIdx) noexcept @@ -74,6 +87,15 @@ std::string molarDensity(int phaseIdx) noexcept std::string molarDensity() noexcept { return "rhoMolar"; } +//! I/O name of relative permeability for multiphase systems +template +std::string relativePermeability(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "kr" : "kr_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of relative permeability for singlephase systems +std::string relativePermeability() noexcept +{ return "kr"; } + //! I/O name of mobility for multiphase systems template std::string mobility(int phaseIdx) noexcept @@ -93,6 +115,22 @@ template std::string massFraction(int phaseIdx, int compIdx) noexcept { return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } +//! I/O name of liquid +std::string liquid() noexcept +{ return "liq"; } + +//! I/O name of gaseous +std::string gaseous() noexcept +{ return "gas"; } + +//! I/O name of aqueous +std::string aqueous() noexcept +{ return "aq"; } + +//! I/O name of napl +std::string napl() noexcept +{ return "napl"; } + //! I/O name of capillary pressure std::string capillaryPressure() noexcept { return "pc"; } @@ -101,15 +139,31 @@ std::string capillaryPressure() noexcept std::string porosity() noexcept { return "porosity"; } +//! I/O name of permeability +std::string permeability() noexcept +{ return "permeability"; } + //! I/O name of phase presence std::string phasePresence() noexcept { return "phase presence"; } +//! I/O name of pressure head +std::string pressureHead() noexcept +{ return "pressure head"; } + +//! I/O name of water content +std::string waterContent() noexcept +{ return "water content"; } + //! I/O name of solid volume fraction template std::string solidVolumeFraction(int compIdx = 0) noexcept { return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } +//! I/O name of displacement +std::string displacement() noexcept +{ return "u"; } + } // end namespace IOName } // end namespace Dumux diff --git a/dumux/material/fluidsystems/1pgas.hh b/dumux/material/fluidsystems/1pgas.hh index a889a3f2d8..e5fa4dc2a2 100644 --- a/dumux/material/fluidsystems/1pgas.hh +++ b/dumux/material/fluidsystems/1pgas.hh @@ -31,6 +31,7 @@ #include #include +#include namespace Dumux { namespace FluidSystems { @@ -73,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "gas"; } + { return IOName::gaseous(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/1pliquid.hh b/dumux/material/fluidsystems/1pliquid.hh index 1d03e04033..d7f4bbf30e 100644 --- a/dumux/material/fluidsystems/1pliquid.hh +++ b/dumux/material/fluidsystems/1pliquid.hh @@ -31,6 +31,7 @@ #include #include +#include namespace Dumux { namespace FluidSystems { @@ -73,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "liq"; } + { return IOName::liquid(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh index 4857dc4b94..4bfe614d72 100644 --- a/dumux/material/fluidsystems/2p1c.hh +++ b/dumux/material/fluidsystems/2p1c.hh @@ -30,6 +30,8 @@ #include +#include + #include "base.hh" namespace Dumux { @@ -68,8 +70,8 @@ public: static std::string phaseName(int phaseIdx) { static std::string name[] = { - std::string("liq"), - std::string("gas"), + std::string(IOName::liquid()), + std::string(IOName::gaseous()), }; assert(0 <= phaseIdx && phaseIdx < numPhases); diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index 2429a039a0..f6cc03cf97 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -33,6 +33,7 @@ #include #include #include +#include #include "base.hh" @@ -89,16 +90,16 @@ public: if (!Fluid0::isGas() && !Fluid1::isGas()) { if (phaseIdx == phase0Idx) - return Components::IsAqueous::value ? "aq" : "napl"; + return Components::IsAqueous::value ? IOName::aqueous() : IOName::napl(); else - return Components::IsAqueous::value ? "aq" : "napl"; + return Components::IsAqueous::value ? IOName::aqueous() : IOName::napl(); } else { if (phaseIdx == phase0Idx) - return Fluid0::isGas() ? "gas" : "liq"; + return Fluid0::isGas() ? IOName::gaseous() : IOName::liquid(); else - return Fluid1::isGas() ? "gas" : "liq"; + return Fluid1::isGas() ? IOName::gaseous() : IOName::liquid(); } } diff --git a/dumux/material/fluidsystems/3pimmiscible.hh b/dumux/material/fluidsystems/3pimmiscible.hh index 3d362ffad3..88d9eb94c6 100644 --- a/dumux/material/fluidsystems/3pimmiscible.hh +++ b/dumux/material/fluidsystems/3pimmiscible.hh @@ -34,6 +34,7 @@ #include #include #include +#include namespace Dumux { namespace FluidSystems { @@ -93,10 +94,10 @@ public: switch (phaseIdx) { case wPhaseIdx: return Components::IsAqueous::value - ? "aq" : "napl"; + ? IOName::aqueous() : IOName::napl(); case nPhaseIdx: return Components::IsAqueous::value - ? "aq" : "napl"; - case gPhaseIdx: return "gas"; + ? IOName::aqueous() : IOName::napl(); + case gPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index 9bfc0769a4..c1d04a7d5f 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -32,6 +32,8 @@ #include +#include + namespace Dumux { namespace FluidSystems { @@ -69,7 +71,7 @@ public: static const std::string phaseName(int phaseIdx = liquidPhaseIdx) { assert(phaseIdx == liquidPhaseIdx); - return "liq"; + return IOName::liquid(); } /*! diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index bba23499dd..24cda87536 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -41,6 +41,8 @@ #include #include +#include + #include "brine.hh" namespace Dumux { @@ -148,8 +150,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquid(); + case gasPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh index 55eb96777b..489c384c46 100644 --- a/dumux/material/fluidsystems/brineco2.hh +++ b/dumux/material/fluidsystems/brineco2.hh @@ -41,6 +41,8 @@ #include +#include + namespace Dumux { // include the default tables for CO2 @@ -195,8 +197,8 @@ public: { switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquid(); + case gasPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 0efa87856c..9cc3091bb9 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -39,6 +39,8 @@ #include #include +#include + namespace Dumux { namespace FluidSystems { /*! @@ -104,8 +106,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquid(); + case gasPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index 3db76865d2..9c8a74049a 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -37,6 +37,8 @@ #include +#include + namespace Dumux { namespace FluidSystems { @@ -197,9 +199,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueous(); + case nPhaseIdx: return IOName::napl(); + case gPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index 944304bb1c..f9832c0b18 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -36,6 +36,8 @@ #include +#include + namespace Dumux { namespace FluidSystems @@ -198,9 +200,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueous(); + case nPhaseIdx: return IOName::napl(); + case gPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 575b2c74f7..55f7c00c47 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -33,6 +33,8 @@ #include +#include + namespace Dumux { namespace FluidSystems { @@ -187,9 +189,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueous(); + case nPhaseIdx: return IOName::napl(); + case gPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index e5c75bc42b..f1cf83305c 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -37,6 +37,8 @@ #include #include +#include + #include "base.hh" namespace Dumux { @@ -105,8 +107,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquid(); + case gasPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index 868dbe8f85..c30a26d4d7 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -44,6 +44,8 @@ #include #include +#include + namespace Dumux { namespace FluidSystems { /*! @@ -124,8 +126,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquid(); + case gasPhaseIdx: return IOName::gaseous(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/liquidphase2c.hh b/dumux/material/fluidsystems/liquidphase2c.hh index 67e5847579..c0e0d9a751 100644 --- a/dumux/material/fluidsystems/liquidphase2c.hh +++ b/dumux/material/fluidsystems/liquidphase2c.hh @@ -30,6 +30,7 @@ #include #include #include +#include namespace Dumux { namespace FluidSystems { @@ -75,7 +76,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "liq"; } + { return IOName::liquid(); } /*! * \brief Returns whether the fluids are miscible diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index b7fc35f9c4..eaafbb8769 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -28,6 +28,7 @@ #include #include +#include namespace Dumux { @@ -89,9 +90,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case gPhaseIdx: return "gas"; - case wPhaseIdx: return "aq"; - case oPhaseIdx: return "napl"; + case gPhaseIdx: return IOName::gaseous(); + case wPhaseIdx: return IOName::aqueous(); + case oPhaseIdx: return IOName::napl(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/porousmediumflow/1pnc/iofields.hh b/dumux/porousmediumflow/1pnc/iofields.hh index b14f2a7d0a..0b4bf08259 100644 --- a/dumux/porousmediumflow/1pnc/iofields.hh +++ b/dumux/porousmediumflow/1pnc/iofields.hh @@ -26,6 +26,8 @@ #include +#include + namespace Dumux { /*! @@ -42,18 +44,22 @@ public: using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, "p"); - out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, "rho"); - out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, "mu"); - out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, "delp"); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, + IOName::pressure()); + out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, + IOName::density()); + out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, + IOName::viscosity()); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, + "delp"); for (int i = 0; i < VolumeVariables::numComponents(); ++i) out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, - "x^" + std::string(FluidSystem::componentName(i)) + "_" + std::string(FluidSystem::phaseName(0))); + IOName::moleFraction(0, i)); for (int i = 0; i < VolumeVariables::numComponents(); ++i) out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, - "X^" + std::string(FluidSystem::componentName(i))+ "_" + std::string(FluidSystem::phaseName(0))); + IOName::massFraction(0, i)); } template @@ -66,12 +72,12 @@ public: template static std::string primaryVariableName(int pvIdx, int state = 0) { - const std::string xString = useMoles ? "x" : "X"; if (pvIdx == 0) - return "p"; + return IOName::pressure(); + else if (useMoles) + return IOName::moleFraction(0, pvIdx); else - return xString + "^" + FluidSystem::componentName(pvIdx) - + "_" + FluidSystem::phaseName(0); + return IOName::massFraction(0, pvIdx); } }; diff --git a/dumux/porousmediumflow/2p/iofields.hh b/dumux/porousmediumflow/2p/iofields.hh index fe726bd7c2..a12e9f4ba5 100644 --- a/dumux/porousmediumflow/2p/iofields.hh +++ b/dumux/porousmediumflow/2p/iofields.hh @@ -43,20 +43,25 @@ public: template static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FS = typename VolumeVariables::FluidSystem; - out.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase0Idx); }, "S_"+FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FS::phase1Idx); }, "S_"+FS::phaseName(FS::phase1Idx)); - out.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase0Idx); }, "p_"+FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FS::phase1Idx); }, "p_"+FS::phaseName(FS::phase1Idx)); - out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, "rho_"+FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, "rho_"+FS::phaseName(FS::phase1Idx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); },"mob_"+ FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); },"mob_"+ FS::phaseName(FS::phase1Idx)); + for (int phaseIdx = 0; phaseIdx < FS::numPhases; ++phaseIdx) + { + out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.saturation(phaseIdx); }, + IOName::saturation(phaseIdx)); + out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.pressure(phaseIdx); }, + IOName::pressure(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.mobility(phaseIdx); }, + IOName::mobility(phaseIdx)); + } - out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); } template @@ -66,13 +71,15 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { if (priVarFormulation == TwoPFormulation::p0s1) - return pvIdx == 0 ? "p_w" : "S_n"; + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase0Idx) + : IOName::saturation(FluidSystem::phase1Idx); else - return pvIdx == 0 ? "p_n" : "S_w"; + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase1Idx) + : IOName::saturation(FluidSystem::phase0Idx); } }; diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 42287814fa..311d498643 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -103,11 +103,11 @@ struct TwoPModelTraits static std::string primaryVariableName(int pvIdx, int state = 0) { if (priVarFormulation() == TwoPFormulation::p0s1) - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx) - : "S_" + FluidSystem::phaseName(FluidSystem::phase1Idx) ; + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase0Idx) + : IOName::saturation(FluidSystem::phase1Idx) ; else - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase1Idx) - : "S_" + FluidSystem::phaseName(FluidSystem::phase0Idx); + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase1Idx) + : IOName::saturation(FluidSystem::phase0Idx); } }; diff --git a/dumux/porousmediumflow/2p1c/iofields.hh b/dumux/porousmediumflow/2p1c/iofields.hh index 9ca4f77d7d..d2cfe34041 100644 --- a/dumux/porousmediumflow/2p1c/iofields.hh +++ b/dumux/porousmediumflow/2p1c/iofields.hh @@ -25,6 +25,7 @@ #define DUMUX_TWOP_ONEC_IO_FIELDS_HH #include +#include namespace Dumux { @@ -43,7 +44,8 @@ public: TwoPIOFields::initOutputModule(out); // output additional to TwoP output: - out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); } template @@ -53,15 +55,19 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { if (priVarFormulation == TwoPFormulation::p0s1) - return (pvIdx == 0) ? "p_w" : - (state == Indices::twoPhases) ? "S_n" : "T"; + return (pvIdx == 0) ? IOName::pressure(FluidSystem::phase0Idx) : + (state == Indices::twoPhases) + ? IOName::saturation(FluidSystem::phase1Idx) + : IOName::temperature(); else - return (pvIdx == 0) ? "p_n" : - (state == Indices::twoPhases) ? "S_w" : "T"; + return (pvIdx == 0) ? IOName::pressure(FluidSystem::phase1Idx) : + (state == Indices::twoPhases) + ? IOName::saturation(FluidSystem::phase0Idx) + : IOName::temperature(); } }; diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh index 1b6ebbd0f2..58ee425377 100644 --- a/dumux/porousmediumflow/2pnc/iofields.hh +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -25,6 +25,7 @@ #define DUMUX_TWOP_NC_IO_FIELDS_HH #include +#include namespace Dumux { @@ -46,24 +47,24 @@ public: // use default fields from the 2p model TwoPIOFields::initOutputModule(out); - //output additional to TwoP output: - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - out.addVolumeVariable([i](const auto& v){ return v.molarDensity(i); }, - "rhoMolar_" + FluidSystem::phaseName(i)); - - if (VolumeVariables::numComponents() < 3){ - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, - "X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + // output additional to TwoP output: + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + { + out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.moleFraction(phaseIdx,compIdx); }, + IOName::moleFraction(phaseIdx, compIdx)); + if (VolumeVariables::numComponents() < 3) + out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.massFraction(phaseIdx,compIdx); }, + IOName::massFraction(phaseIdx, compIdx)); + } + + out.addVolumeVariable([phaseIdx](const auto& v){ return v.molarDensity(phaseIdx); }, + IOName::molarDensity(phaseIdx)); } - out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); } template @@ -76,33 +77,39 @@ public: template static std::string primaryVariableName(int pvIdx, int state) { - const std::string xString = useMoles ? "x" : "X"; - - std::string phaseNameSecComps; + int idxSecComps; if (state == Indices::firstPhaseOnly || (state == Indices::bothPhases && setMoleFractionsForFirstPhase)) - phaseNameSecComps = FluidSystem::phaseName(FluidSystem::phase0Idx); + idxSecComps = FluidSystem::phase0Idx; else - phaseNameSecComps = FluidSystem::phaseName(FluidSystem::phase1Idx); + idxSecComps = FluidSystem::phase1Idx; if (pvIdx > 1) - return xString + "^" + FluidSystem::componentName(pvIdx) + "_" + phaseNameSecComps; + return useMoles ? IOName::moleFraction(idxSecComps, pvIdx) + : IOName::massFraction(idxSecComps, pvIdx); const std::vector p0s1SwitchedPvNames = { - xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), - xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_n"}; + useMoles ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + useMoles ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + IOName::saturation(FluidSystem::phase1Idx)}; + const std::vector p1s0SwitchedPvNames = { - xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), - xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_w"}; + useMoles ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + useMoles ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + IOName::saturation(FluidSystem::phase0Idx)}; switch (priVarFormulation) { case TwoPFormulation::p0s1: - return pvIdx == 0 ? "p_w" : p0s1SwitchedPvNames[state-1]; + return pvIdx == 0 ? IOName::pressure(FluidSystem::wPhaseIdx) + : p0s1SwitchedPvNames[state-1]; case TwoPFormulation::p1s0: - return pvIdx == 0 ? "p_n" : p1s0SwitchedPvNames[state-1]; + return pvIdx == 0 ? IOName::pressure(FluidSystem::nPhaseIdx) + : p1s0SwitchedPvNames[state-1]; default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); } } diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index d8d79889eb..c5cfa177db 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -153,19 +153,19 @@ struct TwoPNCModelTraits const std::vector p0s1SwitchedPvNames = { xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_" + FluidSystem::phaseName(FluidSystem::phase1Idx)}; + IOName::saturation(FluidSystem::phase1Idx)}; const std::vector p1s0SwitchedPvNames = { xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_" + FluidSystem::phaseName(FluidSystem::phase0Idx)}; + IOName::saturation(FluidSystem::phase0Idx)}; switch (priVarFormulation()) { case TwoPFormulation::p0s1: - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx) + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase0Idx) : p0s1SwitchedPvNames[state-1]; case TwoPFormulation::p1s0: - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase1Idx) + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase1Idx) : p1s0SwitchedPvNames[state-1]; default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); } diff --git a/dumux/porousmediumflow/3p/iofields.hh b/dumux/porousmediumflow/3p/iofields.hh index a9947e1ad9..a33a68111b 100644 --- a/dumux/porousmediumflow/3p/iofields.hh +++ b/dumux/porousmediumflow/3p/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_THREEP_IO_FIELDS_HH #define DUMUX_THREEP_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -36,19 +38,24 @@ public: template static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; // register standardized output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) { - out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - out.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density(phaseIdx)); } - out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + out.addVolumeVariable( [](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); }, + IOName::permeability()); } template @@ -58,14 +65,14 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { switch (pvIdx) { - case 0: return "p_g"; - case 1: return "S_w"; - default: return "S_n"; + case 0: return IOName::pressure(FluidSystem::gPhaseIdx); + case 1: return IOName::saturation(FluidSystem::wPhaseIdx); + default: return IOName::saturation(FluidSystem::nPhaseIdx); } } }; diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh index 16c9fe4c70..25d31deb2f 100644 --- a/dumux/porousmediumflow/3p3c/iofields.hh +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_THREEPTHREEC_IO_FIELDS_HH #define DUMUX_THREEPTHREEC_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -40,25 +42,27 @@ public: using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - // register standardized out output fields - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "S_w"); - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"S_n"); - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"S_g"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"p_w"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"p_n"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"p_g"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rho_w"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rho_n"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rho_g"); + // register standardized output fields + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation(phaseIdx)); + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure(phaseIdx)); + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density(phaseIdx)); - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, + IOName::moleFraction(phaseIdx, compIdx)); + } - out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + out.addVolumeVariable( [](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); }, + IOName::permeability()); } template @@ -75,44 +79,44 @@ public: { case Indices::threePhases: { - const std::vector s1 = {"p_g", - "S_w", - "S_n"}; + const std::vector s1 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s1[pvIdx]; } case Indices::wPhaseOnly: { - const std::vector s2 = {"p_g", - "x^" + FluidSystem::componentName(FluidSystem::gCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx), - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx)}; + const std::vector s2 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; return s2[pvIdx]; } case Indices::gnPhaseOnly: { - const std::vector s3 = {"p_g", - "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx), - "S_n"}; + const std::vector s3 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s3[pvIdx]; } case Indices::wnPhaseOnly: { - const std::vector s4 = {"p_g", - "x^" + FluidSystem::componentName(FluidSystem::gCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx), - "S_n"}; + const std::vector s4 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s4[pvIdx]; } case Indices::gPhaseOnly: { - const std::vector s5 = {"p_g", - "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx), - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + const std::vector s5 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s5[pvIdx]; } case Indices::wgPhaseOnly: { - const std::vector s6 = {"p_g", - "S_w", - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + const std::vector s6 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s6[pvIdx]; } } diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh index cdb99db5cb..4d33cae0f7 100644 --- a/dumux/porousmediumflow/3pwateroil/iofields.hh +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -24,6 +24,9 @@ #ifndef DUMUX_3P2CNI_IO_FIELDS_HH #define DUMUX_3P2CNI_IO_FIELDS_HH +#include +#include + namespace Dumux { /*! @@ -41,31 +44,31 @@ public: using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - // register standardized out output fields - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::wPhaseIdx); }, "S_w"); - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::nPhaseIdx); },"S_n"); - out.addVolumeVariable( [](const auto& v){ return v.saturation(FluidSystem::gPhaseIdx); },"S_g"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::wPhaseIdx); },"p_w"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::nPhaseIdx); },"p_n"); - out.addVolumeVariable( [](const auto& v){ return v.pressure(FluidSystem::gPhaseIdx); },"p_g"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::wPhaseIdx); },"rho_w"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::nPhaseIdx); },"rho_n"); - out.addVolumeVariable( [](const auto& v){ return v.density(FluidSystem::gPhaseIdx); },"rho_g"); - out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::wPhaseIdx); },"mob_w"); - out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::nPhaseIdx); },"mob_n"); - out.addVolumeVariable( [](const auto& v){ return v.mobility(FluidSystem::gPhaseIdx); },"mob_g"); - out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::wPhaseIdx); },"viscos_w"); - out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::nPhaseIdx); },"viscos_n"); - out.addVolumeVariable( [](const auto& v){ return v.viscosity(FluidSystem::gPhaseIdx); },"viscos_g"); + // register standardized output fields + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.mobility(phaseIdx); }, + IOName::mobility(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.viscosity(phaseIdx); }, + IOName::viscosity(phaseIdx)); - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, + IOName::moleFraction(phaseIdx, compIdx)); + } - out.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - out.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + out.addVolumeVariable([](const auto& v){ return v.permeability(); }, + IOName::permeability()); } template @@ -82,44 +85,44 @@ public: { case Indices::threePhases: { - const std::vector s1 = {"p_g", - "S_w", - "S_n"}; + const std::vector s1 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s1[pvIdx]; } case Indices::wPhaseOnly: { - const std::vector s2 = {"p_w", - "T", - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::wPhaseIdx)}; + const std::vector s2 = {IOName::pressure(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; return s2[pvIdx]; } case Indices::gnPhaseOnly: { - const std::vector s3 = {"p_g", - "S_n", - "x^" + FluidSystem::componentName(FluidSystem::wCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::nPhaseIdx)}; + const std::vector s3 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx), + IOName::moleFraction(FluidSystem::nPhaseIdx, FluidSystem::wCompIdx)}; return s3[pvIdx]; } case Indices::wnPhaseOnly: { - const std::vector s4 = {"p_w", - "T", - "S_n"}; + const std::vector s4 = {IOName::pressure(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s4[pvIdx]; } case Indices::gPhaseOnly: { - const std::vector s5 = {"p_g", - "T", - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + const std::vector s5 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::temperature(), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s5[pvIdx]; } case Indices::wgPhaseOnly: { - const std::vector s6 = {"p_g", - "S_w", - "x^" + FluidSystem::componentName(FluidSystem::nCompIdx) + "_" + FluidSystem::phaseName(FluidSystem::gPhaseIdx)}; + const std::vector s6 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s6[pvIdx]; } } diff --git a/dumux/porousmediumflow/mineralization/iofields.hh b/dumux/porousmediumflow/mineralization/iofields.hh index e6e750f331..529e64c8c5 100644 --- a/dumux/porousmediumflow/mineralization/iofields.hh +++ b/dumux/porousmediumflow/mineralization/iofields.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_MINERALIZATION_IO_FIELDS_HH #define DUMUX_MINERALIZATION_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -46,7 +48,8 @@ public: // additional output for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i) { - out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },"precipitateVolumeFraction^"+ SolidSystem::componentName(i)); + out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); }, + IOName::solidVolumeFraction(i)); } } @@ -63,7 +66,7 @@ public: if (pvIdx < nonMineralizationNumEq) return NonMineralizationIOFields::template primaryVariableName(pvIdx, state); else - return "precipitateVolumeFraction^" + SolidSystem::componentName(pvIdx - nonMineralizationNumEq); + return IOName::solidVolumeFraction(pvIdx - nonMineralizationNumEq); } }; diff --git a/dumux/porousmediumflow/mpnc/iofields.hh b/dumux/porousmediumflow/mpnc/iofields.hh index 849c7193b9..7a51660f40 100644 --- a/dumux/porousmediumflow/mpnc/iofields.hh +++ b/dumux/porousmediumflow/mpnc/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_MPNC_IO_FIELDS_HH #define DUMUX_MPNC_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -41,18 +43,29 @@ public: for (int i = 0; i < VolumeVariables::numPhases(); ++i) { - out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - out.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - out.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, + IOName::saturation(i)); + out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, + IOName::pressure(i)); + out.addVolumeVariable([i](const auto& v){ return v.density(i); }, + IOName::density(i)); + out.addVolumeVariable([i](const auto& v){ return v.mobility(i); }, + IOName::mobility(i)); for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + IOName::moleFraction(i, j)); } - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([j](const auto& v){ return v.fugacity(j); }, - "fugacity^"+ FluidSystem::componentName(j)); + + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + } + + template + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); } }; diff --git a/dumux/porousmediumflow/nonequilibrium/iofields.hh b/dumux/porousmediumflow/nonequilibrium/iofields.hh index 04254269e4..bece5487af 100644 --- a/dumux/porousmediumflow/nonequilibrium/iofields.hh +++ b/dumux/porousmediumflow/nonequilibrium/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH #define DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH +#include + namespace Dumux { /*! @@ -41,9 +43,10 @@ public: EquilibriumIOFields::initOutputModule(out); for (int i = 0; i < ModelTraits::numEnergyEqFluid(); ++i) - out.addVolumeVariable( [i](const auto& v){ return v.temperatureFluid(i); }, "T_" + FluidSystem::phaseName(i) ); - for (int i = 0; i < ModelTraits::numEnergyEqSolid(); ++i) - out.addVolumeVariable( [i](const auto& v){ return v.temperatureSolid(); }, "T_s" ); + out.addVolumeVariable([i](const auto& v){ return v.temperatureFluid(i); }, + IOName::fluidTemperature(i)); + out.addVolumeVariable([](const auto& v){ return v.temperatureSolid(); }, + IOName::solidTemperature()); for (int i = 0; i < ModelTraits::numPhases(); ++i){ out.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); out.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); diff --git a/dumux/porousmediumflow/nonisothermal/iofields.hh b/dumux/porousmediumflow/nonisothermal/iofields.hh index 21964ab359..3ef98a1259 100644 --- a/dumux/porousmediumflow/nonisothermal/iofields.hh +++ b/dumux/porousmediumflow/nonisothermal/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_ENERGY_OUTPUT_FIELDS_HH #define DUMUX_ENERGY_OUTPUT_FIELDS_HH +#include + namespace Dumux { /*! @@ -39,7 +41,8 @@ public: static void initOutputModule(OutputModule& out) { IsothermalIOFields::initOutputModule(out); - out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, "T"); + out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, + IOName::temperature()); } template @@ -55,7 +58,7 @@ public: if (pvIdx < ModelTraits::numEq() - 1) return IsothermalIOFields::template primaryVariableName(pvIdx, state); else - return "T"; + return IOName::temperature(); } }; diff --git a/dumux/porousmediumflow/richards/iofields.hh b/dumux/porousmediumflow/richards/iofields.hh index 071384df5e..cd2b4a05b2 100644 --- a/dumux/porousmediumflow/richards/iofields.hh +++ b/dumux/porousmediumflow/richards/iofields.hh @@ -25,6 +25,7 @@ #define DUMUX_RICHARDS_IO_FIELDS_HH #include +#include namespace Dumux { @@ -39,28 +40,41 @@ public: template static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FS = typename VolumeVariables::FluidSystem; - out.addVolumeVariable([](const auto& v){ return v.saturation(FS::liquidPhaseIdx); }, "S_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.saturation(FS::gasPhaseIdx); }, "S_"+FS::phaseName(FS::gasPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.pressure(FS::liquidPhaseIdx); }, "p_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.pressure(FS::gasPhaseIdx); }, "p_"+FS::phaseName(FS::gasPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, "rho_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, "mob_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::liquidPhaseIdx); }, "kr"); - out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::liquidPhaseIdx); }, + IOName::saturation(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::gasPhaseIdx); }, + IOName::saturation(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::liquidPhaseIdx); }, + IOName::pressure(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::gasPhaseIdx); }, + IOName::pressure(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, + IOName::density(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, + IOName::mobility(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::liquidPhaseIdx); }, + IOName::relativePermeability(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); static const bool gravity = getParamFromGroup(out.paramGroup(), "Problem.EnableGravity"); if(gravity) - out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::liquidPhaseIdx); }, "pressure head"); + out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::liquidPhaseIdx); }, + IOName::pressureHead()); if (enableWaterDiffusionInAir) - out.addVolumeVariable([](const auto& v){ return v.moleFraction(1, 0); }, "x^"+FS::componentName(FS::gasCompIdx)+"_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::liquidPhaseIdx); },"water content"); + out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::gasPhaseIdx, FS::liquidCompIdx); }, + IOName::moleFraction(FS::gasPhaseIdx, FS::liquidCompIdx)); + out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::liquidPhaseIdx); }, + IOName::waterContent()); - out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); } template @@ -70,13 +84,14 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { if (state == Indices::gasPhaseOnly) - return "x^w_n"; + return IOName::moleFraction(FluidSystem::gasPhaseIdx, + FluidSystem::liquidCompIdx); else - return "p_w"; + return IOName::pressure(FluidSystem::liquidPhaseIdx); } }; diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 642e032535..f1958f5691 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -143,7 +143,7 @@ struct RichardsModelTraits return "x^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx); else - return "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx); + return IOName::pressure(FluidSystem::phase0Idx); } }; diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh index 89209368e0..1dd65fbe04 100644 --- a/dumux/porousmediumflow/richardsnc/iofields.hh +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -25,6 +25,7 @@ #define DUMUX_RICHARDSNC_IO_FIELDS_HH #include +#include namespace Dumux { @@ -42,25 +43,37 @@ public: using VolumeVariables = typename OutputModule::VolumeVariables; using FS = typename VolumeVariables::FluidSystem; - out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, "S_"+FS::phaseName(VolumeVariables::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, "S_gas"); - out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, "p_"+FS::phaseName(VolumeVariables::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, "p_gas"); - out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, "rho_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, "mob_"+FS::phaseName(FS::liquidPhaseIdx)); - out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, "kr"); - out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - out.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, + IOName::saturation() + "_" + IOName::liquid()); + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, + IOName::saturation() + "_" + IOName::gaseous()); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, + IOName::pressure() + "_" + IOName::liquid()); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, + IOName::pressure() + "_" + IOName::gaseous()); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, + IOName::density() + "_" + IOName::liquid()); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, + IOName::mobility() + "_" + IOName::liquid()); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, + IOName::relativePermeability() + "_" + IOName::liquid()); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, + IOName::temperature()); static const bool gravity = getParamFromGroup(out.paramGroup(), "Problem.EnableGravity"); - if(gravity) - out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, "pressure head"); - out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },"water content"); + if (gravity) + out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, + IOName::pressureHead()); + out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); }, + IOName::waterContent()); for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, - "x^" + FS::componentName(compIdx) + "_" + FS::phaseName(VolumeVariables::liquidPhaseIdx)); + IOName::moleFraction(VolumeVariables::liquidPhaseIdx, compIdx)); } @@ -74,12 +87,11 @@ public: template static std::string primaryVariableName(int pvIdx, int state = 0) { - const std::string xString = useMoles ? "x" : "X"; if (pvIdx == 0) - return "p_" + FluidSystem::phaseName(0); + return IOName::pressure(0); else - return xString + "^" + FluidSystem::componentName(pvIdx) - + "_" + FluidSystem::phaseName(0); + return useMoles ? IOName::moleFraction(0, pvIdx) + : IOName::massFraction(0, pvIdx); } }; diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 6499f65f7e..3e2a11e980 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -120,7 +120,7 @@ struct RichardsNCModelTraits { const std::string xString = useMoles() ? "x" : "X"; if (pvIdx == 0) - return "p_" + FluidSystem::phaseName(0); + return IOName::pressure(0); else return xString + "^" + FluidSystem::componentName(pvIdx) + "_" + FluidSystem::phaseName(0); diff --git a/dumux/porousmediumflow/tracer/iofields.hh b/dumux/porousmediumflow/tracer/iofields.hh index e89cca86c3..bebeae2307 100644 --- a/dumux/porousmediumflow/tracer/iofields.hh +++ b/dumux/porousmediumflow/tracer/iofields.hh @@ -26,6 +26,8 @@ #include +#include + namespace Dumux { /*! @@ -45,12 +47,12 @@ public: // register standardized out output fields for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) { - out.addVolumeVariable( [compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, - "x^" + std::string(FluidSystem::componentName(compIdx))); - out.addVolumeVariable( [compIdx](const auto& v){ return v.massFraction(0, compIdx); }, - "X^" + std::string(FluidSystem::componentName(compIdx))); + out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, + "x^" + FluidSystem::componentName(compIdx)); + out.addVolumeVariable([compIdx](const auto& v){ return v.massFraction(0, compIdx); }, + "X^" + FluidSystem::componentName(compIdx)); } - out.addVolumeVariable( [](const auto& v){ return v.density(); }, "rho"); + out.addVolumeVariable( [](const auto& v){ return v.density(); }, IOName::density()); } template diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh index 5db6b4d1d1..8f42a26678 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH #define DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH +#include + namespace Dumux { /*! @@ -40,24 +42,38 @@ public: using FS = typename VolumeVariables::FluidSystem; // register standardized output fields - out.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); }, "S_"+ FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); }, "S_"+ FS::phaseName(FS::phase1Idx)); - out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); }, "p_"+ FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); }, "p_"+ FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); }, + IOName::saturation(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); }, + IOName::saturation(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); }, + IOName::pressure(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); }, + IOName::pressure(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, + IOName::density(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, + IOName::density(FS::phase1Idx)); - out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, "rho_"+ FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, "rho_"+ FS::phaseName(FS::phase1Idx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); }, "mob_"+ FS::phaseName(FS::phase0Idx)); - out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); }, "mob_"+ FS::phaseName(FS::phase1Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); }, + IOName::mobility(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); }, + IOName::mobility(FS::phase1Idx)); for (int i = 0; i < VolumeVariables::numPhases(); ++i) for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X^"+ FS::componentName(j) + "_" + FS::phaseName(i)); + out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, + IOName::massFraction(i, j)); for (int i = 0; i < VolumeVariables::numPhases(); ++i) for (int j = 0; j < VolumeVariables::numComponents(); ++j) - out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FS::componentName(j) + "_" + FS::phaseName(i)); + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + IOName::moleFraction(i, j)); } template diff --git a/test/references/3pwateroilbox-reference.vtu b/test/references/3pwateroilbox-reference.vtu index 8bb9a595ab..2416e05561 100644 --- a/test/references/3pwateroilbox-reference.vtu +++ b/test/references/3pwateroilbox-reference.vtu @@ -2535,7 +2535,7 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - + 0.000954057 0.000954014 0.000954032 0.000953987 0.000953936 0.000953917 0.000953862 0.000953846 0.000953803 0.000953789 0.00095376 0.000953749 0.000953733 0.000953725 0.00095372 0.000953715 0.000953718 0.000953715 0.000953725 0.000953724 0.000953739 0.000953738 0.000953757 0.000953757 0.000953778 0.000953779 0.000953802 0.000953803 0.000953827 0.000953829 0.000953854 0.000953856 0.000953881 0.000953883 0.000953909 0.00095391 @@ -2746,7 +2746,7 @@ 0.000954929 0.000954929 0.00095493 0.00095493 0.000954931 0.000954932 0.000954932 0.000954933 0.000954933 0.000954934 0.000954934 0.000954935 0.000954935 0.000954936 0.000954936 0.000954936 0.000954937 - + 1739.16 1738.7 1738.82 1738.36 1737.91 1737.68 1737.17 1736.98 1736.57 1736.4 1736.14 1736 1735.87 1735.77 1735.74 1735.66 1735.72 1735.66 1735.79 1735.75 1735.92 1735.89 1736.11 1736.09 1736.33 1736.31 1736.57 1736.56 1736.83 1736.82 1737.1 1737.09 1737.38 1737.37 1737.66 1737.65 @@ -2957,7 +2957,7 @@ 1747.21 1747.22 1747.22 1747.23 1747.24 1747.24 1747.25 1747.25 1747.26 1747.26 1747.27 1747.27 1747.28 1747.28 1747.29 1747.29 1747.29 - + 5.91112e-09 5.89577e-09 5.94453e-09 5.92224e-09 5.85837e-09 5.87276e-09 5.81658e-09 5.82477e-09 5.78228e-09 5.78942e-09 5.75858e-09 5.7663e-09 5.74447e-09 5.75313e-09 5.73802e-09 5.74757e-09 5.73737e-09 5.74768e-09 5.74101e-09 5.75193e-09 5.74777e-09 5.75918e-09 5.75676e-09 5.76855e-09 5.76732e-09 5.77942e-09 5.77898e-09 5.79133e-09 5.79138e-09 5.80392e-09 5.80426e-09 5.81697e-09 5.81743e-09 5.83028e-09 5.83077e-09 5.84373e-09 diff --git a/test/references/richardsanalyticalcc-reference.vtu b/test/references/richardsanalyticalcc-reference.vtu index ed9cce9d69..9bcbeef80d 100644 --- a/test/references/richardsanalyticalcc-reference.vtu +++ b/test/references/richardsanalyticalcc-reference.vtu @@ -318,7 +318,7 @@ 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardslensbox-reference-parallel.vtu b/test/references/richardslensbox-reference-parallel.vtu index 3c824a4e3a..901ca580ca 100644 --- a/test/references/richardslensbox-reference-parallel.vtu +++ b/test/references/richardslensbox-reference-parallel.vtu @@ -150,7 +150,7 @@ 146.749 164.984 146.749 3.92159 0 0 0 0 0 0 0 0.0196823 249.082 733.751 753.199 733.751 249.082 - + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslensbox-reference.vtu b/test/references/richardslensbox-reference.vtu index 076c15811e..32ce87a8dc 100644 --- a/test/references/richardslensbox-reference.vtu +++ b/test/references/richardslensbox-reference.vtu @@ -269,7 +269,7 @@ 249.082 733.751 753.199 733.751 249.082 0.0196823 0 0 0 0 0 0 0 0 0 0 0 - + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslenscc-reference-parallel.vtu b/test/references/richardslenscc-reference-parallel.vtu index 64b199f8c9..7a8a5e3c2a 100644 --- a/test/references/richardslenscc-reference-parallel.vtu +++ b/test/references/richardslenscc-reference-parallel.vtu @@ -129,7 +129,7 @@ 0 0 0 0 0 0 0 0 10.7357 17.6661 17.6661 10.7357 0 0 0 0 0 0 0 0.0154609 407.511 473.279 473.279 407.511 - + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslenscc-reference.vtu b/test/references/richardslenscc-reference.vtu index 6a54878150..fa6c1e1b7f 100644 --- a/test/references/richardslenscc-reference.vtu +++ b/test/references/richardslenscc-reference.vtu @@ -241,7 +241,7 @@ 0 0 0 0 0 0 0 0.0154609 407.511 473.279 473.279 407.511 0.0154609 0 0 0 0 0 0 0 0 0 0 0 - + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardsniconductionbox-reference.vtu b/test/references/richardsniconductionbox-reference.vtu index 1986fbf328..8ee8e4fcd8 100644 --- a/test/references/richardsniconductionbox-reference.vtu +++ b/test/references/richardsniconductionbox-reference.vtu @@ -255,7 +255,7 @@ 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconductioncc-reference.vtu b/test/references/richardsniconductioncc-reference.vtu index 36a22a712d..5187408907 100644 --- a/test/references/richardsniconductioncc-reference.vtu +++ b/test/references/richardsniconductioncc-reference.vtu @@ -136,7 +136,7 @@ 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconvectionbox-reference.vtu b/test/references/richardsniconvectionbox-reference.vtu index 72cfb75c55..b751ca7007 100644 --- a/test/references/richardsniconvectionbox-reference.vtu +++ b/test/references/richardsniconvectionbox-reference.vtu @@ -115,7 +115,7 @@ 921.42 921.42 921.42 921.42 921.42 921.42 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.392 921.392 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconvectioncc-reference.vtu b/test/references/richardsniconvectioncc-reference.vtu index e644b0e21a..fdf46b11a0 100644 --- a/test/references/richardsniconvectioncc-reference.vtu +++ b/test/references/richardsniconvectioncc-reference.vtu @@ -66,7 +66,7 @@ 921.422 921.422 921.421 921.421 921.421 921.421 921.421 921.421 921.42 921.42 921.42 921.42 921.42 921.42 921.42 921.419 921.419 921.419 921.419 921.418 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardswelltracerbox-reference.vtu b/test/references/richardswelltracerbox-reference.vtu index 5a0d6b2161..2f22e0c796 100644 --- a/test/references/richardswelltracerbox-reference.vtu +++ b/test/references/richardswelltracerbox-reference.vtu @@ -647,7 +647,7 @@ 0.00249281 0.0025516 0.00264837 0.00282718 0.00320399 0.00394512 0.00523999 0.0074141 0.0116811 0.0259377 0.0944501 0.432193 2.08172 9.29282 31.8186 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardswelltracercc-reference.vtu b/test/references/richardswelltracercc-reference.vtu index df51063e77..9537ef0e72 100644 --- a/test/references/richardswelltracercc-reference.vtu +++ b/test/references/richardswelltracercc-reference.vtu @@ -605,7 +605,7 @@ 0.00614061 0.0062582 0.00646096 0.00684863 0.00773605 0.00951366 0.0130612 0.0244501 0.0786285 0.344282 1.70825 8.96678 45.2552 188.888 535.009 890.348 - + 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/rosi2c-soil-reference.vtu b/test/references/rosi2c-soil-reference.vtu index 99012737ac..176d3bdb6a 100644 --- a/test/references/rosi2c-soil-reference.vtu +++ b/test/references/rosi2c-soil-reference.vtu @@ -4686,7 +4686,7 @@ 0.000634247 0.000632533 0.000629226 0.000624564 0.0006189 0.000612694 0.000606494 0.000600903 0.000596525 0.000593887 0.00059335 0.000595015 0.000598672 0.000603847 0.000609902 0.000616155 0.00062197 0.000626811 0.000630269 0.000632067 - + 6.59414e-07 6.5816e-07 6.55784e-07 6.52554e-07 6.4887e-07 6.45244e-07 6.42229e-07 6.40294e-07 6.3969e-07 6.4044e-07 6.42415e-07 6.45407e-07 6.49154e-07 6.53349e-07 6.57664e-07 6.6178e-07 6.65414e-07 6.68339e-07 6.70382e-07 6.71431e-07 6.58388e-07 6.57017e-07 6.54406e-07 6.5083e-07 6.46713e-07 6.42635e-07 6.39255e-07 6.37145e-07 6.3656e-07 6.37457e-07 6.39653e-07 6.42918e-07 6.4698e-07 6.51511e-07 6.56152e-07 6.60561e-07 diff --git a/test/references/test_boxrichardsevaporation-reference.vtu b/test/references/test_boxrichardsevaporation-reference.vtu index 45135a7768..ad98f26f49 100644 --- a/test/references/test_boxrichardsevaporation-reference.vtu +++ b/test/references/test_boxrichardsevaporation-reference.vtu @@ -94,7 +94,7 @@ 0.000207045 0.000207045 0.000207045 0.000207045 0.000207045 0.000207045 0.000206541 0.000206541 0.000206541 0.000206541 0.000206541 0.000206541 0 0 0 0 0 0 - + 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 diff --git a/test/references/test_ccrichardsevaporation-reference.vtu b/test/references/test_ccrichardsevaporation-reference.vtu index 14e279ed93..85fe61c8e8 100644 --- a/test/references/test_ccrichardsevaporation-reference.vtu +++ b/test/references/test_ccrichardsevaporation-reference.vtu @@ -80,7 +80,7 @@ 0.000207047 0.000207046 0.000207046 0.000207046 0.000207046 0.000207046 0.000206733 0.000206733 0.000206733 0.000206733 0.000206733 0 0 0 0 0 - + 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 diff --git a/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu b/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu index 606678d167..ac4cc1591f 100644 --- a/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu +++ b/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu @@ -1886,7 +1886,7 @@ 0.0127774 0.0126583 0.0122684 0.0123525 0.0125632 0.0125142 0.0122497 0.0123338 0.0125387 0.0124892 0.0124988 0.0126437 0.0127594 0.0126619 0.0124716 0.0126137 0.0127273 0.0126335 - + 1.44809e-05 1.44681e-05 1.44481e-05 1.44309e-05 1.44253e-05 1.44355e-05 1.44585e-05 1.44872e-05 1.45122e-05 1.45267e-05 1.44751e-05 1.44594e-05 1.44341e-05 1.44133e-05 1.44055e-05 1.44179e-05 1.44452e-05 1.44789e-05 1.45076e-05 1.45239e-05 1.4468e-05 1.44479e-05 1.44141e-05 1.43748e-05 1.43911e-05 1.44245e-05 1.4467e-05 1.4502e-05 1.45212e-05 1.44672e-05 1.44446e-05 1.44066e-05 1.43525e-05 1.44114e-05 1.44612e-05 1.45016e-05 diff --git a/test/references/test_embedded_1p_richards_box_3d.vtu b/test/references/test_embedded_1p_richards_box_3d.vtu index 335590ba65..ac4accc8b0 100644 --- a/test/references/test_embedded_1p_richards_box_3d.vtu +++ b/test/references/test_embedded_1p_richards_box_3d.vtu @@ -1305,7 +1305,7 @@ 0.000853228 0.000849936 0.000840787 0.000827768 0.000813799 0.000802194 0.00079593 0.000796775 0.000804455 0.000816508 0.000829133 0.000838513 0.000841964 - + 1.00391e-06 1.00242e-06 1.00366e-06 1.00206e-06 9.95402e-07 9.93208e-07 9.94817e-07 9.92198e-07 9.98992e-07 9.98387e-07 9.8792e-07 9.85599e-07 9.96116e-07 9.95527e-07 9.83273e-07 9.78899e-07 9.96344e-07 9.9544e-07 9.83048e-07 9.78762e-07 1.00053e-06 9.99215e-07 9.88161e-07 9.85146e-07 1.00794e-06 1.00648e-06 9.96855e-07 9.944e-07 1.01744e-06 1.01597e-06 1.00736e-06 1.00513e-06 1.02789e-06 1.0266e-06 1.01866e-06 1.01678e-06 diff --git a/test/references/test_embedded_1p_richards_tpfa_3d.vtu b/test/references/test_embedded_1p_richards_tpfa_3d.vtu index 35ff8633f6..7e0602b4c9 100644 --- a/test/references/test_embedded_1p_richards_tpfa_3d.vtu +++ b/test/references/test_embedded_1p_richards_tpfa_3d.vtu @@ -1025,7 +1025,7 @@ 0.00084527 0.000837485 0.000823297 0.000805259 0.000786915 0.000772548 0.000766755 0.000773315 0.000789494 0.000807961 0.000823252 0.000831811 0.000854015 0.000847195 0.000834856 0.0008194 0.000804085 0.000792642 0.000788559 0.000793778 0.000806374 0.000821398 0.000834209 0.000841488 - + 1.00167e-06 9.98753e-07 9.94934e-07 9.93791e-07 9.97518e-07 1.00505e-06 1.01504e-06 1.02648e-06 1.03813e-06 1.04854e-06 1.05634e-06 1.06051e-06 1.00014e-06 9.96259e-07 9.9067e-07 9.88601e-07 9.92941e-07 1.00095e-06 1.01116e-06 1.02312e-06 1.03552e-06 1.04666e-06 1.05501e-06 1.05947e-06 9.98887e-07 9.93723e-07 9.85174e-07 9.81583e-07 9.86886e-07 9.94784e-07 1.00444e-06 1.01717e-06 1.03097e-06 1.04349e-06 1.05286e-06 1.05785e-06 -- GitLab From 480583d8ff9776c3be4cbd35e6720c0361526260 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Wed, 5 Sep 2018 23:20:23 +0200 Subject: [PATCH 12/26] [io][test] use initOutputModule instead of deprecated init --- test/geomechanics/poroelastic/test_poroelastic.cc | 2 +- test/porousmediumflow/1p/implicit/compressible/test_1p.cc | 2 +- .../1p/implicit/compressible/test_1p_stationary.cc | 2 +- test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc | 2 +- .../1p/implicit/pointsources/test_1pfv_pointsources.cc | 2 +- .../pointsources/test_1pfv_pointsources_timedependent.cc | 2 +- test/porousmediumflow/1p/implicit/test_1pfv.cc | 2 +- test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc | 2 +- test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc | 2 +- test/porousmediumflow/1p/implicit/test_1pnifv.cc | 2 +- test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc | 2 +- .../porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc | 2 +- .../porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc | 2 +- test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc | 2 +- .../2p/implicit/adaptive/test_2p_adaptive_fv.cc | 2 +- test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc | 2 +- .../2p/implicit/cornerpoint/test_2p_cornerpoint.cc | 2 +- .../2p/implicit/fracture/test_2p_fracture_fv.cc | 2 +- test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc | 2 +- test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc | 2 +- test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc | 2 +- .../2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc | 2 +- test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc | 2 +- test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc | 2 +- test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc | 2 +- test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc | 2 +- test/porousmediumflow/3p/implicit/test_3p_fv.cc | 2 +- test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc | 2 +- test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc | 2 +- test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc | 2 +- test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc | 2 +- test/porousmediumflow/co2/implicit/test_co2_fv.cc | 2 +- .../mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc | 2 +- test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc | 2 +- .../mpnc/implicit/test_boxmpncthermalnonequil.cc | 2 +- test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc | 2 +- .../richards/implicit/test_ccrichardsanalytical.cc | 2 +- test/porousmediumflow/richards/implicit/test_richardslens_fv.cc | 2 +- .../richards/implicit/test_richardsniconduction_fv.cc | 2 +- .../richards/implicit/test_richardsniconvection_fv.cc | 2 +- .../richards/implicit/test_richardsnievaporation_fv.cc | 2 +- test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc | 2 +- test/porousmediumflow/tracer/1ptracer/test_cctracer.cc | 2 +- test/porousmediumflow/tracer/constvel/test_tracer.cc | 2 +- .../tracer/multicomp/test_tracer_maxwellstefan.cc | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index 9427b9afc3..97ac7f7e5f 100644 --- a/test/geomechanics/poroelastic/test_poroelastic.cc +++ b/test/geomechanics/poroelastic/test_poroelastic.cc @@ -147,7 +147,7 @@ int main(int argc, char** argv) try using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); using VtkOutputModule = Dumux::VtkOutputModule; VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); + IOFields::initOutputModule(vtkWriter); // also, add exact solution to the output SolutionVector xExact(fvGridGeometry->numDofs()); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index c6a2f1167e..1ddcc3694e 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc @@ -114,7 +114,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc index b89fb3ab68..832cadca5e 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc @@ -104,7 +104,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc index aea88cb523..2d9c502979 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc @@ -102,7 +102,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index 126f98af18..b1be638a61 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -111,7 +111,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index abdb25165a..40d34f9856 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -111,7 +111,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv.cc b/test/porousmediumflow/1p/implicit/test_1pfv.cc index 4836d470a2..2eba645464 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv.cc @@ -141,7 +141,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields // if we are using a random permeability field with gstat bool isRandomField = getParam("SpatialParams.RandomField", false); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc index 1dd3c2ef61..b223bae561 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc index 8bed70d08d..9a2000ab08 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index e22f6ed711..0b1e22cb3d 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -149,7 +149,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(restartTime); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc index 46314767de..14388ed794 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc @@ -115,7 +115,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc index 7d46b0d667..ddcf6be674 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc @@ -114,7 +114,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc index a0c7d1242e..0908681329 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc @@ -114,7 +114,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 5b6853198c..d6218e0144 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -138,7 +138,7 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); + IOFields::initOutputModule(vtkWriter); // Add model specific output fields vtkWriter.addField(problem->getPerm(), "permeability"); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index 30cd903807..27704f7279 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -187,7 +187,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index 241be821e8..789539bb1a 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -150,7 +150,7 @@ int main(int argc, char** argv) try using VtkOutputModule = BoxDfmVtkOutputModule; using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), fractureGridAdapter, "", Dune::VTK::nonconforming); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index 0451780605..7ab9edee59 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc @@ -151,7 +151,7 @@ int main(int argc, char** argv) try "", Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc index d63d240c42..e4e8d2ba27 100644 --- a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc +++ b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc @@ -124,7 +124,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index 11a5af224a..ebf2fd984b 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -163,7 +163,7 @@ int main(int argc, char** argv) try ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 259eaf3ed7..dc2a091754 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 3f4f3bcbbd..e597d12c3a 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -112,7 +112,7 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 758858d5e1..3225fd7be8 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc @@ -136,7 +136,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index d003d787f0..4ddc76aace 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -124,7 +124,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc index e3996f8a36..f091bf5dae 100644 --- a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc +++ b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addVtkFields(vtkWriter); //!< Add problem specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc index 36bb4bd978..4c28d5a862 100644 --- a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc +++ b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc @@ -133,7 +133,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 0b934cbd0d..98264c6ad5 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -147,7 +147,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields //add specific output vtkWriter.addField(problem->getPermeability(), "Permeability"); // update the output fields before write diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/test_3p_fv.cc index 61ad19d8f8..6e8373ebfb 100644 --- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc +++ b/test/porousmediumflow/3p/implicit/test_3p_fv.cc @@ -140,7 +140,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc index 3e551dad4d..0944b34c0d 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc @@ -140,7 +140,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc index ab8d28813f..f1eb062fd2 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc @@ -140,7 +140,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc index f8df5d4f26..727f1a7bac 100644 --- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc +++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc @@ -140,7 +140,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc index 56c09e3e30..6e5745a75d 100644 --- a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc +++ b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc @@ -137,7 +137,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/co2/implicit/test_co2_fv.cc b/test/porousmediumflow/co2/implicit/test_co2_fv.cc index 0508d733a7..54cdbf7e69 100644 --- a/test/porousmediumflow/co2/implicit/test_co2_fv.cc +++ b/test/porousmediumflow/co2/implicit/test_co2_fv.cc @@ -114,7 +114,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc index 50ceb74ac9..bb6ef40cc2 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc @@ -142,7 +142,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc index 91192a6410..ad32dc8140 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc @@ -141,7 +141,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc index 75d46437f3..1c81c08a73 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc @@ -140,7 +140,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc index dfeff2e18c..41f6bfb518 100644 --- a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc @@ -142,7 +142,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc index ba5d771d24..c9b942d261 100644 --- a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc +++ b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index 8c5538bbad..7223f9e41c 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -120,7 +120,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // get some time loop parameters diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc index 19b5ae00a4..056beb23eb 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc index a4ffcd675c..04cc3790ee 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc @@ -135,7 +135,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc index 9406cf8b9b..e44007b65e 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc @@ -108,7 +108,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc index 19a56d7a8c..7197c7c0a6 100644 --- a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc +++ b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc @@ -136,7 +136,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 6e88731670..1af9c7ad18 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -227,7 +227,7 @@ int main(int argc, char** argv) try //! intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, tracerProblem->name()); using IOFields = typename GET_PROP_TYPE(TracerTypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index 4fc0775236..ab2b378871 100644 --- a/test/porousmediumflow/tracer/constvel/test_tracer.cc +++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc @@ -123,7 +123,7 @@ int main(int argc, char** argv) try using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc index c14359cc1c..5e1374769c 100644 --- a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc +++ b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc @@ -142,7 +142,7 @@ int main(int argc, char** argv) try VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop -- GitLab From 6f801baf0799ab5221339733b1dc95426f5d4dde Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 6 Sep 2018 18:10:09 +0200 Subject: [PATCH 13/26] [freeflow][iofields] Add pVNames --- dumux/freeflow/compositional/iofields.hh | 4 ++-- dumux/freeflow/navierstokes/iofields.hh | 8 +++----- dumux/freeflow/nonisothermal/iofields.hh | 4 ++-- dumux/freeflow/rans/iofields.hh | 7 +++++++ dumux/freeflow/rans/oneeq/iofields.hh | 10 ++++++++++ dumux/freeflow/rans/twoeq/kepsilon/iofields.hh | 13 +++++++++++++ dumux/freeflow/rans/twoeq/komega/iofields.hh | 12 ++++++++++++ dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh | 12 ++++++++++++ 8 files changed, 61 insertions(+), 9 deletions(-) diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index 514afc43cd..ebed53abf2 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -74,7 +74,7 @@ public: } //! return the names of the primary variables - template + template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { // priVars: v_0, ..., v_dim-1, p, x_0, ..., x_numComp-1, otherPv ..., T @@ -82,7 +82,7 @@ public: return ModelTraits::useMoles() ? IOName::moleFraction(0, pvIdx - ModelTraits::dim()) : IOName::massFraction(0, pvIdx - ModelTraits::dim()); else - return BaseOutputFields::template primaryVariableName(pvIdx, state); + return BaseOutputFields::template primaryVariableName(pvIdx, state); } }; diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index 0d1fa6f3e9..fae9c6fa83 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -67,13 +67,11 @@ public: } //! return the names of the primary variables - template + template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - const std::array velocities = {"v_x", "v_y", "v_z"}; - - if (pvIdx < FVGridGeometry::Grid::dimension) - return velocities[pvIdx]; + if (pvIdx < ModelTraits::dim()) + return "v"; else return IOName::pressure(); } diff --git a/dumux/freeflow/nonisothermal/iofields.hh b/dumux/freeflow/nonisothermal/iofields.hh index aab75f7562..c8044fdb1d 100644 --- a/dumux/freeflow/nonisothermal/iofields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -62,11 +62,11 @@ public: } //! return the names of the primary variables - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { if (pvIdx < ModelTraits::numEq() - 1) - return IsothermalIOFields::template primaryVariableName(pvIdx, state); + return IsothermalIOFields::template primaryVariableName(pvIdx, state); else return IOName::temperature(); } diff --git a/dumux/freeflow/rans/iofields.hh b/dumux/freeflow/rans/iofields.hh index 3cf03af53a..d14609bc55 100644 --- a/dumux/freeflow/rans/iofields.hh +++ b/dumux/freeflow/rans/iofields.hh @@ -67,6 +67,13 @@ public: out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+"); out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+"); } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + return NavierStokesIOFields::template primaryVariableName(pvIdx, state); + } }; } // end namespace Dumux diff --git a/dumux/freeflow/rans/oneeq/iofields.hh b/dumux/freeflow/rans/oneeq/iofields.hh index 24adbfd3d9..090195661b 100644 --- a/dumux/freeflow/rans/oneeq/iofields.hh +++ b/dumux/freeflow/rans/oneeq/iofields.hh @@ -53,6 +53,16 @@ public: RANSIOFields::initOutputModule(out); out.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + if (pvIdx < ModelTraits::dim() + 1) + return RANSIOFields::template primaryVariableName(pvIdx, state); + else + return "nu_tilde"; + } }; } // end namespace Dumux diff --git a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index c05d2de1b5..4fd4cab951 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -61,6 +61,19 @@ public: out.addVolumeVariable([](const auto& v){ return v.inNearWallRegion(); }, "inNearWallRegion"); out.addVolumeVariable([](const auto& v){ return v.isMatchingPoint(); }, "isMatchingPoint"); } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + std::cout << "kepsi called with " << pvIdx << std::endl; + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "epsilon"; + } }; } // end namespace Dumux diff --git a/dumux/freeflow/rans/twoeq/komega/iofields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh index ea1c338bac..689745676f 100644 --- a/dumux/freeflow/rans/twoeq/komega/iofields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -57,6 +57,18 @@ public: out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "omega"; + } }; } // end namespace Dumux diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index 289777bf00..de2ffd8ad8 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -56,6 +56,18 @@ public: out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); } + + //! return the names of the primary variables + template + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "epsilon"; + } }; } // end namespace Dumux -- GitLab From 4aa4175515658d67c5b62bd72f560d7c91849684 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 6 Sep 2018 18:11:25 +0200 Subject: [PATCH 14/26] [freeflow][model] Remove priVarNames from ModelTraits --- dumux/freeflow/compositional/kepsilonncmodel.hh | 13 ------------- .../compositional/lowrekepsilonncmodel.hh | 13 ------------- .../freeflow/compositional/navierstokesncmodel.hh | 12 ------------ dumux/freeflow/navierstokes/model.hh | 14 -------------- dumux/freeflow/rans/oneeq/model.hh | 11 ----------- dumux/freeflow/rans/twoeq/kepsilon/model.hh | 15 --------------- dumux/freeflow/rans/twoeq/komega/model.hh | 15 --------------- dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh | 15 --------------- 8 files changed, 108 deletions(-) diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 3d272dd21c..757ddc5966 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -69,19 +69,6 @@ struct KEpsilonNCModelTraits : NavierStokesNCModelTraits; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = NavierStokesNCModelTraits; - if (pvIdx < nComp) - return ParentType::template primaryVariableNameCell(pvIdx, state); - else if (pvIdx == nComp) - return "k"; - else - return "epsilon"; - } }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 7242e18100..d09a86edaa 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -74,19 +74,6 @@ struct LowReKEpsilonNCModelTraits : NavierStokesNCModelTraits; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = NavierStokesNCModelTraits; - if (pvIdx < nComp) - return ParentType::template primaryVariableNameCell(pvIdx, state); - else if (pvIdx == nComp) - return "k"; - else - return "epsilon"; - } }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index fa1ec5d18b..b2fb022b16 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -102,18 +102,6 @@ struct NavierStokesNCModelTraits : NavierStokesModelTraits //! the indices using Indices = NavierStokesIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx = 0, int state = 0) - { - const std::string xString = useMoles() ? "x" : "X"; - if (pvIdx == 0) - return NavierStokesModelTraits::template primaryVariableNameCell(pvIdx, state); - else - return xString + "^" + FluidSystem::componentName(pvIdx) - + "_" + FluidSystem::phaseName(0); - } }; /////////////////////////////////////////////////////////////////////////// diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 0f3aaad66f..c3940e3628 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -103,20 +103,6 @@ struct NavierStokesModelTraits //! the indices using Indices = NavierStokesIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx = 0, int state = 0) - { - return "p"; - } - - //! return the names of the primary variables on faces - template - static std::string primaryVariableNameFace(int pvIdx = 0, int state = 0) - { - return "v"; - } }; /*! diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index e434db80ae..ac34e6be3b 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -113,17 +113,6 @@ struct OneEqModelTraits : RANSModelTraits //! the indices using Indices = OneEqIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits; - if (pvIdx == 0) - return ParentType::template primaryVariableNameCell(pvIdx, state); - else - return "nu_tilde"; - } }; /////////////////////////////////////////////////////////////////////////// diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index 6c99ba07ce..9a70db5584 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -99,21 +99,6 @@ struct KEpsilonModelTraits : RANSModelTraits //! the indices using Indices = KEpsilonIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell(pvIdx, state); - case 1: - return "k"; - default: - return "epsilon"; - } - } }; /////////////////////////////////////////////////////////////////////////// diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 806c243387..7bf6db6d8c 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -106,21 +106,6 @@ struct KOmegaModelTraits : RANSModelTraits //! The indices using Indices = KOmegaIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell(pvIdx, state); - case 1: - return "k"; - default: - return "omega"; - } - } }; /////////////////////////////////////////////////////////////////////////// diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 43c36f2896..b1a840544b 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -115,21 +115,6 @@ struct LowReKEpsilonModelTraits : RANSModelTraits //! the indices using Indices = LowReKEpsilonIndices; - - //! return the names of the primary variables in cells - template - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell(pvIdx, state); - case 1: - return "k"; - default: - return "epsilon"; - } - } }; /////////////////////////////////////////////////////////////////////////// -- GitLab From 8c58db99f7db4f9b6d43f848e37ea7a17187cae8 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 6 Sep 2018 18:13:42 +0200 Subject: [PATCH 15/26] [freeflow][iofields] Add createStaggeredFVNameFunction as free function * takes a multitypeblockvector and an index constant to automatically figure out the pv names for cellcenter and face privars --- dumux/freeflow/navierstokes/iofields.hh | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index fae9c6fa83..704541c2ae 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -26,6 +26,8 @@ #include #include +#include +#include // TODO: needed? or is forward declare enough? #include #include @@ -34,6 +36,44 @@ namespace Dumux { +/*! + * \ingroup InputOutput + * \ingroup NavierStokesModel + * \brief helper function to determine the names of cell-centered primary variables of a model with staggered grid discretization + * \note use this as input for the load solution function + */ +template +std::function createStaggeredPVNameFunction(const Dune::MultiTypeBlockVector&, + Dune::index_constant idx, + const std::string& paramGroup = "") +{ + using CellCenterPriVarsType = typename std::tuple_element_t>::block_type; + static constexpr auto offset = ModelTraits::numEq() - CellCenterPriVarsType::dimension; + + if (i == cellCenterIdx) // cell center + { + if (hasParamInGroup(paramGroup, "LoadSolution.CellCenterPriVarNames")) + { + const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.CellCenterPriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; + } + else + // add an offset to the pvIdx so that the velocities are skipped + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx + offset, state); }; + } + else // face + { + if (hasParamInGroup(paramGroup, "LoadSolution.FacePriVarNames")) + { + const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.FacePriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; + } + else + // there is only one scalar-type primary variable called "v" living on the faces + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx , state); }; + } +} + /*! * \ingroup NavierStokesModel * \brief Adds I/O fields for the Navier-Stokes model -- GitLab From 8dcda08722797380faad8b91a165cef3375fe94b Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 6 Sep 2018 21:13:33 +0200 Subject: [PATCH 16/26] [freeflow][io] Free IOFields of (almost all) template parameters --- dumux/freeflow/compositional/iofields.hh | 9 ++---- .../freeflow/compositional/kepsilonncmodel.hh | 17 ++--------- dumux/freeflow/compositional/komegancmodel.hh | 17 ++--------- .../compositional/lowrekepsilonncmodel.hh | 17 ++--------- .../compositional/navierstokesncmodel.hh | 17 ++--------- dumux/freeflow/compositional/oneeqncmodel.hh | 17 ++--------- dumux/freeflow/compositional/zeroeqncmodel.hh | 17 ++--------- dumux/freeflow/navierstokes/iofields.hh | 29 +++++++++++-------- dumux/freeflow/navierstokes/model.hh | 19 ++---------- dumux/freeflow/nonisothermal/iofields.hh | 9 ++---- dumux/freeflow/rans/iofields.hh | 11 +++---- dumux/freeflow/rans/model.hh | 18 ++---------- dumux/freeflow/rans/oneeq/iofields.hh | 8 ++--- dumux/freeflow/rans/oneeq/model.hh | 18 ++---------- .../freeflow/rans/twoeq/kepsilon/iofields.hh | 9 ++---- dumux/freeflow/rans/twoeq/kepsilon/model.hh | 18 ++---------- dumux/freeflow/rans/twoeq/komega/iofields.hh | 9 ++---- dumux/freeflow/rans/twoeq/komega/model.hh | 18 ++---------- .../rans/twoeq/lowrekepsilon/iofields.hh | 9 ++---- .../rans/twoeq/lowrekepsilon/model.hh | 18 ++---------- 20 files changed, 66 insertions(+), 238 deletions(-) diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index ebed53abf2..895eefc9ff 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -36,12 +36,9 @@ namespace Dumux * \ingroup FreeflowNCModel * \brief Adds I/O fields specific to the FreeflowNC model */ -template -class FreeflowNCIOFields +template +struct FreeflowNCIOFields { - -public: - //! Initialize the FreeflowNC specific output fields. template DUNE_DEPRECATED_MSG("use initOutputModule instead") @@ -67,7 +64,7 @@ public: out.addVolumeVariable([j](const auto& v){ return v.diffusionCoefficient(0, j); }, "D^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); // the eddy diffusivity is recalculated for an arbitrary component which is not the phase component - if (ModelTraits::usesTurbulenceModel()) + if (turbulenceModel) out.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusivity(0, j) - v.diffusionCoefficient(0, j); }, "D_t"); } } diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 757ddc5966..5b2ad1784d 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -124,15 +124,7 @@ public: }; //! The specific I/O fields -SET_PROP(KEpsilonNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SinglePhaseIOFields = KEpsilonIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(KEpsilonNC, IOFields, FreeflowNCIOFields); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-epsilon model @@ -198,12 +190,9 @@ public: SET_PROP(KEpsilonNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = KEpsilonIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index 16c6b97e68..79843e06ef 100644 --- a/dumux/freeflow/compositional/komegancmodel.hh +++ b/dumux/freeflow/compositional/komegancmodel.hh @@ -142,15 +142,7 @@ public: }; //! The specific I/O fields -SET_PROP(KOmegaNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SinglePhaseIOFields = KOmegaIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(KOmegaNC, IOFields, FreeflowNCIOFields); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-omega model @@ -216,12 +208,9 @@ public: SET_PROP(KOmegaNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = KOmegaIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index d09a86edaa..5859f65338 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -129,15 +129,7 @@ public: }; //! The specific I/O fields -SET_PROP(LowReKEpsilonNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SinglePhaseIOFields = LowReKEpsilonIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(LowReKEpsilonNC, IOFields, FreeflowNCIOFields); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component low-Re k-epsilon model @@ -203,12 +195,9 @@ public: SET_PROP(LowReKEpsilonNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = LowReKEpsilonIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index b2fb022b16..27b91f3765 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -171,15 +171,7 @@ SET_TYPE_PROP(NavierStokesNC, FluxVariables, FreeflowNCFluxVariables); SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache); //! The specific I/O fields -SET_PROP(NavierStokesNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = NavierStokesIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(NavierStokesNC, IOFields, FreeflowNCIOFields); /*! * \brief The fluid state which is used by the volume variables to @@ -222,12 +214,9 @@ public: SET_PROP(NavierStokesNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = NavierStokesIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; //! Use Fourier's Law as default heat conduction type diff --git a/dumux/freeflow/compositional/oneeqncmodel.hh b/dumux/freeflow/compositional/oneeqncmodel.hh index 4d75e899d0..5673309cfc 100644 --- a/dumux/freeflow/compositional/oneeqncmodel.hh +++ b/dumux/freeflow/compositional/oneeqncmodel.hh @@ -140,15 +140,7 @@ public: }; //! The specific I/O fields -SET_PROP(OneEqNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using SinglePhaseIOFields = OneEqIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(OneEqNC, IOFields, FreeflowNCIOFields); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component one-equation model @@ -214,12 +206,9 @@ public: SET_PROP(OneEqNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = OneEqIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index 45168b0716..8974cf29ae 100644 --- a/dumux/freeflow/compositional/zeroeqncmodel.hh +++ b/dumux/freeflow/compositional/zeroeqncmodel.hh @@ -99,15 +99,7 @@ public: }; //! The specific I/O fields -SET_PROP(ZeroEqNC, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = RANSIOFields; -public: - using type = FreeflowNCIOFields; -}; +SET_TYPE_PROP(ZeroEqNC, IOFields, FreeflowNCIOFields); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component ZeroEq model @@ -155,12 +147,9 @@ public: SET_PROP(ZeroEqNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using BaseIOFields = RANSIOFields; - using NonIsothermalFields = FreeflowNonIsothermalIOFields; + using IsothermalIOFields = FreeflowNCIOFields; public: - using type = FreeflowNCIOFields; + using type = FreeflowNonIsothermalIOFields; }; // \} diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index 704541c2ae..e23bc18ff9 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -74,29 +74,35 @@ std::function createStaggeredPVNameFunction(const Dune::Mu } } +// forward declare +template +class StaggeredVtkOutputModule; + /*! * \ingroup NavierStokesModel * \brief Adds I/O fields for the Navier-Stokes model */ -template class NavierStokesIOFields { - // Helper type used for tag dispatching (to add discretization-specific fields). - template - using discMethodTag = std::integral_constant; + //! Helper strcuts to determine whether a staggered grid discretization is used + template + struct isStaggered : public std::false_type {}; + + template + struct isStaggered> + : public std::true_type {}; public: //! Initialize the Navier-Stokes specific output fields. template static void initOutputModule(OutputModule& out) { - using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; out.addVolumeVariable([](const auto& v){ return v.pressure(); }, IOName::pressure()); out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity()); out.addVolumeVariable([](const auto& v){ return v.density(); }, IOName::density()); // add discretization-specific fields - additionalOutput_(out, discMethodTag{}); + additionalOutput_(out, isStaggered()); } template @@ -119,21 +125,20 @@ public: private: //! Adds discretization-specific fields (nothing by default). - template - static void additionalOutput_(OutputModule& out, AnyMethod) + template + static void additionalOutput_(OutputModule& out) { } //! Adds discretization-specific fields (velocity vectors on the faces for the staggered discretization). template - static void additionalOutput_(OutputModule& out, discMethodTag) + static void additionalOutput_(OutputModule& out, std::true_type) { const bool writeFaceVars = getParamFromGroup(out.paramGroup(), "Vtk.WriteFaceData", false); if(writeFaceVars) { - auto faceVelocityVector = [](const typename FVGridGeometry::SubControlVolumeFace& scvf, const auto& faceVars) + auto faceVelocityVector = [](const auto& scvf, const auto& faceVars) { - using Scalar = typename OutputModule::VolumeVariables::PrimaryVariables::value_type; - using VelocityVector = Dune::FieldVector; + using VelocityVector = std::decay_t; VelocityVector velocity(0.0); velocity[scvf.directionIndex()] = faceVars.velocitySelf(); diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index c3940e3628..6b0275aaa5 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -199,13 +199,8 @@ SET_TYPE_PROP(NavierStokes, FluxVariables, NavierStokesFluxVariables); SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache); //! The specific I/O fields -SET_PROP(NavierStokes, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = NavierStokesIOFields; -}; +SET_TYPE_PROP(NavierStokes, IOFields, NavierStokesIOFields); + ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Navier-Stokes model ////////////////////////////////////////////////////////////////// @@ -222,15 +217,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(NavierStokesNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = NavierStokesIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(NavierStokesNI, IOFields, FreeflowNonIsothermalIOFields); // \} } diff --git a/dumux/freeflow/nonisothermal/iofields.hh b/dumux/freeflow/nonisothermal/iofields.hh index c8044fdb1d..06c4d268c8 100644 --- a/dumux/freeflow/nonisothermal/iofields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -35,12 +35,9 @@ namespace Dumux * \ingroup FreeflowNIModel * \brief Adds I/O fields specific to non-isothermal free-flow models */ -template -class FreeflowNonIsothermalIOFields +template +struct FreeflowNonIsothermalIOFields { - -public: - //! Initialize the non-isothermal specific output fields. template DUNE_DEPRECATED_MSG("use initOutputModule instead") @@ -57,7 +54,7 @@ public: out.addVolumeVariable([](const auto& v){ return v.temperature(); }, IOName::temperature()); out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); - if (ModelTraits::usesTurbulenceModel()) + if (turbulenceModel) out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); } diff --git a/dumux/freeflow/rans/iofields.hh b/dumux/freeflow/rans/iofields.hh index d14609bc55..cbe45478ed 100644 --- a/dumux/freeflow/rans/iofields.hh +++ b/dumux/freeflow/rans/iofields.hh @@ -34,13 +34,8 @@ namespace Dumux * \ingroup RANSModel * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ -template -class RANSIOFields +struct RANSIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: - template DUNE_DEPRECATED_MSG("use initOutputModule instead") static void init(OutputModule& out) @@ -52,7 +47,9 @@ public: template static void initOutputModule(OutputModule& out) { - NavierStokesIOFields::initOutputModule(out); + NavierStokesIOFields::initOutputModule(out); + + static constexpr auto dim = decltype(std::declval().velocity())::dimension; out.addVolumeVariable([](const auto& v){ return v.velocity()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max"); out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/dx_"); diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index 4a1f4e4635..d03900ccd0 100644 --- a/dumux/freeflow/rans/model.hh +++ b/dumux/freeflow/rans/model.hh @@ -84,13 +84,7 @@ public: }; //! The specific I/O fields -SET_PROP(RANS, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = RANSIOFields; -}; +SET_TYPE_PROP(RANS, IOFields, RANSIOFields); ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Reynolds-averaged Navier-Stokes model @@ -112,15 +106,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(RANSNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = RANSIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(RANSNI, IOFields, FreeflowNonIsothermalIOFields); //! Use Fourier's Law as default heat conduction type SET_TYPE_PROP(RANSNI, HeatConductionType, FouriersLaw); diff --git a/dumux/freeflow/rans/oneeq/iofields.hh b/dumux/freeflow/rans/oneeq/iofields.hh index 090195661b..82e1bb64d1 100644 --- a/dumux/freeflow/rans/oneeq/iofields.hh +++ b/dumux/freeflow/rans/oneeq/iofields.hh @@ -33,12 +33,8 @@ namespace Dumux * \ingroup OneEqModel * \brief Adds I/O fields for the one-equation turbulence model by Spalart-Allmaras */ -template -class OneEqIOFields +struct OneEqIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: template DUNE_DEPRECATED_MSG("use initOutputModule instead") static void init(OutputModule& out) @@ -50,7 +46,7 @@ public: template static void initOutputModule(OutputModule& out) { - RANSIOFields::initOutputModule(out); + RANSIOFields::initOutputModule(out); out.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); } diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index ac34e6be3b..18e8e56c8d 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -170,13 +170,7 @@ public: }; //! The specific I/O fields -SET_PROP(OneEq, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = OneEqIOFields; -}; +SET_TYPE_PROP(OneEq, IOFields, OneEqIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal Spalart-Allmaras model @@ -216,15 +210,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(OneEqNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = OneEqIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(OneEqNI, IOFields, FreeflowNonIsothermalIOFields); // \} } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index 4fd4cab951..59b31fc03b 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -34,13 +34,8 @@ namespace Dumux * \ingroup KEpsilonModel * \brief Adds I/O fields for the k-epsilon turbulence model */ -template -class KEpsilonIOFields +struct KEpsilonIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: - template DUNE_DEPRECATED_MSG("use initOutputModule instead") static void init(OutputModule& out) @@ -52,7 +47,7 @@ public: template static void initOutputModule(OutputModule& out) { - RANSIOFields::initOutputModule(out); + RANSIOFields::initOutputModule(out); out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "epsilon"); diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index 9a70db5584..e0ea1338b0 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -156,13 +156,7 @@ public: }; //! The specific I/O fields -SET_PROP(KEpsilon, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = KEpsilonIOFields; -}; +SET_TYPE_PROP(KEpsilon, IOFields, KEpsilonIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-epsilon model @@ -202,15 +196,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(KEpsilonNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KEpsilonIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(KEpsilonNI, IOFields, FreeflowNonIsothermalIOFields); // \} } diff --git a/dumux/freeflow/rans/twoeq/komega/iofields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh index 689745676f..8f0a7fff43 100644 --- a/dumux/freeflow/rans/twoeq/komega/iofields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -34,13 +34,8 @@ namespace Dumux * \ingroup KOmegaModel * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ -template -class KOmegaIOFields +struct KOmegaIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: - template DUNE_DEPRECATED_MSG("use initOutputModule instead") static void init(OutputModule& out) @@ -52,7 +47,7 @@ public: template static void initOutputModule(OutputModule& out) { - RANSIOFields::initOutputModule(out); + RANSIOFields::initOutputModule(out); out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 7bf6db6d8c..7cfebf2463 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -163,13 +163,7 @@ public: }; //! The specific I/O fields -SET_PROP(KOmega, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = KOmegaIOFields; -}; +SET_TYPE_PROP(KOmega, IOFields, KOmegaIOFields); /////////////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-omega single phase model @@ -210,15 +204,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(KOmegaNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KOmegaIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(KOmegaNI, IOFields, FreeflowNonIsothermalIOFields); // \} } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index de2ffd8ad8..3c66ddb0b9 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -34,13 +34,8 @@ namespace Dumux * \ingroup LowReKEpsilonModel * \brief Adds I/O fields for the low-Re k-epsilon turbulence model */ -template -class LowReKEpsilonIOFields +struct LowReKEpsilonIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: - template DUNE_DEPRECATED_MSG("use initOutputModule instead") static void init(OutputModule& out) @@ -52,7 +47,7 @@ public: template static void initOutputModule(OutputModule& out) { - RANSIOFields::initOutputModule(out); + RANSIOFields::initOutputModule(out); out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); out.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index b1a840544b..6b178aa20f 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -172,13 +172,7 @@ public: }; //! The specific I/O fields -SET_PROP(LowReKEpsilon, IOFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = LowReKEpsilonIOFields; -}; +SET_TYPE_PROP(LowReKEpsilon, IOFields, LowReKEpsilonIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal low-Reynolds k-epsilon model @@ -218,15 +212,7 @@ public: }; //! The specific non-isothermal I/O fields -SET_PROP(LowReKEpsilonNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = LowReKEpsilonIOFields; -public: - using type = FreeflowNonIsothermalIOFields; -}; +SET_TYPE_PROP(LowReKEpsilonNI, IOFields, FreeflowNonIsothermalIOFields); // \} } -- GitLab From 86502f1843c6a2f2249441a6bfbf72c790a88d09 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 7 Sep 2018 13:40:12 +0200 Subject: [PATCH 17/26] [io] improve template parameters for the IOFields Restore the template parameters for the `IOField`s to the state when they where `VtkOutputField`s. Add a uniform template parameter `ModelTraits` to the `primaryVariableName` functions inside the `IOField`s. --- dumux/common/properties.hh | 1 + dumux/porousmediumflow/1p/iofields.hh | 2 +- dumux/porousmediumflow/1p/model.hh | 9 ++--- dumux/porousmediumflow/1pnc/iofields.hh | 5 +-- dumux/porousmediumflow/1pnc/model.hh | 17 +++------ dumux/porousmediumflow/1pncmin/model.hh | 20 +++------- dumux/porousmediumflow/2p/iofields.hh | 5 +-- dumux/porousmediumflow/2p/model.hh | 19 ++++------ dumux/porousmediumflow/2p1c/iofields.hh | 9 +++-- dumux/porousmediumflow/2p1c/model.hh | 7 +--- dumux/porousmediumflow/2p2c/model.hh | 22 ++--------- dumux/porousmediumflow/2pnc/iofields.hh | 31 +++++++-------- dumux/porousmediumflow/2pnc/model.hh | 34 +++-------------- dumux/porousmediumflow/2pncmin/model.hh | 38 +++---------------- dumux/porousmediumflow/3p/iofields.hh | 2 +- dumux/porousmediumflow/3p/model.hh | 18 +-------- dumux/porousmediumflow/3p3c/iofields.hh | 5 ++- dumux/porousmediumflow/3p3c/model.hh | 17 +++------ dumux/porousmediumflow/3pwateroil/iofields.hh | 5 ++- dumux/porousmediumflow/3pwateroil/model.hh | 7 +--- .../mineralization/iofields.hh | 10 +++-- .../nonisothermal/iofields.hh | 8 ++-- dumux/porousmediumflow/nonisothermal/model.hh | 7 +++- dumux/porousmediumflow/richards/iofields.hh | 6 ++- dumux/porousmediumflow/richards/model.hh | 7 ++-- dumux/porousmediumflow/richardsnc/iofields.hh | 7 ++-- dumux/porousmediumflow/richardsnc/model.hh | 8 ++-- dumux/porousmediumflow/tracer/iofields.hh | 5 +-- dumux/porousmediumflow/tracer/model.hh | 2 +- 29 files changed, 112 insertions(+), 221 deletions(-) diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index 32e2967186..dafc61396f 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -45,6 +45,7 @@ NEW_PROP_TAG(PrimaryVariables); //!< A vector of primary variables NEW_PROP_TAG(NumEqVector); //!< A vector of size number equations that can be used for Neumann fluxes, sources, residuals, ... NEW_PROP_TAG(GridView); //!< The type of the grid view according to the grid type NEW_PROP_TAG(ModelTraits); //!< Traits class encapsulating model specifications +NEW_PROP_TAG(BaseModelTraits); //!< Model traits to be used as a base for nonisothermal, mineralization ... models 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 diff --git a/dumux/porousmediumflow/1p/iofields.hh b/dumux/porousmediumflow/1p/iofields.hh index 7b59c37ca2..932dab2912 100644 --- a/dumux/porousmediumflow/1p/iofields.hh +++ b/dumux/porousmediumflow/1p/iofields.hh @@ -51,7 +51,7 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx = 0, int state = 0) { return IOName::pressure(); diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index e8d2982a42..e79ed569d4 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -121,7 +121,8 @@ NEW_TYPE_TAG(OnePNI, INHERITS_FROM(OneP)); /////////////////////////////////////////////////////////////////////////// SET_TYPE_PROP(OneP, IOFields, OnePIOFields); //!< default I/O fields specific to this model SET_TYPE_PROP(OneP, LocalResidual, ImmiscibleLocalResidual); //!< the local residual function -SET_TYPE_PROP(OneP, ModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model +SET_TYPE_PROP(OneP, BaseModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model +SET_TYPE_PROP(OneP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the volume variables property SET_PROP(OneP, VolumeVariables) @@ -160,11 +161,7 @@ public: /////////////////////////////////////////////////////////////////////////// //! Add temperature to the output -SET_PROP(OnePNI, IOFields) -{ - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(OnePNI, IOFields, EnergyIOFields); //! The model traits of the non-isothermal model SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits); diff --git a/dumux/porousmediumflow/1pnc/iofields.hh b/dumux/porousmediumflow/1pnc/iofields.hh index 0b4bf08259..c48ba433c8 100644 --- a/dumux/porousmediumflow/1pnc/iofields.hh +++ b/dumux/porousmediumflow/1pnc/iofields.hh @@ -34,7 +34,6 @@ namespace Dumux { * \ingroup OnePNCModel * \brief Adds I/O fields specific to the OnePNC model */ -template class OnePNCIOFields { public: @@ -69,12 +68,12 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { if (pvIdx == 0) return IOName::pressure(); - else if (useMoles) + else if (ModelTraits::useMoles()) return IOName::moleFraction(0, pvIdx); else return IOName::massFraction(0, pvIdx); diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index d293d6330f..7b9fd97c35 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -149,14 +149,15 @@ NEW_TYPE_TAG(OnePNCNI, INHERITS_FROM(OnePNC)); //! Set as default that no component mass balance is replaced by the total mass balance SET_INT_PROP(OnePNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); -//! The model traits. Per default, we use the number of components of the fluid system. -SET_PROP(OnePNC, ModelTraits) +//! The base model traits. Per default, we use the number of components of the fluid system. +SET_PROP(OnePNC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); public: using type = OnePNCModelTraits; }; +SET_TYPE_PROP(OnePNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits /*! @@ -207,19 +208,14 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(OnePNC, IOFields, OnePNCIOFields); +SET_TYPE_PROP(OnePNC, IOFields, OnePNCIOFields); /////////////////////////////////////////////////////////////////////////// // properties for the non-isothermal single phase model /////////////////////////////////////////////////////////////////////////// //! the non-isothermal vtk output fields -SET_PROP(OnePNCNI, IOFields) -{ - using OnePNCIOF = OnePNCIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(OnePNCNI, IOFields, EnergyIOFields); //! Use the average for effective conductivities SET_TYPE_PROP(OnePNCNI, @@ -230,8 +226,7 @@ SET_TYPE_PROP(OnePNCNI, SET_PROP(OnePNCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using IsothermalTraits = OnePNCModelTraits; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits; }; diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index 90fc5c57bb..d03f678254 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -124,9 +124,8 @@ SET_TYPE_PROP(OnePNCMin, LocalResidual, MineralizationLocalResidual); SET_PROP(OnePNCMin, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMinTraits = OnePNCModelTraits; + using NonMinTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = MineralizationModelTraits; }; @@ -142,12 +141,7 @@ public: }; //! Use the mineralization vtk output fields -SET_PROP(OnePNCMin, IOFields) -{ - using OnePNCIOF = OnePNCIOFields; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using type = MineralizationIOFields; -}; +SET_TYPE_PROP(OnePNCMin, IOFields, MineralizationIOFields); ////////////////////////////////////////////////////////////////// // Properties for the non-isothermal 2pncmin model @@ -156,20 +150,16 @@ SET_PROP(OnePNCMin, IOFields) //! non-isothermal vtk output SET_PROP(OnePNCMinNI, IOFields) { - using OnePNCIOF = OnePNCIOFields; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using MineralizationIOF = MineralizationIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; + using MineralizationIOF = MineralizationIOFields; + using type = EnergyIOFields; }; //! The non-isothermal model traits SET_PROP(OnePNCMinNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using OnePNCTraits = OnePNCModelTraits; + using OnePNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); using IsothermalTraits = MineralizationModelTraits; public: using type = PorousMediumFlowNIModelTraits; diff --git a/dumux/porousmediumflow/2p/iofields.hh b/dumux/porousmediumflow/2p/iofields.hh index a12e9f4ba5..48a97cf540 100644 --- a/dumux/porousmediumflow/2p/iofields.hh +++ b/dumux/porousmediumflow/2p/iofields.hh @@ -36,7 +36,6 @@ namespace Dumux { * \ingroup TwoPModel * \brief Adds I/O fields specific to the two-phase model */ -template class TwoPIOFields { public: @@ -71,10 +70,10 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { - if (priVarFormulation == TwoPFormulation::p0s1) + if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1) return pvIdx == 0 ? IOName::pressure(FluidSystem::phase0Idx) : IOName::saturation(FluidSystem::phase1Idx); else diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 311d498643..91765814df 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -138,8 +138,7 @@ struct TwoPVolumeVariablesTraits using SaturationReconstruction = SR; }; -// forward declaration -template +// necessary for models derived from 2p class TwoPIOFields; //////////////////////////////// @@ -166,11 +165,12 @@ SET_PROP(TwoP, Formulation) SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual); //!< Use the immiscible local residual operator for the 2p model -//! The model traits class -SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits); +//! The base model traits class +SET_TYPE_PROP(TwoP, BaseModelTraits, TwoPModelTraits); +SET_TYPE_PROP(TwoP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the vtk output fields specific to the twop model -SET_TYPE_PROP(TwoP, IOFields, TwoPIOFields); +SET_TYPE_PROP(TwoP, IOFields, TwoPIOFields); //! Set the volume variables property SET_PROP(TwoP, VolumeVariables) @@ -209,15 +209,10 @@ public: //////////////////////////////////////////////////////// //! The non-isothermal model traits class -SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits>); +SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits); //! Set the vtk output fields specific to the non-isothermal twop model -SET_PROP(TwoPNI, IOFields) -{ - using TwoPIOF = TwoPIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(TwoPNI, IOFields, EnergyIOFields); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2p1c/iofields.hh b/dumux/porousmediumflow/2p1c/iofields.hh index d2cfe34041..7b43bac9c8 100644 --- a/dumux/porousmediumflow/2p1c/iofields.hh +++ b/dumux/porousmediumflow/2p1c/iofields.hh @@ -33,7 +33,6 @@ namespace Dumux { * \ingroup TwoPOneCModel * \brief Adds I/O fields specific to two-phase one-component model. */ -template class TwoPOneCIOFields { public: @@ -41,7 +40,7 @@ public: static void initOutputModule(OutputModule& out) { // use default fields from the 2p model - TwoPIOFields::initOutputModule(out); + TwoPIOFields::initOutputModule(out); // output additional to TwoP output: out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, @@ -55,10 +54,12 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { - if (priVarFormulation == TwoPFormulation::p0s1) + using Indices = typename ModelTraits::Indices; + + if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1) return (pvIdx == 0) ? IOName::pressure(FluidSystem::phase0Idx) : (state == Indices::twoPhases) ? IOName::saturation(FluidSystem::phase1Idx) diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 55ec945241..1d3a3990e9 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -217,12 +217,7 @@ SET_TYPE_PROP(TwoPOneCNI, ThermalConductivityModel, ThermalConductivitySomerton< SET_TYPE_PROP(TwoPOneCNI, ModelTraits, TwoPOneCNIModelTraits); //! The non-isothermal vtk output fields. -SET_PROP(TwoPOneCNI, IOFields) -{ - using TwoPOneCIOF = TwoPOneCIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(TwoPOneCNI, IOFields, EnergyIOFields); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index a17a3ec7ed..b99b2a7e66 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -141,7 +141,7 @@ NEW_TYPE_TAG(TwoPTwoCNI, INHERITS_FROM(TwoPTwoC)); /*! * \brief Set the model traits property. */ -SET_PROP(TwoPTwoC, ModelTraits) +SET_PROP(TwoPTwoC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); @@ -153,6 +153,7 @@ public: GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx) >; }; +SET_TYPE_PROP(TwoPTwoC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Use the 2p2c VolumeVariables SET_PROP(TwoPTwoC, VolumeVariables) @@ -187,28 +188,13 @@ SET_BOOL_PROP(TwoPTwoC, UseConstraintSolver, true); SET_PROP(TwoPTwoCNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!"); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!"); - using IsothermalTraits = TwoPTwoCModelTraits; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits; }; //! Set non-isothermal output fields -SET_PROP(TwoPTwoCNI, IOFields) -{ - static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); - using Indices = TwoPNCIndices; - static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - static constexpr auto setMoleFractionsForFirstPhase = true; - using TwoPNCIOF = TwoPNCIOFields; - using type = EnergyIOFields; -}; +SET_TYPE_PROP(TwoPTwoCNI, IOFields, EnergyIOFields); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_TYPE_PROP(TwoPTwoCNI, ThermalConductivityModel, ThermalConductivitySomerton); diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh index 58ee425377..1f1ef53cd6 100644 --- a/dumux/porousmediumflow/2pnc/iofields.hh +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -34,7 +34,6 @@ namespace Dumux * \ingroup TwoPNCModel * \brief Adds I/O fields specific to the TwoPNC model */ -template class TwoPNCIOFields { public: @@ -45,7 +44,7 @@ public: using FluidSystem = typename VolumeVariables::FluidSystem; // use default fields from the 2p model - TwoPIOFields::initOutputModule(out); + TwoPIOFields::initOutputModule(out); // output additional to TwoP output: for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) @@ -74,35 +73,37 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { + using Indices = typename ModelTraits::Indices; + int idxSecComps; if (state == Indices::firstPhaseOnly - || (state == Indices::bothPhases && setMoleFractionsForFirstPhase)) + || (state == Indices::bothPhases && ModelTraits::setMoleFractionsForFirstPhase())) idxSecComps = FluidSystem::phase0Idx; else idxSecComps = FluidSystem::phase1Idx; if (pvIdx > 1) - return useMoles ? IOName::moleFraction(idxSecComps, pvIdx) - : IOName::massFraction(idxSecComps, pvIdx); + return ModelTraits::useMoles() ? IOName::moleFraction(idxSecComps, pvIdx) + : IOName::massFraction(idxSecComps, pvIdx); const std::vector p0s1SwitchedPvNames = { - useMoles ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) - : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), - useMoles ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) - : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), IOName::saturation(FluidSystem::phase1Idx)}; const std::vector p1s0SwitchedPvNames = { - useMoles ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) - : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), - useMoles ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) - : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), IOName::saturation(FluidSystem::phase0Idx)}; - switch (priVarFormulation) + switch (ModelTraits::priVarFormulation()) { case TwoPFormulation::p0s1: return pvIdx == 0 ? IOName::pressure(FluidSystem::wPhaseIdx) diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index c5cfa177db..7deeeefc33 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -194,7 +194,6 @@ struct TwoPNCVolumeVariablesTraits using ModelTraits = MT; }; - namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags @@ -234,8 +233,8 @@ public: using type = TwoPNCVolumeVariables; }; -//! Set the model traits -SET_PROP(TwoPNC, ModelTraits) +//! Set the base model traits +SET_PROP(TwoPNC, BaseModelTraits) { private: //! we use the number of components specified by the fluid system here @@ -247,16 +246,10 @@ public: GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; }; +SET_TYPE_PROP(TwoPNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the vtk output fields specific to this model -SET_PROP(TwoPNC, IOFields) -{ - static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); - using Indices = TwoPNCIndices; - static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); - using type = TwoPNCIOFields; -}; +SET_TYPE_PROP(TwoPNC, IOFields, TwoPNCIOFields); SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual); //!< Use the compositional local residual @@ -290,28 +283,13 @@ public: SET_PROP(TwoPNCNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); - using IsothermalTraits = TwoPNCModelTraits; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits; }; //! Set non-isothermal output fields -SET_PROP(TwoPNCNI, IOFields) -{ - static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); - using Indices = TwoPNCIndices; - static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - static constexpr auto setMoleFractionsForFirstPhase = ModelTraits::setMoleFractionsForFirstPhase(); - using TwoPNCIOF = TwoPNCIOFields; - using type = EnergyIOFields; -}; +SET_TYPE_PROP(TwoPNCNI, IOFields, EnergyIOFields); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNCNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index 84b63f3a1f..ebb7782c09 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -139,29 +139,14 @@ public: }; //! Set the vtk output fields specific to this model -SET_PROP(TwoPNCMin, IOFields) -{ - static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); - using Indices = TwoPNCIndices; - static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); - using TwoPNCIOF = TwoPNCIOFields; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using type = MineralizationIOFields; -}; +SET_TYPE_PROP(TwoPNCMin, IOFields, MineralizationIOFields); //! The 2pnc model traits define the non-mineralization part SET_PROP(TwoPNCMin, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMineralizationTraits = TwoPNCModelTraits; + using NonMineralizationTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = MineralizationModelTraits; }; @@ -184,14 +169,8 @@ public: SET_PROP(TwoPNCMinNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using TwoPNCTraits = TwoPNCModelTraits; + using TwoPNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); using IsothermalTraits = MineralizationModelTraits; public: // the mineralization traits, based on 2pnc traits, are the isothermal traits @@ -201,15 +180,8 @@ public: //! non-isothermal vtkoutput SET_PROP(TwoPNCMinNI, IOFields) { - static constexpr auto formulation = GET_PROP_VALUE(TypeTag, Formulation); - using Indices = TwoPNCIndices; - static constexpr auto useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - static constexpr auto setMoleFractionsForFirstPhase = GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase); - using TwoPNCIOF = TwoPNCIOFields; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using MineralizationIOF = MineralizationIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; + using MineralizationIOF = MineralizationIOFields; + using type = EnergyIOFields; }; } // end namespace Properties diff --git a/dumux/porousmediumflow/3p/iofields.hh b/dumux/porousmediumflow/3p/iofields.hh index a33a68111b..3b8138622a 100644 --- a/dumux/porousmediumflow/3p/iofields.hh +++ b/dumux/porousmediumflow/3p/iofields.hh @@ -65,7 +65,7 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { switch (pvIdx) diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index d6f9e405e6..bd6b39126d 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -186,14 +186,7 @@ public: }; //! Set the vtk output fields specific to this model -SET_PROP(ThreeP, IOFields) -{ -private: - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - -public: - using type = ThreePIOFields; -}; +SET_TYPE_PROP(ThreeP, IOFields, ThreePIOFields); ///////////////////////////////////////////////// // Properties for the non-isothermal 3p model @@ -209,14 +202,7 @@ public: }; //! Set non-isothermal output fields -SET_PROP(ThreePNI, IOFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using IsothermalFields = ThreePIOFields; -public: - using type = EnergyIOFields; -}; +SET_TYPE_PROP(ThreePNI, IOFields, EnergyIOFields); //! Set non-isothermal model traits SET_PROP(ThreePNI, ModelTraits) diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh index 25d31deb2f..5f0b3206ac 100644 --- a/dumux/porousmediumflow/3p3c/iofields.hh +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -32,7 +32,6 @@ namespace Dumux { * \ingroup ThreePThreeCModel * \brief Adds I/O fields specific to the three-phase three-component model */ -template class ThreePThreeCIOFields { public: @@ -72,9 +71,11 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { + using Indices = typename ModelTraits::Indices; + switch (state) { case Indices::threePhases: diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index e777112c22..be5d31c175 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -206,7 +206,7 @@ NEW_TYPE_TAG(ThreePThreeCNI, INHERITS_FROM(ThreePThreeC)); ////////////////////////////////////////////////////////////////// //! Set the model traits -SET_PROP(ThreePThreeC, ModelTraits) +SET_PROP(ThreePThreeC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); @@ -215,6 +215,7 @@ private: public: using type = ThreePThreeCModelTraits; }; +SET_TYPE_PROP(ThreePThreeC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Determines whether a constraint solver should be used explicitly SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false); @@ -272,7 +273,7 @@ public: SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields); +SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields); //! Use mole fractions in the balance equations by default SET_BOOL_PROP(ThreePThreeC, UseMoles, true); @@ -288,21 +289,13 @@ SET_TYPE_PROP(ThreePThreeCNI, ThermalConductivityModel, ThermalConductivitySomer SET_PROP(ThreePThreeCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!"); - static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!"); - using IsothermalModelTraits = ThreePThreeCModelTraits; + using IsothermalModelTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits; }; //! Set the non-isothermal vktoutputfields -SET_PROP(ThreePThreeCNI, IOFields) -{ - using ThreePThreeCIOF = ThreePThreeCIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(ThreePThreeCNI, IOFields, EnergyIOFields); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh index 4d33cae0f7..90ed23fe99 100644 --- a/dumux/porousmediumflow/3pwateroil/iofields.hh +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -33,7 +33,6 @@ namespace Dumux { * \ingroup ThreePWaterOilModel * \brief Adds I/O fields specific to the three-phase three-component model */ -template class ThreePWaterOilIOFields { @@ -78,9 +77,11 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { + using Indices = typename ModelTraits::Indices; + switch (state) { case Indices::threePhases: diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index 6e18d90b42..ecb22d7d78 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -274,12 +274,7 @@ public: }; //! Set the non-isothermal vkt output fields -SET_PROP(ThreePWaterOilNI, IOFields) -{ - using ThreePWaterOilIOF = ThreePWaterOilIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; -}; +SET_TYPE_PROP(ThreePWaterOilNI, IOFields, EnergyIOFields); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/mineralization/iofields.hh b/dumux/porousmediumflow/mineralization/iofields.hh index 529e64c8c5..0ca489e4d4 100644 --- a/dumux/porousmediumflow/mineralization/iofields.hh +++ b/dumux/porousmediumflow/mineralization/iofields.hh @@ -33,7 +33,7 @@ namespace Dumux { * \ingroup MineralizationModel * \brief Adds I/O fields specific to a NCMin model */ -template +template class MineralizationIOFields { public: @@ -60,13 +60,15 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { - if (pvIdx < nonMineralizationNumEq) + static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComp() + ModelTraits::numInertSolidComp(); + + if (pvIdx < nonMinNumEq) return NonMineralizationIOFields::template primaryVariableName(pvIdx, state); else - return IOName::solidVolumeFraction(pvIdx - nonMineralizationNumEq); + return IOName::solidVolumeFraction(pvIdx - nonMinNumEq); } }; diff --git a/dumux/porousmediumflow/nonisothermal/iofields.hh b/dumux/porousmediumflow/nonisothermal/iofields.hh index 3ef98a1259..ed979301a3 100644 --- a/dumux/porousmediumflow/nonisothermal/iofields.hh +++ b/dumux/porousmediumflow/nonisothermal/iofields.hh @@ -32,7 +32,7 @@ namespace Dumux { * \ingroup NIModel * \brief Adds I/O fields specific to non-isothermal models */ -template +template class EnergyIOFields { @@ -52,11 +52,13 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { + using IsothermalTraits = typename ModelTraits::IsothermalTraits; + if (pvIdx < ModelTraits::numEq() - 1) - return IsothermalIOFields::template primaryVariableName(pvIdx, state); + return IsothermalIOFields::template primaryVariableName(pvIdx, state); else return IOName::temperature(); } diff --git a/dumux/porousmediumflow/nonisothermal/model.hh b/dumux/porousmediumflow/nonisothermal/model.hh index edf37038be..12d5cfdf0e 100644 --- a/dumux/porousmediumflow/nonisothermal/model.hh +++ b/dumux/porousmediumflow/nonisothermal/model.hh @@ -63,9 +63,12 @@ namespace Dumux { * flow models based on the specifics of a given isothermal model. * \tparam IsothermalTraits Model traits of the isothermal model */ -template -struct PorousMediumFlowNIModelTraits : public IsothermalTraits +template +struct PorousMediumFlowNIModelTraits : public IsothermalT { + //! Export the isothermal model traits + using IsothermalTraits = IsothermalT; + //! We solve for one more equation, i.e. the energy balance static constexpr int numEq() { return IsothermalTraits::numEq()+1; } //! only one energy equation is needed when assuming thermal equilibrium diff --git a/dumux/porousmediumflow/richards/iofields.hh b/dumux/porousmediumflow/richards/iofields.hh index cd2b4a05b2..c2df1959b1 100644 --- a/dumux/porousmediumflow/richards/iofields.hh +++ b/dumux/porousmediumflow/richards/iofields.hh @@ -33,7 +33,7 @@ namespace Dumux { * \ingroup RichardsModel * \brief Adds I/O fields specific to the Richards model. */ -template +template class RichardsIOFields { public: @@ -84,9 +84,11 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state) { + using Indices = typename ModelTraits::Indices; + if (state == Indices::gasPhaseOnly) return IOName::moleFraction(FluidSystem::gasPhaseIdx, FluidSystem::liquidCompIdx); diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index f1958f5691..992be84a6f 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -198,7 +198,7 @@ private: = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); public: - using type = RichardsIOFields; + using type = RichardsIOFields; }; //! The model traits @@ -300,9 +300,8 @@ SET_PROP(RichardsNI, IOFields) { static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); - using RichardsIOF = RichardsIOFields; - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using type = EnergyIOFields; + using RichardsIOF = RichardsIOFields; + using type = EnergyIOFields; }; // \} diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh index 1dd65fbe04..99c20395d6 100644 --- a/dumux/porousmediumflow/richardsnc/iofields.hh +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -33,7 +33,6 @@ namespace Dumux { * \ingroup RichardsNCModel * \brief Adds I/O fields specific to the Richards model. */ -template class RichardsNCIOFields { public: @@ -84,14 +83,14 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { if (pvIdx == 0) return IOName::pressure(0); else - return useMoles ? IOName::moleFraction(0, pvIdx) - : IOName::massFraction(0, pvIdx); + return ModelTraits::useMoles() ? IOName::moleFraction(0, pvIdx) + : IOName::massFraction(0, pvIdx); } }; diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 3e2a11e980..3937e5a568 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -144,13 +144,14 @@ NEW_TYPE_TAG(RichardsNCNI, INHERITS_FROM(RichardsNC)); ////////////////////////////////////////////////////////////////// //! Set the model traits class -SET_PROP(RichardsNC, ModelTraits) +SET_PROP(RichardsNC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); public: using type = RichardsNCModelTraits; }; +SET_TYPE_PROP(RichardsNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Define that per default mole fractions are used in the balance equations SET_BOOL_PROP(RichardsNC, UseMoles, true); @@ -213,7 +214,7 @@ SET_PROP(RichardsNC, FluidState) }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(RichardsNC, IOFields, RichardsNCIOFields); +SET_TYPE_PROP(RichardsNC, IOFields, RichardsNCIOFields); //! The model after Millington (1961) is used for the effective diffusivity SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk); @@ -229,8 +230,7 @@ SET_TYPE_PROP(RichardsNCNI, ThermalConductivityModel, ThermalConductivityAverage SET_PROP(RichardsNCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using IsothermalTraits = RichardsNCModelTraits; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits; }; diff --git a/dumux/porousmediumflow/tracer/iofields.hh b/dumux/porousmediumflow/tracer/iofields.hh index bebeae2307..94cae16f18 100644 --- a/dumux/porousmediumflow/tracer/iofields.hh +++ b/dumux/porousmediumflow/tracer/iofields.hh @@ -34,7 +34,6 @@ namespace Dumux { * \ingroup TracerModel * \brief Adds I/O fields specific to the tracer model */ -template class TracerIOFields { public: @@ -62,10 +61,10 @@ public: initOutputModule(out); } - template + template static std::string primaryVariableName(int pvIdx, int state = 0) { - const std::string xString = useMoles ? "x" : "X"; + const std::string xString = ModelTraits::useMoles() ? "x" : "X"; return xString + "^" + FluidSystem::componentName(pvIdx); } }; diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index b909797476..cccbb3bc10 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -142,7 +142,7 @@ public: SET_TYPE_PROP(Tracer, LocalResidual, TracerLocalResidual); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(Tracer, IOFields, TracerIOFields); +SET_TYPE_PROP(Tracer, IOFields, TracerIOFields); //! Set the volume variables property SET_PROP(Tracer, VolumeVariables) -- GitLab From 34dcc1b5a9885b67d4b1fca01174c2d313f46e32 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 7 Sep 2018 14:19:24 +0200 Subject: [PATCH 18/26] [io] fix 2pnc and mineralization IOFields --- dumux/porousmediumflow/2pnc/iofields.hh | 4 ++-- dumux/porousmediumflow/mineralization/iofields.hh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh index 1f1ef53cd6..c04b981105 100644 --- a/dumux/porousmediumflow/2pnc/iofields.hh +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -106,10 +106,10 @@ public: switch (ModelTraits::priVarFormulation()) { case TwoPFormulation::p0s1: - return pvIdx == 0 ? IOName::pressure(FluidSystem::wPhaseIdx) + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase0Idx) : p0s1SwitchedPvNames[state-1]; case TwoPFormulation::p1s0: - return pvIdx == 0 ? IOName::pressure(FluidSystem::nPhaseIdx) + return pvIdx == 0 ? IOName::pressure(FluidSystem::phase1Idx) : p1s0SwitchedPvNames[state-1]; default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); } diff --git a/dumux/porousmediumflow/mineralization/iofields.hh b/dumux/porousmediumflow/mineralization/iofields.hh index 0ca489e4d4..62124d295b 100644 --- a/dumux/porousmediumflow/mineralization/iofields.hh +++ b/dumux/porousmediumflow/mineralization/iofields.hh @@ -63,10 +63,10 @@ public: template static std::string primaryVariableName(int pvIdx, int state = 0) { - static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComp() + ModelTraits::numInertSolidComp(); + static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComps() + ModelTraits::numInertSolidComps(); if (pvIdx < nonMinNumEq) - return NonMineralizationIOFields::template primaryVariableName(pvIdx, state); + return NonMineralizationIOFields::template primaryVariableName(pvIdx, state); else return IOName::solidVolumeFraction(pvIdx - nonMinNumEq); } -- GitLab From 90a4261ddb3afb292bd424693c9785b494bdbe14 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 7 Sep 2018 14:20:04 +0200 Subject: [PATCH 19/26] [io] adapt createPVNameFunction to use primaryVariableName from IOFields --- dumux/freeflow/navierstokes/iofields.hh | 50 ++++++++++--------- dumux/io/loadsolution.hh | 14 +++--- .../1p/implicit/test_1pnifv.cc | 4 +- .../2p/implicit/incompressible/test_2p_fv.cc | 4 +- .../2p2c/implicit/test_2p2c_fv.cc | 4 +- .../2pncmin/implicit/test_2pncmin_fv.cc | 4 +- .../richards/implicit/test_richardslens_fv.cc | 4 +- 7 files changed, 49 insertions(+), 35 deletions(-) diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh index e23bc18ff9..0e2f927966 100644 --- a/dumux/freeflow/navierstokes/iofields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -42,36 +42,38 @@ namespace Dumux * \brief helper function to determine the names of cell-centered primary variables of a model with staggered grid discretization * \note use this as input for the load solution function */ -template -std::function createStaggeredPVNameFunction(const Dune::MultiTypeBlockVector&, - Dune::index_constant idx, - const std::string& paramGroup = "") +template +std::function createCellCenterPVNameFunction(const std::string& paramGroup = "") { - using CellCenterPriVarsType = typename std::tuple_element_t>::block_type; - static constexpr auto offset = ModelTraits::numEq() - CellCenterPriVarsType::dimension; + static constexpr auto offset = ModelTraits::numEq() - PrimaryVariables::dimension; - if (i == cellCenterIdx) // cell center + if (hasParamInGroup(paramGroup, "LoadSolution.CellCenterPriVarNames")) { - if (hasParamInGroup(paramGroup, "LoadSolution.CellCenterPriVarNames")) - { - const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.CellCenterPriVarNames"); - return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; - } - else - // add an offset to the pvIdx so that the velocities are skipped - return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx + offset, state); }; + const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.CellCenterPriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; } - else // face + else + // add an offset to the pvIdx so that the velocities are skipped + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx + offset, state); }; +} + +/*! + * \ingroup InputOutput + * \ingroup NavierStokesModel + * \brief helper function to determine the names of primary variables on the cell faces of a model with staggered grid discretization + * \note use this as input for the load solution function + */ +template +std::function createFacePVNameFunction(const std::string& paramGroup = "") +{ + if (hasParamInGroup(paramGroup, "LoadSolution.FacePriVarNames")) { - if (hasParamInGroup(paramGroup, "LoadSolution.FacePriVarNames")) - { - const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.FacePriVarNames"); - return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; - } - else - // there is only one scalar-type primary variable called "v" living on the faces - return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx , state); }; + const auto pvName = getParamFromGroup>(paramGroup, "LoadSolution.FacePriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; } + else + // there is only one scalar-type primary variable called "v" living on the faces + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx , state); }; } // forward declare diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index e01e338230..da1c8640c5 100644 --- a/dumux/io/loadsolution.hh +++ b/dumux/io/loadsolution.hh @@ -232,8 +232,9 @@ auto loadSolutionFromVtkFile(SolutionVector& sol, * \brief helper function to determine the primary variable names of a model with privar state * \note use this as input for the load solution function */ -template -std::function createPVNameFunctionWithState(const std::string& paramGroup = "") +template +auto createPVNameFunction(const std::string& paramGroup = "") +-> typename std::enable_if_t> { return [paramGroup](int pvIdx, int state = 0) { @@ -250,7 +251,7 @@ std::function createPVNameFunctionWithState(const std::str return pvName[pvIdx]; } else - return ModelTraits::template primaryVariableName(pvIdx, state); + return IOFields::template primaryVariableName(pvIdx, state); }; } @@ -259,8 +260,9 @@ std::function createPVNameFunctionWithState(const std::str * \brief helper function to determine the primary variable names of a model without state * \note use this as input for the load solution function */ -template -std::function createPVNameFunction(const std::string& paramGroup = "") +template +auto createPVNameFunction(const std::string& paramGroup = "") +-> typename std::enable_if_t> { if (hasParamInGroup(paramGroup, "LoadSolution.PriVarNames")) { @@ -268,7 +270,7 @@ std::function createPVNameFunction(const std::string& para return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; } else - return [](int pvIdx, int state = 0){ return ModelTraits::template primaryVariableName(pvIdx, state); }; + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName(pvIdx, state); }; } /*! diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index 0b1e22cb3d..87acaaf41c 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -131,9 +131,11 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); const auto fileName = getParam("Restart.File"); - loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); } else problem->applyInitialSolution(x); diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index ebf2fd984b..dbd1d3f570 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -136,10 +136,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam("Restart.File"); - loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); } else problem->applyInitialSolution(x); diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index 4ddc76aace..32af683f5b 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -104,10 +104,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam("Restart.File"); - const auto pvName = createPVNameFunctionWithState(); + const auto pvName = createPVNameFunction(); loadSolution(x, fileName, pvName, *fvGridGeometry); } else diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 98264c6ad5..7dfe35fa76 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -126,11 +126,13 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); const auto fileName = getParam("Restart.File"); - const auto pvName = createPVNameFunctionWithState(); + const auto pvName = createPVNameFunction(); loadSolution(x, fileName, pvName, *fvGridGeometry); } else diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index 7223f9e41c..dc48aebad5 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -98,10 +98,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam("Restart.File"); - loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction(), *fvGridGeometry); } else { -- GitLab From c9bc55bc26d403de634a40267da36822d5ac8051 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Wed, 5 Sep 2018 18:13:21 +0200 Subject: [PATCH 20/26] [test][io] Add staggered outputname test --- test/io/vtk/CMakeLists.txt | 5 + .../vtk/test_vtk_staggeredfreeflowpvnames.cc | 397 ++++++++++++++++++ 2 files changed, 402 insertions(+) create mode 100644 test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc diff --git a/test/io/vtk/CMakeLists.txt b/test/io/vtk/CMakeLists.txt index f4e8f47e82..9745bfa56f 100644 --- a/test/io/vtk/CMakeLists.txt +++ b/test/io/vtk/CMakeLists.txt @@ -1,3 +1,5 @@ +add_input_file_links() + dune_add_test(NAME test_vtkreader_3d SOURCES test_vtkreader.cc CMAKE_GUARD dune-alugrid_FOUND @@ -46,3 +48,6 @@ dune_add_test(NAME test_vtkreader_1d ${CMAKE_SOURCE_DIR}/test/references/test_embedded_1p_richards_tpfa_1d.vtp test-1d" --files ${CMAKE_SOURCE_DIR}/test/references/test_embedded_1p_richards_tpfa_1d.vtp ${CMAKE_CURRENT_BINARY_DIR}/test-1d.vtp) + +dune_add_test(NAME test_vtk_staggeredfreeflowpvnames + SOURCES test_vtk_staggeredfreeflowpvnames.cc) diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc new file mode 100644 index 0000000000..cb9c3f4408 --- /dev/null +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -0,0 +1,397 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * + * \brief Test for writing and reading vtk files for the staggered grid free flow models + */ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Dumux { +namespace Properties { + +NEW_TYPE_TAG(StaggeredPVNamesTestTypeTag, INHERITS_FROM(StaggeredFreeFlowModel)); + +NEW_TYPE_TAG(NavierStokesPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokes)); +NEW_TYPE_TAG(NavierStokesNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNI)); +NEW_TYPE_TAG(NavierStokesNCPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNC)); +NEW_TYPE_TAG(NavierStokesNCNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNCNI)); + +NEW_TYPE_TAG(KEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilon)); +NEW_TYPE_TAG(KEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNI)); +NEW_TYPE_TAG(KEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNC)); +NEW_TYPE_TAG(KEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNCNI)); + +NEW_TYPE_TAG(LowReKEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilon)); +NEW_TYPE_TAG(LowReKEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNI)); +NEW_TYPE_TAG(LowReKEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNC)); +NEW_TYPE_TAG(LowReKEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNCNI)); + +NEW_TYPE_TAG(KOmegaNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmega)); +NEW_TYPE_TAG(KOmegaNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNI)); +NEW_TYPE_TAG(KOmegaNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNC)); +NEW_TYPE_TAG(KOmegaNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNCNI)); + +NEW_TYPE_TAG(OneEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEq)); +NEW_TYPE_TAG(OneEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNI)); +NEW_TYPE_TAG(OneEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNC)); +NEW_TYPE_TAG(OneEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNCNI)); + +NEW_TYPE_TAG(ZeroEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEq)); +NEW_TYPE_TAG(ZeroEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNI)); +NEW_TYPE_TAG(ZeroEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNC)); +NEW_TYPE_TAG(ZeroEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNCNI)); + +// The fluid system +SET_PROP(StaggeredPVNamesTestTypeTag, FluidSystem) +{ + using H2OAir = FluidSystems::H2OAir; + static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase + using type = FluidSystems::OnePAdapter; +}; + +SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Scalar, double); + +// Set the grid type +SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Grid, Dune::YaspGrid<2>); + +SET_PROP(StaggeredPVNamesTestTypeTag, Problem) +{ +private: + // use the ZeroEqProblem as base class for non-RANS models and for the ZeroEq model + // use the the KEpsilonProblem as base class for all RANS models except the ZeroEq model + // NOTE: this rather unpleasant hack will be removed once the RANS models have been unified + using MTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + + static constexpr auto dim = MTraits::dim(); + static constexpr auto nComp = MTraits::numComponents(); + static constexpr auto numEq = MTraits::numEq(); + + using BaseTurbulentProblem = std::conditional_t<(std::is_same>::value || + std::is_same, numEq>>::value), + KOmegaProblem, + std::conditional_t<(std::is_same>::value || + std::is_same, numEq>>::value), + KEpsilonProblem, + std::conditional_t<(std::is_same>::value || + std::is_same, numEq>>::value), + LowReKEpsilonProblem, OneEqProblem>>>; + + using BaseProblem = std::conditional_t>::value && + !std::is_same>>::value && + !std::is_same>::value && + !std::is_same>>::value, + BaseTurbulentProblem, ZeroEqProblem>; + + template + class MockProblem : public BaseProblem + { + using ParentType = BaseProblem; + using BoundaryTypes = typename GET_PROP_TYPE(TTag, BoundaryTypes); + using Scalar = typename GET_PROP_TYPE(TTag, Scalar); + using Traits = typename GET_PROP_TYPE(TTag, ModelTraits); + public: + using ParentType::ParentType; + + template + BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const + { + BoundaryTypes values; + return values; + } + + Scalar temperature() const + { return 300; } + + template = 0> + void updateStaticWallProperties() {} + + template = 0> + void updateDynamicWallProperties(const U&) {} + + // for ZeroEq model + template = 0> + void updateStaticWallProperties() + { ParentType::updateStaticWallProperties(); } + + // for ZeroEq model + template = 0> + void updateDynamicWallProperties(const U& u) + { return ParentType::updateDynamicWallProperties(u); } + + template + bool isOnWall(const Scvf&) const + { return true; } + }; + +public: + using type = MockProblem; +}; + +} +} + +template +void assignValues(SolutionVector& sol, Values values) +{ + for (auto& entry : sol) + { + for (int pvIdx = 0; pvIdx < values.size(); ++pvIdx) + { + // make sure to get values that can be exactly represented in the vtk file (Float32) + std::stringstream stream; + stream << std::fixed << std::setprecision(5) << std::scientific << values[pvIdx]; + entry[pvIdx] = std::stod(stream.str()); + } + + // increment all values by 1% for each dof + for (auto& i : values) + i += 0.01*i; + } +} + +template +void testWriteAndReadVtk(std::shared_ptr fvGridGeometry, + const std::array& values, + const std::string& fileName, + bool verbose = false, + bool deleteFiles = true) +{ + using namespace Dumux; + + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector writeFrom; + + writeFrom[FVGridGeometry::cellCenterIdx()].resize(fvGridGeometry->numCellCenterDofs()); + writeFrom[FVGridGeometry::faceIdx()].resize(fvGridGeometry->numFaceDofs()); + + SolutionVector readTo = writeFrom; + + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared(fvGridGeometry); + + assignValues(writeFrom[FVGridGeometry::cellCenterIdx()], values); + assignValues(writeFrom[FVGridGeometry::faceIdx()], std::array{1.0}); + + problem->updateStaticWallProperties(); + problem->updateDynamicWallProperties(writeFrom); + + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared(problem, fvGridGeometry); + gridVariables->init(writeFrom); + + // initialize the vtk output module + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + StaggeredVtkOutputModule vtkWriter(*gridVariables, writeFrom, fileName); + VtkOutputFields::initOutputModule(vtkWriter); //!< Add model specific output fields + vtkWriter.write(0); + + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + + using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); + using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + + // cc dofs + loadSolution(readTo[FVGridGeometry::cellCenterIdx()], fileName + "-00000.vtu", + createCellCenterPVNameFunction(), + *fvGridGeometry); + + if (verbose) + { + std::cout << "reference cc " << std::endl; + for (const auto& block : writeFrom[FVGridGeometry::cellCenterIdx()]) + std::cout << block << std::endl; + + std::cout << "result cc " << std::endl; + for (const auto& block : readTo[FVGridGeometry::cellCenterIdx()]) + std::cout << block << std::endl; + } + + for (int i = 0; i < readTo[FVGridGeometry::cellCenterIdx()].size(); ++i) + { + if (Dune::FloatCmp::ne(readTo[FVGridGeometry::cellCenterIdx()][i], writeFrom[FVGridGeometry::cellCenterIdx()][i])) + DUNE_THROW(Dune::IOError, "Values don't match: new " << readTo[FVGridGeometry::cellCenterIdx()][i] << ", old " << writeFrom[FVGridGeometry::cellCenterIdx()][i]); + } + + // face dofs + loadSolution(readTo[FVGridGeometry::faceIdx()], fileName + "-face-00000.vtp", + createFacePVNameFunction(), + *fvGridGeometry); + + if (verbose) + { + std::cout << "reference face " << std::endl; + for (const auto& block : writeFrom[FVGridGeometry::faceIdx()]) + std::cout << block << std::endl; + + std::cout << "result face " << std::endl; + for (const auto& block : readTo[FVGridGeometry::faceIdx()]) + std::cout << block << std::endl; + } + + for (int i = 0; i < readTo[FVGridGeometry::faceIdx()].size(); ++i) + { + if (Dune::FloatCmp::ne(readTo[FVGridGeometry::faceIdx()][i], writeFrom[FVGridGeometry::faceIdx()][i])) + DUNE_THROW(Dune::IOError, "Values don't match: new " << readTo[FVGridGeometry::faceIdx()][i] << ", old " << writeFrom[FVGridGeometry::faceIdx()][i]); + } + + // clean up the folder + if(deleteFiles) + { + if(system("exec rm -r *pvd *vtu *vtp")) + DUNE_THROW(Dune::IOError, "Deleting files failed"); + } +} + + +int main(int argc, char** argv) try +{ + using namespace Dumux; + + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); + + // initialize ther parameters + auto parameters = [](auto& params) + { + params["Problem.Name"] = "test"; + params["Vtk.WriteFaceData"] = "true"; + }; + + Parameters::init(parameters); + + using CommonTypeTag = TTAG(StaggeredPVNamesTestTypeTag); + using Grid = typename GET_PROP_TYPE(CommonTypeTag, Grid); + using FVGridGeometry = typename GET_PROP_TYPE(CommonTypeTag, FVGridGeometry); + using Scalar = typename GET_PROP_TYPE(CommonTypeTag, Scalar); + using GlobalPosition = Dune::FieldVector; + + const GlobalPosition lowerLeft(0.0); + const GlobalPosition upperRight(5.0); + std::array cells; + std::fill(cells.begin(), cells.end(), 5); + + const auto grid = Dune::StructuredGridFactory::createCubeGrid(lowerLeft, upperRight, cells); + const auto gridView = grid->leafGridView(); + auto fvGridGeometry = std::make_shared(gridView); + fvGridGeometry->update(); + + using FluidSystem = typename GET_PROP_TYPE(CommonTypeTag, FluidSystem); + FluidSystem::init(); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5}, "navierstokes"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 300.0}, "navierstokesni"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3}, "navierstokesnc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 300.0}, "navierstokesncni"); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5}, "zeroeq"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 300.0}, "zeroeqni"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3}, "zeroeqnc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 300.0}, "zeroeqncni"); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.0}, "oneeq"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.0, 300.0}, "oneeqni"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.0}, "oneeqnc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.0, 300.0}, "oneeqncni"); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2}, "kepsilon"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2, 300.0}, "kepsilonni"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2}, "kepsilonnc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2, 300.0}, "kepsilonncni"); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2}, "lowrekepsilon"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2, 300.0}, "lowrekepsilonni"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2}, "lowrekepsilonnc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2, 300.0}, "lowrekepsilonncni"); + + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2}, "komega"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1.1, 1.2, 300.0}, "komegani"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2}, "komeganc"); + testWriteAndReadVtk(fvGridGeometry, std::array{1e5, 1e-3, 1.1, 1.2, 300.0}, "komegancni"); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + { + Parameters::print(); + DumuxMessage::print(/*firstCall=*/false); + } + + return 0; +} // end main +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 2; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 3; +} -- GitLab From 7224ffb285e0d76d9212d7672df87275e8acbdfc Mon Sep 17 00:00:00 2001 From: Kilian Date: Wed, 31 Oct 2018 17:45:15 +0100 Subject: [PATCH 21/26] [mpnc][iofields] Add missing variable * fugacity was missing --- dumux/porousmediumflow/mpnc/iofields.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dumux/porousmediumflow/mpnc/iofields.hh b/dumux/porousmediumflow/mpnc/iofields.hh index 7a51660f40..ee9d59c61a 100644 --- a/dumux/porousmediumflow/mpnc/iofields.hh +++ b/dumux/porousmediumflow/mpnc/iofields.hh @@ -57,6 +57,11 @@ public: IOName::moleFraction(i, j)); } + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([j](const auto& v){ return v.fugacity(j); }, + "fugacity^"+ FluidSystem::componentName(j)); + + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, IOName::porosity()); } -- GitLab From 19571ab982bd0c67eddb7f2003f88e466f5f7fbf Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Wed, 31 Oct 2018 15:47:27 +0100 Subject: [PATCH 22/26] [io] adapt names "liquid", ... to "liquidPhase", ... --- dumux/io/name.hh | 16 ++++++++-------- dumux/material/fluidsystems/1pgas.hh | 2 +- dumux/material/fluidsystems/1pliquid.hh | 2 +- dumux/material/fluidsystems/2p1c.hh | 4 ++-- dumux/material/fluidsystems/2pimmiscible.hh | 8 ++++---- dumux/material/fluidsystems/3pimmiscible.hh | 6 +++--- dumux/material/fluidsystems/brine.hh | 2 +- dumux/material/fluidsystems/brineair.hh | 4 ++-- dumux/material/fluidsystems/brineco2.hh | 4 ++-- dumux/material/fluidsystems/h2oair.hh | 4 ++-- dumux/material/fluidsystems/h2oairmesitylene.hh | 6 +++--- dumux/material/fluidsystems/h2oairxylene.hh | 6 +++--- dumux/material/fluidsystems/h2oheavyoil.hh | 6 +++--- dumux/material/fluidsystems/h2on2.hh | 4 ++-- dumux/material/fluidsystems/h2on2o2.hh | 4 ++-- dumux/material/fluidsystems/liquidphase2c.hh | 2 +- dumux/material/fluidsystems/spe5.hh | 6 +++--- dumux/porousmediumflow/richardsnc/iofields.hh | 14 +++++++------- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/dumux/io/name.hh b/dumux/io/name.hh index e44c7019ae..340adf2612 100644 --- a/dumux/io/name.hh +++ b/dumux/io/name.hh @@ -115,20 +115,20 @@ template std::string massFraction(int phaseIdx, int compIdx) noexcept { return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } -//! I/O name of liquid -std::string liquid() noexcept +//! I/O name of liquid phase +std::string liquidPhase() noexcept { return "liq"; } -//! I/O name of gaseous -std::string gaseous() noexcept +//! I/O name of gaseous phase +std::string gaseousPhase() noexcept { return "gas"; } -//! I/O name of aqueous -std::string aqueous() noexcept +//! I/O name of aqueous phase +std::string aqueousPhase() noexcept { return "aq"; } -//! I/O name of napl -std::string napl() noexcept +//! I/O name of napl phase +std::string naplPhase() noexcept { return "napl"; } //! I/O name of capillary pressure diff --git a/dumux/material/fluidsystems/1pgas.hh b/dumux/material/fluidsystems/1pgas.hh index e5fa4dc2a2..ef8a86ac5e 100644 --- a/dumux/material/fluidsystems/1pgas.hh +++ b/dumux/material/fluidsystems/1pgas.hh @@ -74,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return IOName::gaseous(); } + { return IOName::gaseousPhase(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/1pliquid.hh b/dumux/material/fluidsystems/1pliquid.hh index d7f4bbf30e..a4b818749d 100644 --- a/dumux/material/fluidsystems/1pliquid.hh +++ b/dumux/material/fluidsystems/1pliquid.hh @@ -74,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return IOName::liquid(); } + { return IOName::liquidPhase(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh index 4bfe614d72..c2ccdfe78f 100644 --- a/dumux/material/fluidsystems/2p1c.hh +++ b/dumux/material/fluidsystems/2p1c.hh @@ -70,8 +70,8 @@ public: static std::string phaseName(int phaseIdx) { static std::string name[] = { - std::string(IOName::liquid()), - std::string(IOName::gaseous()), + std::string(IOName::liquidPhase()), + std::string(IOName::gaseousPhase()), }; assert(0 <= phaseIdx && phaseIdx < numPhases); diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index f6cc03cf97..43e96ecea9 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -90,16 +90,16 @@ public: if (!Fluid0::isGas() && !Fluid1::isGas()) { if (phaseIdx == phase0Idx) - return Components::IsAqueous::value ? IOName::aqueous() : IOName::napl(); + return Components::IsAqueous::value ? IOName::aqueousPhase() : IOName::naplPhase(); else - return Components::IsAqueous::value ? IOName::aqueous() : IOName::napl(); + return Components::IsAqueous::value ? IOName::aqueousPhase() : IOName::naplPhase(); } else { if (phaseIdx == phase0Idx) - return Fluid0::isGas() ? IOName::gaseous() : IOName::liquid(); + return Fluid0::isGas() ? IOName::gaseousPhase() : IOName::liquidPhase(); else - return Fluid1::isGas() ? IOName::gaseous() : IOName::liquid(); + return Fluid1::isGas() ? IOName::gaseousPhase() : IOName::liquidPhase(); } } diff --git a/dumux/material/fluidsystems/3pimmiscible.hh b/dumux/material/fluidsystems/3pimmiscible.hh index 88d9eb94c6..885f34022d 100644 --- a/dumux/material/fluidsystems/3pimmiscible.hh +++ b/dumux/material/fluidsystems/3pimmiscible.hh @@ -94,10 +94,10 @@ public: switch (phaseIdx) { case wPhaseIdx: return Components::IsAqueous::value - ? IOName::aqueous() : IOName::napl(); + ? IOName::aqueousPhase() : IOName::naplPhase(); case nPhaseIdx: return Components::IsAqueous::value - ? IOName::aqueous() : IOName::napl(); - case gPhaseIdx: return IOName::gaseous(); + ? IOName::aqueousPhase() : IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index c1d04a7d5f..67685a187e 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -71,7 +71,7 @@ public: static const std::string phaseName(int phaseIdx = liquidPhaseIdx) { assert(phaseIdx == liquidPhaseIdx); - return IOName::liquid(); + return IOName::liquidPhase(); } /*! diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index 24cda87536..65f96a9dbc 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -150,8 +150,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return IOName::liquid(); - case gasPhaseIdx: return IOName::gaseous(); + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh index 489c384c46..17b5e215e3 100644 --- a/dumux/material/fluidsystems/brineco2.hh +++ b/dumux/material/fluidsystems/brineco2.hh @@ -197,8 +197,8 @@ public: { switch (phaseIdx) { - case liquidPhaseIdx: return IOName::liquid(); - case gasPhaseIdx: return IOName::gaseous(); + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 9cc3091bb9..438eb7f2d5 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -106,8 +106,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return IOName::liquid(); - case gasPhaseIdx: return IOName::gaseous(); + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index 9c8a74049a..d5dafd18bf 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -199,9 +199,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return IOName::aqueous(); - case nPhaseIdx: return IOName::napl(); - case gPhaseIdx: return IOName::gaseous(); + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index f9832c0b18..9fd072be01 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -200,9 +200,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return IOName::aqueous(); - case nPhaseIdx: return IOName::napl(); - case gPhaseIdx: return IOName::gaseous(); + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 55f7c00c47..b4e1b3437e 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -189,9 +189,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return IOName::aqueous(); - case nPhaseIdx: return IOName::napl(); - case gPhaseIdx: return IOName::gaseous(); + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index f1cf83305c..47d8f04e78 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -107,8 +107,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return IOName::liquid(); - case gasPhaseIdx: return IOName::gaseous(); + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index c30a26d4d7..9673b9b904 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -126,8 +126,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return IOName::liquid(); - case gasPhaseIdx: return IOName::gaseous(); + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/liquidphase2c.hh b/dumux/material/fluidsystems/liquidphase2c.hh index c0e0d9a751..a911e6c426 100644 --- a/dumux/material/fluidsystems/liquidphase2c.hh +++ b/dumux/material/fluidsystems/liquidphase2c.hh @@ -76,7 +76,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return IOName::liquid(); } + { return IOName::liquidPhase(); } /*! * \brief Returns whether the fluids are miscible diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index eaafbb8769..d68745b9bd 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -90,9 +90,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case gPhaseIdx: return IOName::gaseous(); - case wPhaseIdx: return IOName::aqueous(); - case oPhaseIdx: return IOName::napl(); + case gPhaseIdx: return IOName::gaseousPhase(); + case wPhaseIdx: return IOName::aqueousPhase(); + case oPhaseIdx: return IOName::naplPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh index 99c20395d6..865623ad38 100644 --- a/dumux/porousmediumflow/richardsnc/iofields.hh +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -43,21 +43,21 @@ public: using FS = typename VolumeVariables::FluidSystem; out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, - IOName::saturation() + "_" + IOName::liquid()); + IOName::saturation() + "_" + IOName::liquidPhase()); out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, - IOName::saturation() + "_" + IOName::gaseous()); + IOName::saturation() + "_" + IOName::gaseousPhase()); out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, - IOName::pressure() + "_" + IOName::liquid()); + IOName::pressure() + "_" + IOName::liquidPhase()); out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, - IOName::pressure() + "_" + IOName::gaseous()); + IOName::pressure() + "_" + IOName::gaseousPhase()); out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, IOName::capillaryPressure()); out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, - IOName::density() + "_" + IOName::liquid()); + IOName::density() + "_" + IOName::liquidPhase()); out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, - IOName::mobility() + "_" + IOName::liquid()); + IOName::mobility() + "_" + IOName::liquidPhase()); out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, - IOName::relativePermeability() + "_" + IOName::liquid()); + IOName::relativePermeability() + "_" + IOName::liquidPhase()); out.addVolumeVariable([](const auto& v){ return v.porosity(); }, IOName::porosity()); out.addVolumeVariable([](const auto& v){ return v.temperature(); }, -- GitLab From ce83e0b96b61c36d1a41b8069a6524a0d9dd3c4e Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Wed, 31 Oct 2018 15:59:39 +0100 Subject: [PATCH 23/26] [io] use static std::arrays instead of std::vectors --- dumux/porousmediumflow/2pnc/iofields.hh | 6 ++- dumux/porousmediumflow/3p3c/iofields.hh | 38 ++++++++++--------- dumux/porousmediumflow/3pwateroil/iofields.hh | 38 ++++++++++--------- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh index c04b981105..aee9f5cc23 100644 --- a/dumux/porousmediumflow/2pnc/iofields.hh +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -77,6 +77,8 @@ public: static std::string primaryVariableName(int pvIdx, int state) { using Indices = typename ModelTraits::Indices; + static constexpr auto numStates = 3; + using StringVec = std::array; int idxSecComps; if (state == Indices::firstPhaseOnly @@ -89,14 +91,14 @@ public: return ModelTraits::useMoles() ? IOName::moleFraction(idxSecComps, pvIdx) : IOName::massFraction(idxSecComps, pvIdx); - const std::vector p0s1SwitchedPvNames = { + static const StringVec p0s1SwitchedPvNames = { ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) : IOName::massFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx), IOName::saturation(FluidSystem::phase1Idx)}; - const std::vector p1s0SwitchedPvNames = { + static const StringVec p1s0SwitchedPvNames = { ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx) : IOName::massFraction(FluidSystem::phase0Idx, FluidSystem::comp1Idx), ModelTraits::useMoles() ? IOName::moleFraction(FluidSystem::phase1Idx, FluidSystem::comp0Idx) diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh index 5f0b3206ac..9b24517a1e 100644 --- a/dumux/porousmediumflow/3p3c/iofields.hh +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -75,49 +75,51 @@ public: static std::string primaryVariableName(int pvIdx, int state) { using Indices = typename ModelTraits::Indices; + static constexpr auto numEq = ModelTraits::numEq(); + using StringVec = std::array; switch (state) { case Indices::threePhases: { - const std::vector s1 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::saturation(FluidSystem::wPhaseIdx), - IOName::saturation(FluidSystem::nPhaseIdx)}; + static const StringVec s1 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s1[pvIdx]; } case Indices::wPhaseOnly: { - const std::vector s2 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), - IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s2 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; return s2[pvIdx]; } case Indices::gnPhaseOnly: { - const std::vector s3 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), - IOName::saturation(FluidSystem::nPhaseIdx)}; + static const StringVec s3 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s3[pvIdx]; } case Indices::wnPhaseOnly: { - const std::vector s4 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), - IOName::saturation(FluidSystem::nPhaseIdx)}; + static const StringVec s4 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s4[pvIdx]; } case Indices::gPhaseOnly: { - const std::vector s5 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s5 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s5[pvIdx]; } case Indices::wgPhaseOnly: { - const std::vector s6 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::saturation(FluidSystem::wPhaseIdx), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s6 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s6[pvIdx]; } } diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh index 90ed23fe99..1da1f5382e 100644 --- a/dumux/porousmediumflow/3pwateroil/iofields.hh +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -81,49 +81,51 @@ public: static std::string primaryVariableName(int pvIdx, int state) { using Indices = typename ModelTraits::Indices; + static constexpr auto numEq = ModelTraits::numEq(); + using StringVec = std::array; switch (state) { case Indices::threePhases: { - const std::vector s1 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::saturation(FluidSystem::wPhaseIdx), - IOName::saturation(FluidSystem::nPhaseIdx)}; + static const StringVec s1 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s1[pvIdx]; } case Indices::wPhaseOnly: { - const std::vector s2 = {IOName::pressure(FluidSystem::wPhaseIdx), - IOName::temperature(), - IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s2 = {IOName::pressure(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::moleFraction(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; return s2[pvIdx]; } case Indices::gnPhaseOnly: { - const std::vector s3 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::saturation(FluidSystem::nPhaseIdx), - IOName::moleFraction(FluidSystem::nPhaseIdx, FluidSystem::wCompIdx)}; + static const StringVec s3 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::nPhaseIdx), + IOName::moleFraction(FluidSystem::nPhaseIdx, FluidSystem::wCompIdx)}; return s3[pvIdx]; } case Indices::wnPhaseOnly: { - const std::vector s4 = {IOName::pressure(FluidSystem::wPhaseIdx), - IOName::temperature(), - IOName::saturation(FluidSystem::nPhaseIdx)}; + static const StringVec s4 = {IOName::pressure(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::saturation(FluidSystem::nPhaseIdx)}; return s4[pvIdx]; } case Indices::gPhaseOnly: { - const std::vector s5 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::temperature(), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s5 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::temperature(), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s5[pvIdx]; } case Indices::wgPhaseOnly: { - const std::vector s6 = {IOName::pressure(FluidSystem::gPhaseIdx), - IOName::saturation(FluidSystem::wPhaseIdx), - IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + static const StringVec s6 = {IOName::pressure(FluidSystem::gPhaseIdx), + IOName::saturation(FluidSystem::wPhaseIdx), + IOName::moleFraction(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; return s6[pvIdx]; } } -- GitLab From ce39e71d6b59a26b5b48d5e371964ca25bb31cab Mon Sep 17 00:00:00 2001 From: Bernd Flemisch Date: Fri, 2 Nov 2018 11:38:37 +0100 Subject: [PATCH 24/26] [test][freeflow] remove restart test The functionality is tested in `test/io/vtk/test_vtk_staggeredfreeflowpvnames`. --- test/freeflow/navierstokes/CMakeLists.txt | 11 ----------- test/freeflow/navierstokes/test_channel.cc | 16 +--------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/test/freeflow/navierstokes/CMakeLists.txt b/test/freeflow/navierstokes/CMakeLists.txt index ba3367981d..f9b9bea078 100644 --- a/test/freeflow/navierstokes/CMakeLists.txt +++ b/test/freeflow/navierstokes/CMakeLists.txt @@ -51,17 +51,6 @@ dune_add_test(NAME test_navierstokes_channel ${CMAKE_CURRENT_BINARY_DIR}/test_channel_navierstokes-00002.vtu --command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_channel_navierstokes.input -Vtk.WriteFaceData 1") -dune_add_test(NAME test_navierstokes_channel_restart - TARGET test_channel - CMAKE_GUARD HAVE_UMFPACK - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/channel-navierstokes-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_channel_navierstokes_restart-00001.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_channel_navierstokes.input -Vtk.WriteFaceData 1 -TimeLoop.DtInitial 1 -Restart.Time 1 -CellCenter.Restart.File test_channel_navierstokes-00001.vtu -Face.Restart.File test_channel_navierstokes-face-00001.vtp -Problem.Name test_channel_navierstokes_restart") - -# the restart test has to run after the test that produces the corresponding vtu file -set_tests_properties(test_navierstokes_channel_restart PROPERTIES DEPENDS test_navierstokes_channel) add_executable(test_channel_stokesni EXCLUDE_FROM_ALL test_channel.cc) target_compile_definitions(test_channel_stokesni PUBLIC "NONISOTHERMAL=1") diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index e5be192cb6..78fc06c138 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -139,21 +139,7 @@ int main(int argc, char** argv) try SolutionVector x; x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); x[FVGridGeometry::faceIdx()].resize(numDofsFace); - if (restartTime > 0) - { - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - - auto fileNameCell = getParamFromGroup("CellCenter", "Restart.File"); - loadSolution(x[FVGridGeometry::cellCenterIdx()], fileNameCell, - [](int pvIdx, int state){ return "p"; }, // test option with lambda - *fvGridGeometry); - - auto fileNameFace = getParamFromGroup("Face", "Restart.File"); - loadSolution(x[FVGridGeometry::faceIdx()], fileNameFace, - ModelTraits::primaryVariableNameFace<>, *fvGridGeometry); - } - else - problem->applyInitialSolution(x); + problem->applyInitialSolution(x); auto xOld = x; // instantiate time loop -- GitLab From 7ce9217648ef022df7a11447e0f10a45fd62b390 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 8 Nov 2018 18:01:24 +0100 Subject: [PATCH 25/26] [iofields] Remove old VtkOutputField property --- test/freeflow/navierstokes/test_angeli.cc | 4 ++-- test/freeflow/navierstokes/test_closedsystem.cc | 4 ++-- test/freeflow/navierstokes/test_kovasznay.cc | 4 ++-- test/freeflow/navierstokes/test_navierstokes_1d.cc | 4 ++-- test/freeflow/navierstokes/test_stokes_channel_3d.cc | 4 ++-- .../navierstokesnc/test_densitydrivenflow.cc | 4 ++-- test/freeflow/navierstokesnc/test_msfreeflow.cc | 4 ++-- test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc | 4 ++-- test/multidomain/boundary/darcydarcy/1p_1p/main.cc | 4 ++-- test/multidomain/boundary/darcydarcy/1p_2p/main.cc | 4 ++-- .../test_stokes1p2cdarcy1p2chorizontal.cc | 4 ++-- .../verticalflow/test_stokes1p2cdarcy1p2cvertical.cc | 4 ++-- .../1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc | 4 ++-- .../horizontalflow/test_stokes1pdarcy1phorizontal.cc | 4 ++-- .../verticalflow/test_stokes1pdarcy1pvertical.cc | 4 ++-- .../1p_2p/test_stokes1pdarcy2pvertical.cc | 4 ++-- .../1d3d/1p2c_richards2c/test_1p2c_richards2c.cc | 6 +++--- test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc | 8 ++++---- .../embedded/1d3d/1p_richards/test_1p_richards.cc | 6 +++--- test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc | 4 ++-- .../1p_1p/analytical/test_facetcoupling_fv_1p1p.cc | 8 ++++---- .../test_facetcoupling_tpfa_1p1p_threedomain.cc | 12 ++++++------ test/multidomain/poromechanics/el1p/test_el1p.cc | 4 ++-- test/multidomain/poromechanics/el2p/test_el2p.cc | 4 ++-- .../1p/implicit/periodicbc/test_1pfv.cc | 4 ++-- 25 files changed, 60 insertions(+), 60 deletions(-) diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 021fbc2100..54a69fc433 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -149,8 +149,8 @@ int main(int argc, char** argv) try // intialize the vtk output module StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index 8401ace5e1..9530b8ceed 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -142,9 +142,9 @@ int main(int argc, char** argv) try auto dt = getParam("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 173cfd5d75..cc2a60a7b3 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -134,9 +134,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index b728eea171..db71272df9 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -123,9 +123,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index 8280439437..b5389b17f3 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -131,9 +131,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index edd782c140..1dbb8bc579 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -146,9 +146,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 766d662052..1cf5daa701 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -146,9 +146,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::init(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc index cb9c3f4408..453126339d 100644 --- a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -233,9 +233,9 @@ void testWriteAndReadVtk(std::shared_ptr fvGridGeometry, gridVariables->init(writeFrom); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, writeFrom, fileName); - VtkOutputFields::initOutputModule(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index daabfac105..d662aa15ce 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -225,12 +225,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t; VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::init(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t; VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::init(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 5d39ab1b25..b38e7d16dc 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -210,12 +210,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t; VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::init(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t; VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::init(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index 3c0a40bfcf..ed90f6302b 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -187,13 +187,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 33c4e66f11..35b37cb2ef 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -188,13 +188,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index f75717383c..0dc1b24130 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -180,13 +180,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index 0bcdd17719..f19998392f 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -159,13 +159,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index bcd5fe3199..df0db1e15e 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -162,13 +162,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index 4461ef4de1..c4f6802ba7 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -211,13 +211,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); darcyVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index d09a5bd60c..ef171f63e2 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc @@ -350,13 +350,13 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); - lowDimProblem->addVtkOutputFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); + lowDimProblem->addIOFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc index 02476ecaf3..0cdc8bb92d 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc @@ -161,14 +161,14 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); - bulkProblem->addVtkOutputFields(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); + bulkProblem->addIOFields(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); - lowDimProblem->addVtkOutputFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); + lowDimProblem->addIOFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // an output file for the L2-norm diff --git a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc index 35cbf5b279..ce3f48c7ce 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc @@ -167,13 +167,13 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); - lowDimProblem->addVtkOutputFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); + lowDimProblem->addIOFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc index 454917e870..6fb6f05843 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc @@ -211,12 +211,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc index 3298918f05..6e6d22a9f3 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc @@ -281,10 +281,10 @@ int main(int argc, char** argv) try const bool writeVTK = getParam("Output.EnableVTK"); if (writeVTK) { - using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); - using LowDimVtkOutputFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, VtkOutputFields); - BulkVtkOutputFields::init(bulkVtkWriter); - LowDimVtkOutputFields::init(lowDimVtkWriter); + using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); + using LowDimIOFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, IOFields); + BulkIOFields::init(bulkVtkWriter); + LowDimIOFields::init(lowDimVtkWriter); bulkExact.resize(bulkFvGridGeometry->numDofs()); lowDimExact.resize(lowDimFvGridGeometry->numDofs()); diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc index fdd1dcfba2..d755f44b0b 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc @@ -183,12 +183,12 @@ int main(int argc, char** argv) try VtkOutputModule edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields - using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); - using FacetVtkOutputFields = typename GET_PROP_TYPE(FacetProblemTypeTag, VtkOutputFields); - using EdgeVtkOutputFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, VtkOutputFields); - BulkVtkOutputFields::init(bulkVtkWriter); - FacetVtkOutputFields::init(facetVtkWriter); - EdgeVtkOutputFields::init(edgeVtkWriter); + using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); + using FacetIOFields = typename GET_PROP_TYPE(FacetProblemTypeTag, IOFields); + using EdgeIOFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, IOFields); + BulkIOFields::init(bulkVtkWriter); + FacetIOFields::init(facetVtkWriter); + EdgeIOFields::init(edgeVtkWriter); bulkVtkWriter.write(0.0); facetVtkWriter.write(0.0); edgeVtkWriter.write(0.0); diff --git a/test/multidomain/poromechanics/el1p/test_el1p.cc b/test/multidomain/poromechanics/el1p/test_el1p.cc index a70a605bac..2626ca23e2 100644 --- a/test/multidomain/poromechanics/el1p/test_el1p.cc +++ b/test/multidomain/poromechanics/el1p/test_el1p.cc @@ -156,8 +156,8 @@ int main(int argc, char** argv) try PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using OnePOutputFields = typename GET_PROP_TYPE(OnePTypeTag, VtkOutputFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, VtkOutputFields); + using OnePOutputFields = typename GET_PROP_TYPE(OnePTypeTag, IOFields); + using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); OnePOutputFields::init(onePVtkWriter); PoroMechOutputFields::init(poroMechVtkWriter); diff --git a/test/multidomain/poromechanics/el2p/test_el2p.cc b/test/multidomain/poromechanics/el2p/test_el2p.cc index f30dcb2d6f..06e38222f2 100644 --- a/test/multidomain/poromechanics/el2p/test_el2p.cc +++ b/test/multidomain/poromechanics/el2p/test_el2p.cc @@ -164,8 +164,8 @@ int main(int argc, char** argv) try PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using TwoPOutputFields = typename GET_PROP_TYPE(TwoPTypeTag, VtkOutputFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, VtkOutputFields); + using TwoPOutputFields = typename GET_PROP_TYPE(TwoPTypeTag, IOFields); + using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); TwoPOutputFields::init(twoPVtkWriter); PoroMechOutputFields::init(poroMechVtkWriter); diff --git a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc index 2cbb88a834..5402c046e0 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc @@ -102,8 +102,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system -- GitLab From da5f5e7f53a7417e9a34557b665c830a0a15f518 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Thu, 8 Nov 2018 18:08:51 +0100 Subject: [PATCH 26/26] [iofields][test] Use new signature initOutputModule --- test/freeflow/navierstokes/test_angeli.cc | 2 +- test/freeflow/navierstokes/test_closedsystem.cc | 2 +- test/freeflow/navierstokes/test_kovasznay.cc | 2 +- test/freeflow/navierstokes/test_navierstokes_1d.cc | 2 +- test/freeflow/navierstokes/test_stokes_channel_3d.cc | 2 +- test/freeflow/navierstokesnc/test_densitydrivenflow.cc | 2 +- test/freeflow/navierstokesnc/test_msfreeflow.cc | 2 +- test/multidomain/boundary/darcydarcy/1p_1p/main.cc | 4 ++-- test/multidomain/boundary/darcydarcy/1p_2p/main.cc | 4 ++-- .../horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc | 4 ++-- .../verticalflow/test_stokes1p2cdarcy1p2cvertical.cc | 4 ++-- .../1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc | 4 ++-- .../horizontalflow/test_stokes1pdarcy1phorizontal.cc | 4 ++-- .../1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc | 4 ++-- .../stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc | 4 ++-- .../embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc | 6 +++--- test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc | 8 ++++---- .../embedded/1d3d/1p_richards/test_1p_richards.cc | 6 +++--- test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc | 4 ++-- .../facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc | 4 ++-- .../test_facetcoupling_tpfa_1p1p_threedomain.cc | 6 +++--- test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc | 2 +- 22 files changed, 41 insertions(+), 41 deletions(-) diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 54a69fc433..f19351e6bb 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -150,7 +150,7 @@ int main(int argc, char** argv) try // intialize the vtk output module StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index 9530b8ceed..a006672081 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -144,7 +144,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index cc2a60a7b3..1bb20aeb39 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -136,7 +136,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index db71272df9..da8777f6de 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -125,7 +125,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index b5389b17f3..5b9d3a0f96 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -133,7 +133,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index 1dbb8bc579..bebae70faf 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 1cf5daa701..bbe525a69f 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -148,7 +148,7 @@ int main(int argc, char** argv) try // intialize the vtk output module using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - IOFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index d662aa15ce..2a9686fbe0 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -225,12 +225,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t; VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, IOFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t; VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, IOFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index b38e7d16dc..f749e14122 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -210,12 +210,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t; VtkOutputModule vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, IOFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t; VtkOutputModule vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, IOFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index ed90f6302b..0e51f16ffb 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -187,13 +187,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 35b37cb2ef..946bb677b4 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -188,13 +188,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index 0dc1b24130..9a506d0e0f 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -180,13 +180,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index f19998392f..70ad0085b4 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -159,13 +159,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index df0db1e15e..a51aeacd04 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -162,13 +162,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index c4f6802ba7..9d6712d2b6 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -211,13 +211,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, IOFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, IOFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index ef171f63e2..4ad2895076 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc @@ -350,13 +350,13 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); - lowDimProblem->addIOFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc index 0cdc8bb92d..93e29f7992 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc @@ -161,14 +161,14 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); - bulkProblem->addIOFields(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); + bulkProblem->addVtkOutputFields(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); - lowDimProblem->addIOFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // an output file for the L2-norm diff --git a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc index ce3f48c7ce..f224443224 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc @@ -167,13 +167,13 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); - lowDimProblem->addIOFields(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); + lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc index 6fb6f05843..89cd00a390 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc @@ -211,12 +211,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t; VtkOutputModule bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, IOFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t; VtkOutputModule lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, IOFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc index 6e6d22a9f3..39490ae7dc 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc @@ -283,8 +283,8 @@ int main(int argc, char** argv) try { using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); using LowDimIOFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, IOFields); - BulkIOFields::init(bulkVtkWriter); - LowDimIOFields::init(lowDimVtkWriter); + BulkIOFields::initOutputModule(bulkVtkWriter); + LowDimIOFields::initOutputModule(lowDimVtkWriter); bulkExact.resize(bulkFvGridGeometry->numDofs()); lowDimExact.resize(lowDimFvGridGeometry->numDofs()); diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc index d755f44b0b..fe8edaccf1 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc @@ -186,9 +186,9 @@ int main(int argc, char** argv) try using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); using FacetIOFields = typename GET_PROP_TYPE(FacetProblemTypeTag, IOFields); using EdgeIOFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, IOFields); - BulkIOFields::init(bulkVtkWriter); - FacetIOFields::init(facetVtkWriter); - EdgeIOFields::init(edgeVtkWriter); + BulkIOFields::initOutputModule(bulkVtkWriter); + FacetIOFields::initOutputModule(facetVtkWriter); + EdgeIOFields::initOutputModule(edgeVtkWriter); bulkVtkWriter.write(0.0); facetVtkWriter.write(0.0); edgeVtkWriter.write(0.0); diff --git a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc index 5402c046e0..160f8afe73 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc @@ -103,7 +103,7 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); - IOFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system -- GitLab