Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3773a25
Remove Vitess_ChopperFermi
willend Nov 29, 2026
6a88329
Remove obsolete Beam_spy and SasView_model
willend Nov 29, 2026
5cbc90e
Remove code-specific event-file components
willend Nov 29, 2026
97a5dc0
Source_div: exit(-1) on zero divergence
willend Nov 29, 2026
b64f184
Add Test_Mask example
willend Nov 29, 2026
4934e69
Test_NMO, Test_FlatEllipse_finite_mirror: add %Test lines
willend Nov 29, 2026
e6250ad
RITA-II: run with defaults and add %Test
willend Nov 29, 2026
757da66
RITA-II: push SPLIT counts and PSD windows to the GPU
willend Nov 29, 2026
d0625d1
Refresh component example inventories
willend Nov 29, 2026
e31650d
Apply mccode-clangformat to Source_div and Virtual_output
willend Nov 29, 2026
2698b44
Guide_four_side: fix R0, table weight and uninitialised wall index; a…
willend Nov 29, 2026
811477d
multi_pipe: fix generated hole grid; add test
willend Nov 29, 2026
3e502bc
Pol_bender_tapering: absorb at top/bottom only before the exit; add test
willend Nov 29, 2026
0d99ac6
AF_HB_1D_process: exit(-1) on error; add Test_AF_HB_1D
willend Nov 29, 2026
cb9fec7
SiC: document the algorithm; add reflectometry test vs Multilayer_Sample
willend Nov 29, 2026
1d41896
Add Test_Sapphire_filter: Sapphire_Filter vs NCrystal_filter
willend Nov 29, 2026
b92606d
Add Test_PerfectCrystal: Si(111) backscattering vs NCrystal
willend Nov 29, 2026
690b353
Test_Guides: add Guide_gravity_psd and Guide_multichannel cases
willend Nov 29, 2026
07c80ee
Manuals: refresh Virtual_* snippets, drop Vitess_ChopperFermi mention
willend Nov 29, 2026
b3d1221
Refresh component example inventories
willend Nov 29, 2026
53bc5d3
Test_AF_HB_1D: define Ncount parameter used by %Test
willend Nov 29, 2026
0fa7373
SiC: add MCDISPLAY, note AI-written docs
willend Nov 29, 2026
5f72ba3
Sapphire_Filter: add exit aperture, rewrite docs
willend Nov 29, 2026
ec024ea
PerfectCrystal: move changelog into %D
willend Nov 29, 2026
9226dd3
Bispectral mirrors: fix back-side hits and transmit reflection, add d…
willend Nov 29, 2026
7a4a5c2
Cylindrical TOF monitors: skip end-cap exits, honour restore_neutron …
willend Nov 29, 2026
cd6bd59
Add Test_Monitors_flat: flat monitors vs PSD_monitor
willend Nov 29, 2026
975903a
Source_adapt: fix dropped DECLARE variables; add Test_Source_adapt
willend Nov 29, 2026
59fd956
Add Test_Source_multi_surfaces with mock spectra
willend Nov 29, 2026
0236d04
Refresh component example inventories
willend Nov 29, 2026
cad7443
Pol_bender: scale distance threshold with radius
willend Nov 29, 2026
099cc07
Union_abs_logger_1D_time: fix docs; add Test_abs_logger_1D_time
willend Nov 29, 2026
2f19353
Refresh component example inventories
willend Nov 29, 2026
8798dac
compmatrix.sh: fix sort order with LC_ALL=C; remove unused vitess fig…
willend Nov 29, 2026
2e29a80
SANS_Liposomes_Abs: fix zero output; test SANSCurve and SANS_Liposome…
willend Nov 29, 2026
6eadab8
Vertical_Bender: scale distance threshold with radius
willend Nov 29, 2026
f39670a
Pol_bender: fix reflectivity defaults doc; update Test_Pol_Bender ref…
willend Nov 29, 2026
2c71db2
Fix uninitialised values found by clang --analyze
willend Nov 29, 2026
6ca4b4c
Source_adapt: use rays per process for the adaption ramp under MPI
willend Nov 29, 2026
e7588d0
PerfectCrystal: define NAN when missing (nvc/OpenACC)
willend Nov 29, 2026
836b907
PerfectCrystal: make grandvec_target_circle GPU-callable
willend Nov 29, 2026
fd8efd8
SiC, Bispectral mirrors: write ranges as <code>0 < x < L</code> for m…
willend Nov 29, 2026
b58f475
SiC, Bispectral mirrors: write plate ranges in LaTeX math mode
willend Nov 29, 2026
c3237cf
Example instruments: write [parameters=values] instead of <...>
willend Nov 29, 2026
0c0d2a8
McXtrace example instruments: write [parameters=values] instead of <...>
willend Nov 29, 2026
a3b0f2d
Fix author/origin headers: SANSsimple, Source_div, Reflectometer, Tes…
willend Nov 29, 2026
b3cc4a4
McXtrace template_simple: plain-text placeholders; Guide_four_side: […
willend Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ jobs:
-DENSURE_MCPL=OFF \
-DENSURE_NCRYSTAL=OFF \
-DENABLE_CIF2HKL=ON \
-DENABLE_NEUTRONICS=OFF \
${EXTRA_ARGS_FOR_CMAKE}
cmake --build . --config Release
cmake --build . --target install --config Release
Expand Down Expand Up @@ -341,7 +340,6 @@ jobs:
-DBUILD_TOOLS=ON
-DENABLE_COMPONENTS=ON
-DENABLE_CIF2HKL=OFF
-DENABLE_NEUTRONICS=OFF
-DMPIINCLUDEDIR=%MPIINCVAR%
-DMPILIBDIR=%MPILIBVAR%

Expand Down Expand Up @@ -834,7 +832,6 @@ jobs:
-DENSURE_MCPL=OFF \
-DENSURE_NCRYSTAL=OFF \
-DENABLE_CIF2HKL=OFF \
-DENABLE_NEUTRONICS=OFF \
-DGSLFLAGS="-I/usr/local/include -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgsl -lgslcblas" \
-DNEXUSLIB=/usr/local/lib \
-DNEXUSINCLUDE=/usr/local/include \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/mcxtrace-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ jobs:
-DENSURE_MCPL=OFF \
-DENSURE_NCRYSTAL=OFF \
-DENABLE_CIF2HKL=ON \
-DENABLE_NEUTRONICS=OFF \
${EXTRA_ARGS_FOR_CMAKE}
cmake --build . --config Release
cmake --build . --target install --config Release
Expand Down Expand Up @@ -350,7 +349,6 @@ jobs:
-DBUILD_TOOLS=ON
-DENABLE_COMPONENTS=ON
-DENABLE_CIF2HKL=OFF
-DENABLE_NEUTRONICS=OFF
-DMPIINCLUDEDIR=%MPIINCVAR%
-DMPILIBDIR=%MPILIBVAR%

Expand Down Expand Up @@ -853,7 +851,6 @@ jobs:
-DENSURE_MCPL=OFF \
-DENSURE_NCRYSTAL=OFF \
-DENABLE_CIF2HKL=OFF \
-DENABLE_NEUTRONICS=OFF \
-DGSLFLAGS="-I/usr/local/include -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lgsl -lgslcblas" \
-DNEXUSLIB=/usr/local/lib \
-DNEXUSINCLUDE=/usr/local/include \
Expand Down
1 change: 0 additions & 1 deletion devel/bin/mccode-build-conda
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def mccode_build_conda ( cfg ):
'-DENSURE_MCPL=OFF',
'-DENSURE_NCRYSTAL=OFF',
'-DENABLE_CIF2HKL=OFF',
'-DENABLE_NEUTRONICS=OFF',
'-G',GENERATOR]
cmd += extra_args

