Releases: mctools/ncrystal
NCrystal release 0.9.10
- This release represents a large amount of work in many areas, and in particular focusing on aspects of Bragg diffraction in single crystals.
- The Gaussian mosaicity modelling code was completely reimplemented, going back to the fundamental equations and making sure everything is carried out in a consistent and precise manner. Cross-section evaluation automatically selects between efficient numerical Romberg integrations and evaluation of new improved closed-form expressions, which takes the relevant spherically geometric into account. The code thus now gracefully handles everything from backscattering to forward scattering scenarios, and a large dynamic range of mosaicities, covering at least a range of 0.01arcseconds to tens of degrees. Despite this, computational speed is also improved, thanks to various enhancements and in particular faster code for searching through the available plane normals. A new parameter, mosprec, can be used to tune the tradeoff between precision and speed. The default value of 1e-3 is likely adequate for almost all users.
- Introducing a completely new and precise modelling of layered crystals, with the LCBragg class. This class, primarily intended to be used for modelling of Pyrolythic Graphite, by default takes the rotational aspects of such crystal into account using an from-first-principles approach to figuring out which sets of normals will contribute to the scattering cross-sections, and then finding the exact contribution through efficient numerical integrals. A crystal is considered to be a layered crystal if it has the lcaxis vector parameter set. Additionally, the lcmode parameter can be used to select slower reference parameters, which simply sample an SCBragg single-crystal instance many times, in different rotated systems.
- Huge speedup when modelling low-wavelength (<1Aa) neutrons in single crystals: Approximate the very large number of very weak and uninteresting scatter planes at 2*d-spacings < 1Aa with an isotropic mosaicity distribution, which is a rather appropriate approximation due to the very large number of very weak planes involved. The cutoff value of dspacing=0.5Aa can be modified with the new sccutoff parameter.
- Bragg diffraction in powders and polycrystals was never slow, but the PCbragg class was nonetheless rewritten to become even faster by working on energies directly, avoiding internal conversions to wavelength at each call.
- Embedded an NCRYSTALMATCFG[lcaxis=0,0,1] statement in the data file C_sg194_pyrolytic_graphite.ncmat, so that it will by default be modelled as a layered crystal with the correct rotation axis, which is likely what almost all users will want.
- Calling generateScattering where cross-sections are vanishing now generally leads to nothing happening (i.e. scatter_angle = 0 and delta_ekin=0) rather than the previous fallback of isotropic elastic scattering.
- Retire RandSimple and introduce instead RandXRSR implementing the xoroshiro128+ generator. This means that the fall-back RNG option shipped with NCrystal is now not only fast, but also fully suitable for scientific work.
- Fix bug in the NCrystal McStas component which resulted in wrong attenuation factors being calculated for the default absorption mode.
- Changed the conversion constants used in the McStas component in order to make unit conversion issues in the NCrystal-McStas interface less likely to produce undesired imprecision. Further discussions with McStas devs will be needed in order to completely address the issue.
- Code creating lattice rotation matrices was updated in order to avoid small rounding errors in the generated normals in most cases.
- More sanity checks and input pruning of atomic positions and lattice structure loaded from input files. Also improved robustness of .nxs file loading.
- Remove spurious ref-count increase in CalcBase::setRandomGenerator (thanks to A. Morozov for the report).
- Fix windows builds (see github issue #17). Many thanks to A. Morozov for a detailed report.
- Many general infrastructure improvements: Refactor random sampling algorithms from CalcBase objects (a necessary step for future enhanced MT support). Refactor orientation code from SCBragg (now used by both SCBragg and LCBragg). Refactor .ncmat loading code to disentangle the parsing code from the code. Lots of new utilities: Cubic splines, Romberg integration, root finding, derivative estimation. Single header NCDefs.hh providing all ubiquitous definitions and infrastructure related to memory handling and error reporting, and also handles includes which must get special treatment due to differences between platforms or C++ versions. Add UniquePtr (similar to C++11's unique_ptr). Add PlaneProvider (supported in PCBragg, SCBragg, LCBragg), for customizing which planes goes in which process. Avoid bind1st usage as it is removed in C++17. Custom functions for evaluating sine and cosine of angles in various ranges - between 5-10 times faster than the standard functions at 15 significant digits. Also add fast approximations for atan and exp. Performed careful changes to ncmin and ncmax functions with large performance implications (surprisingly, std::fmax generates very inefficient machine code: https://godbolt.org/g/Dxy52A ). Add helper class for efficiently generating sine and cosine values for all grid-points in a grid. PCBragg supports more custom constructors.
NCrystal release 0.9.9
- Atomic positions and mean-squared-displacement parameters are now optionally available in
Info
objects (for now, they are filled when using .ncmat files only). - Expose
loadNCMAT
function to client C++ code, making it possible to work with .ncmat files completely independent from the factory infrastructure. - Rename standard factories to
stdnxs
,stdncmat
,stdlaz
,stdscat
andstdabs
respectively and allow factory-specific parameters to be passed along to info factories. Thus,expandhkl
which was until now a globalNCMatCfg
parameter, is now a parameter specific to the .ncmat factory. It can be set using a cfg like:"infofact=stdncmat:expandhkl"
. - For .nxs files running with
"bkgd=external"
will now result in background curves from nxslib which fully correspond to those in NXSG4 (except for a few cases such as with mono-/tri-clinic crystals where that nxslib version crashed, but the version in NCrystal was patched). For comparison studies, it is now possible to select a bkgd curve exactly like the one seen in Sample_nxs.comp with McStas by the configuration"bkgd=external;infofact=stdnxs:mcstaslikebkgd"
. - Other changes: Cleanup internal .ncmat loading code splitting out
fillHKL
to a new utility file, renameNonOrientedScatter
toIsotropicScatter
and fix compilation error inNCRCBase.hh
seen with some compilers.
NCrystal release 0.9.8
- Decouple PhononDebye background cross-section code from .ncmat format, making it the new default also for .nxs files. For .nxs files, it is still possible to select the old behaviour of using curves provided by nxslib itself by configuring those files with "bkgd=external". A side benefit of this splitout can in some cases result in significant faster initialisation times when working with .ncmat files.
- Major cleanup and renaming of configuration variables, in preparation of the 1.0.0 release milestone. The renames are:
mosaicity
->mos
,orientationprimary
->dir1
,orientationsecondary
->dir2
,orientationtolerance
->dirtol
,packingfactor
->packfact
,dcutoffupper
->dcutoffup
,scatterbkgdmodel
->bkgd
,scatterfactory
->scatfactory
,absorptionfactory
->absnfactory
andskippbragg
becomesbragg
but with opposite logic, e.g.bragg=0
disables Bragg diffraction. Removed entirely was the variables braggonly (usebkgd=none
orbkgd=0
instead now) andnphonon
. Experts can now instead tune parameters for specific background models by embedding them in thebkgd
parameter value itself, e.g.bkgd=phonondebye:nphonon@20
. As always, consult NCMatCfg.hh for a full description of parameters. - Temporarily disable single-crystal speedup tricks while we investigate further, due to concerns that it is too aggresive (see github issue #13).
NCrystal release 0.9.7
The McStas sample component now actually applies the packingfactor
for powder materials, if such is requested by the user. In addition, the code loading .ncmat
files no longer produce a spurious floating point exception when loading .ncmat files containing elements with negative coherent scattering lengths (H, Li, Ti, V and Mn).
NCrystal release 0.9.6
Fix visualisation of box-shaped sample in McStas component.
NCrystal release 0.9.5
Add support for python3.
NCrystal release 0.9.4
Small patch release fixing bad version numbering.
NCrystal release 0.9.3
Minor fixes in NCrystal_sample.comp, addressing linking issues and compiler warnings observed by some McStas users.
NCrystal release 0.9.2
This release fixes a few important bugs in the NCrystal-Geant4 interface, which impacted the composition and neutronic cross-sections of NCrystal-enabled G4Materials. Only Geant4 users are affected by this change.
In addition, a few minor issues related purely to build & installation were addressed, concerning compiler warnings from GCC7 and relative RPATHs on OSX.
First github based release of NCrystal
v0.9.1 import from dgcode mercurial: version 0.9.1