McStas - A neutron ray-trace simulation package
McStas is a general tool for simulating neutron scattering instruments
and experiments. It is actively supported by
DTU Physics,
NBI KU,
ESS,
PSI and
ILL.
Simulated
scattering from a hollow-cylinder vanadium
sample.
| The plot shows the intensity of scattered neutrons (red is
highest intensity). The sample is at the center of the sphere with the
neutron beam coming from the left. Clearly seen is the shadowing effect
of the sample causing a lower intensity opposite the beam. Also seen is
the effect of the non-symmetric geometry of the sample, causing lower intensity
directly above and to the side of the sample.
|  |
Recent news
Migrating from McStas 2.x to 3.x? - Use the wiki-based guides
February 19th, 2025: McStas and McXtrace 3.5.24 released
Dear all,
McStas and McXtrace release 3.5.24 is now available - McStas installation
instructons on GitHub .
What's Changed
Important note
- McStas and McXtrace will soon change organisation-name on GitHub - from McStasMcXtrace -> mccode-dev
Components and instruments
Interfaces and interoperability with other codes
- Thanks to @g5t for ping-pong on this :)
- [Feature]
mccode-antlr
is an alternative code-generator for McStas and McXtrace - a new development by @g5t and based on ANTLR
instead of lex/yacc
. The new tool is mainly written in python and thus has a lower barrier for changes in language syntax and code generation. The tool implementations mcstas-antlr
and mcxtrace-antlr
are thus a candidate implementations to potentially replace the classic mcstas
and mcxtrace
code generators in the future. Current status is that
- McStas:
mcstas-antlr
is fully feature complete wrt. mcstas
for CPU simulations and close to complete for GPU simulations
- McXtrace: Not all instruments will compile using
mcxtrace-antlr
but basic functionality is in place
- To try:
- Install
mccode-antlr
from conda-forge
or via pip
- Adapt your configuration to use e.g.
mcstas-antlr
by
- Setting the new
--cogen=mcstas-antlr
option in mcrun
- Enable or edit the
MCCOGEN
field of mccode_config.json
using the new Save/Edit configuration
in mcgui
- (The antlr tools default to download comps etc. to an internal cache: Add e.g.
-I${MCSTAS}
to prefer ingredients fromyour local library)
- Use the
mcrun-antlr/mxrun-antlr
tools provided directly by mccode-antlr
- Debian/Ubuntu
- Windows
- [Feature] NCrystal is now available with McStas on Windows
- [Info] Windows via cross-compiled
.exe
installer from mccode.org
:
Please place the MCPL-related .bat
files from the extras
folder in e.g. c:\mcstas-3.5.24\bin
to enable MCPL
(May require giving your user 'full access' permissions to the bin folder)
- [Info] Windows via conda-forge: MCPL is not yet available but expected during the spring
Full Changelog: https://github.com/McStasMcXtrace/McCode/compare/v3.5.16...v3.5.24
January 8th, 2025: Monte Carlo Satellite to ICNS2025
Dear all,
The ICNS2025 conference is
taking place in Copenhagen and Lund this summer, and the abstract
submission is closing January 15th - in one week.
Of special interest to McStas users:
A satellite event is being planned for July 11th, arranged by Mads Bertelsen, ESS and Peter Willendrup DTU/ESS.
We envision a one-day event with contributed talks on instrument simulation and its use, abstract submission will open soon:
Advanced computer simulations methods for neutron scattering instruments
Abstract:
Neutron scattering relies heavily on computer simulations of neutron scattering instrumentation to optimize their performance. These simulation tools are also evolving to be more relevant for a running facility, aiding in both preparation and analysis for individual experiments. It is even becoming possible to make better decisions during experiments by running simulations in parallel.
All the best and hope to see you this summer in Copenhagen,
Peter Willendrup
Previous news items: 2024,
2023, 2022, 2021,2020,2019, 2018, 2017, 2016,
2015, 2014, 2013,
2012, 2011, 2010, 2009,
2008, 2007, 2006,
2005, 2004, 2003, 2002, 2001, 2000, 1999,
1998.
Last Modified: Wednesday, 19-Feb-2025 13:26:01 CET