Expand Down
16 changes: 8 additions & 8 deletions docs/manuals/mcstas/contrib/Guide_four_side.tex
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ \subsection*{Input parameters}
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
RIreflect & & (str) Name of relfectivity file for the right inner wall. & 0 \\
LIreflect & & (str) Name of relfectivity file for the left inner wall. & 0 \\
UIreflect & & (str) Name of relfectivity file for the top inner wall. & 0 \\
DIreflect & & (str) Name of relfectivity file for the bottom inner wall. & 0 \\
ROreflect & & (str) Name of relfectivity file for the right outer wall. & 0 \\
LOreflect & & (str) Name of relfectivity file for the left outer wall. & 0 \\
UOreflect & & (str) Name of relfectivity file for the top outer wall. & 0 \\
DOreflect & & (str) Name of relfectivity file for the bottom outer wall. & 0 \\
RIreflect & str & Name of reflectivity file for the right inner wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
LIreflect & str & Name of reflectivity file for the left inner wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
UIreflect & str & Name of reflectivity file for the top inner wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
DIreflect & str & Name of reflectivity file for the bottom inner wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
ROreflect & str & Name of reflectivity file for the right outer wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
LOreflect & str & Name of reflectivity file for the left outer wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
UOreflect & str & Name of reflectivity file for the top outer wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
DOreflect & str & Name of reflectivity file for the bottom outer wall. File columns [q(\AA{}-1) R(0-1)] (DEFAULT : no file) & 0 \\
w1l & m & Width at the left guide entry (positive x-axis) (DEFAULT = 0) & 0.002 \\
w2l & m & Width at the left guide exit (positive x-axis) (DEFAULT = 0) & 0.002 \\
linwl & m & left horizontal wall: distance of 1st focal point and guide entry (DEFAULT = 0) & 0 \\
Expand Down
6 changes: 5 additions & 1 deletion docs/manuals/mcstas/contrib/Mirror_Curved_Bispectral.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ \subsection*{Identification}
\end{itemize}

