Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uniform field + MSC along-step kernel #465

Merged
merged 17 commits into from
Jul 28, 2022

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Jul 27, 2022

This implements an alternate along-step kernel for a uniform magnetic field with optional MSC. To be consistent with adept's default, this kernel doesn't implement energy fluctuations (though it would be trivial to add that capability).

Closes #281 .

@sethrj sethrj added field Magnetic field and propagation integration labels Jul 27, 2022
@sethrj sethrj requested a review from amandalund July 27, 2022 16:41
Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, @sethrj! Just a couple build errors and conflicts to resolve.

Were you able to run the demo loop with a uniform field?

app/demo-loop/LDemoIO.cc Outdated Show resolved Hide resolved
src/celeritas/phys/PhysicsStepUtils.hh Outdated Show resolved Hide resolved
test/CMakeLists.txt Show resolved Hide resolved
@sethrj sethrj requested a review from amandalund July 28, 2022 13:20
@sethrj
Copy link
Member Author

sethrj commented Jul 28, 2022

Running TestEM3 with a 1T field along x gives an error:

/home/s3j/.local/src/celeritas/src/celeritas/global/alongstep/AlongStep.hh:120: void celeritas::along_step(MH &&, MP &&, AE &&, const celeritas::CoreTrackView &) [with MH = celeritas::detail::UrbanMsc; MP = lambda [](const celeritas::ParticleTrackView &, celeritas::OrangeTrackView *)->celeritas::FieldPropagator<celeritas::FieldDriver<celeritas::DormandPrinceStepper<celeritas::MagFieldEquation<celeritas::UniformField>>>>; AE = celeritas::detail::EnergyLossApplier]: block: [7837,0,0], thread: [68,0,0] Assertion `mfp > 0` failed.

😢 I'll see what might be going on. This is the first time we've ever tried to run with the field propagator outside of unit tests...

@amandalund
Copy link
Contributor

Haha yep I just tried the same and see lots of those assertion failures (boundary action with zero mfp, all particle types)...

@sethrj
Copy link
Member Author

sethrj commented Jul 28, 2022

@amandalund Somehow the field propagator is moving all the way to the end of the physics step but marking it as a boundary crossing. I think this is a bug in the propagator as opposed to the new code: the propagator tests are far from complete. I suggest we merge this branch (knowing that it doesn't work in anything but an infinite medium) and I rewrite the field propagator tests and fix the propagator.

Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Thanks @sethrj!

@sethrj
Copy link
Member Author

sethrj commented Jul 28, 2022

CI failure is due to out-of-disk for the vecgeom demos as usual.

@sethrj sethrj merged commit 378ad3d into celeritas-project:master Jul 28, 2022
@sethrj sethrj deleted the along-step-uniform-msc branch August 3, 2022 13:21
@sethrj sethrj added the enhancement New feature or request label Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request field Magnetic field and propagation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate magnetic field into tracking loop
2 participants