Repository navigation
Expand file tree
/
Copy pathContinuousEnergyTable.python.cpp
More file actions
687 lines (597 loc) · 19 KB
/
Copy pathContinuousEnergyTable.python.cpp
File metadata and controls
687 lines (597 loc) · 19 KB
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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/ContinuousEnergyTable.hpp"
#include "ACEtk/fromFile.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
void wrapContinuousEnergyTable( python::module& module, python::module& ) {
// type aliases
using HeaderVariant = njoy::ACEtk::Table::HeaderVariant;
using Table = njoy::ACEtk::ContinuousEnergyTable;
using ESZ = njoy::ACEtk::continuous::ESZ;
using NU = njoy::ACEtk::continuous::NU;
using DNU = njoy::ACEtk::continuous::DNU;
using MTR = njoy::ACEtk::continuous::MTR;
using LQR = njoy::ACEtk::continuous::LQR;
using SIG = njoy::ACEtk::continuous::SIG;
using AND = njoy::ACEtk::continuous::AND;
using DLW = njoy::ACEtk::continuous::DLW;
using BDD = njoy::ACEtk::continuous::BDD;
using DNED = njoy::ACEtk::continuous::DNED;
using GPD = njoy::ACEtk::continuous::GPD;
using MTRP = njoy::ACEtk::continuous::MTRP;
using SIGP = njoy::ACEtk::continuous::SIGP;
using ANDP = njoy::ACEtk::continuous::ANDP;
using DLWP = njoy::ACEtk::continuous::DLWP;
using YP = njoy::ACEtk::continuous::YP;
using UNR = njoy::ACEtk::continuous::UNR;
using PTYPE = njoy::ACEtk::continuous::PTYPE;
using HPD = njoy::ACEtk::continuous::HPD;
using MTRH = njoy::ACEtk::continuous::MTRH;
using SIGH = njoy::ACEtk::continuous::SIGH;
using ANDH = njoy::ACEtk::continuous::ANDH;
using DLWH = njoy::ACEtk::continuous::DLWH;
using YH = njoy::ACEtk::continuous::YH;
// wrap views created by this table
// create the table
python::class_< Table > table(
module,
"ContinuousEnergyTable",
"A continuous energy ACE table\n\n"
"The ContinuousEnergyTable class represents the ACE table for continuous\n"
"energy data for incident neutrons and charged particles."
);
// wrap the table
table
.def(
python::init< unsigned int, unsigned int, unsigned int, HeaderVariant,
ESZ, std::optional< NU >, std::optional< DNU >,
MTR, LQR, SIG, AND, DLW,
std::optional< BDD >, std::optional< DNED >,
std::optional< GPD >, std::optional< MTRP >,
std::optional< SIGP >, std::optional< ANDP >,
std::optional< DLWP >, std::optional< YP >,
std::optional< UNR >, std::optional< PTYPE >,
std::optional< std::vector< HPD > >,
std::optional< std::vector< MTRH > >,
std::optional< std::vector< SIGH > >,
std::optional< std::vector< ANDH > >,
std::optional< std::vector< DLWH > >,
std::optional< std::vector< YH > > >(),
python::arg( "z" ), python::arg( "a" ), python::arg( "s" ),
python::arg( "header" ), python::arg( "esz" ),
python::arg( "nu" ) = std::nullopt, python::arg( "dnu" ) = std::nullopt,
python::arg( "mtr" ), python::arg( "lqr" ),
python::arg( "sig" ), python::arg( "ang" ), python::arg( "dlw" ),
python::arg( "bdd" ) = std::nullopt, python::arg( "dned" ) = std::nullopt,
python::arg( "gpd" ) = std::nullopt, python::arg( "mtrp" ) = std::nullopt,
python::arg( "sigp" ) = std::nullopt, python::arg( "andp" ) = std::nullopt,
python::arg( "dlwp" ) = std::nullopt, python::arg( "yp" ) = std::nullopt,
python::arg( "unr" ) = std::nullopt, python::arg( "ptype" ) = std::nullopt,
python::arg( "hpd" ) = std::nullopt, python::arg( "mtrh" ) = std::nullopt,
python::arg( "sigh" ) = std::nullopt,
python::arg( "andh" ) = std::nullopt, python::arg( "dlwh" ) = std::nullopt,
python::arg( "yh" ) = std::nullopt,
"Initialise the table\n\n"
"Arguments:\n"
" self the table\n"
" z the Z number of the target\n"
" a the A number of the target\n"
" s the S number of the target\n"
" header the header for the table\n"
" esz the principal cross section block\n"
" nu the optional fission neutron multiplicity block\n"
" dnu the optional delayed fission neutron multiplicity block\n"
" mtr the reaction number block\n"
" lqr the reaction Q value block\n"
" sig the cross section data block\n"
" ang the angular distribution data block\n"
" dlw the energy distribution data block\n"
" bdd the delayed fission neutron precursor data block\n"
" dned the delayed fission neutron energy distribution data block\n"
" gpd the photon production block\n"
" mtrp the photon production reaction number block\n"
" sigp the photon production cross section data block\n"
" angp the photon production angular distribution data block\n"
" dlwp the photon production energy distribution data block\n"
" yp the photon multiplicity reaction number block\n"
" unr the unresolved resonance probability table block\n"
" ptype the secondary particle type block\n"
" hpd the secondary particle production blocks\n"
" mtrh the secondary particle production reaction number blocks\n"
" sigh the secondary particle production cross section data blocks\n"
" andh the secondary particle angular distribution data blocks\n"
" dlwh the secondary particle energy distribution data blocks\n"
" yh the secondary particle multiplicity reaction number blocks"
)
.def_property_readonly(
"zaid",
&Table::ZAID,
"The full ZAID or SZAID of the table"
)
.def_property_readonly(
"AWR",
&Table::AWR,
"The atomic weight ratio (with respect to the neutron mass)"
)
.def_property_readonly(
"atomic_weight_ratio",
&Table::atomicWeightRatio,
"The atomic weight ratio (with respect to the neutron mass)"
)
.def_property_readonly(
"TEMP",
&Table::TEMP,
"The temperature of the table"
)
.def_property_readonly(
"temperature",
&Table::temperature,
"The temperature of the table"
)
.def_property_readonly(
"date",
&Table::date,
"The date"
)
.def_property_readonly(
"length",
&Table::length,
"The total length of the XSS array"
)
.def_property_readonly(
"za",
&Table::ZA,
"The ZA of the target"
)
.def_property_readonly(
"NES",
&Table::NES,
"The number of energy points"
)
.def_property_readonly(
"number_energy_points",
&Table::numberEnergyPoints,
"The number of energy points"
)
.def_property_readonly(
"NTR",
&Table::NTR,
"The number of available reactions (excluding elastic)"
)
.def_property_readonly(
"number_reactions",
&Table::numberReactions,
"The number of available reactions (excluding elastic)"
)
.def_property_readonly(
"total_number_reactions",
&Table::totalNumberReactions,
"The total number of available reactions (including elastic)"
)
.def_property_readonly(
"NR",
&Table::NR,
"The number of reactions excluding elastic that produce the projectile"
)
.def_property_readonly(
"number_projectile_production_reactions",
&Table::numberProjectileProductionReactions,
"The number of reactions excluding elastic that produce the projectile"
)
.def_property_readonly(
"NTRP",
&Table::NTRP,
"The number of reactions that produce photons"
)
.def_property_readonly(
"number_photon_production_reactions",
&Table::numberPhotonProductionReactions,
"The number of reactions that produce photons"
)
.def_property_readonly(
"NTYPE",
&Table::NTYPE,
"The number of secondary particle types (excluding the projectile and photons)"
)
.def_property_readonly(
"number_secondary_particle_types",
&Table::numberSecondaryParticleTypes,
"The number of secondary particle types (excluding the projectile and photons)"
)
.def_property_readonly(
"NPCR",
&Table::NPCR,
"The number of delayed percursor families"
)
.def_property_readonly(
"number_delayed_precursors",
&Table::numberDelayedPrecursors,
"The number of delayed percursor families"
)
.def_property_readonly(
"S",
&Table::S,
"The isomeric state of the target"
)
.def_property_readonly(
"isomeric_state",
&Table::isomericState,
"The isomeric state of the target"
)
.def_property_readonly(
"Z",
&Table::Z,
"The atom number of the target"
)
.def_property_readonly(
"atom_number",
&Table::atomNumber,
"The atom number of the target"
)
.def_property_readonly(
"A",
&Table::A,
"The mass number of the target"
)
.def_property_readonly(
"mass_number",
&Table::massNumber,
"The mass number of the target"
)
.def_property_readonly(
"ESZ",
&Table::ESZ,
"The principal cross section block"
)
.def_property_readonly(
"principal_cross_section_block",
&Table::principalCrossSectionBlock,
"The principal cross section block"
)
.def_property_readonly(
"NU",
&Table::NU,
"The fission multiplicity block"
)
.def_property_readonly(
"fission_multiplicity_block",
&Table::fissionMultiplicityBlock,
"The fission multiplicity block"
)
.def_property_readonly(
"MTR",
&Table::MTR,
"The reaction number block"
)
.def_property_readonly(
"reaction_number_block",
&Table::reactionNumberBlock,
"The reaction number block"
)
.def_property_readonly(
"LQR",
&Table::LQR,
"The reaction Q value block"
)
.def_property_readonly(
"reaction_qvalue_block",
&Table::reactionQValueBlock,
"The reaction Q value block"
)
.def_property_readonly(
"TYR",
&Table::TYR,
"The reference frame and multiplicity block"
)
.def_property_readonly(
"frame_and_multiplicity_block",
&Table::frameAndMultiplicityBlock,
"The reference frame and multiplicity block"
)
.def_property_readonly(
"SIG",
&Table::SIG,
"The cross section block"
)
.def_property_readonly(
"cross_section_block",
&Table::crossSectionBlock,
"The cross section block"
)
.def_property_readonly(
"AND",
&Table::AND,
"The angular distribution block"
)
.def_property_readonly(
"angular_distribution_block",
&Table::angularDistributionBlock,
"The angular distribution block"
)
.def_property_readonly(
"DLW",
&Table::DLW,
"The energy distribution block"
)
.def_property_readonly(
"energy_distribution_block",
&Table::energyDistributionBlock,
"The energy distribution block"
)
.def_property_readonly(
"GPD",
&Table::GPD,
"The photon production block"
)
.def_property_readonly(
"photon_production_block",
&Table::photonProductionBlock,
"The photon production block"
)
.def_property_readonly(
"MTRP",
&Table::MTRP,
"The photon production reaction number block"
)
.def_property_readonly(
"photon_production_reaction_number_block",
&Table::photonProductionReactionNumberBlock,
"The photon production reaction number block"
)
.def_property_readonly(
"SIGP",
&Table::SIGP,
"The photon production cross section block"
)
.def_property_readonly(
"photon_production_cross_section_block",
&Table::crossSectionBlock,
"The photon production cross section block"
)
.def_property_readonly(
"ANDP",
&Table::ANDP,
"The photon production angular distribution block"
)
.def_property_readonly(
"photon_production_angular_distribution_block",
&Table::photonProductionAngularDistributionBlock,
"The photon production angular distribution block"
)
.def_property_readonly(
"DLWP",
&Table::DLWP,
"The photon production energy distribution block"
)
.def_property_readonly(
"photon_production_energy_distribution_block",
&Table::photonProductionEnergyDistributionBlock,
"The photon production energy distribution block"
)
.def_property_readonly(
"YP",
&Table::YP,
"The photon multiplicity reaction number block"
)
.def_property_readonly(
"photon_multiplicity_reaction_number_block",
&Table::photonMultiplicityReactionNumberBlock,
"The photon multiplicity reaction number block"
)
.def_property_readonly(
"UNR",
&Table::UNR,
"The unresolved probability table block"
)
.def_property_readonly(
"probability_table_block",
&Table::probabilityTableBlock,
"The unresolved probability table block"
)
.def_property_readonly(
"DNU",
&Table::DNU,
"The delayed fission multiplicity block"
)
.def_property_readonly(
"delayed_fission_multiplicity_block",
&Table::delayedFissionMultiplicityBlock,
"The delayed fission multiplicity block"
)
.def_property_readonly(
"BDD",
&Table::BDD,
"The delayed neutron precursor block"
)
.def_property_readonly(
"delayed_neutron_precursor_block",
&Table::delayedNeutronPrecursorBlock,
"The delayed neutron precursor block"
)
.def_property_readonly(
"DNED",
&Table::DNED,
"The delayed neutron energy distribution block"
)
.def_property_readonly(
"delayed_neutron_energy_distribution_block",
&Table::delayedNeutronEnergyDistributionBlock,
"The delayed neutron energy distribution block"
)
.def_property_readonly(
"PTYPE",
&Table::PTYPE,
"The secondary particle type block"
)
.def_property_readonly(
"secondary_particle_type_block",
&Table::secondaryParticleTypeBlock,
"The secondary particle type block"
)
.def_property_readonly(
"NTRO",
&Table::NTRO,
"The secondary particle information block"
)
.def_property_readonly(
"secondary_particle_information_block",
&Table::secondaryParticleInformationBlock,
"The secondary particle information block"
)
.def_property_readonly(
"IXS",
&Table::IXS,
"The secondary particle locator block"
)
.def_property_readonly(
"secondary_particle_locator_block",
&Table::secondaryParticleLocatorBlock,
"The secondary particle locator block"
)
.def(
"HPD",
&Table::HPD,
python::arg( "index" ),
"Return the secondary particle production block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_production_block",
&Table::secondaryParticleProductionBlock,
python::arg( "index" ),
"Return the secondary particle production block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"MTRH",
&Table::MTRH,
python::arg( "index" ),
"Return the reaction number block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_reaction_number_block",
&Table::secondaryParticleReactionNumberBlock,
python::arg( "index" ),
"Return the reaction number block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"TYRH",
&Table::TYRH,
python::arg( "index" ),
"Return the reference frame and multiplicity block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_frame_and_multiplicity_block",
&Table::secondaryParticleFrameAndMultiplicityBlock,
python::arg( "index" ),
"Return the reference frame and multiplicity block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"SIGH",
&Table::SIGH,
python::arg( "index" ),
"Return the production cross section block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_production_cross_section_block",
&Table::secondaryParticleFrameAndMultiplicityBlock,
python::arg( "index" ),
"Return the production cross section block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"ANDH",
&Table::ANDH,
python::arg( "index" ),
"Return the angular distribution block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_angular_distribution_block",
&Table::secondaryParticleAngularDistributionBlock,
python::arg( "index" ),
"Return the angular distribution block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"DLWH",
&Table::DLWH,
python::arg( "index" ),
"Return the energy distribution block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_energy_distribution_block",
&Table::secondaryParticleEnergyDistributionBlock,
python::arg( "index" ),
"Return the energy distribution block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"YH",
&Table::YH,
python::arg( "index" ),
"Return the multiplicity reaction number block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"secondary_particle_multiplicity_reaction_number_block",
&Table::secondaryParticleMultiplicityReactionNumberBlock,
python::arg( "index" ),
"Return the multiplicity reaction number block for a secondary particle index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
);
// add standard block definitions
addStandardTableDefinitions< Table >( table );
}