diff --git a/two-scale-heat-conduction/macro-dumux/appl/main.cc b/two-scale-heat-conduction/macro-dumux/appl/main.cc index 3491731a5..bbcf54310 100644 --- a/two-scale-heat-conduction/macro-dumux/appl/main.cc +++ b/two-scale-heat-conduction/macro-dumux/appl/main.cc @@ -289,8 +289,15 @@ int main(int argc, char **argv) // linearize & solve nonLinearSolver.solve(x, *timeLoop); - for (int solIdx = 0; solIdx < numberOfElements; ++solIdx) - temperatures[solIdx] = x[solIdx][problem->returnTemperatureIdx()]; + int solIdx = 0; + for (const auto &element : elements(leafGridView, Dune::Partitions::interior)) { + auto fvGeometry = localView(*gridGeometry); + fvGeometry.bindElement(element); + for (const auto &scv : scvs(fvGeometry)) { + temperatures[solIdx++] = + x[scv.elementIndex()][problem->returnTemperatureIdx()]; + } + } if (getParam("Precice.RunWithCoupling") == true) { couplingParticipant.writeQuantityVector(meshName,