Skip to content
Snippets Groups Projects
Commit e21f9c98 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[io] make vtk output module independent of fluid system

Geomechanical models will not be able to reuse the vtk output module
otherwise.
parent 649fcea5
No related branches found
No related tags found
1 merge request!973Feature/box elastic
...@@ -78,6 +78,10 @@ public: ...@@ -78,6 +78,10 @@ public:
bool enableOutput() bool enableOutput()
{ return velocityOutput_; } { return velocityOutput_; }
// returns the name of the phase for a given index
static std::string phaseName(int phaseIdx)
{ return GET_PROP_TYPE(TypeTag, FluidSystem)::phaseName(phaseIdx); }
//! Return the problem boundary types //! Return the problem boundary types
auto problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const auto problemBoundaryTypes(const Element& element, const SubControlVolumeFace& scvf) const
{ return problem_.boundaryTypes(element, scvf); } { return problem_.boundaryTypes(element, scvf); }
......
...@@ -72,7 +72,6 @@ class VtkOutputModule ...@@ -72,7 +72,6 @@ class VtkOutputModule
static constexpr int numPhases = ModelTraits::numPhases(); static constexpr int numPhases = ModelTraits::numPhases();
using VV = typename GridVariables::VolumeVariables; using VV = typename GridVariables::VolumeVariables;
using FluidSystem = typename VV::FluidSystem;
using Scalar = typename GridVariables::Scalar; using Scalar = typename GridVariables::Scalar;
using GridView = typename FVGridGeometry::GridView; using GridView = typename FVGridGeometry::GridView;
...@@ -381,7 +380,7 @@ private: ...@@ -381,7 +380,7 @@ private:
{ {
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx],
"velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)",
/*numComp*/dimWorld, /*codim*/dim).get() ); /*numComp*/dimWorld, /*codim*/dim).get() );
} }
// cell-centered models // cell-centered models
...@@ -389,7 +388,7 @@ private: ...@@ -389,7 +388,7 @@ private:
{ {
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx],
"velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)",
/*numComp*/dimWorld, /*codim*/0).get() ); /*numComp*/dimWorld, /*codim*/0).get() );
} }
} }
...@@ -549,14 +548,14 @@ private: ...@@ -549,14 +548,14 @@ private:
if (dim > 1) if (dim > 1)
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx], sequenceWriter_.addVertexData( Field(gridGeom_.gridView(), gridGeom_.vertexMapper(), velocity[phaseIdx],
"velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)",
/*numComp*/dimWorld, /*codim*/dim).get() ); /*numComp*/dimWorld, /*codim*/dim).get() );
// cell-wise velocities // cell-wise velocities
else else
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx], sequenceWriter_.addCellData( Field(gridGeom_.gridView(), gridGeom_.elementMapper(), velocity[phaseIdx],
"velocity_" + std::string(FluidSystem::phaseName(phaseIdx+phaseIdxOffset)) + " (m/s)", "velocity_" + velocityOutput.phaseName(phaseIdx+phaseIdxOffset) + " (m/s)",
/*numComp*/dimWorld, /*codim*/0).get() ); /*numComp*/dimWorld, /*codim*/0).get() );
} }
......
...@@ -48,6 +48,7 @@ class PorousMediumFlowVelocityOutput ...@@ -48,6 +48,7 @@ class PorousMediumFlowVelocityOutput
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView; using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables);
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
...@@ -106,6 +107,10 @@ public: ...@@ -106,6 +107,10 @@ public:
bool enableOutput() bool enableOutput()
{ return velocityOutput_; } { return velocityOutput_; }
// returns the name of the phase for a given index
static std::string phaseName(int phaseIdx)
{ return FluidSystem::phaseName(phaseIdx); }
// The following SFINAE enable_if usage allows compilation, even if only a // The following SFINAE enable_if usage allows compilation, even if only a
// //
// boundaryTypes(const Element&, const scv&) // boundaryTypes(const Element&, const scv&)
......
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