ncrystal 4.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,206 @@
1
+ The Apache 2.0 license is reproduced in the following. See the NOTICE file for
2
+ important details of how it applies to the distributed NCrystal code.
3
+
4
+
5
+
6
+ Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright [yyyy] [name of copyright owner]
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
@@ -0,0 +1,531 @@
1
+ Metadata-Version: 2.2
2
+ Name: ncrystal
3
+ Version: 4.0.0
4
+ Summary: Library for thermal neutron transport in crystals and other materials.
5
+ Author: NCrystal developers (Thomas Kittelmann, Xiao Xiao Cai)
6
+ License: The Apache 2.0 license is reproduced in the following. See the NOTICE file for
7
+ important details of how it applies to the distributed NCrystal code.
8
+
9
+
10
+
11
+ Apache License
12
+ Version 2.0, January 2004
13
+ http://www.apache.org/licenses/
14
+
15
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
16
+
17
+ 1. Definitions.
18
+
19
+ "License" shall mean the terms and conditions for use, reproduction,
20
+ and distribution as defined by Sections 1 through 9 of this document.
21
+
22
+ "Licensor" shall mean the copyright owner or entity authorized by
23
+ the copyright owner that is granting the License.
24
+
25
+ "Legal Entity" shall mean the union of the acting entity and all
26
+ other entities that control, are controlled by, or are under common
27
+ control with that entity. For the purposes of this definition,
28
+ "control" means (i) the power, direct or indirect, to cause the
29
+ direction or management of such entity, whether by contract or
30
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
31
+ outstanding shares, or (iii) beneficial ownership of such entity.
32
+
33
+ "You" (or "Your") shall mean an individual or Legal Entity
34
+ exercising permissions granted by this License.
35
+
36
+ "Source" form shall mean the preferred form for making modifications,
37
+ including but not limited to software source code, documentation
38
+ source, and configuration files.
39
+
40
+ "Object" form shall mean any form resulting from mechanical
41
+ transformation or translation of a Source form, including but
42
+ not limited to compiled object code, generated documentation,
43
+ and conversions to other media types.
44
+
45
+ "Work" shall mean the work of authorship, whether in Source or
46
+ Object form, made available under the License, as indicated by a
47
+ copyright notice that is included in or attached to the work
48
+ (an example is provided in the Appendix below).
49
+
50
+ "Derivative Works" shall mean any work, whether in Source or Object
51
+ form, that is based on (or derived from) the Work and for which the
52
+ editorial revisions, annotations, elaborations, or other modifications
53
+ represent, as a whole, an original work of authorship. For the purposes
54
+ of this License, Derivative Works shall not include works that remain
55
+ separable from, or merely link (or bind by name) to the interfaces of,
56
+ the Work and Derivative Works thereof.
57
+
58
+ "Contribution" shall mean any work of authorship, including
59
+ the original version of the Work and any modifications or additions
60
+ to that Work or Derivative Works thereof, that is intentionally
61
+ submitted to Licensor for inclusion in the Work by the copyright owner
62
+ or by an individual or Legal Entity authorized to submit on behalf of
63
+ the copyright owner. For the purposes of this definition, "submitted"
64
+ means any form of electronic, verbal, or written communication sent
65
+ to the Licensor or its representatives, including but not limited to
66
+ communication on electronic mailing lists, source code control systems,
67
+ and issue tracking systems that are managed by, or on behalf of, the
68
+ Licensor for the purpose of discussing and improving the Work, but
69
+ excluding communication that is conspicuously marked or otherwise
70
+ designated in writing by the copyright owner as "Not a Contribution."
71
+
72
+ "Contributor" shall mean Licensor and any individual or Legal Entity
73
+ on behalf of whom a Contribution has been received by Licensor and
74
+ subsequently incorporated within the Work.
75
+
76
+ 2. Grant of Copyright License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ copyright license to reproduce, prepare Derivative Works of,
80
+ publicly display, publicly perform, sublicense, and distribute the
81
+ Work and such Derivative Works in Source or Object form.
82
+
83
+ 3. Grant of Patent License. Subject to the terms and conditions of
84
+ this License, each Contributor hereby grants to You a perpetual,
85
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
86
+ (except as stated in this section) patent license to make, have made,
87
+ use, offer to sell, sell, import, and otherwise transfer the Work,
88
+ where such license applies only to those patent claims licensable
89
+ by such Contributor that are necessarily infringed by their
90
+ Contribution(s) alone or by combination of their Contribution(s)
91
+ with the Work to which such Contribution(s) was submitted. If You
92
+ institute patent litigation against any entity (including a
93
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
94
+ or a Contribution incorporated within the Work constitutes direct
95
+ or contributory patent infringement, then any patent licenses
96
+ granted to You under this License for that Work shall terminate
97
+ as of the date such litigation is filed.
98
+
99
+ 4. Redistribution. You may reproduce and distribute copies of the
100
+ Work or Derivative Works thereof in any medium, with or without
101
+ modifications, and in Source or Object form, provided that You
102
+ meet the following conditions:
103
+
104
+ (a) You must give any other recipients of the Work or
105
+ Derivative Works a copy of this License; and
106
+
107
+ (b) You must cause any modified files to carry prominent notices
108
+ stating that You changed the files; and
109
+
110
+ (c) You must retain, in the Source form of any Derivative Works
111
+ that You distribute, all copyright, patent, trademark, and
112
+ attribution notices from the Source form of the Work,
113
+ excluding those notices that do not pertain to any part of
114
+ the Derivative Works; and
115
+
116
+ (d) If the Work includes a "NOTICE" text file as part of its
117
+ distribution, then any Derivative Works that You distribute must
118
+ include a readable copy of the attribution notices contained
119
+ within such NOTICE file, excluding those notices that do not
120
+ pertain to any part of the Derivative Works, in at least one
121
+ of the following places: within a NOTICE text file distributed
122
+ as part of the Derivative Works; within the Source form or
123
+ documentation, if provided along with the Derivative Works; or,
124
+ within a display generated by the Derivative Works, if and
125
+ wherever such third-party notices normally appear. The contents
126
+ of the NOTICE file are for informational purposes only and
127
+ do not modify the License. You may add Your own attribution
128
+ notices within Derivative Works that You distribute, alongside
129
+ or as an addendum to the NOTICE text from the Work, provided
130
+ that such additional attribution notices cannot be construed
131
+ as modifying the License.
132
+
133
+ You may add Your own copyright statement to Your modifications and
134
+ may provide additional or different license terms and conditions
135
+ for use, reproduction, or distribution of Your modifications, or
136
+ for any such Derivative Works as a whole, provided Your use,
137
+ reproduction, and distribution of the Work otherwise complies with
138
+ the conditions stated in this License.
139
+
140
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
141
+ any Contribution intentionally submitted for inclusion in the Work
142
+ by You to the Licensor shall be under the terms and conditions of
143
+ this License, without any additional terms or conditions.
144
+ Notwithstanding the above, nothing herein shall supersede or modify
145
+ the terms of any separate license agreement you may have executed
146
+ with Licensor regarding such Contributions.
147
+
148
+ 6. Trademarks. This License does not grant permission to use the trade
149
+ names, trademarks, service marks, or product names of the Licensor,
150
+ except as required for reasonable and customary use in describing the
151
+ origin of the Work and reproducing the content of the NOTICE file.
152
+
153
+ 7. Disclaimer of Warranty. Unless required by applicable law or
154
+ agreed to in writing, Licensor provides the Work (and each
155
+ Contributor provides its Contributions) on an "AS IS" BASIS,
156
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
157
+ implied, including, without limitation, any warranties or conditions
158
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
159
+ PARTICULAR PURPOSE. You are solely responsible for determining the
160
+ appropriateness of using or redistributing the Work and assume any
161
+ risks associated with Your exercise of permissions under this License.
162
+
163
+ 8. Limitation of Liability. In no event and under no legal theory,
164
+ whether in tort (including negligence), contract, or otherwise,
165
+ unless required by applicable law (such as deliberate and grossly
166
+ negligent acts) or agreed to in writing, shall any Contributor be
167
+ liable to You for damages, including any direct, indirect, special,
168
+ incidental, or consequential damages of any character arising as a
169
+ result of this License or out of the use or inability to use the
170
+ Work (including but not limited to damages for loss of goodwill,
171
+ work stoppage, computer failure or malfunction, or any and all
172
+ other commercial damages or losses), even if such Contributor
173
+ has been advised of the possibility of such damages.
174
+
175
+ 9. Accepting Warranty or Additional Liability. While redistributing
176
+ the Work or Derivative Works thereof, You may choose to offer,
177
+ and charge a fee for, acceptance of support, warranty, indemnity,
178
+ or other liability obligations and/or rights consistent with this
179
+ License. However, in accepting such obligations, You may act only
180
+ on Your own behalf and on Your sole responsibility, not on behalf
181
+ of any other Contributor, and only if You agree to indemnify,
182
+ defend, and hold each Contributor harmless for any liability
183
+ incurred by, or claims asserted against, such Contributor by reason
184
+ of your accepting any such warranty or additional liability.
185
+
186
+ END OF TERMS AND CONDITIONS
187
+
188
+ APPENDIX: How to apply the Apache License to your work.
189
+
190
+ To apply the Apache License to your work, attach the following
191
+ boilerplate notice, with the fields enclosed by brackets "[]"
192
+ replaced with your own identifying information. (Don't include
193
+ the brackets!) The text should be enclosed in the appropriate
194
+ comment syntax for the file format. We also recommend that a
195
+ file or class name and description of purpose be included on the
196
+ same "printed page" as the copyright notice for easier
197
+ identification within third-party archives.
198
+
199
+ Copyright [yyyy] [name of copyright owner]
200
+
201
+ Licensed under the Apache License, Version 2.0 (the "License");
202
+ you may not use this file except in compliance with the License.
203
+ You may obtain a copy of the License at
204
+
205
+ http://www.apache.org/licenses/LICENSE-2.0
206
+
207
+ Unless required by applicable law or agreed to in writing, software
208
+ distributed under the License is distributed on an "AS IS" BASIS,
209
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210
+ See the License for the specific language governing permissions and
211
+ limitations under the License.
212
+
213
+ Project-URL: Homepage, https://mctools.github.io/ncrystal/
214
+ Project-URL: Bug Tracker, https://github.com/mctools/ncrystal/issues
215
+ Classifier: Programming Language :: Python :: 3
216
+ Classifier: License :: OSI Approved :: Apache Software License
217
+ Requires-Python: >=3.8
218
+ Description-Content-Type: text/markdown
219
+ License-File: LICENSE
220
+ Requires-Dist: ncrystal-core==4.0.0
221
+ Requires-Dist: ncrystal-python==4.0.0
222
+ Provides-Extra: composer
223
+ Requires-Dist: spglib; extra == "composer"
224
+ Provides-Extra: cif
225
+ Requires-Dist: ase<3.24.0; extra == "cif"
226
+ Requires-Dist: gemmi; extra == "cif"
227
+ Requires-Dist: spglib; extra == "cif"
228
+ Provides-Extra: plot
229
+ Requires-Dist: matplotlib; extra == "plot"
230
+ Provides-Extra: all
231
+ Requires-Dist: ase<3.24.0; extra == "all"
232
+ Requires-Dist: gemmi; extra == "all"
233
+ Requires-Dist: spglib; extra == "all"
234
+ Requires-Dist: matplotlib; extra == "all"
235
+ Provides-Extra: devel
236
+ Requires-Dist: simple-build-system>=1.6.0; extra == "devel"
237
+ Requires-Dist: ruff>=0.8.0; extra == "devel"
238
+ Requires-Dist: pyyaml; extra == "devel"
239
+ Requires-Dist: cppcheck; extra == "devel"
240
+ Requires-Dist: mpmath; extra == "devel"
241
+ Requires-Dist: tomli; extra == "devel"
242
+ Requires-Dist: pybind11; extra == "devel"
243
+
244
+ NCrystal : A library for thermal neutron transport in crystals and other materials
245
+ ----------------------------------------------------------------------------------
246
+
247
+ This is a source distribution of NCrystal, a library and associated tools which
248
+ enables calculations for Monte Carlo simulations of thermal neutrons in crystals
249
+ and other materials. Supported is a range of physics including both coherent,
250
+ incoherent, elastic and inelastic scatterings in a wide range of materials,
251
+ including crystal powders, mosaic single crystals, layered single crystals,
252
+ amorphous solids, and liquids. Multiphase materials or isotopically enriched
253
+ material are supported as well, and the framework furthermore supports
254
+ phase-contrast (SANS) physics. Written in C++, interfaces and infrastructure
255
+ facilitate integration into existing simulation frameworks such as OpenMC
256
+ (https://docs.openmc.org/), Geant4 (https://geant4.web.cern.ch/) or McStas
257
+ (http://mcstas.org/), as well as allowing direct usage from C++, C or Python
258
+ code or via command-line tools. While the C++ library is designed with a high
259
+ degree of flexibility in mind for developers, typical end-user configuration is
260
+ deliberately kept simple and uniform across various applications and APIs - this
261
+ for instance allows tuning and validation of a particular material configuration
262
+ to be performed in one tool before it is then deployed in another.
263
+
264
+ In addition to code and tools, the NCrystal distribution also includes a set of
265
+ validated data files, covering many crystals important at neutron scattering
266
+ facilities. For more information about the properties and validity of each file,
267
+ users are referred to the dedicated page at:
268
+
269
+ https://github.com/mctools/ncrystal/wiki/Data-library
270
+
271
+ Supporting compilation with all modern C++ standards (C++11 and later), the code
272
+ has no third-party dependencies and is available under the highly liberal open
273
+ source Apache 2.0 license (see NOTICE and LICENSE files for usage conditions and
274
+ the INSTALL file for build and installation instructions). NCrystal was
275
+ developed in close collaboration by Xiao Xiao Cai (DTU, ESS) and Thomas
276
+ Kittelmann (ESS) and was supported in part by the European Union's Horizon 2020
277
+ research and innovation programme under grant agreement No 676548 (the
278
+ BrightnESS project) and 951782 (the HighNESS project).
279
+
280
+ A very substantial effort went into developing NCrystal. If you use it for your
281
+ work, we would appreciate it if you would use the following primary reference in
282
+ your work:
283
+
284
+ X.-X. Cai and T. Kittelmann, NCrystal: A library for thermal neutron
285
+ transport, Computer Physics Communications 246 (2020) 106851,
286
+ https://doi.org/10.1016/j.cpc.2019.07.015
287
+
288
+ For work benefitting from elastic physics (e.g. Bragg diffraction), we
289
+ furthermore request that you additionally also use the following reference in
290
+ your work:
291
+
292
+ T. Kittelmann and X.-X. Cai, Elastic neutron scattering models
293
+ for NCrystal, Computer Physics Communications 267 (2021) 108082,
294
+ https://doi.org/10.1016/j.cpc.2021.108082
295
+
296
+ For work benefitting from our inelastic physics, we furthermore request that you
297
+ additionally also use the following reference in your work:
298
+
299
+ X.-X. Cai, T. Kittelmann, et. al., "Rejection-based sampling of inelastic
300
+ neutron scattering", Journal of Computational Physics 380 (2019) 400-407,
301
+ https://doi.org/10.1016/j.jcp.2018.11.043
302
+
303
+ The rest of this file gives a brief overview of the manners in which NCrystal
304
+ capabilities can be utilised. Further instructions and documentation, along with
305
+ the latest version of NCrystal, can be found at https://mctools.github.io/ncrystal/
306
+
307
+
308
+
309
+ Using the NCrystal installation from the command-line
310
+ -----------------------------------------------------
311
+
312
+ After installing NCrystal and having sourced the setup.sh script mentioned in
313
+ the INSTALL file, you can run any of the commands from the $NCRYSTALDIR/bin
314
+ directory, which includes example code as well as the "nctool" command. Start by
315
+ reading the usage instructions:
316
+
317
+ $> nctool --help
318
+
319
+ Assuming you chose to install data files, you can try to let NCrystal load one
320
+ of the data files found in $NCRYSTALDIR/data/ (or provide the absolute path to a
321
+ data file downloaded from https://github.com/mctools/ncrystal/wiki/Data-library)
322
+ and either dump the derived information to the terminal...:
323
+
324
+ $> nctool --dump 'Al_sg225.ncmat;temp=10C'
325
+
326
+ Note that this included a choice of temperature. If you leave it out, it will
327
+ usually default to room temperature (20C). You can also plot (powder)
328
+ cross-sections and sampled scatter angles with:
329
+
330
+ $> nctool 'Al_sg225.ncmat;temp=10C'
331
+
332
+
333
+
334
+ Using the NCrystal installation from C++, C or Python code
335
+ -----------------------------------------------------------------------------
336
+
337
+ If you wish to use NCrystal from Python code, there is no special setup needed,
338
+ assuming NCrystal was installed correctly (cf. INSTALL.md). If you on the other
339
+ hand wish to use NCrystal from your compiled C++ or C code, you must put
340
+ appropriate build flags. The recommended way is using CMake to do this (see next
341
+ section), but otherwise you must ensure that the NCrystal header files are in
342
+ your compiler's include path, and that the NCrystal library is linked
343
+ correctly. Here are some examples of how this could for instance be done, with a
344
+ C and a C++ app respectively:
345
+
346
+ export LDFLAGS="${LDFLAGS:-} -Wl,-rpath,$(ncrystal-config --show libdir) $(ncrystal-config --show libpath)"
347
+ export CFLAGS="${CFLAGS:-} -I$(ncrystal-config --show includedir)"
348
+ export CXXFLAGS="${CXXFLAGS:-} -I$(ncrystal-config --show includedir)"
349
+ cc -std=c11 ${LDFLAGS} ${CFLAGS} my_c_code.c -o my_c_app
350
+ c++ -std=c++17 ${LDFLAGS} ${CXXFLAGS} my_cpp_code.cpp -o my_cpp_app
351
+
352
+ Then, in your code you can access the relevant APIs with with statements like:
353
+
354
+ #include "NCrystal/NCrystal.hh" // C++ code, core NCrystal
355
+ #include "NCrystal/ncrystal.h" // C code
356
+ import NCrystal ## Python code
357
+
358
+ In the ./examples/ directory of your NCrystal distribution that you got after
359
+ downloading and unpacking the NCrystal source tar-ball, you will find small
360
+ examples of code using NCrystal. For C++/C, there is currently no documentation
361
+ beyond the header files and examples. In the case of Python, there is integrated
362
+ documentation available via the usual "help" function, accessed with:
363
+
364
+ import NCrystal
365
+ help(NCrystal)
366
+
367
+ There are also several jupyter-lab notebooks showcasing the NCrystal python API
368
+ at https://github.com/mctools/ncrystal-notebooks
369
+
370
+
371
+
372
+ Configuring CMake-based projects to use NCrystal
373
+ ------------------------------------------------
374
+
375
+ Assuming NCrystal was built and installed via CMake, it is possible and
376
+ recommended for client projects to simply use NCrystal as a CMake package in
377
+ order to correctly build their C/C++ code which depends on the NCrystal C++ or C
378
+ APIs.
379
+
380
+ Depending on where NCrystal was installed on the system, it might be necessary
381
+ to let CMake know about it via the usual mechanisms (for instance passing
382
+ -DNCrystal_DIR=/path/to/ncrystalinstall as an argument to cmake on the command
383
+ line).
384
+
385
+ CMake code for a small project using NCrystal might look like the following
386
+ (assume that exampleapp.cc below includes the NCrystal/NCrystal.hh header):
387
+
388
+ cmake_minimum_required(VERSION 3.10...3.26)
389
+ project(MyExampleProject LANGUAGES CXX)
390
+ execute_process( COMMAND "ncrystal-config" "--show" "cmakedir"
391
+ OUTPUT_VARIABLE NCrystal_DIR
392
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
393
+ find_package(NCrystal 4.0.0 REQUIRED)
394
+ add_executable(exampleapp "${PROJECT_SOURCE_DIR}/exampleapp.cc")
395
+ target_link_libraries( exampleapp NCrystal::NCrystal )
396
+ install( TARGETS exampleapp DESTINATION bin )
397
+
398
+ Note that the "execute_process( ... )" command above is optional, but is
399
+ required before the code can work in an environment where the NCrystal CMake
400
+ modules are not automatically injected into the CMake package search path (this
401
+ notably includes NCrystal installed via "pip install ncrystal").
402
+
403
+
404
+
405
+ Using the NCrystal with Geant4
406
+ ------------------------------
407
+
408
+ The instructions for the NCrystal-Geant4 bindings are currently being
409
+ updated. Once complete, they will appear on
410
+ https://github.com/mctools/ncrystal-geant4
411
+
412
+
413
+
414
+ Using NCrystal with OpenMC
415
+ --------------------------
416
+
417
+ Using NCrystal materials in OpenMc is supported since OpenMC release 13.3, and
418
+ uses a nice simple syntax in the Python API:
419
+
420
+ ```
421
+ mat = openmc.Material.from_ncrystal('Polyethylene_CH2.ncmat;temp=50C')
422
+ ```
423
+
424
+ which when used in a complete OpenMC project, results in the following material
425
+ entry being added to the `materials.xml` produced:
426
+
427
+ ```
428
+ <material cfg="Polyethylene_CH2.ncmat;temp=50C" id="1" temperature="323.15">
429
+ <density units="g/cm3" value="0.92" />
430
+ <nuclide ao="0.66656284" name="H1" />
431
+ <nuclide ao="0.00010382666666666666" name="H2" />
432
+ <nuclide ao="0.32964066666666664" name="C12" />
433
+ <nuclide ao="0.003692666666666666" name="C13" />
434
+ </material>
435
+ ```
436
+
437
+ Temperature, density and material composition were all created automatically
438
+ from the cfg-string, and the cfg-string itself was also encoded. Upon launching
439
+ the simulation with the OpenMC binary executable `openmc`, it will handle the
440
+ material as usual, except that low-energy neutron scattering physics (currently
441
+ defined as ($E<5eV$) will be provided by the algorithms in NCrystal.
442
+
443
+ A few issues might warrent attention:
444
+
445
+ 1. If you try to assemble the above xml manually, it is rather unlikely that you
446
+ will get the base densities and compositions right. It is safest to stick to
447
+ let the Python API compose the xml for you.
448
+ 2. After creation with `mat=openmc.Material.from_ncrystal(..)`, you can not use
449
+ the usual OpenMC API to modify the material density, temperature, or
450
+ composition. So be sure to reflect the final desired material inside the
451
+ NCrystal cfg-string.
452
+ 3. The OpenMC binaries must have been built with NCrystal support, or your job
453
+ will fail once you launch the simulation (you can check for this by running
454
+ the command `openmc -v`). Specifically (as documented on
455
+ https://docs.openmc.org/en/stable/usersguide/install.html) you must supply
456
+ the CMake flag `cmake -DOPENMC_USE_NCRYSTAL=on ..` (and make sure NCrystal is
457
+ available already). Note: we have agreement from OpenMC developers to enable
458
+ NCrystal support by default in the conda-forge version of OpenMC. So in "the
459
+ near future" (summer/fall 2023) conda users will always have NCrystal support
460
+ available in OpenMC.
461
+
462
+ For more information, please consult the user guide at:
463
+
464
+ https://docs.openmc.org/
465
+
466
+ In particular note the sections concerning installation and usage of NCrystal in
467
+ the sections:
468
+
469
+ https://docs.openmc.org/en/stable/usersguide/install.html
470
+ https://docs.openmc.org/en/stable/usersguide/materials.html
471
+
472
+
473
+
474
+ Using NCrystal with McStas
475
+ --------------------------
476
+
477
+ NOTE: The following discussion concerns the modern McStas 3 branch, and might in
478
+ particular not be 100% accurate for releases earlier than McStas 3.3 (probably
479
+ OK for v3.2 though).
480
+
481
+ You can use NCrystal in two ways in McStas. You can either use it for advanced
482
+ studies with the McStas Union sub-system through the NCrystal_process component,
483
+ or it can be used via the dedicated NCrystal_sample.comp which is simpler but
484
+ less feature rich. In any case, the McStas instrument file compilation will need
485
+ to build against NCrystal, and it uses the ncrystal-config command to figure out
486
+ the correct settings for doing so. Thus, you can always invoke "ncrystal-config
487
+ -s" to find out if you have the right NCrystal installation available and
488
+ active. Depending on how you installed McStas, NCrystal is most likely already
489
+ available. If not, you can try one of the following ways of enabling it:
490
+
491
+ $> conda install conda-forge::ncrystal [if you are in a conda-forge env]
492
+ $> python3 -mpip install ncrystal [for non-conda users]
493
+
494
+ It is beyond the scope for this README to provide a full documentation of
495
+ McStas, or the Union sub-system, but if you are using McStasScript to compose
496
+ your instruments, you can add NCrystal materials into your Union geometry using
497
+ code like:
498
+
499
+ from mcstasscript.tools.ncrystal_union import add_ncrystal_union_material
500
+ add_ncrystal_union_material(instr, name="myAl", cfgstr="Al_sg225.ncmat;temp=10C")
501
+
502
+ This creates the material and gives it the name "myAl", which you must later
503
+ attach to a particular Union volume, like for instance:
504
+
505
+ myvol.set_parameters(radius=0.01, yheight=0.01,
506
+ material_string='"myAl"', priority=1)
507
+
508
+ If you are instead hand-editing your instrument files, you can generate code
509
+ which defines Union materials from an NCrystal cfg-string by invoking:
510
+
511
+ $> python3 -mNCrystal.mcstasutils --union myAl 'Al_sg225.ncmat;temp=250K'
512
+
513
+ It should be noted that McStas 3.3 also provides a new SHELL syntax which can
514
+ also be used to faciliate this invocation from with a classic .instr file.
515
+
516
+ On the other hand, the dedicated NCrystal_sample.comp component, embeds NCrystal
517
+ material simulations into simple shapes (currently boxes, cylinders and
518
+ spheres), and can be used for components representing samples, filters or
519
+ monochromators, entrance windows, etc. The component is since McStas v3.3 part
520
+ of the McStas release itself, and can be used in a .instr file - for instance if
521
+ you wish to set up an r=1cm sphere with powdered sapphire you would write:
522
+
523
+ COMPONENT mysample = NCrystal_sample(cfg="Al2O3_sg167_Corundum.ncmat",radius=0.01)
524
+ AT (0, 0, 0) RELATIVE PREVIOUS
525
+
526
+ For more documentation about the NCrystal_sample component, run:
527
+
528
+ $> mcdoc NCrystal_sample
529
+
530
+ Or consult the documentation online at
531
+ https://www.mcstas.org/download/components/
@@ -0,0 +1,5 @@
1
+ ncrystal-4.0.0.dist-info/LICENSE,sha256=cSwpZfFyXSC1mBPZgO2TbtGwoH2tR1SomMa5tEUU9o0,11509
2
+ ncrystal-4.0.0.dist-info/METADATA,sha256=Vt-3mkQYRZZHJaCw6L_qgvjlEWmsmnhRZ2-WvvhverU,28175
3
+ ncrystal-4.0.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ ncrystal-4.0.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ ncrystal-4.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+