<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<p class="MsoNormal" style="margin-bottom:0cm; line-height:normal"><span style="font-size:12.0pt" lang="EN-GB">Dear McStas users,</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; line-height:normal"><span style="font-size:12.0pt" lang="EN-GB"> </span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">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.
<br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">To that end, I calculate this field analytically on a regular 3D grid and export the output in an ASCII text file.
<br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">This file is then used as the argument of a
<i>Pol_FieldBox</i> component. <br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB"><br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">My test instrument is compiling well, besides the following warning message:</span></p>
<p class="MsoNormal"><font size="3" face="Courier New"><br>
<font color="0000FF"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">C:\mcstas-2.7\lib\tools\Python\mcrun\..\mccodelib\..\..\..\optics\Pol_FieldBox.comp: At top level:</span></font></font></p>
<font size="3" face="Courier New" color="0000FF"></font>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<font size="3" face="Courier New" color="0000FF">C:\mcstas-2.7\lib\tools\Python\mcrun\..\mccodelib\..\..\..\optics\Pol_FieldBox.comp:76:19: warning: ISO C99 requires whitespace after the macro name</font></p>
<font size="3" face="Courier New" color="0000FF"></font>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<font size="3" face="Courier New" color="0000FF">((double *)field_parameters)[2]=Bz;</font></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<font color="0000FF"><span style="font-size:12.0pt" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB"><br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">Note that this doesn't prevent me from accessing the "<i>Start simulation</i>" window of the
<i>mcgui</i>.<br>
</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; text-align:justify; line-height:normal">
<span style="font-size:12.0pt" lang="EN-GB">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:</span></p>
<p class="MsoNormal" style="margin-bottom:0cm; line-height:normal"><span style="font-size:12.0pt; font-family:"Times New Roman",serif" lang="EN-GB"> </span></p>
<p class="MsoNormal" style="margin-bottom:0cm; line-height:normal"><font color="0000FF"><span style="font-size:12.0pt; font-family:"Courier New"" lang="EN-GB">Opening input file 'fieldbox.dat' (Table_Read_Offset)<br>
interpolator_load: Axis 0: step=0.004, unique values=12220, from file 'fieldbox.dat'.<br>
interpolator_load: Axis 1: step=0.004, unique values=1110, from file 'fieldbox.dat'.<br>
interpolator_load: Axis 2: step=0.004, unique values=100, from file 'fieldbox.dat'.<br>
interpolator: file 'fieldbox.dat' with 12221 points. Space is 3D, Field is 3D. Using method 'kdtree'.<br>
interpolator_interpolate: ERROR: invalid interpolator method from file 'fieldbox.dat'.</span></font><span style="font-size:12.0pt; font-family:"Times New Roman",serif" lang="EN-GB"></span></p>
<p class="MsoNormal" style="margin-bottom:0cm; line-height:normal"><span style="font-size:12.0pt; font-family:"Times New Roman",serif" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">The result is exactly the same with the
</span><span style="font-size:12.0pt; line-height:107%" lang="EN-GB"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">"<i>flipfield.dat</i>" file (provided in the "<i><a>\\mcstas-2.7\lib\data</a></i>" folder).</span></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">My instrument and field files are attached to this e-mail.</span><br>
<span style="font-size:12.0pt; line-height:107%" lang="EN-GB"></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB"><br>
</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">Has anyone already encountered this interpolator issue? Any clue to fix it?
<br>
</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">Should I arrange my input data in a different way? Use a different number of decimal places?<br>
</span></p>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB"><br>
</span></p>
<span style="font-size:12.0pt; line-height:107%" lang="EN-GB">Many thanks in advance for your help, kind regards,</span>
<p class="MsoNormal"><span style="font-size:12.0pt; line-height:107%" lang="EN-GB">Nicola<font size="3">s</font>
</span><span style="" lang="EN-GB"></span></p>
<div>
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px">
<div style="font-size:13px"><font size="3">_______________________________</font></div>
<div style="font-size:13px"><font size="3">Dr. Nicolas MARTIN<br>
</font><font size="3">Laboratoire Léon Brillouin<br>
UMR12 CEA-CNRS<br>
Bât 563 CEA Saclay - p. 105<br>
91191 Gif-sur-Yvette Cedex<br>
France</font><font size="3"><br>
</font><font size="3"><u><i>E-mail:</i></u> <a href="mailto:nicolas.martin@cea.fr" target="_blank" rel="noopener noreferrer">
nicolas.martin@cea.fr</a> / <a href="mailto:nicolas.martin84@gmail.com" target="_blank" rel="noopener noreferrer">
nicolas.martin84@gmail.com</a> <br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>