[mcstas-users] ALLOW_BACKPROP, PROP_Z0 vs --gravitation

Peter Kjær Willendrup pkwi at fysik.dtu.dk
Tue Aug 17 09:49:16 CEST 2021


Hi Richard,


Thank you for the instrument and MCPL files, I have now had a look at things.

Not surprisingly, I do reproduce your finding, the neutrons are NOT propagated backward when gravity is on. I reproduce the issue both with McStas 2.7 and 3.0, on macOS and on Linux.

At this moment I can still only speculate about the underlying issue that causes this… Will be back with more information later. :)

Best
Peter



On 9 Aug 2021, at 18.24, Richard Wagner <wagnerrichard at ill.fr<mailto:wagnerrichard at ill.fr>> wrote:


Hi Peter,

find enclosed my example of an instrument where the back-propagation fails.

The source is an MCPL_input component and I added a small mcpl-input file, too.
The particles in the MCPL file all start at z=1.84m

Without gravitation back-propagation works, with gravitation it fails.

Any ideas, what could cause such a behavior?

Best,

Richard

PS: The PSI_source instrument you enclosed works for me (== back-propagation with gravity turned on)


On 26/07/2021 16:58, Peter Kjær Willendrup wrote:
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

--
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<x-msg://8/www.ill.eu>


<Test_MCPL_input_testbackprop.instr><out_first_1000.mcpl.gz>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20210817/dd051fdf/attachment-0001.html>


More information about the mcstas-users mailing list