Contents
Preface and acknowledgments
Preface and acknowledgments
1
Introduction to McStas
1.1
Development of Monte Carlo neutron simulation
1.2
Scientific background
1.3
The design of McStas
1.4
Overview
2
Monte Carlo Techniques and simulation strategy
2.1
Neutron spectrometer simulations
2.2
The neutron weight
2.3
Weight factor transformations during a Monte Carlo choice
2.4
Adaptive and Stratified sampling
2.5
Accuracy of Monte Carlo simulations
3
Running McStas
3.1
Installation and updates
3.2
Brief introduction to the graphical user interface
3.3
Running the instrument compiler
3.4
Running the simulations
3.5
Using simulation front-ends
3.6
Data formats - Analyzing and visualizing the simulation results
3.7
Using MPI for parallel computing
4
The McStas kernel and meta-language
4.1
Notational conventions
4.2
Syntactical conventions
4.3
Writing instrument definitions
4.4
Writing instrument definitions - complex arrangements and syntax
4.5
Writing component definitions
4.6
Extending component definitions
4.7
McDoc, the McStas library documentation tool
5
Polarisation in McStas
5.1
The Polarization Vector
5.2
Polarized Neutron Scattering
5.3
Magnetic fields: the precession algorithm and field framework
5.4
Polarisation components in McStas
5.5
Test and example instruments
6
Links to other computing codes
6.1
McStas and MANTID
6.2
McStas and MCNP(X)
7
The component library: Abstract
7.1
Component categories
7.2
Data files
7.3
Component and instrument examples
8
Instrument examples
8.1
A quick tour of instrument examples
8.2
A test instrument for the component V_sample
8.3
The triple axis spectrometer TAS1
8.4
The time-of-flight spectrometer PRISMA
A
Random numbers in McStas
A.1
Transformation of random numbers
A.2
Random generator
B
Libraries and constants
B.1
Run-time calls and functions (
mcstas-r
)
B.2
Reading a data file into a vector/matrix (Table input,
read_table-lib
)
B.3
Monitor_nD Library
B.4
Adaptive importance sampling Library
B.5
Vitess import/export Library
B.6
Constants for unit conversion etc.
C
The McStas terminology
Bibliography
Bibliography
Index and keywords
Index
User and Programmers Guide to the Neutron Ray-Tracing Package McStas, version 3.8.6
[
next
] [
tail
] [
up
]
Contents
Preface and acknowledgments
1
Introduction to McStas
1.1
Development of Monte Carlo neutron simulation
1.2
Scientific background
1.2.1
The goals of McStas
1.3
The design of McStas
1.4
Overview
2
Monte Carlo Techniques and simulation strategy
2.1
Neutron spectrometer simulations
2.1.1
Monte Carlo ray tracing simulations
2.2
The neutron weight
2.2.1
Statistical errors of non-integer counts
2.3
Weight factor transformations during a Monte Carlo choice
2.3.1
Direction focusing
2.4
Adaptive and Stratified sampling
2.5
Accuracy of Monte Carlo simulations
3
Running McStas
3.1
Installation and updates
3.1.1
Important note for Windows users
3.1.2
New releases of McStas
3.2
Brief introduction to the graphical user interface
3.3
Running the instrument compiler
3.3.1
Code generation options
3.3.2
Specifying the location of files
3.3.3
Embedding the generated simulations in other programs
3.3.4
Running the C compiler
3.4
Running the simulations
3.4.1
Choosing an output data file format
3.4.2
Basic import and plot of results
3.4.3
Interacting with a running simulation
3.4.4
Optimizing simulation speed
3.4.5
Optimizing instrument parameters
3.5
Using simulation front-ends
3.5.1
The graphical user interface (mcgui)
3.5.2
Running simulations on the commandline (mcrun)
3.5.3
GPU acceleration via OpenACC
3.5.4
Graphical display of simulations (mcdisplay)
3.5.5
Plotting the results of a simulation (mcplot)
3.5.6
Plotting resolution functions (mcresplot)
3.5.7
Creating and viewing the library, component/instrument help and Manuals (mcdoc)
3.5.8
Self-testing the installation (mctest, mcviewtest)
3.6
Data formats - Analyzing and visualizing the simulation results
3.6.1
The McStas/McCode text format
3.6.2
NeXus format
3.7
Using MPI for parallel computing
3.7.1
Parallel computing (MPI)
3.7.2
McRun options for MPI
3.7.3
McStas/MPI Performance
3.7.4
MPI Bugs and limitations
4
The McStas kernel and meta-language
4.1
Notational conventions
4.2
Syntactical conventions
4.3
Writing instrument definitions
4.3.1
The instrument definition head
4.3.2
The
DEPENDENCY
line
4.3.3
The
SEARCH
line
4.3.4
The
SHELL
line
4.3.5
The
DECLARE
section
4.3.6
The
USERVARS
section
4.3.7
The
INITIALIZE
section
4.3.8
The
NEXUS
extension
4.3.9
The
TRACE
section
4.3.10
The
SAVE
section
4.3.11
The
FINALLY
section
4.3.12
The end of the instrument definition
4.3.13
Code for the instrument
vanadium_example.instr
4.4
Writing instrument definitions - complex arrangements and syntax
4.4.1
Embedding instruments in instruments TRACE
4.4.2
Groups and component extensions - GROUP - EXTEND
4.4.3
Duplication of component instances - COPY
4.4.4
Conditional components - WHEN
4.4.5
Component loops and non sequential propagation - JUMP
4.4.6
Enhancing statistics reaching components - SPLIT
4.4.7
Attaching metadata to components and instruments - METADATA
4.5
Writing component definitions
4.5.1
The component definition header
4.5.2
The
NOACC
flag
4.5.3
The
DEPENDENCY
line
4.5.4
The
DECLARE
section
4.5.5
The
SHARE
section
4.5.6
The
INITIALIZE
section
4.5.7
The
TRACE
section
4.5.8
The
SAVE
section
4.5.9
The
FINALLY
section
4.5.10
The
MCDISPLAY
section
4.5.11
The end of the component definition
4.5.12
A component example: Slit
4.6
Extending component definitions
4.6.1
Extending from the instrument definition
4.6.2
Component heritage and duplication
4.7
McDoc, the McStas library documentation tool
4.7.1
Documentation generators mcdoc and mcgui
4.7.2
The format of the comments in the library source code
5
Polarisation in McStas
5.1
The Polarization Vector
5.1.1
Example: Magnetic fields
5.2
Polarized Neutron Scattering
5.2.1
Example: Nuclear scattering
5.2.2
Example: Polarizing Monochromator and Guides
5.3
Magnetic fields: the precession algorithm and field framework
5.3.1
The magnetic field stack
5.3.2
Numerical spin precession:
SimpleNumMagnetPrecession
5.3.3
Available field functions
5.4
Polarisation components in McStas
5.4.1
Setting and analysing polarisation
5.4.2
Polarising monochromators, mirrors and guides
5.4.3
Magnetic field components
5.4.4
Polarisation-sensitive monitors
5.4.5
Samples and polarisation
5.5
Test and example instruments
5.5.1
Component-level regression tests
5.5.2
Test_Pol_TripleAxis
5.5.3
He3_spin_filter
5.5.4
A spin-echo example: SE_example
6
Links to other computing codes
6.1
McStas and MANTID
6.1.1
System requirements
6.1.2
Requirements for the instrument file
6.1.3
Compiling and running your simulation for Mantid output
6.1.4
Looking at instrument output in Mantid
6.2
McStas and MCNP(X)
7
The component library: Abstract
7.1
Component categories
7.2
Data files
7.3
Component and instrument examples
8
Instrument examples
8.1
A quick tour of instrument examples
8.1.1
Templates
8.1.2
Risoe
8.1.3
ISIS
8.1.4
ILL
8.1.5
ESS
8.1.6
Union_demos, Union_sample_environments, Union_validation
8.1.7
NCrystal
8.1.8
Tests_* categories
8.1.9
Other facility categories
8.2
A test instrument for the component V_sample
8.2.1
Scattering from the V-sample test instrument
8.3
The triple axis spectrometer TAS1
8.3.1
Simulated and measured resolution of TAS1
8.4
The time-of-flight spectrometer PRISMA
8.4.1
Simple spectra from the PRISMA instrument
A
Random numbers in McStas
A.1
Transformation of random numbers
A.2
Random generator
B
Libraries and constants
B.1
Run-time calls and functions (
mcstas-r
)
B.1.1
Neutron propagation
B.1.2
Coordinate and component variable retrieval
B.1.3
Coordinate transformations
B.1.4
Mathematical routines
B.1.5
Output from detectors
B.1.6
Ray-geometry intersections
B.1.7
Random numbers
B.2
Reading a data file into a vector/matrix (Table input,
read_table-lib
)
B.3
Monitor_nD Library
B.4
Adaptive importance sampling Library
B.5
Vitess import/export Library
B.6
Constants for unit conversion etc.
C
The McStas terminology
Bibliography
Index and keywords
[
next
] [
front
] [
up
]