-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from njoy/feature/ace-part2
Feature/ace part2
- Loading branch information
Showing
15 changed files
with
2,308 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#include "dryad/format/ace/createTabulatedScatteringFunction.hpp" | ||
|
||
#include "dryad/format/ace/photoatomic/createReactionNumbers.hpp" | ||
#include "dryad/format/ace/photoatomic/createPartialReactionNumbers.hpp" | ||
#include "dryad/format/ace/photoatomic/createTabulatedCrossSections.hpp" | ||
#include "dryad/format/ace/photoatomic/createReactions.hpp" | ||
#include "dryad/format/ace/photoatomic/createProjectileTarget.hpp" | ||
|
||
#include "dryad/format/ace/electroatomic/createReactionNumbers.hpp" | ||
#include "dryad/format/ace/electroatomic/createPartialReactionNumbers.hpp" | ||
#include "dryad/format/ace/electroatomic/createTabulatedCrossSections.hpp" | ||
#include "dryad/format/ace/electroatomic/createReactions.hpp" | ||
#include "dryad/format/ace/electroatomic/createProjectileTarget.hpp" |
35 changes: 35 additions & 0 deletions
35
src/dryad/format/ace/electroatomic/createProjectileTarget.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef NJOY_DRYAD_FORMAT_ACE_ELECTROATOMIC_CREATEPROJECTILETARGET | ||
#define NJOY_DRYAD_FORMAT_ACE_ELECTROATOMIC_CREATEPROJECTILETARGET | ||
|
||
// system includes | ||
#include <vector> | ||
|
||
// other includes | ||
#include "tools/Log.hpp" | ||
#include "dryad/ProjectileTarget.hpp" | ||
#include "dryad/format/ace/electroatomic/createReactions.hpp" | ||
#include "ACEtk/PhotoatomicTable.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
namespace format { | ||
namespace ace { | ||
namespace electroatomic { | ||
|
||
/** | ||
* @brief Create a ProjectileTarget for electroatomic data | ||
*/ | ||
ProjectileTarget createProjectileTarget( const ACEtk::PhotoatomicTable& table ) { | ||
|
||
return ProjectileTarget( id::ParticleID( "e-" ), id::ParticleID( table.ZAID() ), | ||
InteractionType::Atomic, | ||
createReactions( table ) ); | ||
} | ||
|
||
} // electroatomic namespace | ||
} // ace namespace | ||
} // format namespace | ||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#ifndef NJOY_DRYAD_FORMAT_ACE_ELECTROATOMIC_CREATEREACTIONS | ||
#define NJOY_DRYAD_FORMAT_ACE_ELECTROATOMIC_CREATEREACTIONS | ||
|
||
// system includes | ||
#include <vector> | ||
|
||
// other includes | ||
#include "tools/Log.hpp" | ||
#include "dryad/Reaction.hpp" | ||
#include "dryad/format/ace/electroatomic/createReactionNumbers.hpp" | ||
#include "dryad/format/ace/electroatomic/createPartialReactionNumbers.hpp" | ||
#include "dryad/format/ace/electroatomic/createTabulatedCrossSections.hpp" | ||
#include "ACEtk/PhotoatomicTable.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
namespace format { | ||
namespace ace { | ||
namespace electroatomic { | ||
|
||
/** | ||
* @brief Create the reactions for electroatomic data | ||
*/ | ||
std::vector< Reaction > createReactions( const ACEtk::PhotoatomicTable& table ) { | ||
|
||
std::vector< Reaction > reactions; | ||
|
||
auto numbers = createReactionNumbers( table ); | ||
auto partialNumbers = createPartialReactionNumbers( table ); | ||
auto xs = createTabulatedCrossSections( table ); | ||
auto size = numbers.size(); | ||
|
||
for ( std::size_t index = 0; index < size; ++index ) { | ||
|
||
id::ReactionID id( std::to_string( numbers[index] ) ); | ||
if ( partialNumbers[index].size() == 0 ) { | ||
|
||
reactions.emplace_back( std::move( id ), std::move( xs[index] ) ); | ||
} | ||
else { | ||
|
||
std::vector< id::ReactionID > partials( partialNumbers[index].size() ); | ||
std::transform( partialNumbers[index].begin(), partialNumbers[index].end(), | ||
partials.begin(), | ||
[] ( auto&& number ) { return std::to_string( number ); } ); | ||
|
||
reactions.emplace_back( std::move( id ), std::move( partials ), std::move( xs[index] ) ); | ||
} | ||
} | ||
|
||
return reactions; | ||
} | ||
|
||
} // electroatomic namespace | ||
} // ace namespace | ||
} // format namespace | ||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
35 changes: 35 additions & 0 deletions
35
src/dryad/format/ace/photoatomic/createProjectileTarget.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEPROJECTILETARGET | ||
#define NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEPROJECTILETARGET | ||
|
||
// system includes | ||
#include <vector> | ||
|
||
// other includes | ||
#include "tools/Log.hpp" | ||
#include "dryad/ProjectileTarget.hpp" | ||
#include "dryad/format/ace/photoatomic/createReactions.hpp" | ||
#include "ACEtk/PhotoatomicTable.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
namespace format { | ||
namespace ace { | ||
namespace photoatomic { | ||
|
||
/** | ||
* @brief Create a ProjectileTarget for photoatomic data | ||
*/ | ||
ProjectileTarget createProjectileTarget( const ACEtk::PhotoatomicTable& table ) { | ||
|
||
return ProjectileTarget( id::ParticleID( "g" ), id::ParticleID( table.ZAID() ), | ||
InteractionType::Atomic, | ||
createReactions( table ) ); | ||
} | ||
|
||
} // electroatomic namespace | ||
} // ace namespace | ||
} // format namespace | ||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
67 changes: 67 additions & 0 deletions
67
src/dryad/format/ace/photoatomic/createReactionProducts.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#ifndef NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEREACTIONPRODUCTS | ||
#define NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEREACTIONPRODUCTS | ||
|
||
// system includes | ||
#include <vector> | ||
|
||
// other includes | ||
#include "tools/Log.hpp" | ||
#include "dryad/ReactionProduct.hpp" | ||
#include "dryad/format/ace/createTabulatedScatteringFunction.hpp" | ||
#include "ACEtk/PhotoatomicTable.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
namespace format { | ||
namespace ace { | ||
namespace photoatomic { | ||
|
||
/** | ||
* @brief Create partial reaction numbers for photoatomic data | ||
*/ | ||
std::vector< std::vector< ReactionProduct > > | ||
createReactionProducts( const ACEtk::PhotoatomicTable& table ) { | ||
|
||
std::vector< std::vector< ReactionProduct > > products; | ||
|
||
// total - MT501 | ||
products.push_back( {} ); | ||
|
||
// coherent scattering - MT502 | ||
products.push_back( {} ); | ||
products.back().emplace_back( | ||
id::ParticleID( "g" ), 1, | ||
CoherentDistributionData( ReferenceFrame::CentreOfMass, | ||
createTabulatedScatteringFunction( table.coherentFormFactorBlock() ) ) ); | ||
|
||
// incoherent scattering - MT504 | ||
products.push_back( {} ); | ||
products.back().emplace_back( | ||
id::ParticleID( "g" ), 1, | ||
IncoherentDistributionData( ReferenceFrame::CentreOfMass, | ||
createTabulatedScatteringFunction( table.incoherentScatteringFunctionBlock() ) ) ); | ||
|
||
// pair production - MT516 (sum of MT515 and MT517) | ||
products.push_back( {} ); | ||
|
||
// photoelectric - MT522 (sum of MT534 and up) | ||
products.push_back( {} ); | ||
if ( table.electronPhotonRelaxationFormat() > 0 ) { | ||
|
||
for ( std::size_t index = 1; index <= table.numberElectronSubshells(); ++index ) { | ||
|
||
// partial: subshell photoelectric - MT534 and up | ||
products.push_back( {} ); | ||
} | ||
} | ||
|
||
return products; | ||
} | ||
|
||
} // photoatomic namespace | ||
} // ace namespace | ||
} // format namespace | ||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#ifndef NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEREACTIONS | ||
#define NJOY_DRYAD_FORMAT_ACE_PHOTOATOMIC_CREATEREACTIONS | ||
|
||
// system includes | ||
#include <vector> | ||
|
||
// other includes | ||
#include "tools/Log.hpp" | ||
#include "dryad/Reaction.hpp" | ||
#include "dryad/format/ace/photoatomic/createReactionNumbers.hpp" | ||
#include "dryad/format/ace/photoatomic/createPartialReactionNumbers.hpp" | ||
#include "dryad/format/ace/photoatomic/createTabulatedCrossSections.hpp" | ||
#include "dryad/format/ace/photoatomic/createReactionProducts.hpp" | ||
#include "ACEtk/PhotoatomicTable.hpp" | ||
|
||
namespace njoy { | ||
namespace dryad { | ||
namespace format { | ||
namespace ace { | ||
namespace photoatomic { | ||
|
||
/** | ||
* @brief Create the reactions for photoatomic data | ||
*/ | ||
std::vector< Reaction > createReactions( const ACEtk::PhotoatomicTable& table ) { | ||
|
||
std::vector< Reaction > reactions; | ||
|
||
auto numbers = createReactionNumbers( table ); | ||
auto partialNumbers = createPartialReactionNumbers( table ); | ||
auto xs = createTabulatedCrossSections( table ); | ||
auto products = createReactionProducts( table ); | ||
auto size = numbers.size(); | ||
|
||
for ( std::size_t index = 0; index < size; ++index ) { | ||
|
||
id::ReactionID id( std::to_string( numbers[index] ) ); | ||
if ( partialNumbers[index].size() == 0 ) { | ||
|
||
reactions.emplace_back( std::move( id ), std::move( xs[index] ), | ||
std::move( products[index] ) ); | ||
} | ||
else { | ||
|
||
std::vector< id::ReactionID > partials( partialNumbers[index].size() ); | ||
std::transform( partialNumbers[index].begin(), partialNumbers[index].end(), | ||
partials.begin(), | ||
[] ( auto&& number ) { return std::to_string( number ); } ); | ||
|
||
reactions.emplace_back( std::move( id ), std::move( partials ), std::move( xs[index] ), | ||
std::move( products[index] ) ); | ||
} | ||
} | ||
|
||
return reactions; | ||
} | ||
|
||
} // electroatomic namespace | ||
} // ace namespace | ||
} // format namespace | ||
} // dryad namespace | ||
} // njoy namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.