\subsection*{Description}
Single curved mirror plate for e.g. a bispectral extraction inside an elliptic guide. In local coordinates x is the guide axis (beam direction) and the plate passes through the origin, spanning $-\mathtt{length}/2 \le x \le \mathtt{length}/2$. Its shape in the x-z plane is z(x) = a1*x\textasciicircum{}3 + b1*x\textasciicircum{}2 + c1*x, with slopes given by the angles theta\_1, theta\_2 and theta\_3 at the start, centre and end. Its half height follows the elliptic guide (focus\_s, focus\_e, smallaxis), or is yheight/2 before guide\_start. Rotate the component so that local x points along the beam, e.g. ROTATED (0, -90, 0) for a beam along z. Reflectivity uses a built-in m-value supermirror model (R0=0.99, Qc=0.0217 \AA{}\textasciicircum{}-1) or a reflectivity file. With transmit=1 non-reflected neutrons pass the plate with substrate and coating attenuation; neutrons with velocity along the normal sin(theta)*e\_x - cos(theta)*e\_z hit the back side.

This description was written with AI assistance (Claude Code, 2026) from the component code, after a long history in McStas without sufficient documentation or an example instrument.

Example: Mirror\_Curved\_Bispectral(focus\_s=-10, focus\_e=10, mirror\_start=-0.1, guide\_start=-0.1, yheight=0.05, smallaxis=1, length=0.2, m=2, theta\_1=1, theta\_2=1, theta\_3=1)

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.
Expand All @@ -26,7 +30,7 @@ \subsection*{Input parameters}
\textbf{guide\_start} & m & start of guide in ABSOLUTE COORDINATES & \\
\textbf{yheight} & m & the height of the mirror when not in the guide & \\
\textbf{smallaxis} & m & the smallaxis of the guide & \\
\textbf{length} & m & the length of the mirror R0=0.99: [] low angle reflectivity & \\
\textbf{length} & m & the length of the mirror & \\
\textbf{m} & & m-value of material & \\
transmit & 0/1 & 0: non reflected neutrons are absorbed. 1: non reflected neutrons pass through & 0 \\
substrate\_thickness & m & thickness of substrate (for absorption) & 0.0005 \\
Expand Down
6 changes: 5 additions & 1 deletion docs/manuals/mcstas/contrib/Mirror_Elliptic_Bispectral.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ \subsection*{Identification}
\end{itemize}

\subsection*{Description}
Single elliptic mirror plate: one side wall of an elliptic guide, for e.g. a bispectral extraction. In local coordinates x is the guide axis (beam direction) and the plate spans $0 \le x \le \mathtt{length}$, starting at mirror\_start along the axis. The wall lies on the z\textgreater{}0 half of the horizontal ellipse with foci at focus\_start\_w and focus\_end\_w and small axis smallaxis\_w, centred on z=0. Its half height follows the vertical ellipse (focus\_start\_h, focus\_end\_h, smallaxis\_h). Rotate the component so that local x points along the beam, e.g. ROTATED (0, -90, 0) for a beam along z. Reflectivity uses a built-in m-value supermirror model (R0=0.99, Qc=0.0217 \AA{}\textasciicircum{}-1) or a reflectivity file. With transmit=1 non-reflected neutrons pass the plate with substrate and coating attenuation.

This description was written with AI assistance (Claude Code, 2026) from the component code, after a long history in McStas without sufficient documentation or an example instrument.

