[mcstas-users] ALLOW_BACKPROP, PROP_Z0 vs --gravitation
Peter Kjær Willendrup
pkwi at fysik.dtu.dk
Mon Jul 26 16:58:57 CEST 2021
Hi Richard,
I just came back from vacation and had a look at the issue you report. ALLOW_BACKPROP ought to work irrespective of the gravity setting in fact.
I tried putting your snippet of code into the PSI_source instrument “behind” the source (see attached) - and I don’t seem to reproduce your finding?
Could the issue potentially be specific to the instrument you are using it in? If you send me a copy (plus need inputfiles etc.) I will have a closer look.
(Feel free to do this outside the mailinglist if you prefer. :) )
Best,
Peter
On 18 Jul 2021, at 00.14, Richard Wagner <wagnerrichard at ill.fr<mailto:wagnerrichard at ill.fr>> wrote:
Dear All,
I have the following issue with a Shape Component in a simulation. It is used to filter neutrons that have not are not originating from the moderator window.
COMPONENT Mod_Face = Shape(xwidth=.30,yheight=.24)
AT (0,0,0.16) RELATIVE ABSOLUTE
EXTEND %{
/* Propagate back to a small rectangle in front of moderator */
printf("(before) x=%g y=%g z=%g\n", x, y, z);
ALLOW_BACKPROP;
PROP_Z0;
SCATTER;
printf("(after) x=%g y=%g z=%g\n", x, y, z);
printf("(if) %d\n", (fabs(x)> xwidth/2 || fabs(y)> yheight/2));
/* Remove neutrons that are not from around the moderators */
if (fabs(x)> xwidth/2 || fabs(y)> yheight/2)
{
printf("(absorbed) x=%g y=%g z=%g\n", x, y, z);
ABSORB;
}
%}
If I run the McStas simulation with the --gravitation flag the back propagation is not working.
Log entries will exemplaryly read:
(if) 0
(before) x=0.131648 y=0.00568935 z=1.84
(after) x=0.131648 y=0.00568935 z=1.84
And no neutrons will be filtered out
With gravity set to 'off' I get:
(before) x=0.110096 y=0.118489 z=1.84
(after) x=-0.118996 y=-0.00294855 z=0
(if) 0
(before) x=-0.0518426 y=-0.0952835 z=1.84
(after) x=0.519784 y=-0.514964 z=0
(if) 1
(absorbed) x=0.519784 y=-0.514964 z=0
So it works as intended.
Is this behavior as expected? Or differently is backprop not working with gravity turned on?
I use McStas 2.7 and need to make the simulation with gravity.
Any ideas?
Best,
Richard
--
Richard Wagner
Research Engineer
Nuclear and Particle Physics Group
Institut Laue-Langevin - ILL
71, avenue des Martyrs
CS 20156
38042 Grenoble Cedex 9
France
www.ill.eu
_______________________________________________
mcstas-users mailing list
mcstas-users at mcstas.org<mailto:mcstas-users at mcstas.org>
https://mailman2.mcstas.org/mailman/listinfo/mcstas-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20210726/6aacae49/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PSI_source.instr
Type: application/octet-stream
Size: 4051 bytes
Desc: PSI_source.instr
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20210726/6aacae49/attachment-0001.obj>
More information about the mcstas-users
mailing list