Commit dbf7d652 authored by Martin Schneider's avatar Martin Schneider
Browse files

[md][ffpm] Update new indices in tests

parent 9517c3cf
......@@ -93,9 +93,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problems (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -132,16 +132,16 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// get a solution vector storing references to the two Stokes solution vectors
auto stokesSol = partial(sol, stokesFaceIdx, stokesCellCenterIdx);
auto stokesSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
// apply initial solution for instationary problems
stokesProblem->applyInitialSolution(stokesSol);
darcyProblem->applyInitialSolution(sol[darcyIdx]);
darcyProblem->applyInitialSolution(sol[porousMediumIdx]);
auto solOld = sol;
......@@ -153,7 +153,7 @@ int main(int argc, char** argv)
stokesGridVariables->init(stokesSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
const auto stokesName = getParam<std::string>("Problem.Name") + "_" + stokesProblem->name();
......@@ -163,7 +163,7 @@ int main(int argc, char** argv)
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyName);
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
darcyVtkWriter.write(0.0);
......
......@@ -107,7 +107,7 @@ public:
BoundaryTypes values;
values.setAllNeumann();
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values.setAllCouplingNeumann();
return values;
......@@ -133,7 +133,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf, DiffusionCoefficientAveragingType::harmonic);
return values;
......
......@@ -138,7 +138,7 @@ public:
values.setNeumann(Indices::conti0EqIdx + 1);
}
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values.setCouplingNeumann(Indices::conti0EqIdx);
values.setCouplingNeumann(Indices::conti0EqIdx + 1);
......@@ -182,7 +182,7 @@ public:
{
NumEqVector values(0.0);
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values[Indices::momentumYBalanceIdx] = couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......
......@@ -92,9 +92,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problems (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -120,16 +120,16 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// get a solution vector storing references to the two Stokes solution vectors
auto stokesSol = partial(sol, stokesFaceIdx, stokesCellCenterIdx);
auto stokesSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
// apply initial solution for instationary problems
stokesProblem->applyInitialSolution(stokesSol);
darcyProblem->applyInitialSolution(sol[darcyIdx]);
darcyProblem->applyInitialSolution(sol[porousMediumIdx]);
auto solOld = sol;
......@@ -141,14 +141,14 @@ int main(int argc, char** argv)
stokesGridVariables->init(stokesSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
StaggeredVtkOutputModule<StokesGridVariables, decltype(stokesSol)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name());
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name());
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyProblem->name());
using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>;
darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables));
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
......
......@@ -99,7 +99,7 @@ public:
BoundaryTypes values;
values.setAllNeumann();
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values.setAllCouplingNeumann();
if (verticalFlow_)
......@@ -165,7 +165,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf);
return values;
......
......@@ -161,7 +161,7 @@ public:
}
}
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values.setCouplingNeumann(Indices::conti0EqIdx);
values.setCouplingNeumann(Indices::conti0EqIdx + 1);
......@@ -233,7 +233,7 @@ public:
{
NumEqVector values(0.0);
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values[Indices::momentumYBalanceIdx] = couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......
......@@ -94,9 +94,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problem (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -121,16 +121,16 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// get a solution vector storing references to the two Stokes solution vectors
auto stokesSol = partial(sol, stokesFaceIdx, stokesCellCenterIdx);
auto stokesSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
// apply initial solution for instationary problems
stokesProblem->applyInitialSolution(stokesSol);
darcyProblem->applyInitialSolution(sol[darcyIdx]);
darcyProblem->applyInitialSolution(sol[porousMediumIdx]);
auto solOld = sol;
......@@ -142,14 +142,14 @@ int main(int argc, char** argv)
stokesGridVariables->init(stokesSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
StaggeredVtkOutputModule<StokesGridVariables, decltype(stokesSol)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name());
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name());
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyProblem->name());
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
darcyVtkWriter.write(0.0);
......@@ -205,7 +205,7 @@ int main(int argc, char** argv)
// make the new solution the old solution
solOld = sol;
darcyProblem->printWaterMass(sol[darcyIdx], *darcyGridVariables, timeLoop->timeStepSize());
darcyProblem->printWaterMass(sol[porousMediumIdx], *darcyGridVariables, timeLoop->timeStepSize());
stokesGridVariables->advanceTimeStep();
darcyGridVariables->advanceTimeStep();
......
......@@ -155,7 +155,7 @@ public:
BoundaryTypes values;
values.setAllNeumann();
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values.setAllCouplingNeumann();
return values;
......@@ -194,7 +194,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
{
#if !NONISOTHERMAL
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf, diffCoeffAvgType_);
......
......@@ -157,7 +157,7 @@ public:
#endif
}
if (couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values.setCouplingNeumann(Indices::conti0EqIdx);
values.setCouplingNeumann(Indices::conti0EqIdx + 1);
......@@ -214,7 +214,7 @@ public:
#endif
}
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values[Indices::momentumYBalanceIdx] = couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......@@ -303,7 +303,7 @@ public:
*/
Scalar alphaBJ(const SubControlVolumeFace& scvf) const
{
return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center());
return couplingManager().problem(CouplingManager::porousMediumIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center());
}
// \}
......
......@@ -92,9 +92,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problems (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -119,16 +119,16 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// get a solution vector storing references to the two Stokes solution vectors
auto stokesSol = partial(sol, stokesFaceIdx, stokesCellCenterIdx);
auto stokesSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
// apply initial solution for instationary problems
stokesProblem->applyInitialSolution(stokesSol);
darcyProblem->applyInitialSolution(sol[darcyIdx]);
darcyProblem->applyInitialSolution(sol[porousMediumIdx]);
auto solOld = sol;
......@@ -140,7 +140,7 @@ int main(int argc, char** argv)
stokesGridVariables->init(stokesSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
const auto stokesName = getParam<std::string>("Problem.Name") + "_" + stokesProblem->name();
......@@ -150,7 +150,7 @@ int main(int argc, char** argv)
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyName);
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
darcyVtkWriter.write(0.0);
......
......@@ -114,7 +114,7 @@ public:
BoundaryTypes values;
values.setAllNeumann();
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values.setAllCouplingNeumann();
......@@ -141,7 +141,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(couplingManager().darcyIdx, scvf))
if (couplingManager().isCoupledEntity(couplingManager().porousMediumIdx, scvf))
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf, DiffusionCoefficientAveragingType::harmonic);
return values;
......
......@@ -133,7 +133,7 @@ public:
values.setNeumann(Indices::conti0EqIdx + 2);
}
if(couplingManager().isCoupledEntity(couplingManager().stokesIdx, scvf))
if(couplingManager().isCoupledEntity(couplingManager().freeFlowIdx, scvf))
{
values.setNeumann(Indices::conti0EqIdx);
values.setNeumann(Indices::conti0EqIdx+1);
......@@ -173,7 +173,7 @@ public:
{
NumEqVector values(0.0);
if(couplingManager().isCoupledEntity(couplingManager().stokesIdx, scvf))
if(couplingManager().isCoupledEntity(couplingManager().freeFlowIdx, scvf))
{
values[Indices::momentumYBalanceIdx] = couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......
......@@ -196,9 +196,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(freeFlowGridGeometry, darcyGridGeometry);
// the indices
constexpr auto freeFlowCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problem (initial and boundary conditions)
const auto testCaseName = getParam<std::string>("Problem.TestCase");
......@@ -226,7 +226,7 @@ int main(int argc, char** argv)
Traits::SolutionVector sol;
sol[freeFlowCellCenterIdx].resize(freeFlowGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(freeFlowGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyGridGeometry->numDofs());
sol[porousMediumIdx].resize(darcyGridGeometry->numDofs());
// get a solution vector storing references to the two FreeFlow solution vectors
auto freeFlowSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
......@@ -239,7 +239,7 @@ int main(int argc, char** argv)
freeFlowGridVariables->init(freeFlowSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
using Scalar = typename Traits::Scalar;
......@@ -253,7 +253,7 @@ int main(int argc, char** argv)
freeFlowVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name());
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyProblem->name());
using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>;
darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables));
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
......@@ -288,8 +288,8 @@ int main(int argc, char** argv)
freeFlowVtkWriter.write(1.0);
darcyVtkWriter.write(1.0);
printFreeFlowL2Error(freeFlowProblem, freeFlowSol);
printDarcyL2Error(*darcyProblem, sol[darcyIdx]);
printFreeFlowL2Error(*freeFlowProblem, freeFlowSol);
printDarcyL2Error(*darcyProblem, sol[porousMediumIdx]);
////////////////////////////////////////////////////////////
// finalize, print dumux message to say goodbye
......
......@@ -126,7 +126,7 @@ public:
{
BoundaryTypes values;
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
values.setAllCouplingNeumann();
else
values.setAllDirichlet();
......@@ -168,8 +168,8 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
values[Indices::conti0EqIdx] = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, scvf);
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, element, scvf))
values[Indices::conti0EqIdx] = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
return values;
}
......
......@@ -146,7 +146,7 @@ public:
values.setDirichlet(Indices::velocityXIdx);
values.setDirichlet(Indices::velocityYIdx);
if (couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values.setCouplingNeumann(Indices::conti0EqIdx);
values.setCouplingNeumann(Indices::momentumYBalanceIdx);
......@@ -182,7 +182,7 @@ public:
{
NumEqVector values(0.0);
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
if(couplingManager().isCoupledEntity(CouplingManager::freeFlowIdx, scvf))
{
values[Indices::conti0EqIdx] = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
values[Indices::momentumYBalanceIdx] = couplingManager().couplingData().momentumCouplingCondition(element, fvGeometry, elemVolVars, elemFaceVars, scvf);
......@@ -226,7 +226,7 @@ public:
*/
Scalar alphaBJ(const SubControlVolumeFace& scvf) const
{
return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center());
return couplingManager().problem(CouplingManager::porousMediumIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center());
}
/*!
......
......@@ -94,9 +94,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto darcyIdx = CouplingManager::porousMediumIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problem (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -106,12 +106,12 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// get a solution vector storing references to the two Stokes solution vectors
auto stokesSol = partial(sol, stokesFaceIdx, stokesCellCenterIdx);
auto stokesSol = partial(sol, freeFlowFaceIdx, freeFlowCellCenterIdx);
couplingManager->init(stokesProblem, darcyProblem, sol);
......@@ -121,14 +121,14 @@ int main(int argc, char** argv)
stokesGridVariables->init(stokesSol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// intialize the vtk output module
StaggeredVtkOutputModule<StokesGridVariables, decltype(stokesSol)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesProblem->name());
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name());
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyProblem->name());
using DarcyVelocityOutput = GetPropType<DarcyTypeTag, Properties::VelocityOutput>;
darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables));
GetPropType<DarcyTypeTag, Properties::IOFields>::initOutputModule(darcyVtkWriter);
......
......@@ -91,9 +91,9 @@ int main(int argc, char** argv)
auto couplingManager = std::make_shared<CouplingManager>(stokesFvGridGeometry, darcyFvGridGeometry);
// the indices
constexpr auto stokesCellCenterIdx = CouplingManager::stokesCellCenterIdx;
constexpr auto stokesFaceIdx = CouplingManager::stokesFaceIdx;
constexpr auto darcyIdx = CouplingManager::darcyIdx;
constexpr auto freeFlowCellCenterIdx = CouplingManager::freeFlowCellCenterIdx;
constexpr auto freeFlowFaceIdx = CouplingManager::freeFlowFaceIdx;
constexpr auto porousMediumIdx = CouplingManager::porousMediumIdx;
// the problem (initial and boundary conditions)
using StokesProblem = GetPropType<StokesTypeTag, Properties::Problem>;
......@@ -111,13 +111,13 @@ int main(int argc, char** argv)
// the solution vector
Traits::SolutionVector sol;
sol[stokesCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[stokesFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[darcyIdx].resize(darcyFvGridGeometry->numDofs());
sol[freeFlowCellCenterIdx].resize(stokesFvGridGeometry->numCellCenterDofs());
sol[freeFlowFaceIdx].resize(stokesFvGridGeometry->numFaceDofs());
sol[porousMediumIdx].resize(darcyFvGridGeometry->numDofs());
// apply initial solution for instationary problems
stokesProblem->applyInitialSolution(sol);
darcyProblem->applyInitialSolution(sol[darcyIdx]);
darcyProblem->applyInitialSolution(sol[porousMediumIdx]);
auto solOld = sol;
......@@ -129,7 +129,7 @@ int main(int argc, char** argv)
stokesGridVariables->init(sol);
using DarcyGridVariables = GetPropType<DarcyTypeTag, Properties::GridVariables>;
auto darcyGridVariables = std::make_shared<DarcyGridVariables>(darcyProblem, darcyFvGridGeometry);
darcyGridVariables->init(sol[darcyIdx]);
darcyGridVariables->init(sol[porousMediumIdx]);
// get some time loop parameters
using Scalar = GetPropType<StokesTypeTag, Properties::Scalar>;
......@@ -142,7 +142,7 @@ int main(int argc, char** argv)
GetPropType<StokesTypeTag, Properties::IOFields>::initOutputModule(stokesVtkWriter);
stokesVtkWriter.write(0.0);
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyProblem->name());
VtkOutputModule<DarcyGridVariables, GetPropType<DarcyTypeTag, Properties::SolutionVector>> darcyVtkWriter(*darcyGridVariables, sol[porousMediumIdx], darcyProblem->name());