Example: Mirror\_Elliptic\_Bispectral(focus\_start\_w=-10, focus\_end\_w=10, focus\_start\_h=-10, focus\_end\_h=10, mirror\_start=9.5, m=2, smallaxis\_w=0.1, smallaxis\_h=1, length=0.2)

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.
Expand All @@ -28,7 +32,7 @@ \subsection*{Input parameters}
\textbf{m} & & m-value of material & \\
\textbf{smallaxis\_w} & m & Small-axis dimension of horizontal ellipse & \\
\textbf{smallaxis\_h} & m & Small-axis dimension of vertical ellipse & \\
\textbf{length} & m & the length of the mirror R0=0.99: [] low angle reflectivity & \\
\textbf{length} & m & the length of the mirror & \\
transmit & 0/1 & 0: non reflected neutrons are absorbed. 1: non reflected neutrons pass through & 0 \\
substrate\_thickness & m & thickness of substrate (for absorption) & 0.0005 \\
coating\_thickness & m & thickness of coating (for absorption) & 10e-6 \\
Expand Down
17 changes: 6 additions & 11 deletions docs/manuals/mcstas/contrib/PerfectCrystal.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
\section{The \texttt{PerfectCrystal} McStas Component}
Based on a perfect crystal component by: Miguel A. Gonzalez, A. Dianoux June 2013 (ILL)

Changelog:
Version 1.1
- BUGFIX: correct neutron energy shift in Doppler mode
- added option 'debyescherrer' to select analyzer geometry
- added option 'facette' to approximate analyzer sphere by small, flat crystals

Version 1.0
- inital release

\subsection*{Identification}
\begin{itemize}
\item \textbf{Author:} Markus Appel
Expand All @@ -28,6 +19,10 @@ \subsection*{Description}

IN16B (ILL) Si111 Doppler monochromator: PerfectCrystal(radius=2.165, lambda=6.2708, sigma=0.24e-3, width = 0.500, height = 0.250, centerfocus=0, speed = 4.7, amplitude = 0.075, exclusive=1)

Changelog: Version 1.1 - BUGFIX: correct neutron energy shift in Doppler mode - added option 'debyescherrer' to select analyzer geometry - added option 'facette' to approximate analyzer sphere by small, flat crystals

Version 1.0 - initial release

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

