Commit 12cbaef5 authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Timo Koch
Browse files

[io][vtk] fix condition in enable_if_t, adapt to changed output names

parent b007f298
......@@ -138,10 +138,10 @@ auto loadSolutionFromVtkFile(const std::string fileName,
* \brief helper function to read from two files into a staggered solution vector
*/
template <class SolutionVector, class PvNamesFunc>
auto loadStaggeredSolutionFromVtkFiles(const std::string fileName,
auto loadStaggeredSolutionFromVtkFiles(const std::string baseFileName,
PvNamesFunc&& pvNamesFunc,
SolutionVector& sol)
-> typename std::enable_if_t<decltype(!isMultiTypeBlockVector<SolutionVector>())::value, void>
-> typename std::enable_if_t<!decltype(isMultiTypeBlockVector<SolutionVector>())::value, void>
{}
/*!
......
......@@ -102,9 +102,9 @@ struct TwoPModelTraits
static std::string primaryVariableName(int pvIdx, int state = 0)
{
if (priVarFormulation() == TwoPFormulation::p0s1)
return pvIdx == 0 ? "pw" : "Sn";
return pvIdx == 0 ? "p_w" : "S_n";
else
return pvIdx == 0 ? "pn" : "Sw";
return pvIdx == 0 ? "p_n" : "S_w";
}
};
......
......@@ -108,12 +108,12 @@ struct TwoPTwoCModelTraits : public TwoPNCModelTraits</*numComps=*/2, useMol, /*
{
static const std::string xString = useMol ? "x" : "X";
static const std::array<std::string, 3> p0s1SwitchedPvNames = {{
xString + "_" + FluidSystem::phaseName(0) + "^" + FluidSystem::componentName(1),
xString + "_" + FluidSystem::phaseName(1) + "^" + FluidSystem::componentName(0),
xString + "^" + FluidSystem::componentName(1) + "_" + FluidSystem::phaseName(0),
xString + "^" + FluidSystem::componentName(0) + "_" + FluidSystem::phaseName(1),
"S_n"}};
static const std::array<std::string, 3> p1s0SwitchedPvNames = {{
xString + "_" + FluidSystem::phaseName(0) + "^" + FluidSystem::componentName(1),
xString + "_" + FluidSystem::phaseName(1) + "^" + FluidSystem::componentName(0),
xString + "^" + FluidSystem::componentName(1) + "_" + FluidSystem::phaseName(0),
xString + "^" + FluidSystem::componentName(0) + "_" + FluidSystem::phaseName(1),
"S_w"}};
switch (formulation)
......
dune_symlink_to_source_files(FILES "test_2p.input")
# using tpfa
add_executable(test_2p_incompressible_tpfa EXCLUDE_FROM_ALL test_2p_fv.cc)
target_compile_definitions(test_2p_incompressible_tpfa PUBLIC TYPETAG=TwoPIncompressibleTpfa)
dune_add_test(NAME test_2p_incompressible_tpfa
SOURCES test_2p_fv.cc
COMPILE_DEFINITIONS TYPETAG=TwoPIncompressibleTpfa
TARGET test_2p_incompressible_tpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/lenscc-reference.vtu
......@@ -12,13 +14,12 @@ dune_add_test(NAME test_2p_incompressible_tpfa
# using tpfa
dune_add_test(NAME test_2p_incompressible_tpfa_restart
SOURCES test_2p_fv.cc
COMPILE_DEFINITIONS TYPETAG=TwoPIncompressibleTpfa
TARGET test_2p_incompressible_tpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/lenscc-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/2p_tpfa_restart-00003.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_incompressible_tpfa_restart test_2p.input -Problem.Name 2p_tpfa_restart -TimeLoop.DtInitial 526.62 -Restart.Time 1859.95 -Restart.File 2p_tpfa-00005.vtu")
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_incompressible_tpfa test_2p.input -Problem.Name 2p_tpfa_restart -TimeLoop.DtInitial 526.62 -Restart.Time 1859.95 -Restart.File 2p_tpfa-00005.vtu")
# the restart test has to run after the test that produces the corresponding vtu file
set_tests_properties(test_2p_incompressible_tpfa_restart PROPERTIES DEPENDS test_2p_incompressible_tpfa)
......
......@@ -21,6 +21,6 @@ TemperatureLow = 312.15 # [Pa] lower temperature limit for tabularization
TemperatureHigh = 314.15 # [Pa] upper temperature limit for tabularization
[LoadSolution]
PriVarNamesState1 = pw x_w^N2
PriVarNamesState2 = pw x_n^H2O
PriVarNamesState3 = pw Sn
PriVarNamesState1 = p_w x^N2_w
PriVarNamesState2 = p_w x^H2O_n
PriVarNamesState3 = p_w S_n
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment