IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 56092264 authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

make ERROR out of assertion

parent 5c10afc7
No related branches found
No related tags found
No related merge requests found
...@@ -204,17 +204,20 @@ namespace corsika { ...@@ -204,17 +204,20 @@ namespace corsika {
CORSIKA_LOG_DEBUG("step limit reached (e.g. deflection). nothing further happens."); CORSIKA_LOG_DEBUG("step limit reached (e.g. deflection). nothing further happens.");
[[maybe_unused]] auto const assertion = [&] { {
auto const* numericalNodeAfterStep = auto const* numericalNodeAfterStep =
environment_.getUniverse()->getContainingNode(vParticle.getPosition()); environment_.getUniverse()->getContainingNode(vParticle.getPosition());
CORSIKA_LOG_TRACE( CORSIKA_LOG_TRACE(
"Geometry check: numericalNodeAfterStep={} currentLogicalNode={}", "Geometry check: numericalNodeAfterStep={} currentLogicalNode={}",
fmt::ptr(numericalNodeAfterStep), fmt::ptr(currentLogicalNode)); fmt::ptr(numericalNodeAfterStep), fmt::ptr(currentLogicalNode));
return numericalNodeAfterStep == currentLogicalNode; if (numericalNodeAfterStep != currentLogicalNode) {
}; CORSIKA_LOG_ERROR(
"expect to be in node currentLogicalNode={} but are in "
assert(assertion()); // numerical and logical nodes should match, since "numericalNodeAfterStep={}. Continue, but without guarantee.",
// we did not cross any volume boundary fmt::ptr(currentLogicalNode), fmt::ptr(numericalNodeAfterStep));
}
}
// we did not cross any volume boundary
// step length limit // step length limit
return; return;
...@@ -253,7 +256,7 @@ namespace corsika { ...@@ -253,7 +256,7 @@ namespace corsika {
sequence_.doSecondaries(secondaries); sequence_.doSecondaries(secondaries);
vParticle.erase(); vParticle.erase();
} } // namespace corsika
template <typename TTracking, typename TProcessList, typename TOutput, typename TStack> template <typename TTracking, typename TProcessList, typename TOutput, typename TStack>
inline ProcessReturn Cascade<TTracking, TProcessList, TOutput, TStack>::decay( inline ProcessReturn Cascade<TTracking, TProcessList, TOutput, TStack>::decay(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment