Skip to content

Commit 8a80f2c

Browse files
[two-scale-heat-conduction] Fix parallel macro: Write data only for interior elements (#665)
* [two-scale-heat-conduction] Write data only for interior elements * Formatting --------- Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
1 parent 826b6cd commit 8a80f2c

File tree

1 file changed

+9
-2
lines changed
  • two-scale-heat-conduction/macro-dumux/appl

1 file changed

+9
-2
lines changed

two-scale-heat-conduction/macro-dumux/appl/main.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,15 @@ int main(int argc, char **argv)
289289
// linearize & solve
290290
nonLinearSolver.solve(x, *timeLoop);
291291

292-
for (int solIdx = 0; solIdx < numberOfElements; ++solIdx)
293-
temperatures[solIdx] = x[solIdx][problem->returnTemperatureIdx()];
292+
int solIdx = 0;
293+
for (const auto &element : elements(leafGridView, Dune::Partitions::interior)) {
294+
auto fvGeometry = localView(*gridGeometry);
295+
fvGeometry.bindElement(element);
296+
for (const auto &scv : scvs(fvGeometry)) {
297+
temperatures[solIdx++] =
298+
x[scv.elementIndex()][problem->returnTemperatureIdx()];
299+
}
300+
}
294301

295302
if (getParam<bool>("Precice.RunWithCoupling") == true) {
296303
couplingParticipant.writeQuantityVector(meshName,

0 commit comments

Comments
 (0)