Expand All @@ -38,12 +33,12 @@ \subsection*{Input parameters}
\endhead
ttmin & deg & Minimum horizontal analyzer coverage angle (option 1) & NAN \\
ttmax & deg & analyzer coverage angle in horizontal xz-plane between -180 and 180 & NAN \\
tt0 & deg & Horizontal angular center of the analyzer coverage (option 2) & NAN \\
tt0 & deg & Horizontal angular center of the analyzer coverage (options 2 and 3) & NAN \\
ttwidth & deg & horizontal coverage as center and full width & NAN \\
width & m & absolute width & NAN \\
phimin & deg & Minimum vertical analyzer coverage angle (option 1) & NAN \\
phimax & deg & vertical analyzer coverage between -90 and 90 (-180 and 180 if debyescherrer==1) option 2 & NAN \\
phi0 & deg & Vertical angular center of the analyzer coverage (option 2) & NAN \\
phi0 & deg & Vertical angular center of the analyzer coverage (options 2 and 3) & NAN \\
phiwidth & deg & vertical coverage as center and full width option 3 & NAN \\
height & m & absolute height (only if debyescherrer==0) & NAN \\
debyescherrer & -180...180 & (0/1) bend analyzer following a Debye-Scherrer ring along scattering angle tt (twotheta) (phi = & 0 \\
Expand Down
10 changes: 8 additions & 2 deletions docs/manuals/mcstas/contrib/Sapphire_Filter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ \section{The \texttt{Sapphire\_Filter} McStas Component}

\subsection*{Identification}
\begin{itemize}
\item \textbf{Author:} Jonas Okkels Birk (based upon Filteg\_Graphite by Thomas C Hansen (2000))
\item \textbf{Author:} Jonas Okkels Birk (based upon Filter\_graphite by Thomas C Hansen (2000))
\item \textbf{Origin:} PSI
\item \textbf{Date:} 6 December 2006
\end{itemize}

\subsection*{Description}
ESCRIPTION

This sapphire filter, defined by two identical rectangular opening apertures, is based upon an absorption function absorp=exp(L*A+C*(exp(-(B/L\textasciicircum{}2+D/L\textasciicircum{}4)))) decribed by Freund (1983) Nucl. Instrum. Methods, A278, 379-401. The defaultvalues is for Sapphire at 300K as found by measurement by (Mildner \& Lamaze (1998) J. Appl. Cryst. 31,835-840 ( http://journals.iucr.org/j/issues/1998/06/00/hw0070/hw0070bdy.html\#BB4)). It is possble to ajust the formular to other materials or temperatures by typing in other parameters. The transmission in sapphire is only lightly demependt on temperature, but The formular is only cheked at wavelenths between 0.5 and 14 \AA{} (0.4 meV 0.3 eV). The filter is for example used in the Eiger beamline at PSI to cut of high energies.
Sapphire filter defined by two identical rectangular apertures (entrance and exit). The transmission is T = exp(-mu*len) with the attenuation fit mu(lambda) = A*lambda + C*(1-exp(-B/lambda\textasciicircum{}2 - D/lambda\textasciicircum{}4)) described by Freund (1983) Nucl. Instrum. Methods, A278, 379-401. The default values are for sapphire at 300K as measured by Mildner \&

\begin{verbatim}
Lamaze (1998) J. Appl. Cryst. 31, 835-840
\end{verbatim}

( http://journals.iucr.org/j/issues/1998/06/00/hw0070/hw0070bdy.html\#BB4). The fit can be adjusted to other materials or temperatures by changing the parameters. The transmission of sapphire depends only weakly on temperature. The fit is only checked for wavelengths between 0.5 and 14 \AA{} (0.4 meV to 0.3 eV). The filter is used, for example, at the EIGER beamline at PSI to cut off high energies.

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.
Expand Down
18 changes: 15 additions & 3 deletions docs/manuals/mcstas/contrib/SiC.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\section{The \texttt{SiC} McStas Component}
SiC layer sample
Reflectivity of a thin layer on a Si substrate (Born approximation)

\subsection*{Identification}
\begin{itemize}
Expand All @@ -9,9 +9,21 @@ \subsection*{Identification}
\end{itemize}

\subsection*{Description}
SiC layer sample
Flat reflectometry sample in the local z=0 plane, covering $0 \le x \le \mathtt{xlength}$ and $0 \le y \le \mathtt{yheight}$. Neutrons hitting the plate are specularly reflected (from either side); all others pass unaffected. Note: the component origin is at a corner of the plate, not at its centre as for other mirrors and samples.

Example: SiC()
The reflectivity is computed in the Born (kinematic) approximation from a hard-coded scattering length density (SLD) profile, sampled in 1 \AA{} steps:

\begin{verbatim}
R(q) = 16 pi^2 / q^4 * | sum_z dSLD/dz exp(-i q z) |^2
\end{verbatim}

The profile is a 80 \AA{} layer of SLD 7.3106e-6 \AA{}\textasciicircum{}-2 (presumably the SiC film; bulk SiC is about 5.2e-6 \AA{}\textasciicircum{}-2) on a Si substrate of SLD 2.073e-6 \AA{}\textasciicircum{}-2. Below Qc = 0.010208 \AA{}\textasciicircum{}-1 (the Si substrate value) R = 1.

The Born approximation underestimates R by about 20-35\% for q below about 3 times the Qc of the layer, compared with the exact Parratt result (see Test\_SiC, which compares with Multilayer\_Sample).

This description was written with AI assistance (Claude Code, 2026) from the component code, after a long history in McStas without sufficient documentation or an example instrument.

Example: SiC(xlength=0.2, yheight=0.02)

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.
Expand Down
2 changes: 1 addition & 1 deletion docs/manuals/mcstas/contrib/TOF2Q_cyl_monitor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ \subsection*{Input parameters}
q\_min & 1/\AA{} & Minimum q value & 0 \\
q\_max & 1/\AA{} & Maximum q value & 20 \\
L\_chop2samp & m & Distance from resolution chopper to sample position & 144.0 \\
t\_chop & ms & Flight time of mean wave length from source to resolution chopper & 0.004 \\
t\_chop & ms & Flight time of mean wave length from source to resolution chopper & 4 \\
pixel & 1 & Flag, 0: no pixelation and perfect time. 1: make pixels from nphi and nh and time resolution limitation. & 1 \\
\bottomrule
\end{longtable}
Expand Down
8 changes: 4 additions & 4 deletions docs/manuals/mcstas/contrib/multi_pipe.tex
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ \subsection*{Input parameters}
\midrule
\endhead
filename & str & define user table of holes & 0 \\
\textbf{xmin} & m & Lower x bound & \\
\textbf{xmax} & m & Upper x bound & \\
\textbf{ymin} & m & Lower y bound & \\
\textbf{ymax} & m & Upper y bound & \\
xmin & m & Lower x bound & 0 \\
xmax & m & Upper x bound & 0 \\
ymin & m & Lower y bound & 0 \\
ymax & m & Upper y bound & 0 \\
radius & m & radius of a single hole & 0.0 \\
gap & m & distance between holes & 0.0 \\
thickness & m & thickness of the pipe & 0.0 \\
Expand Down
Loading
Loading