Skip to content

Commit 8b51b55

Browse files
committed
Adding the ESZE block to the pa table
1 parent 0e6be59 commit 8b51b55

4 files changed

Lines changed: 97 additions & 0 deletions

File tree

‎python/src/PhotoatomicTable.python.cpp‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@ void wrapPhotoatomicTable( python::module& module, python::module& ) {
191191
&Table::numberElectronSubshells,
192192
"The number of subshells for photoelectric and electron impact ionization"
193193
)
194+
.def_property_readonly(
195+
196+
"NE",
197+
&Table::NE,
198+
"The number of electron energy points"
199+
)
200+
.def_property_readonly(
201+
202+
"number_electron_energy_points",
203+
&Table::numberElectronEnergyPoints,
204+
"The number of electron energy points"
205+
)
194206
.def_property_readonly(
195207

196208
"ESZ",
@@ -286,6 +298,18 @@ void wrapPhotoatomicTable( python::module& module, python::module& ) {
286298
"photoelectric_cross_section_block",
287299
&Table::photoelectricCrossSectionBlock,
288300
"The photolectric cross section block for eprdata (NEPR > 0)"
301+
)
302+
.def_property_readonly(
303+
304+
"ESZE",
305+
&Table::ESZE,
306+
"The electron cross section block for eprdata (NEPR > 0)"
307+
)
308+
.def_property_readonly(
309+
310+
"electron_cross_section_block",
311+
&Table::electronCrossSectionBlock,
312+
"The electron cross section block for eprdata (NEPR > 0)"
289313
);
290314

291315
// add standard block definitions

‎src/ACEtk/PhotoatomicTable.hpp‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "ACEtk/block/PhotoatomicComptonProfileBlock.hpp"
1515
#include "ACEtk/block/PhotoatomicElectronSubshellBlock.hpp"
1616
#include "ACEtk/block/PhotoelectricCrossSectionBlock.hpp"
17+
#include "ACEtk/block/PhotoatomicElectronCrossSectionBlock.hpp"
1718

1819
namespace njoy {
1920
namespace ACEtk {
@@ -37,6 +38,8 @@ class PhotoatomicTable : protected Table {
3738
std::optional< block::SUBSH > subsh_;
3839
std::optional< block::SPHEL > sphel_;
3940

41+
std::optional< block::ESZE > esze_;
42+
4043
/* auxiliary functions */
4144
#include "ACEtk/PhotoatomicTable/src/generateBlocks.hpp"
4245
#include "ACEtk/PhotoatomicTable/src/generateData.hpp"
@@ -171,6 +174,16 @@ class PhotoatomicTable : protected Table {
171174
*/
172175
unsigned int numberElectronSubshells() const { return this->NSSH(); }
173176

177+
/**
178+
* @brief Return the number of electron energy points
179+
*/
180+
unsigned int NE() const { return this->data().NXS(8); }
181+
182+
/**
183+
* @brief Return the number of electron energy points
184+
*/
185+
unsigned int numberElectronEnergies() const { return this->NE(); }
186+
174187
// JXS information
175188

176189
// XSS blocks
@@ -282,6 +295,19 @@ class PhotoatomicTable : protected Table {
282295

283296
return this->SPHEL();
284297
}
298+
299+
/**
300+
* @brief Return the electron cross section block for eprdata (NEPR > 0)
301+
*/
302+
const std::optional< block::ESZE >& ESZE() const { return this->esze_; }
303+
304+
/**
305+
* @brief Return the electron cross section block for eprdata (NEPR > 0)
306+
*/
307+
const std::optional< block::ESZE >& electronCrossSectionBlock() const {
308+
309+
return this->ESZE();
310+
}
285311
};
286312

287313
} // ACEtk namespace

‎src/ACEtk/PhotoatomicTable/src/generateBlocks.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void generateBlocks() {
3333
this->swd_ = std::nullopt;
3434
this->subsh_ = std::nullopt;
3535
this->sphel_ = std::nullopt;
36+
this->esze_ = std::nullopt;
3637

3738
// starting iterator into the XSS array
3839
auto begin = this->data().XSS().begin();
@@ -84,5 +85,8 @@ void generateBlocks() {
8485
auto sphel = block( 16 );
8586
this->subsh_ = block::SUBSH( subsh.first, sphel.first, this->NSSH() );
8687
this->sphel_ = block::SPHEL( sphel.first, sphel.second, this->NSSH(), this->NES() );
88+
89+
auto esze = block( 19 );
90+
this->esze_ = block::ESZE( esze.first, esze.second, this->NSSH(), this->NE() );
8791
}
8892
}

‎src/ACEtk/PhotoatomicTable/test/PhotoatomicTable.test.cpp‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,11 @@ void verifyChunkMcplib( const PhotoatomicTable& chunk ) {
535535

536536
// SPHEL block - not an EPR data file
537537
CHECK( false == chunk.SPHEL().has_value() );
538+
539+
// XPROB block - EPR data file
540+
541+
// ESZE block - EPR data file
542+
CHECK( false == chunk.ESZE().has_value() );
538543
}
539544

540545
void verifyChunkMcplib03( const PhotoatomicTable& chunk ) {
@@ -683,6 +688,11 @@ void verifyChunkMcplib03( const PhotoatomicTable& chunk ) {
683688

684689
// SPHEL block - not an EPR data file
685690
CHECK( false == chunk.SPHEL().has_value() );
691+
692+
// XPROB block - EPR data file
693+
694+
// ESZE block - EPR data file
695+
CHECK( false == chunk.ESZE().has_value() );
686696
}
687697

688698
void verifyChunkEprdata12( const PhotoatomicTable& chunk ) {
@@ -849,4 +859,37 @@ void verifyChunkEprdata12( const PhotoatomicTable& chunk ) {
849859

850860
CHECK( 0.000000000000E+00 == Approx( chunk.SPHEL()->photoelectric(1).front() ) );
851861
CHECK( -3.249289163676E+01 == Approx( chunk.SPHEL()->photoelectric(1).back() ) );
862+
863+
// XPROB block - EPR data file
864+
865+
// ESZE block - EPR data file
866+
CHECK( true == chunk.ESZE().has_value() );
867+
868+
CHECK( 342 == chunk.ESZE()->NE() );
869+
CHECK( 342 == chunk.ESZE()->numberEnergyPoints() );
870+
CHECK( 1 == chunk.ESZE()->NSSH() );
871+
CHECK( 1 == chunk.ESZE()->numberElectronSubshells() );
872+
873+
CHECK( 342 == chunk.ESZE()->energies().size() );
874+
CHECK( 342 == chunk.ESZE()->total().size() );
875+
CHECK( 342 == chunk.ESZE()->elastic().size() );
876+
CHECK( 342 == chunk.ESZE()->bremsstrahlung().size() );
877+
CHECK( 342 == chunk.ESZE()->excitation().size() );
878+
CHECK( 342 == chunk.ESZE()->totalElectroionisation().size() );
879+
CHECK( 342 == chunk.ESZE()->electroionisation(1).size() );
880+
881+
CHECK( 1.000000000000E-05 == Approx( chunk.ESZE()->energies().front() ) );
882+
CHECK( 1.000000000000E+05 == Approx( chunk.ESZE()->energies().back() ) );
883+
CHECK( 2.748960297832E+08 == Approx( chunk.ESZE()->total().front() ) );
884+
CHECK( 1.643349906341E+05 == Approx( chunk.ESZE()->total().back() ) );
885+
CHECK( 2.748960000000E+08 == Approx( chunk.ESZE()->elastic().front() ) );
886+
CHECK( 1.311760000000E-05 == Approx( chunk.ESZE()->elastic().back() ) );
887+
CHECK( 2.978320000000E+01 == Approx( chunk.ESZE()->bremsstrahlung().front() ) );
888+
CHECK( 9.906210000000E-01 == Approx( chunk.ESZE()->bremsstrahlung().back() ) );
889+
CHECK( 0.000000000000E+00 == Approx( chunk.ESZE()->excitation().front() ) );
890+
CHECK( 8.144160000000E+04 == Approx( chunk.ESZE()->excitation().back() ) );
891+
CHECK( 0.000000000000E+00 == Approx( chunk.ESZE()->totalElectroionisation().front() ) );
892+
CHECK( 8.289240000000E+04 == Approx( chunk.ESZE()->totalElectroionisation().back() ) );
893+
CHECK( 0.000000000000E+00 == Approx( chunk.ESZE()->electroionisation(1).front() ) );
894+
CHECK( 8.289240000000E+04 == Approx( chunk.ESZE()->electroionisation(1).back() ) );
852895
}

0 commit comments

Comments
 (0)