[mcstas-users] [McStas 2.7] Pol_FieldBox with tabled magnetic field

MARTIN Nicolas Nicolas.MARTIN at cea.fr
Sun Dec 13 17:22:47 CET 2020


Dear McStas users,

I am currently trying to simulate the effect of a guide field on the beam polarization of a SANS instrument, using McStas 2.7 on Windows 10 64 bits.
To that end, I calculate this field analytically on a regular 3D grid and export the output in an ASCII text file.
This file is then used as the argument of a Pol_FieldBox component.

My test instrument is compiling well, besides the following warning message:

C:\mcstas-2.7\lib\tools\Python\mcrun\..\mccodelib\..\..\..\optics\Pol_FieldBox.comp: At top level:

C:\mcstas-2.7\lib\tools\Python\mcrun\..\mccodelib\..\..\..\optics\Pol_FieldBox.comp:76:19: warning: ISO C99 requires whitespace after the macro name

((double *)field_parameters)[2]=Bz;

Note that this doesn't prevent me from accessing the "Start simulation" window of the mcgui.
Although McStas seems to read the content of my field file correctly (number of points and step sizes are OK), I get the following error message when trying to perform the simulation:

Opening input file 'fieldbox.dat' (Table_Read_Offset)
interpolator_load: Axis 0: step=0.004, unique values=12220, from file 'fieldbox.dat'.
interpolator_load: Axis 1: step=0.004, unique values=1110, from file 'fieldbox.dat'.
interpolator_load: Axis 2: step=0.004, unique values=100, from file 'fieldbox.dat'.
interpolator: file 'fieldbox.dat' with 12221 points. Space is 3D, Field is 3D. Using method 'kdtree'.
interpolator_interpolate: ERROR: invalid interpolator method  from file 'fieldbox.dat'.

The result is exactly the same with the "flipfield.dat" file (provided in the "\\mcstas-2.7\lib\data" folder).

My instrument and field files are attached to this e-mail.

Has anyone already encountered this interpolator issue? Any clue to fix it?
Should I arrange my input data in a different way? Use a different number of decimal places?

Many thanks in advance for your help, kind regards,
Nicolas
_______________________________
Dr. Nicolas MARTIN
Laboratoire Léon Brillouin
UMR12 CEA-CNRS
Bât 563 CEA Saclay - p. 105
91191 Gif-sur-Yvette Cedex
France
E-mail: nicolas.martin at cea.fr<mailto:nicolas.martin at cea.fr> / nicolas.martin84 at gmail.com<mailto:nicolas.martin84 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20201213/f43c3bad/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fieldbox.dat
Type: application/octet-stream
Size: 449948 bytes
Desc: fieldbox.dat
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20201213/f43c3bad/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GappedGuideField.instr
Type: application/octet-stream
Size: 1350 bytes
Desc: GappedGuideField.instr
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20201213/f43c3bad/attachment-0003.obj>


More information about the mcstas-users mailing list