[mcstas-users] [EXTERNAL] Multiple samples in a single mcstas instrument?
Wildgruber, Christoph U.
wildgrubercu at ornl.gov
Mon Jul 15 20:29:25 CEST 2019
Hi again,
so here is a little update…
To get my instrument with multiple instances of SANSCurve.comp (attached) compiled I had to
- or at least thats what I thought - move the functions “CountLines” and “LoadCurve” into the
main body of the instr(ument) file (attached). However despite the uneventful execution of
the code only the first of the five I(q) data sets was used to simulate a SANS curve.
Being suspicious about my understanding of how ‘split’ should/would work I cloned SANSCurve.comp
and used SANSCurve_1.comp … SANSCurve_5.comp.
Again the code ran without problems but still ignored all but the first I(q) data I specified.
At this point I started to wonder if there is a problem with the scope of the variables
- especially “Q’ and ‘I’ - as defined in SANSCurve.
After renaming ‘I’ to “I-1’ … ‘I-5’ and ‘Q’ to ‘Q-1 … Q-5’ in my SANSCurve Clones I got the desired results.
I consulted the manual (and Lee Robertson :-) but still could not figure out how I should modifiy
my instrument and/or SANSCurve.comp.
I suspect there is a right way to do it and I am curious how that would look like.
Any ideas/suggestions?
Thanks so much,
Uli
> On 12 Jul 2019, at 09:26, Erik B Knudsen <erkn at fysik.dtu.dk> wrote:
>
> Hi Uli,
> Excellent! Great news. Always happy to help!
> When it all works and you are satisfied with it - please consider
> contributing your instrument file to the project. It might help other
> users 8-).
>
> cheers
> Erik
>
> On 12/07/2019 14:21, Wildgruber, Christoph U. wrote:
>> Hi Erik & Peter,
>>
>> it is working really well and I’d say it is pretty efficient :-)
>> The only other thing I had to do was to move two function definition
>> from SANSCurve inot the
>> instrument to avoid ‘redefinition’ complaints from the compiler.
>> All I need to do now is to make sure the output is valid…
>>
>> Thanks again for your help,
>>
>> Uli
>>
>>
>>> On 11 Jul 2019, at 14:28, Wildgruber, Christoph U.
>>> <wildgrubercu at ornl.gov <mailto:wildgrubercu at ornl.gov>> wrote:
>>>
>>> Hi Erik,
>>>
>>> thanks for the immediate response, I’ll give it a try right away…
>>> The error message threw me off...
>>>
>>> Thanks, again
>>>
>>> Uli
>>>
>>>
>>>> On 11 Jul 2019, at 14:23, Erik B Knudsen <erkn at fysik.dtu.dk
>>>> <mailto:erkn at fysik.dtu.dk>> wrote:
>>>>
>>>> Dear Christoph,
>>>>
>>>> In your instrument file there are two missing ; (line 186 and 194), a
>>>> switched %} line 187, and a double '==' where it should say '=' (line
>>>> 187). Some of these were due to me being a bit too fast of the mark this
>>>> morning, so sorry for that. The attached version has these things fixed
>>>> - I can't test it completely since I lack your SANS-component but it
>>>> should get you a bit further. Good Luck!
>>>>
>>>> cheers
>>>> Erik
>>>>
>>>>
>>>> On 11/07/2019 19:57, Wildgruber, Christoph U. wrote:
>>>>> Hi again,
>>>>>
>>>>> so I did try the basic ‘SPLIT 2’ approach but I end up with an
>>>>> unexpected compile time error (RHEL 7, mcstas 2.5, mpi enabled)…
>>>>> I must be missing something really basic…
>>>>>
>>>>> Here is the result:
>>>>> ==============
>>>>>
>>>>> Setting environment:
>>>>> MCSTAS_OVERRIDE=
>>>>> /usr/local/mcstas/2.5/tools/Python/mcgui/../mccodelib/../../..
>>>>>
>>>>> MCSTAS_CFLAGS_OVERRIDE=
>>>>> -g -O2 -lm
>>>>>
>>>>> MCSTAS_CC_OVERRIDE=
>>>>> gcc
>>>>>
>>>>> MCSTAS_MPICC_OVERRIDE=
>>>>> mpicc
>>>>>
>>>>> mcrun -c BER_SANS_guide_elliptical_optimize_2.1.instr -n0
>>>>>
>>>>> INFO: No output directory specified (--dir)
>>>>> INFO: Using directory:
>>>>> "BER_SANS_guide_elliptical_optimize_2.1_20190711_134948"
>>>>> INFO: Regenerating c-file: BER_SANS_guide_elliptical_optimize_2.1.c
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:246.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:258.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:266.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:274.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:284.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:294.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:304.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:314.
>>>>> Info: 'PSD_monitor_rad' is a contributed component.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:321.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:328.
>>>>> Info: 'SANSQMonitor' is a contributed component.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:338.
>>>>> Reference to undefined component instance a1 at line
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr:347.
>>>>> McStas: 12 Errors encountered during parse of
>>>>> BER_SANS_guide_elliptical_optimize_2.1.instr.
>>>>> compile thread done
>>>>>
>>>>>
>>>>> I attach the instr file in case you get a chance to try to compile it…
>>>>>
>>>>> So what is going on?
>>>>>
>>>>>
>>>>> Thanks so much,
>>>>>
>>>>>
>>>>> Uli
>>>>>
>>>>
>>>> --
>>>> Erik Bergbäck Knudsen, Research Engineer | DTU | morituri
>>>> NEXMAP, DTU Fysik, DK-2800 Kgs. Lyngby, Denmark |<>-<>| te
>>>> phone: (+45) 2132 6655 |<>-<>| salutant
>>>> <SANS_test.instr>
>>>
>>
>
> --
> Erik Bergbäck Knudsen, Research Engineer | DTU | morituri
> NEXMAP, DTU Fysik, DK-2800 Kgs. Lyngby, Denmark |<>-<>| te
> phone: (+45) 2132 6655 |<>-<>| salutant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20190715/e6e39ac4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SANSCurve.comp
Type: application/octet-stream
Size: 6035 bytes
Desc: SANSCurve.comp
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20190715/e6e39ac4/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BER_SANS.instr
Type: application/octet-stream
Size: 18434 bytes
Desc: BER_SANS.instr
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20190715/e6e39ac4/attachment-0003.obj>
More information about the mcstas-users
mailing list