Skip to content
Snippets Groups Projects
Commit 47221243 authored by Timo Koch's avatar Timo Koch
Browse files

[2p][2p1c] Free vtk outputfields from TypeTag

parent 6c4b87b6
No related branches found
No related tags found
1 merge request!819[2p][2p1c] Free vtk outputfields from TypeTag
...@@ -103,7 +103,9 @@ SET_BOOL_PROP(TwoP, EnableEnergyBalance, false); // ...@@ -103,7 +103,9 @@ SET_BOOL_PROP(TwoP, EnableEnergyBalance, false); //
SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model
SET_TYPE_PROP(TwoP, VolumeVariables, TwoPVolumeVariables<TypeTag>); //!< the VolumeVariables property SET_TYPE_PROP(TwoP, VolumeVariables, TwoPVolumeVariables<TypeTag>); //!< the VolumeVariables property
SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>); //!< The spatial parameters. Use FVSpatialParams by default. SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>); //!< The spatial parameters. Use FVSpatialParams by default.
SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< Set the vtk output fields specific to the twop model
//! Set the vtk output fields specific to the twop model
SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
SET_TYPE_PROP(TwoP, SET_TYPE_PROP(TwoP,
Indices, Indices,
...@@ -125,7 +127,9 @@ public: ...@@ -125,7 +127,9 @@ public:
SET_INT_PROP(TwoPNI, IsothermalNumEq, 2); //!< set isothermal NumEq SET_INT_PROP(TwoPNI, IsothermalNumEq, 2); //!< set isothermal NumEq
SET_TYPE_PROP(TwoPNI, IsothermalVolumeVariables, TwoPVolumeVariables<TypeTag>); //!< set isothermal VolumeVariables SET_TYPE_PROP(TwoPNI, IsothermalVolumeVariables, TwoPVolumeVariables<TypeTag>); //!< set isothermal VolumeVariables
SET_TYPE_PROP(TwoPNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< set isothermal LocalResidual SET_TYPE_PROP(TwoPNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< set isothermal LocalResidual
SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< set isothermal output fields
//! Set the vtk output fields specific to the isothermal twop model
SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
//! Set isothermal Indices //! Set isothermal Indices
SET_PROP(TwoPNI, IsothermalIndices) SET_PROP(TwoPNI, IsothermalIndices)
......
...@@ -24,33 +24,29 @@ ...@@ -24,33 +24,29 @@
#ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH #ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH
#define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH #define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH
#include <dumux/common/properties.hh>
namespace Dumux { namespace Dumux {
/*! /*!
* \ingroup TwoPModel * \ingroup TwoPModel
* \brief Adds vtk output fields specific to the two-phase model * \brief Adds vtk output fields specific to the two-phase model
*/ */
template<class TypeTag> template<class Indices>
class TwoPVtkOutputFields class TwoPVtkOutputFields
{ {
using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
public: public:
template <class VtkOutputModule> template <class VtkOutputModule>
static void init(VtkOutputModule& vtk) static void init(VtkOutputModule& vtk)
{ {
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw"); vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn"); vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::wPhaseIdx); }, "pw"); vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::nPhaseIdx); }, "pn"); vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.capillaryPressure(); }, "pc"); vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::wPhaseIdx); }, "rhoW"); vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::nPhaseIdx); }, "rhoN"); vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW"); vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN"); vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN");
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.porosity(); }, "porosity"); vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity");
} }
}; };
......
...@@ -183,7 +183,7 @@ SET_TYPE_PROP(TwoPOneCNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeT ...@@ -183,7 +183,7 @@ SET_TYPE_PROP(TwoPOneCNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeT
SET_TYPE_PROP(TwoPOneCNI, IsothermalIndices, TwoPOneCIndices<TypeTag, 0>); SET_TYPE_PROP(TwoPOneCNI, IsothermalIndices, TwoPOneCIndices<TypeTag, 0>);
//! The isothermal vtk output fields. //! The isothermal vtk output fields.
SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<TypeTag>); SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>);
//! Set isothermal NumEq. //! Set isothermal NumEq.
SET_INT_PROP(TwoPOneCNI, IsothermalNumEq, 1); SET_INT_PROP(TwoPOneCNI, IsothermalNumEq, 1);
......
...@@ -26,26 +26,24 @@ ...@@ -26,26 +26,24 @@
#include <dumux/porousmediumflow/2p/vtkoutputfields.hh> #include <dumux/porousmediumflow/2p/vtkoutputfields.hh>
namespace Dumux namespace Dumux {
{
/*! /*!
* \ingroup TwoPOneCModel * \ingroup TwoPOneCModel
* \brief Adds vtk output fields specific to two-phase one-component model. * \brief Adds vtk output fields specific to two-phase one-component model.
*/ */
template<class TypeTag> template<class Indices>
class TwoPOneCVtkOutputFields class TwoPOneCVtkOutputFields
{ {
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
public: public:
template <class VtkOutputModule> template <class VtkOutputModule>
static void init(VtkOutputModule& vtk) static void init(VtkOutputModule& vtk)
{ {
// use default fields from the 2p model // use default fields from the 2p model
TwoPVtkOutputFields<TypeTag>::init(vtk); TwoPVtkOutputFields<Indices>::init(vtk);
//output additional to TwoP output: // output additional to TwoP output:
vtk.addVolumeVariable([](const VolumeVariables& v){ return v.priVars().state(); }, "phasePresence"); vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence");
} }
}; };
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
static void init(VtkOutputModule& vtk) static void init(VtkOutputModule& vtk)
{ {
// use default fields from the 2p model // use default fields from the 2p model
TwoPVtkOutputFields<TypeTag>::init(vtk); TwoPVtkOutputFields<Indices>::init(vtk);
//output additional to TwoP output: //output additional to TwoP output:
for (int i = 0; i < numPhases; ++i) for (int i = 0; i < numPhases; ++i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment