-
Notifications
You must be signed in to change notification settings - Fork 18
/
CHANGELOG
1514 lines (1441 loc) · 94.3 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
v3.9.7 2024-09-02
* Fix bug in LoadedMaterial.xsect/.macroscopic_xsect methods.
v3.9.6 2024-08-30
* Add several new convenience methods to MiniMC results and histograms.
* Fix bug in MiniMC histogram error propagation.
* NCMATComposer gets new expert-only methods for adding @CUSTOM_ sections
or raw text to NCMAT data.
* NCMATComposer.from_hfg sets plotlabel from title.
v3.9.5 2024-08-28
* Make ncrystal_hfg2ncmat functionality available in Python API as well in
the new NCrystal.hfg2ncmat module. Also add NCMATComposer.from_hfg(..)
factory function to access the functionality.
* Fix bug in Python-C++ message handler infrastructure which potentially
caused message handler to be set more than once.
v3.9.4 2024-08-22
* Fix PhononDOSAnalyser (github issue #187).
v3.9.3 2024-08-20
* Fix NCrystal.cifutils plot labels with underscores in filenames.
* Fix MiniMC plotting.
v3.9.2 2024-08-19
* Prevent rare error in the MiniMC framework, which happened when acos was
evaluated on a value which due to numerical instabilities was ever so
slightly larger than one.
* Minor tweaks to MMC parsing and plotting code.
v3.9.1 2024-08-16
* Add missing _hklobjects.py file which was left out by mistake. Thus
making the newly introduced info.hklObjects() function actually work.
* Fix debug compilation of MMC messages.
v3.9.0 2024-08-12
* This release brings both general improvements and new features, as well
as a slew of maintenance updates and bug fixes. The first few items below
will discuss the main highlights.
* General speedup in a lot of the code. In particular the Fast Fourier
Transform code, used when expanding phonon density of states to full
scattering kernels for inelastic modelling, was improved by as much as
40%. This will make a noticeable difference when initialising many
materials, and is an improvement independent from the multi-threading
option mentioned in the previous item.
* If requested, NCrystal can now initialise materials even faster, by
performing the initialisation calculations in multiple threads. This can
for instance be enabled by setting the environment variable
NCRYSTAL_FACTORY_THREADS to the number of threads you wish to use (e.g. 8
if you have 8 CPU cores available, or 9999 to have NCrystal pick a number
suitable for your machine). Alternatively, you can call functions in the
Python, C, or C++ APIs to enable this:
NC.enableFactoryThreads() # Python
NC::FactoryThreadPool::enable(); //C++
ncrystal_enable_factory_threadpool(9999); //C
export NCRYSTAL_FACTORY_THREADS=9999 # BASH
* NCrystal now includes the first iteration of a "Mini Monte Carlo"
framework (for lack of a better word), which makes it possible to insert
an NCrystal material into a simple geometric "sample" shape, subject it
to a source of neutrons, and obtain a spectrum or pattern of the outgoing
neutrons. Thus, one can easily produce a simplistic diffraction pattern,
including effects of multiple scattering and both elastic and inelastic
physics. For now, the focus has been on developing the framework itself,
rather than preparing a library of interesting shapes, sources, and
tallies. Thus, the only readily available setup in this release is that
of a monochromatic pencil beam impinging on a sphere, tallying the
outgoing angle of the neutrons as they leave that sphere. Nonetheless,
the results provides a very convenient view of how NCrystal modelling
translates into a particular pattern -- without the need for an
additional software package like McStas, Geant4, or OpenMC. The `nctool`
command will now by default show such scattering pattern, or they can be
explicitly requested, as shown in this example where 1.8Aa neutrons
impinge on an aluminium sphere with a diameter of 2cm:
$> nctool --mc 1.8Aa 2cm Al_sg225.ncmat
The scope of this "Mini Monte Carlo" framework is of course not to try to
rival existing applications in terms of ability to simulate complicated
geometries or beamlines, but rather to provide another convenient way to
quickly investigate NCrystal materials, as well as potentially serve as a
way for NCrystal to be used in a regression-loop while analysing actual
neutron scattering data. For that reason, speed has been a major concern,
and both multithreading and vectorisation has been utilised to bring the
time it takes to go from defined NCMAT data to having a high-statistics
diffraction pattern available, down to the sub-second scale.
* Internally NCrystal code no longer uses raw `std::cout` or `printf`
statements. Rather, all messages are now emitted via a centralised
infrastructure. This most importantly fixes an issue where output from
the Python and C++ layers could occasionally be emitted in incorrect
order - now, when using the NCrystal Python API, all output will be
emitted through Python's own print buffer. Secondly, several NCrystal
objects now gets a `.dump_str()` method, meaning for instance that
material dumps can be captured in strings rather than emitted on
std-output. Finally, this new feature could in principle be used for
various output redirection purposes (e.g. a GUI application might wish to
show all output from NCrystal in some dedicated text box).
* NCrystal has been updated to work with latest versions of Numpy, Clang,
GCC, Python, Gemmi, and Spglib. Additionally work has started to support
Intel OneAPI compilers and Microsoft VisualStudio, although more work is
needed to finalise this. As part of these efforts, the ABI had to be
broken in some places, since for instance Microsoft VisualStudio did not
support all the data structures used previously (for instance,
VisualStudio `std::vector` does not accept move-only objects like
`std::unique_ptr`).
* This concludes the highlights in this changelog entry - refer to the
following items for more detailed information about specific changes.
* Several speedups of the phonon convolution calculation code was
implemented, resulting in noticable speed increases (20-40%): the FFT
phase factor calculation by a factor of two, swap indices were cached,
and an integer division was rewritten as a bit shift.
* Reduce luxury in some VDOS integrations slightly for a more reasonable
amount of calculations, speeding up Info material creation.
* Add internal utilities to allow usage of multiple threads for material
loading, allowing for sizeable speedups. This required many changes to
ensure good behaviour (i.e. using a fixed number of threads only), and no
dead-locks of various kinds even though the multi-threading can take
place at various levels during the loading. For now, the number of
available threads can be controlled with the NCRYSTAL_FACTORY_THREADS
environment variable, the NCrystal::FactoryThreadPool::enable() C++
function, the NCrystal.enableFactoryThreads Python function, or the
ncrystal_enable_factory_threadpool C function.
* Build NCrystal library with -fno-math-errno (github issue #169).
* Several non-trivial fixes were implemented to prepare for MS VisualStudio
and Intel oneapi compilation support. This breaks ABI.
* Apply -fp-model=precise for intel oneapi compiler.
* Change C++ DynamicInfoList type from
std::vector<std::unique_ptr<DynamicInfo>> to typedef
SmallVector<std::unique_ptr<DynamicInfo>,4>, since VisualStudio
apparently does not support std::vector's with move-only objects. This in
principle breaks the ABI and API, but is deemed necessary. A few other
types in internal non-API headers were changed as well for the same
reason.
* Fix build error due to ODR violation in the TopLvlVar type.
* Removed noexcept from C++ functions where it should not have been added
(e.g. those used for streaming to std::ostream).
* Fix cfg-string bug (github issue #182). This only affected multiphase
cfg-strings in which the first phase contained either a density or
phasechoice setting, so is not believed to have affected many users.
* ProcComposition::consumeAndCombine(..) fct is now better at removing null
components.
* Adding the infrastructure for better control of NCrystal output, through
usage of a new setMessageHandler(..) function (related to github issues
#53 and #122).
* Rewrote the NCrystal::dump C++ function (which provides printouts/"dumps"
of material Info objects) to stop using printf entirely and now only use
C++ output streams, but notably while preserving existing output
exactly. This makes it possible to capture the dumps into strings and
streams, rather than printing them out. Along with the general message
handling changes, this should prevent Python output buffering causing
incorrect output ordering (seen in e.g. Jupyter notebooks).
* Python objects with .dump(..) methods gets new .dump_str() methods as
well, which simply returns the information as a string instead of
printing it directly.
* Update cifutils to follow changes in upstream Gemmi project.
* Updates to reflect upstream API changes in spglib.
* Stop using numpy.asfarray which was removed in numpy 2.0.0 (github issue
#185).
* More helpful error message when loading huge DFT-generated unit cells
(thousands of atoms, no symmetries) without raising dcutoff (github issue
#160).
* DI_VDOSDebye Python objects now also get an analyseVDOS() method, for
consistency (github issue #174).
* Update NCMAT documentation to clarify the ordering of sab entries (github
issue #170).
* Add convenience .xsect(..) and .macroscopic_xsect(..) methods to
LoadedMaterial instances in the Python API.
* Add experimental material loading benchmark utility to nctool. This
feature is for now kept out of the documentation, but can be tested with:
"nctool --bench --help".
* Updated year in copyright notice in all files.
* Info objects gets a new .hklObjects() method which returns HKL list
information in a more object oriented and convenient format than the
existing .hklList(). See issue #164 for more details.
v3.8.2 2024-04-30
* Add importlib_metadata as python build dependency for Python < 3.8.
* CMake code no longer strictly disallows mixing of NCRYSTAL_NAMESPACE and
NCRYSTAL_GEANT4 options.
v3.8.1 2024-04-11
* Fix rare FPE in lcbragg code (github issue #171).
* Remove a few faulty noexcept modifiers in (found by cppcheck).
* Fix NCMatCfg::textData which technically returned a reference to a
temporary (although this is not believed to have actually caused any
issues, since the "temporary" came from a longer-lived shared_ptr). This
was also found with cppcheck.
v3.8.0 2023-12-03
* Completely obsolete the ncrystal_inspectfile command in favour of the
nctool command. Trying to invoke ncrystal_inspectfile now results in an
error message with a reminder to use nctool instead.
* The default value of the CMake cfg option -DNCRYSTAL_ENABLE_SETUPSH is
changed from "ON" to "OFF". Additionally, if setting
-DNCRYSTAL_ENABLE_SETUPSH=ON, the oly files installed are now named
<PREFIX>/ncrystal_setup.sh and <PREFIX>/ncrystal_unsetup.sh, whereas in
the past they were named <PREFIX>/setup.sh and <PREFIX>/unsetup.sh. Note
that in releases v3.7.0 and v3.7.1 both versions of the files were
available. Consequently, users who were manually compiling NCrystal and relying on
e.g. <PREFIX>/setup.sh files files will now need
to explicitly set -DNCRYSTAL_ENABLE_SETUPSH=ON and instead use the
<PREFIX>/ncrystal_setup.sh file. (github issue #126).
* NCrystal components and instrument examples for McStas (mcstas.org) are
no longer shipped with NCrystal, since all NCrystal components and
instrument examples are now shipped with McStas itself.
* Add a new NCRYSTAL_NAMESPACE option, which can be used when there is a
need to be able to use NCrystal header files and libraries from multiple
NCrystal installations into the same environment. Eventually, it is the
plan to enable such namespace protection in NCrystal conda-forge and PyPI
packages, to prevent hard-to-catch errors in case a user ends up having
both packages installed in the same environment (which can happen when
people mix "conda install .." and "pip install .."). CMake-based
downstream projects should not be affected by this, but if you are
maintaining downstream custom builds which hardcode linker flags like
"-L/path/to/ncrystal/lib -lNCrystal" you are encouraged to based your
flags instead on $(ncrystal-config --show libpath). That way you will be
future-proof and ready to also work with NCrystal installations where a
namespace has been enabled. See the README file for more details.
* As a result of the namespace support, all function names in the C-api are
now actually macros.
* Adding VERSION and SOVERSION to libNCrystal.so/dylib. For now, the
VERSION number is simply the full NCrystal release version number, while
the SOVERSION is the major release number (i.e. "3" for release
3.8.0). This feature can be disabled with -DNCRYSTAL_ENABLE_SOVERSION=OFF.
* CMake find_package(NCrystal ...) calls no longer sets NCrystal_DIR to the
installation prefix, since that could disrupt the usage of multiple
find_package calls. The prefix directory previously available as the
CMake variable NCrystal_DIR is thus instead made available under the name
NCrystal_PREFIX.
* Update Avogadro's constant to NIST/CODATA2018 value, changing it from
6.022140857e23/mol to 6.02214076e23/mol (a change of ~0.016ppm).
* The CMake code now also adds $CONDA_PREFIX/lib to rpath when appropriate.
* Explicitly forbid # and $ chars in cfg-strings (github issue #153).
* Fix misleading values in ncrystal-config in some rare cases.
* Fix for a few (incorrect) compiler warnings.
* Fix for cmake test in python3 -mNCrystal.test cmake.
* Warnings emitted from python layer now has right stacklevel.
* Fix tests for Python 3.12 (a few tests depended on the now
deprecated distutils modules, cf. PEP-632).
v3.7.1 2023-08-02
* Update documentation to reflect availability on PyPI.
* Set version-based policies in NCrystalConfig.cmake to make
find_package(NCrystal) work when CMake is new enough, but the downstream
CMake project nevertheless specifies a very old version in their
cmake_minimum_required statement (cf. github issue/discussion #137).
* Add NCrystal_LIBRARIES variables for downstream CMake-based projects with
legacy 2.x-style CMake code. If the GEANT4BINDINGS component is enabled,
also set G4NCrystal_LIBDIR, G4NCrystal_INCDIR, G4NCrystal_LIBNAME and
G4NCrystal_LIBRARIES variables, likewise intended for such legacy
projects. Note of course, that usage of such legacy CMake 2.x-style code
is discouraged.
* Include type_traits in NCDefs.hh, to potentially fix some compilation
errors seen in #137.
* Fix several minor bugs in NCrystal Python code which were discovered via
the ruff static code analysis tool.
* Change signature of all 0-argument functions in C-API in ncrystal.h from
f() to f(void), since the first form is apparently deprecated since 30
years and gives issues in clang 14
(cf. https://github.com/madler/zlib/issues/633 and
https://github.com/mctools/dgcode/issues/34).
* For NCrystal builds, change max version in cmake_minimum_required to
3.27.
v3.7.0 2023-07-14
* The main feature of this release is that NCrystal now can be optionally
built and installed using standard Python-centric toolchains. Work on
this feature was spearheaded by Milan Klausz, and is associated with
newly added setup.py and pyproject.toml files, using skbuild behind the
scenes. Additionally, Python modules and script were moved out of the
ncrystal_python directory and into directories named NCrystal and
scripts, respectively (solving github issue #127). Finally, existing
Python modules and the ncrystal-config script were modified to support
such builds and installation. As a result, it is now possible to do "pip
install <path-to-ncrystal-src>", and get a fully-fledged NCrystal
release. The only difference with respect to e.g. a conda installation
of NCrystal, is that downstream CMake-based projecs won't detect the
installation, unless the directory reported by "ncrystal-config --show
cmakedir" is manually added to the CMAKE_PREFIX_PATH.
* Work is ongoing by Milan Klausz to setup workflows at GitHUB to
automatically build binary wheels for PyPI, similar to how binary
packages are now built automatically at conda-forge. Once this is
completed, it will be possible to install prebuilt NCrystal packages via
"pip install ncrystal" (solving github issue #93).
* Note that setup.py maps NCrystal releases with minor number >= 80 to a
development version lke "3.6.dev80", with the intention of preventing
"pip install ncrystal" from automatically picking up release candidates.
* Rewrote the aligned allocator code used internally when implementing
convenience containers such as SmallVector. This was done in response to
fix compilation errors with gcc12 (github issue #125). This new version
avoid the previous incorrect reliance of a non-standard feature of
std::free, and overall the new version is more portable, as it relies on
nothing except std::malloc and std::free.
* Updated the SmallVector::clear method, in order to work around what
appears to be a false-positive compilation error by gcc12.
* For completeness, added more functions like ekin2k, constexpr_ekin2k,
k2ekin, and k2wl functions in the C++ and Python API's.
* Bugfixes (C++ API): NeutronEnergy::k() now actually returns the
wavenumber k, and not the squared of k, as it did previously. Also, the
free-standing ekin2wl(..) function is no longer constexpr (since
std::sqrt is not actually constexpr), but there is a new
constexpr_ekin2wl which is.
* Added new standard testing facilities, for checking an installation for
presence of commandline scripts (solving github issue #110) and that
downstream CMake/C++ projects can find and use NCrystal (after getting
CMAKE_PREFIX_PATH from ncrystal-config). To invoke all tests, run
"python3 -mNCrystal.test all". For other options, run "python3
-mNCrystal.test all".
* Add ncrystal_setup.sh/ncrystal_unsetup.sh files in addition to the
ambiguously named setup.sh/unsetup.sh files. (github issue #126).
v3.6.82 2023-07-13
* RC3 for release 3.7.0.
v3.6.81 2023-06-23
* RC2 for release 3.7.0.
v3.6.80 2023-06-07
* RC1 for release 3.7.0.
v3.6.1 2023-05-16
* Tiny update with a quick workaround for gcc12 compilation issues
(github issue #125).
v3.6.0 2023-05-16
* This milestone release primarily brings a massive restructuring and
update of the Python API of NCrystal. The changes should be backwards
compatible in almost all cases, and the most user-visible changes should
hopefully be the addition of several new big features, highlighted
below.
* Note that along with this release we are also publishing several Jupyter
notebooks at https://github.com/mctools/ncrystal-notebooks which might
be a more enjoyable (or at least useful) way to learn the Python API of
NCrystal. These notebooks will also be used during the "HighNESS
International School on Thermal Neutron Scattering Kernel Generation"
hosted at the European Spallation Source in Lund
(https://indico.esss.lu.se/event/3096/).
* The new NCMATComposer helper class is added to the Python API. It can be
used to create new materials in an object-oriented and pythonic manner, as
opposed to hand-crafting the NCMAT data. It essentially supports all
features of the underlying NCMAT format, but does so in a much more
easily accessible manner, and handles a lot of the book-keeping that can
arise in some complicated materials.
* A new NCrystal.cifutils submodule brings a CIFLoader class, which behind
the scene empowers the NCMATComposer class to adopt crystal structures
from CIF files. Such files can reside both locally or in selected online
databases. CIF files often contain incomplete information, so be sure to
consult the Jupyter notebook tutorial linked above for examples of how
to deal with these. Note that based on this CIF functionality, the
NCMATComposer now also support ASE (https://wiki.fysik.dtu.dk/ase/)
objects, or the loading of a variety of input formats via ASE.
* A new PhononDOSAnalyser class can be used to investigate and cleanup
phonon density of state (VDOS) curves, and then (with the help of the
NCMATComposer class) add them to a material. In particular, one of the
Jupyter notebooks linked above shows how one might go through the steps
of converting phonon curves produced by Quantum Espresso
(https://www.quantum-espresso.org/) to define high quality NCMAT data
for a material.
* A new NCrystal.plot submodule brings several new plotting utilities,
that can either be used directly, or via various convenience plotting
methods added to various classes in the API. In particular, note the
plot_xsect(..) and plot_xsects(..) function in the submodule, which can
be used to easily produce cross section plots from a range of inputs
(NCrystal objects, NCMAT data, cfg-strings, etc.).
* In general, many objects, both new and old, have been enriched with more
convenience methods for plotting, dumping, or merely extracting
data. Note for instance the new .findDynInfo and .findAtomInfo methods
of the Info objects, or the various .plot_xxx() methods on the
DynamicsInfo objects.
* A new global .load() function can be used to load either cfg-strings or
raw NCMAT data into LoadedMaterials objects. LoadedMaterials objects
have .info, .scatter, and .absorption properties available for accessing
all of these physics objects. Loading a material in such a unified
manner might be more convenient for many use-cases (in particular
interactive sessions) than the classic .createInfo(..),
.createScatter(..), and .createAbsorption().
* Note that while NCrystal in general does not have any required
dependencies, several of the features above does depend on third-party
python modules. All these modules are well-maintained open-source
projects, available both on PyPI (for "pip install xxx") and on
conda-forge (for "conda install -c conda-forge xxx"). The optional
dependencies are:
- "numpy": for various array-based functionality. Although not strictly
needed, it is recommended to always install this.
- "matplotlib": for usage of the plotting utilities.
- "spglib": For producing crystalline materials with NCMATComposer, in
order to verify (or refine) the structures.
- "gemmi": For reading CIF data into NCMATComposer.
- "ase": For loading crystal structures from ASE objects or non-CIF files
(like those produced by Quantum Espresso) into NCMATComposer.
-"pymatgen"/"mp_api": Only needed for loading CIF data from the online
database at materialsproject.org into NCMATComposer.
* Since release 3.0.0 we have provided the alias "nctool" for the command
named "ncrystal_inspectfile", and while we will keep providing both
aliases, we now swap their role and primarily mention the name "nctool"
in our documentation. There are not immediate plans to remove the
"ncrystal_inspecfile" command, but users are encouraged to migrate to
use the "nctool" command instead.
* Introduce new ncrystal_cif2ncmat command which internally uses the new
CIF and NCMAT tools from the Python API, and which supports both local
CIF files or remote online databases. This also obsoletes the
ncrystal_onlinedb2ncmat command.
* The rest of this changelog will list a range of other improvements and
bug fixes that are also a part of this release.
* Added new utility functions in the NCrystal.atomdata Python module:
elementNameToZValue, elementZToName, allElementNames, isElementName,
knownElementNames, and isKnownElement.
* Added new conversion functions in the NCrystal.constants module in
addition to the existing. The full list is now wl2ekin, ekin2wl,
wlsq2ekin, ekin2wlsq, ekin2wlsqinv, ekin2ksq, ekin2k, ksq2ekin,
wl2k. However, note that only the first two are put in the main module,
so one must explicitly import NCrystal.constants to access the rest
(existing users of ekin2ksq, wl2k, wl2ksq functions will therefore have
to modify their code).
* Be in general aware that a few specialist functions were moved from the
main Python module to sub-modules.
* The AtomData class in the Python API gets new .fmt_atomdb_str(..) and
.to_atomdb_str() convenience methods, for converting data into a string
with a format suitable for @ATOMDB sections of NCMAT data. Perhaps more
noticably, the AtomData class also gets __str__ and __repr__ methods for
a better interactive experience with the NCrystal.atomDB function.
* NCrystal.Info objects gets a .factor_macroscopic_xs property, which can
be used to convert cross sections from (barns/atom) to inverse
penetration depth (1/cm). This is numerically identical to the
.numberdensity property, but more explicit.
* Rename NCrystal.directMultiCreate as NCrystal.directLoad, but keeping
the old name as an alias for now. Also make it more accepting in terms
of the kinds of data it accepts. Most users likely use the new
NCrystal.load(..) function instead though, as it accepts a wider range
of input types.
* Prepare Python modules with a special mode for finding libNCrystal.*,
needed for an hopefully upcoming PyPI package being developed with the
help of Milan Klausz.
* Add "version_tuple" variable in the main NCrystal module, so one can do
"if NCrystal.version_tuple>=(3,6,0)" instead of "if
NCrystal.version_num>=3006000". But be aware that the
NCrystal.version_num exists all the way back to NCrystal release 0.9.1,
so it will for now result in nicer error messages if one checks against
NCrystal.version_num (at least for the next few years).
* Allow atomic positions in unit cell with fractional coordinates within
1e-4 of each other. The previous limit of 1e-2 was too tight for some
CIF files.
* Single crystal materials with no hkl entries (due to high dcutoff or
forced b_coh=0 for atoms) no longer results in an exception from the
PlaneProvider. Rather, the std plane provider instead now provides an
empty list of normals, avoiding spurious errors.
* Modify the .laz/.lau loader to be able to work directly with files
produced by the cif2hkl programme. Specifically this means being able to
extract spacegroup and chemical composition from the SPCGRP and TITLE
fields. It still might not load all files though, since cif2hkl might
produce small fluctuations between structure-factors for
symmetry-equivalent planes, which NCrystal won't accept currently.
* Due to the new improved utilities for interpreting CIF files for
conversion to NCMAT, a few materials in the data-library received
corrections. Additionally, several online database entries (in
particular those at materialprojects.org) appear to have been updated
with supposedly more accurate content. These changes are naturally
reflected in the new validation plots at the data library
page. Consequently, two materials received updates to structures
(CaSiO3_sg2_Wollastonite.ncmat and KOH_sg4_PotassiumHydroxide.ncmat),
and for a few other materials the list of relevant online database
entries (mentioned in comments in the files) was updated. As a comment,
we observe a general trend for structures loaded from
materialprojects.org to now better match the equivalent structures
* The C API function ncrystal_ncmat2json now works with raw NCMAT data
rather than just ncmat files. It is still an incomplete implementation
though.
* Updated README file, including adding a mention about OpenMC support.
* Modify CMake to make sure downstream C++ projects use at least C++11.
* Data files embedded in the binary with -DNCRYSTAL_ENABLE_DATA=EMBED will
no longer be in a compact form stripped for comments. This was a
mistake, of course the content of the stdlib data files should never
depend on installation details.
* Fix bug in ncrystal_ncmat2cpp which could introduce extra random bytes
at the end of huge (>60KB) files. This affected two files
(LiquidHeavyWaterD2O_T293.6K.ncmat and LiquidWaterH2O_T293.6K.ncmat) in
the standard library when building with -DNCRYSTAL_ENABLE_DATA=EMBED,
like is done in the conda packages.
* NCScatKnlData now allows a vanishing boundXS, which would earlier
trigger an exception. Related to this, the standard scattering factory
has been updated to not initialse SABScatter processes based on such
vanishing kernels, or if the scattering cross section is vanishing.
Also Added a few checks elsewhere in the code against sterile elements
(all scattering lengths 0), ensuring not only a tiny speedup, but also
that consistency checks did not falsely trigger exceptions.
* It is now possible to get all usual NCrystal functions in the api Python
submodule, meaning that "import NCrystal.api as NC" will mostly (apart
from a bit of package metadata variables) give the same result as
"import NCrystal as NC" since the __init__.py module also does an "from
.api import *" import internally. However, this latter import can be
avoided by setting the environment variable NCRYSTAL_SLIMPYINIT.
* Many obsoleted functions will now emit a warning upon
usage. Additionally, setting the environment variable
NCRYSTAL_NOPYOBSOLETE before importing the NCrystal modules, will remove
many such obsolete functions entirely. Note that some obsolete functions
might not yet have been migrated to this new scheme.
* Better error messages if code like the following causes the Info object
to be cleaned up before an associated dyninfo object needs it:
di=NC.createInfo("bla.ncmat").dyninfos[0]
print(di.vdosData())
A better solution for the future would be to have DynInfo + AtomInfo
objects exposed directly as objects in the C-API, so the object
lifetimes in Python could be directly tied to the C++-side equivalents.
* Expose raw Gn functions and vdos2knl expansion code to both C and Python
APIs, and make available on dyninfo objects as well for convenience.
* Caching of idealised VDOS based on Debye temperatures use slightly more
digits in the cache keys.
v3.5.81 2023-05-14
* RC2 for incoming release v3.6.0.
v3.5.80 2023-05-09
* RC1 for incoming release v3.6.0.
v3.5.1 2022-12-05
* Redo VDOS integrals for gamma0 and Teff to support much lower
temperatures (down to 0.001K certainly no issue now).
* Ensure that the evaluation of the G1 function is now numerically safe,
even at very low temperatures where the detailed balance factor becomes
numerically indistinguishable from 0 or infinity (github issue #109).
* Trim excess zeroes at edges of G1 function.
* Unify temperature range checks. More specifically, replace asserts which
were imposing temperature limits inconsistent with those allowed by the
"temp" cfg-parameter (1e-3K to 1e6K).
* Make FileListEntry returned by NCrystal.browseFiles sortable.
* Fix ncrystal_endf2ncmat (github issue #110).
v3.5.0 2022-11-23
* Migrate names of all CMake parameter options to be prefixed with
"NCRYSTAL_". Using the old names will mostly keep working for the time
being, but will cause a warning to be issued (mctools/ncrystal#105).
* No longer build and install examples by default.
* We now newer fiddle with CMAKE_BUILD_TYPE if a multi-cfg generator is
detected.
* Add option NCRYSTAL_ENABLE_CPACK. If set, a few CPACK-related variables
will be set and an "include(CPack)" statement is triggered just after
the "project(..)" statement (mctools/ncrystal#107).
* Rename CMake target "common" to "ncrystal_common" to avoid clashes when
project is build as a subproject (mctools/ncrystal#105).
* Completely ignore the CMake option BUILD_EXTRA which has not been
supported since release v3.0.0.
* Minor fix for setup.py file generated from CMake, needed to work with some
outdated python installations.
* Add hidden --pytrace option to ncrystal_inspectfile and nctool, for
running the script under the python trace module.
* A few fixes for Windows (thanks to Peter Willendrup). In particular,
never use aligned_alloc on windows.
v3.4.1 2022-10-19
* Expose utility for completely flattening a material composition to
Python interface, as a new info.getFlattenedComposition() method. This
is intended to better support materials with non-natural compositions in
the OpenMC bindings. Internally, the new method is using the same
machinery as what is already in place to provide the same functionality
for the Geant4 bindings.
* ncrystal_onlinedb2ncmat was not using new unified cmdline script
machinery introduced in v3.4.0, which has now been corrected.
v3.4.0 2022-10-12
* Modify location of CMake config files provided by an NCrystal
installation, to hopefully make it easier for downstream projects to
locate an existing NCrystal installation (more details on this MCPL
issue: https://github.com/mctools/mcpl/issues/58).
* Modify manner in which Geant4 bindings must be activated in downstream
CMake code. Previously they were enabled via a dedicated
"find_package(G4NCrystal)" call, but now they are instead provided as an
optional COMPONENT when requesting the NCrystal package:
"find_package(NCrystal COMPONENTS GEANT4BINDINGS )" and if succesful the
downstream binaries must be configured to depend on the G4NCrystal
interface by adding the NCrystal::G4NCrystal target as a dependency,
i.e. "target_link_libraries( mybinary NCrystal::G4NCrystal )". The
Geant4 bindings will not be enabled unless the GEANT4BINDINGS component
is explicitly requested.
* Unify manner in which shipped cmdline scripts look for NCrystal python
module.
v3.3.1 2022-10-06
* Fix info.getComposition() for multiphase materials in the Python
interface. This issue is not believed to have affected many users, but
a fix is crucial in order to support multiphase materials in OpenMC
hooks which are currently being prepared (github issue #102).
* Minor fix to make Geant4 hooks work with Geant4 release 11. Note that
this is still not the long awaited major update which makes the hooks
work with Geant4 in multithreaded mode.
* Rewrote internal code in NCIter.hh to avoid usage of deprecated
std::iterator. This avoids compilation warnings on newer platforms
(github issue #100).
* Reduce precision from %.15g to %.14g in output of ncrystal_ncmat2hkl to
get reproducible results across platforms.
v3.3.0 2022-08-23
* Updates to CMake code which is needed to support creation of
NCrystal conda packages.
* ncrystal_inspectfile now has --version and --versionnum arguments.
v3.2.0 2022-08-11
* Introduce a new quick TextData factory for gas mixtures, supporting
on-the-fly gas mixtures through cfg-strings like
"gasmix::0.7xCO2+0.3xAr/2bar/30C". The format is rather flexible, and
supports both mass and molar fractions, relative humidity, and has an
alias for normal air ("gasmix::air"). See more details on the wiki:
https://github.com/mctools/ncrystal/wiki/Announcement-Release3.2.0
* Introduce NCMAT v7 which adds a new optional @TEMPERATURE section to the
format, allowing the default temperature value to be modified from the
normal 293.15K, or even of locking the value at a certain value
(attempts at modifying it via cfg variables will then fail). This is
used by the new gasmix factory to error on the flawed but
correct-looking "gasmix::CO2/2bar;temp=200K" (which is not the same as
the correct "gasmix::CO2/2bar/200K"). Future developments might move the
gas mixture support to the NCMAT format itself (rather than just in the
pre-processing as now), which would solve the issue in a nicer way.
* At the C++ level, a new fmt_frac function allows easy printing of
floating point values which might be simple fractions, a dedicated
Pressure type was added, and a minor issue with confusing error messages
from NCMAT data from quick factories was addressed.
v3.1.0 2022-06-29
* Introduce cfg parameter named "ucnmode" which can be used to enable a
new dedicated modelling of UCN-production processes. Thus, appending
";comp=inelas;ucnmode=only" to a given cfg-string, will result in a
scattering process which ONLY contains UCN-production
events. Conversely, appending ";ucnmode=remove" will provide a process
which contains everything EXCEPT UCN-production events. This splitup is
intended to facilitate usage of biasing and variance reduction tricks
when designing VCN or UCN moderators. The UCN threshold defaults to
300neV, but this can of course be modified. In addition to just
facilitating a process splitup, the UCN-production process resulting
from "ucnmode=only" is more precise (essentially exact) than the usual
S(alpha,beta) treatment - which is rather precise in general, but
currently contains some flaws when sampling events where the neutron
loose almost all energy (see also next item).
* Improve general (i.e. also when not running with special ucnmode)
scattering-kernel based inelastic physics for the case where the neutron
looses almost all energy. Specifically, the sampling of S(alpha,beta)
near the kinematic endpoint is greatly improved. We still have
additional plans for how to completely remove any artifacts related to
the numerical processing, if manpower allows at some point in the
future.
* Add internal utilities for evaluating S(alpha,beta) kernels at any
(alpha,beta) point, and add utilities for what is essentially exact
sampling or integration for cross sections. These utilities are useful
as they allow us to validate scattering kernel models better, and are
used directly in the new UCN-production models.
* Add notice to the ncrystal_preparemcstasdir for how to make it work when
using NCrystal with the McStas-Union geometry system.
* CMake now actually installs the "nctool" alias of "ncrystal_inspectfile".
* S(alpha,beta) kernels hardcoded in .ncmat files will now have any
null-edges discarded upon loading. This is often needed for kernels
converted from ENDF files, where the alpha/beta grid is often larger
than needed.
* Add PiecewiseLinearFct1D utility class (for some reason we had utilities
for cubic splines and sampling of piece-wise linear functions, but not
for simple evaluations of them!).
* Fix bug when accessing DynInfo of directly specified scattering kernels
with the Python interface (the DI_ScatKnlDirect was missing a required
initialisation).
* The process summaries printed via ncrystal_inspectfile or accessed via
the Python interface, now supports multiple layers of nested
processes. This was required to support the new ExcludeUCNScatter
process, which is implemented as a wrapper of two other processes.
* Adding experimental and incomplete support for converting raw parsed
NCMAT data to JSON. This is intended to help avoid the need for
resorting to custom parsing code, but is clearly an expert-only feature
as the data is presented as-is, without additional loading.
v3.0.0 2022-04-24
* The NCrystal v3.0.0 release brings both major new features and technical
improvements "under the hood", with around 19.000 lines of code changed
in more than 300 files! The list of specific changes is too long to
document here, but the following bullet points mention a few highlights
as well as a select number of very specific technical details. For a
more detailed and hopefully readable overview, please refer to the
following page in the wiki:
https://github.com/mctools/ncrystal/wiki/Announcement-Release3.0.0
Furthermore, we would like to encourage users to post questions
concerning the new release (or anything else NCrystal related obviously)
to the forum at: https://github.com/mctools/ncrystal/discussions
* Support for multiphase materials. These can be defined in terms of phase
volume-fractions, either in cfg-strings
("phases<0.9*Al_sg225.ncmat&0.1*Be_sg.ncmat>"), in NCMAT data, or a
combination of those. All interfaces and tools have been updated to
properly integrate multiphase materials, in a manner which is believed
to not add complications when working with single-phase materials.
* Framework-level support for Small Angle Neutron Scattering (SANS)
physics. The release includes resources to facilitate future development
of advanced SANS models, and already include a hard-sphere SANS model
(useful both by itself, and as proof-of-concept for other models).
* Material densities can now be easily modified. This can be done by
either specifying a relative scaling,
"Polyethylene_CH2.ncmat;density=0.9x", or an absolute one:
"Polyethylene_CH2.ncmat;density=0.88gcm3" (g/cm^3) or
"Polyethylene_CH2.ncmat;density=0.1perAa3" (atoms/Aa^3).
* Support for quickly setting up unstructured materials with just a
cfg-string and without a data file for such simple materials. For
instance, a He3 gas might be defined via the cfg-string
"freegas::He/0.17kgm3/He_is_He3". This makes it easy to add materials
for which the structure is not deemed important (e.g. in a strong
absorber).
* The various new features can be combined for quickly settting up
advanced materials. For instance, here is how to define a low-density
polyethylene with enriched B4C pellets, even without a dedicated data
file for B4C:
"phases<0.99*Polyethylene_CH2.ncmat;density=0.8x&0.01*solid::B4C/2.5gcm3/B_is_0.95_B10_0.05_B11>"
* Improve documentation of cfg-string parameters, with the code now able
to provide dynamic documentation, which can be accessed either
programatically (with the Python/C/C++ API or by running
ncrystal_inspectfile --doc), or on the new wiki page:
https://github.com/mctools/ncrystal/wiki/CfgRefDoc
* Introduce for convenience a new cfg-string parameter "comp", which can
be used to easily pick out one or more of the components contributing to
the scattering cross section. For instance, appending ";comp=inelas" to
any cfg-string (i.e. "Al_sg225.ncmat;comp=inelas"), will disable all
components *except* inelastic models.
* Reflection (hkl) planes provided by NCrystal are now grouped according
to the symmetry-equivalency indicated by the space group. This has the
benefit of drastically improving both the initialisation time and memory
usage needed for hkl lists, and additionally makes it easier to use
reflection lists from NCrystal with other software which often depends
on such symmetry groupings. Additionally, ondemand loading for quicker
inspection (e.g. --dump will be almost instantaneous even for the most
complicated crystal structures), and by default only the 10 planes with
largest dspacing is shown.
* Improve and update McStas support:
- Make NCrystal work with both the McStas v2.7 and McStas v3.0 branches.
- Add ncrystal_ncmat2hkl cmd-line utility for converting NCMAT files to
the .laz and .lau files needed by the McStas PowderN and
Single_crystal components (note that this only includes Bragg
diffraction, not inelastic/incoherent/SANS/multiphase physics for
which direct NCrystal usage in the NCrystal_sample component or
McStas-Union system is needed).
- Utilities for better/easier integration between NCrystal and the
McStas-Union system for complex geometries.
* Remove the few optional files which were not copyrighted by the NCrystal
developers, ensuring that the entire NCrystal release now has a single
well-defined license (Apache 2.0). The removed files were used to
support the semi-obsolete .nxs file format, and will still be available
as a separately distributed plugin if really needed.
* Stop supporting Python 3.5. Oldest supported Python version is now
Python 3.6.
* Introduce NCMAT v6 which adds a new optional @OTHERPHASES section to the
format, allowing secondary phases to be defined via volume fractions and
cfg-strings.
* Remove NCMatCfg::isPolyCrystal which used to return the opposite of
isSingleCrystal(). This was obviously misleading for non-crystalline
materials.
* Vector::normalise() now does nothing if the squared magnitude is already
within 2 ULP's of unity. This is to avoid repeated calls to this
function from inducing slight changes due to numerical inaccuracies in
the normalisation process.
* Add cyclical dependency detection in NCrystal factories to exit with
clear error instead of deadlocking. This is in particular needed to
handle cyclic dependencies in multiphase materials in which a phase is
wrongly defined by recursively referring back to the top level material.
* Type safe AtomData::captureXS in C++.
* Add utilities for encoding data in JSON format, which for now is used to
enable conversion of MatCfg objects as JSON objects. On the python side
this means that a cfg-string can be decoded into a Python dictionary
using the new decodeCfg function (a new encodeCfg function re-encodes
this into a cfg-string).
* Fix bug where scattering kernels generated on-the-fly from VDOS curves
with vdoslux values less than 3 (the default) were subsequently treated
to the "beta-thickening" procedure introduced in release v2.6.1. This
procedure is now, as intended, only applied to externally provided
kernels, since the on-the-fly generated ones already have an optimised
grid layout.
* ncrystal_inspectfile gets --energy/--liny/--logy/--xrange options to
control more aspects of the generated plots.
* Introduce an alias, nctool, for the ncrystal_inspectfile command (this
is done in anticipation of a future actual renaming of the command).
* Fix misleading @ATOMDB examples in NCMAT documentation where cohSL
numbers for Si and Al were a factor of 10 off from realistic numbers,
which might confuse users to think they have to use a unit of 0.1fm
rather than fm for such numbers (github issue #77).
v2.9.93 2022-04-21
* Release candidate #3 for release 3.0.0.
* Detailed ChangeLog to come.
v2.9.92 2022-04-10
* Release candidate #2 for release 3.0.0.
* Detailed ChangeLog to come.
v2.9.91 2022-03-02
* Release candidate #1 for release 3.0.0.
* Detailed ChangeLog to come.
v2.7.3 2021-09-09
* Add missing import statement in ncrystal_hfg2ncmat (github issue #71).
* C++ API gets ekin2ksq and ksq2ekin utility functions.
* Cleanup the PointwiseDist utility class and add new sampleBelow and
commulIntegral utility functions
* Add new internal IofQHelper utility class which can be used to
implement elastic physics described via an I(Q) curve
* Fix some obscure -Wshadow warnings on some rare platforms when some
local variable named s or m clashes with global variables of the same
name from Geant4.
v2.7.2 2021-07-08
* Various compilation fixes, affecting only users of Geant4-hooks with
the most recent Geant4 release (10.07.p02) or users with the rather
outdated gcc 4.8.5 (github issue #69).
v2.7.1 2021-06-17
* Fix single crystal alignment bug which was inadvertantly introduced
among the many technical changes in release v2.5.0, essentially
swapping the meaning of @crys: and @crys_hkl: in the parts of the cfg
strings defining the crystal orientation.
v2.7.0 2021-05-31
* Introduce NCMAT v5 which two updates for the format, both meant to
facilitate modelling of amorphous (i.e. non-crystalline) solids.
Firstly, Debye temperatures can now be specified directly in @DYNINFO
sections of vdosdebye type, meaning that such sections can now also be
used in non-crystalline materials where @DEBYETEMPERATURE sections are
disallowed. Secondly, a new optional @STATEOFMATTER section can be used
to explicitly indicate the state of matter if needed. If @STATEOFMATTER
is not specified, materials with crystal structure or vdos curves are
assumed to be solids, otherwise the state will be undefined. Amorphous
solids will currently get both inelastic and elastic physics determined
from the VDOS curves - with coherent components approximated via the
incoherent approximation.
* Improve HKL plane initialisation code to make it 200% faster (i.e. a
factor of 3 speedup)! This was mostly achieved by using our own custom
sin+cos implementations, which are much faster than the standard ones,
but with no impact on precision. As a result, the heuristics picking a
default dcutoff value were updated so that structures with more than 40
atoms per unit cell now defaults to dcutoff=0.2Aa, as opposed to
dcutoff=0.25Aa before (the default value for other materials remain
dcutoff=0.1Aa).
* Add ncrystal_hfg2ncmat script for convenient production of NCMAT files
for hydrogen rich amorphous materials, based on concept and data from
Romanelli et. al. (2021), https://dx.doi.org/10.1088/1361-648X/abfc13
* Add ncrystal_onlinedb2ncmat script for creating materials with crystal
structure taken from online databases (materialprojects.org or
Crystallography Open Database). The script also has options for copying
material dynamics from existing .ncmat files, and for verifying that
NCMAT files containing comments containing specific links to entries in
these databases, actually contain those structure (by overlaying Bragg
cross section curves). Internally the script uses the Python Materials
Genomics (pymatgen) Python module to access the online databases.
* Add ncrystal_verifyatompos script for verifying that the list of
@ATOMPOSITIONS in an .ncmat file is consistent with the indicated
@SPACEGROUP number. Internally the script uses the Atomic Simulation
Environment (ASE) Python module to handle the symmetries.
* Add 16 new amorphous materials. Most are created with the
ncrystal_hfg2ncmat script: Epoxy_Araldite506_C18H20O3 Kapton_C22H10N2O5
Nylon11_C11H21NO Nylon12_C12H23NO Nylon610_C16H30N2O2
Nylon66or6_C12H22N2O2 PEEK_C19H12O3 Polycarbonate_C16O3H14
Polyester_C10H8O4 Polylactide_C3H4O2 Polypropylene_C3H6 Polystyrene_C8H8
PVC_C2H3Cl Rubber_C5H8. The material Polyethylene_CH2.ncmat is not
created with the ncrystal_hfg2ncmat script (although it could have
been), but is instead based on phonon DOS curves provided by Kemal Ramic
from the ESS Spallation Physics group, (based on modelling with Phonopy,
VASP and OCLIMAX software). Finally, AcrylicGlass_C5O2H8.ncmat
(a.k.a. "Plexiglass" or "Lucite"), is based on a VDOS curve used in
ENDF/B-VIII.0 due to Petersen, et. al. (NCSU)., as it gave a slightly
better fit to experimental data.
* Add CaSiO3_sg2_Wollastonite.ncmat. The main motivation for adding this
is that our library should contain at least one triclinic material, to
make sure we exercise all code paths. For now, the material does not
have VDOS curves and the dynamics are described via the Debye model.
* Thanks to work by K. Ramic and J. I. Marquez Damian from the ESS
Spallation Physics group under the HighNESS EU project, a massive number
(64) of new crystalline materials are added to the data library, which
along with the 16 new amorphous materials brings the number of material
files shipped with NCrystal to a whooping total of 131! Additionally,
VDOS curves were added for 4 existing materials so that now only two
crystalline materials (gamma-calcium and wollastonite) in the entire
library have dynamics based purely on the less accurate Debye model. The
64 new crystalline materials are mostly polyatomic materials of interest
to the wider community of nuclear scientists, neutronics, and neutron
scattering instrumentation. All these materials come fully described
with both crystal structures and phonon VDOS curves, and have been
carefully validated. Crystal structures are mostly taken from the
Crystallography Open Database and the Materials Project, with most
structures verified by verification against multiple DB entries (using
the ncrystal_onlinedb2ncmat script). The VDOS curves are mostly based on
calculations with Phonopy and OCLIMAX software with input files from the
Phonon database at Kyoto university
(http://phonondb.mtl.kyoto-u.ac.jp/). VDOS curves for two materials,
magnesium hydride (MgH2) and magnesium deuteride (MgD2), were provided
by Davide Campi and Marco Bernasconi from University of Milano-Bicocca,
based on DFPT calculations with the Quantum-ESPRESSO package. All
materials were validated against total cross section curves where
available, VDOS curves were verified to be in agreement with
experimentally measured heat capacity curves, predicted material
densities were verified to be in accordance with known densities, and
crystal symmetries were verified with the ncrystal_verifyatompos script.
* Files for a few existing materials (SiLu2O5, UO2, SiO2) were renamed for
consistency, and Crystallography Open Database reference numbers were
added for all existing crystalline files.
* Fixed bug where some hkl planes slightly above the d-spacing cutoff were
left out of the final calculated list. Cubic, tetragonal, and
orthorombic space groups were not affected by this bug, and since our
default d-spacing cut off value is rather low, the effect was in any
case unlikely to have affected many users.
* Fixed bug where some hkl planes could very rarely be left out in
crystals containing elements with negative coherent scattering
lengths. It is not believed to be likely that this bug has affected any
users, but a few of the new materials would have been affected.
* Updated calcium scattering lengths due to improved measurements,
Palomino et al. (2019), DOI:10.1016/j.nima.2019.02.072. This was
implemented as a modification of b_coh for natural Ca and the dominant
isotope Ca40, increasing the values of both b_coh parameters by roughly
23%.
* NCrystal.directMultiCreate now works with NCrystal.TextData objects.
* Improve wrapping and indentation in code produced by the Python
formatVectorForNCMAT utility function.
* Add --stdout option to ncrystal_vdos2ncmat for easier usage in scripts.
* Small fix for NCMAT parser which previously allowed multiple entries in
@DENSITY section.
* Add unofficial mechanism for removing certain contributions when
expanding a VDOS to a scattering kernel. This is primarily intended to
allow people working on plugins with detailed coherent physics to avoid
double-counting by making it possible to exclude components otherwise
created based on the incoherent approximation. The mechanism is
implemented via the @CUSTOM_ support in NCMAT data, and it should be
understood that files with such sections are always considered "under
development", and unlikely to be suitable for general usage.
* Expose VDOS analysis utilities from NCVDOSEval.hh to Python and C
interfaces. In Python this is available both as a global analyseVDOS
function, and as a member function in DI_VDOS objects. Return value is a
dictionary with quantities derived from the VDOS curve: Debye
temperature, mean-squared-displacements, effective temperature, etc.
* Rename Python crossSectionNonOriented method to crossSectionIsotropic
for consistency, keeping crossSectionNonOriented as a backwards
compatible alias.
* Fix python NCrystal.atomDB method where some situations of querying for
unknown isotopes would always result in an exception even when called
with throwOnErrors=False (github issue #65).
* Type safe VDOSEval::elementMassAMU in C++.
* Conversion from shared_obj<T> to pointer T* in C++ is made explicit to
avoid footgun "const Info* info = NC::createInfo(..)". The footgun is
still available for references (const Info& info = ...), but that is a
necessary tradeoff since the implicit conversion to a reference is so
useful when passing shared objects to functions taking reference
parameters.
v2.6.1 2021-05-03
* Workaround for numerical artifacts in inelastic cross sections arising
from low-granularity beta-grids. In practice this affected materials
which either used hard-coded low-granularity scattering kernel, or those
with phonon VDOS curves that had large empty regions (often the case for
hydrogen VDOS curves in materials with C-H bounds). The workaround for
external low-granularity kernels consists of a simple "thickening" of
the beta-grid, while the workaround for VDOS-based kernels consists in
modifying the beta-grid generation code to ensure points are inserted
into any large gaps in the single-phonon region.
v2.6.0 2021-04-05
* Introduce NCMAT v4 which introduces a few new features, as described in
detail in the ncmat_doc.md file. The most important new feature relies
on the fact that it is possible to estimate atomic
mean-squared-displacements directly from a phonon density of state
distribution (VDOS), meaning that it is now allowed (and actually
recommended) to skip @DEBYETEMPERATURE's for crystalline materials where
atoms have VDOS curves available). This is not only useful, but improves
low-temperature reliability of the Debye-Waller factors used in the
elastic scattering components. This development was helped by Kemal
Ramic and Jose Ignacio Marquez Damian from the ESS Spallation Physics
group, and more details are available in the ncrystal GitHub issue
#58. The other new feature in NCMAT v4 is a new optional syntax for the
@CELL section, which allows more compact specification for certain
crystal systems (in particular cubic systems).
* The vast majority of crystalline materials in the NCrystal data library
were updated to take advantage of the new features, and in addition the
number of VDOS curves was increased dramatically, meaning that the
dynamics in almost all crystalline materials are now described using
actual VDOS curves rather than just Debye temperatures.
* Missing VDOS curves for all elements in beryllium-fluoride (BeF2),
aragonite (CaCO3), cuprite (Cu2O), periclase (MgO), and quartz (SiO2)
were provided by Kemal Ramic from the ESS Spallation Physics group,
based on modelling with Phonopy, VASP and OCLIMAX software.
* Missing VDOS curves for 14 mono-atomic materials were added (fixing
github issue #39): Au, Ba, Cr, Mg, Mo, Na, Nb, Pd, Pt, Rb, Sc, Sn, Y,
and Zn. Refer to comments in the individual NCMAT files for references
concerning the origin of these curves.
* Missing VDOS curves were added to uranium oxide (UO2), taken from
DOI:10.1103/PhysRevB.102.134312. Note that UO2 NCMAT files with VDOS
tuned for specific temperatures are available (refer to comments in the
UO2 NCMAT file for details).
* All existing files with VDOS have been update to NCMAT v4, and had
@DEBYETEMPERATURE sections removed in order to benefit from the better
performance of getting the atomic displacements from the VDOS.
* Added new material: gamma-Iron (Fe_sg225_Iron-gamma.ncmat) with VDOS
curve. At the same time, the not particularly useful beta-Iron file was
removed, so the NCrystal data library now contains both alpha- and
gamma-iron, both with VDOS curves.
* Expose debyeIsotropicMSD and debyeTempFromIsotropicMSD functions from
NCDebyeMSD.hh header to C and Python, allowing conversions between
atomic mean-squared-displacement and Debye temperature.
* Improve robustness of the function debyeTempFromIsotropicMSD. Previously
the internally deployed root-finding algorithm could fail under some
scenarios (e.g. non-ultra cold rubidium).
* Various improvements for ncrystal_vdos2ncmat.
* Compilation fix for pre-Catalina OSX where the aligned_alloc function is
apparently missing.
* Fix bug where early calls to removeAllDataSources could get reverted by
subsequent plugin loading.
* Before defining macros in public headers, check if present already and
if so undefine.
v2.5.81 2021-04-01