[mcstas-users] McStas component ESS_moderator

Peter Kjær Willendrup pkwi at fysik.dtu.dk
Fri Jun 12 13:57:13 CEST 2015


Dear Pascale,


Most of these can be safely ignored (those relating to -Wreturn-type), but I admit it looks a bit nasty… And unfortunately hid a slightly more important warning for my eyes:

The warning about -Wunused-value at the line  if(i==0)par3-14.27; indicates that there should have been an assignment inside - I am guessing it should have read  if(i==0)par3-=14.27;  - What do you think Troels?

As far as I can see, this bug only affects the i==0 setting corresponding the 5 degree beamport_angle setting… (Which I am guessing you are after for your instrument Pascale… :-( )


All of the above has (now) been fixed in our GitHub repository - the two affected files are also attached here… - Should be put either your working directory or in the share/ directory of your McStas 2.2a.

At some non-decided point I will release a source bundle with these fixes, also including a version that runs with the legacy McStas 1.12c...


Best and sorry for the inconvenience,

Peter
- On paternity leave until August :-)

On 11 Jun 2015, at 15:27 , Pascale Deen <pascale.deen at esss.se<mailto:pascale.deen at esss.se>> wrote:

Hello,
I am trying to run the moderator component

COMPONENT ESS_Source = ESS_moderator(
    isleft = 0.9, Lmin = 0.5, Lmax = 10, cold_frac = 0.5,
    dist = 2, focus_xw = 0.2, focus_yh = 0.2, yheight_c = 0.03,
    yheight_t = 0.03, n_pulses = 1, beamport_angle = 5,
    sourcedef = "2015", extraction_opening = 120)
  AT (0, 0, -0.1) RELATIVE Origin

but I get the following warnings:
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:409:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end of ESS_Mezei_cold_2012 */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:517:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end of ESS_Mezei_cold */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:622:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end of ESS_Mezei_thermal */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:639:1: warning: control reaches end of non-void function [-Wreturn-type]
} /* end of ESS_2012_Lieutenant_cold */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:693:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2013_Schoenfeldt_cold */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:719:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2014_Schoenfeldt_cold */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:851:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2013_Schoenfeldt_thermal */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:871:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2014_Schoenfeldt_thermal */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:894:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2015_Schoenfeldt_thermal */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:922:1: warning: control may reach end of non-void function [-Wreturn-type]
} /* end of ESS_2015_Schoenfeldt_cold */
^
/Applications/McStas-2.2a.app/Contents/Resources/mcstas/2.2a/sources/ESS_moderator.comp:959:17: warning: expression result unused [-Wunused-value]
    if(i==0)par3-14.27;
            ~~~~^~~~~~
11 warnings generated.
----------------------------------------------------
Pascale Deen
Instrument Scientist - Chopper Spectrometry
European Spallation Source ESS AB
P.O Box 176, SE-221 00 Lund, Sweden
Visiting address: Tunavägen 24 Lund

Adjunct Associate Professor
Niels Bohr Institute
University of Copenhagen

Mobile: +46 721 792 079
Phone: +46 46 888 3079
E-mail: pascale.deen at esss.se<mailto:pascale.deen at esss.se>

www.esss.se<http://www.esss.se/>

The European Spallation Source is a Partnership of 16 European Nations committed to the goal of collectively building and operating the world's leading facility for research using neutrons by the second quarter of the 21st Century

_______________________________________________
mcstas-users mailing list
mcstas-users at mcstas.org<mailto:mcstas-users at mcstas.org>
http://mailman.mcstas.org/cgi-bin/mailman/listinfo/mcstas-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20150612/0cc3b74b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ess_source-lib.h
Type: application/octet-stream
Size: 5698 bytes
Desc: ess_source-lib.h
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20150612/0cc3b74b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ess_source-lib.c
Type: application/octet-stream
Size: 40861 bytes
Desc: ess_source-lib.c
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20150612/0cc3b74b/attachment-0001.obj>


More information about the mcstas-users mailing list