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

Particles stuck in DOSXYZnrc following modification to ELECTR for magnetic fields #425

Closed
snaqvi69 opened this issue Apr 16, 2018 · 5 comments
Assignees

Comments

@snaqvi69
Copy link

I tried the latest version of EGSnrc. But every dosxyznrc simulation seems to be getting stuck after a few histories. Even the examples such as air_bone_interface_example.egsinp.
I am wondering if anyone has experienced this issue. Thanks.

@mchamberland
Copy link
Contributor

mchamberland commented Apr 16, 2018

Yes, I can confirm the behaviour, at least with the air and bone interface example.

@mchamberland
Copy link
Contributor

@ftessier I think that dosxyznrc gets stuck in some of the electron transport routine and the only commit related to electron transport that I could think of is 677bbe5. So I reverted to the commit before that (de1717c) and sure enough, dosxyznrc runs properly.

@snaqvi69
Copy link
Author

Thanks Frederic. I am still having the same issue after downloading from https://github.com/nrc-cnrc/EGSnrc.git today. Where can I get the correct version from? Thanks.

@rtownson
Copy link
Collaborator

rtownson commented Apr 16, 2018

For now if you replace line 1390 in $HEN_HOUSE/src/egsnrc.mortran:

IF(irnew ~= irold) [ $electron_region_change; ];

with:

$electron_region_change;

this will fix the bug and the transport will be correct if you are not using magnetic fields. After that change, recompile any apps you are using. As @mchamberland points out this was a recently introduced bug while working on magnetic fields in vacuum; we'll push a proper fix to the release asap.

@ftessier
Copy link
Member

Thanks @snaqvi69 and @mchamberland for reporting on this rather critical bug! Will advise shortly.

@ftessier ftessier changed the title dosxyznrc (MAC and linux) getting stuck Particles getting stuck in dosxyznrc following modification to ELECTR for magnetic fields Apr 16, 2018
@ftessier ftessier changed the title Particles getting stuck in dosxyznrc following modification to ELECTR for magnetic fields Particles stuck in DOSXYZnrc following modification to ELECTR for magnetic fields Apr 17, 2018
ftessier added a commit that referenced this issue Apr 17, 2018
Assign the current particle region, ir(np), to the old region index,
irold, within the ustep loop in electron transport. Previously, irold
was not updated, so the irnew ~= irold condition added to fix magnetic
field transport in vacuum caused zero-size steps to skip the region
change macro. Remove the now redundant irold = ir(np) assignment in the
non-zero step size block.
ftessier added a commit that referenced this issue Apr 18, 2018
Assign the current particle region, ir(np), to the old region index,
irold, within the ustep loop in electron transport. Previously, irold
was not updated, so the irnew ~= irold condition added to fix magnetic
field transport in vacuum caused zero-size steps to skip the region
change macro. Remove the now redundant irold = ir(np) assignment in the
non-zero step size block.
rtownson pushed a commit that referenced this issue Apr 16, 2021
Assign the current particle region, ir(np), to the old region index,
irold, within the ustep loop in electron transport. Previously, irold
was not updated, so the irnew ~= irold condition added to fix magnetic
field transport in vacuum caused zero-size steps to skip the region
change macro. Remove the now redundant irold = ir(np) assignment in the
non-zero step size block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants