Merge pull request #3606 from blattms/fix-non-restart-writes-with-tracers

[bugfix] Make tracerConcentrations_ valid for non-restart writes.
This commit is contained in:
Bård Skaflestad 2021-10-14 17:37:20 +02:00 committed by GitHub
commit 3174643fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -670,6 +670,11 @@ assignToSolution(data::Solution& sol)
std::string tmp = tracer.name + "F";
sol.insert(tmp, UnitSystem::measure::identity, std::move(tracerConcentrations_[tracerIdx++]), data::TargetType::RESTART_SOLUTION);
}
// We need put tracerConcentrations into a valid state.
// Otherwise next time we end up here outside of a restart write we will
// move invalidated data above (as it was moved away before and never
// reallocated)
tracerConcentrations_.resize(0);
}
}