Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Nov 13, 2024
1 parent 45b795d commit 755b525
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createAtomicRelaxation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace format {
namespace gnds {

/**
* @brief Create an AtomicRelaxation from an unparsed ENDF material
* @brief Create an AtomicRelaxation from a GNDS xml document
*/
static AtomicRelaxation createAtomicRelaxation( const pugi::xml_document& document ) {

Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createAtomicRelaxationFromFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace format {
namespace gnds {

/**
* @brief Create an AtomicRelaxation from a GNDS file
* @brief Create an AtomicRelaxation from a GNDS xml file
*
* @param[in] filename the GNDS file name
*/
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createInteractionType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace format {
namespace gnds {

/**
* @brief Create the interpolation type
* @brief Create the interpolation type from a GNDS string value
*/
static InteractionType createInteractionType( const std::string& type ) {

Expand Down
3 changes: 2 additions & 1 deletion src/dryad/format/gnds/createInterpolationType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ namespace format {
namespace gnds {

/**
* @brief Create the interpolation type
* @brief Create the interpolation type from a GNDS string value
*/
static InterpolationType createInterpolationType( const std::string& type ) {

// when no interpolation type is given, assume lin-lin
if ( type == "" || type == "lin-lin" ) {

return InterpolationType::LinearLinear;
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace format {
namespace gnds {

/**
* @brief Create an integer or tabulated multiplicity from a parsed ENDF multiplicity
* @brief Create an integer or tabulated multiplicity from a GNDS multiplicity node
*/
static std::variant< int, TabulatedMultiplicity >
createMultiplicity( pugi::xml_node multiplicity, const std::string& style = "eval" ) {
Expand Down
22 changes: 15 additions & 7 deletions src/dryad/format/gnds/createProjectileTarget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,30 @@ namespace format {
namespace gnds {

/**
* @brief Create a ProjectileTarget from a GNDS reactionSuite
* @brief Create a ProjectileTarget from a GNDS xml document
*/
static ProjectileTarget
createProjectileTarget( const pugi::xml_document& document,
const std::string& style = "eval" ) {

auto suite = document.child( "reactionSuite" );

id::ParticleID projectile( suite.attribute( "projectile" ).as_string() );
id::ParticleID target( suite.attribute( "target" ).as_string() );
InteractionType type = createInteractionType( suite.attribute( "interaction" ).as_string() );
if ( suite ) {

std::vector< Reaction > reactions = createReactions( projectile, target, suite, style );
id::ParticleID projectile( suite.attribute( "projectile" ).as_string() );
id::ParticleID target( suite.attribute( "target" ).as_string() );
InteractionType type = createInteractionType( suite.attribute( "interaction" ).as_string() );

return ProjectileTarget( std::move( projectile ), std::move( target ),
type, std::move( reactions ) );
std::vector< Reaction > reactions = createReactions( projectile, target, suite, style );

return ProjectileTarget( std::move( projectile ), std::move( target ),
type, std::move( reactions ) );
}
else {

Log::error( "The GNDS file does not contain projectile-target data" );
throw std::exception();
}
}

} // gnds namespace
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createReaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace format {
namespace gnds {

/**
* @brief Create a Reaction from an unparsed ENDF material
* @brief Create a Reaction from GNDS node (reaction or crossSectionSum)
*/
static Reaction
createReaction( const id::ParticleID& projectile, const id::ParticleID& target,
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createReactionProduct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace gnds {
}
}

// return a basic reaction product
// there is no distribution, return a basic reaction product
return ReactionProduct( id, multiplicity );
}

Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createReactionProducts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace format {
namespace gnds {

/**
* @brief Create a Reaction from an unparsed ENDF material
* @brief Create a Reaction from a GNDS products node
*/
static std::vector< ReactionProduct >
createReactionProducts( const id::ParticleID& projectile, const id::ParticleID& target,
Expand Down
2 changes: 2 additions & 0 deletions src/dryad/format/gnds/createReactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ namespace gnds {
std::vector< Reaction > reactions;

// get the children that contain the reaction data
// there are primary reactions, summation reactions and incomplete reactions
//! @todo there also are production reactions (e.g. MT3)
pugi::xml_node primaries = suite.child( "reactions" );
pugi::xml_node sums = suite.child( "sums" ).child( "crossSectionSums" );
pugi::xml_node incomplete = suite.child( "incompleteReactions" );
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createReferenceFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace format {
namespace gnds {

/**
* @brief Create the reference frame
* @brief Create the reference frame from a GNDS string
*/
static ReferenceFrame createReferenceFrame( const std::string& frame ) {

Expand Down
2 changes: 2 additions & 0 deletions src/dryad/format/gnds/createTabulatedAngularDistribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace gnds {

/**
* @brief Create a TabulatedAngularDistribution from a GNDS XYs1d node
*
* @todo is it possible to have a regions1d version?
*/
static std::pair< std::optional< double >,
TabulatedAngularDistribution >
Expand Down
4 changes: 2 additions & 2 deletions src/dryad/format/gnds/createTabulatedCrossSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace format {
namespace gnds {

/**
* @brief Create a TabulatedCrossSection from a parsed ENDF section
* @brief Create a TabulatedCrossSection from a GNDS node (XYs1d or regions1d)
*/
static TabulatedCrossSection
createTabulatedCrossSection( const pugi::xml_node& xs,
Expand Down Expand Up @@ -95,7 +95,7 @@ namespace gnds {
else if ( strcmp( node.name(), "resonancesWithBackground" ) == 0 ) {

auto resolved = node.child( "background" ).child( "resolvedRegion" );
auto unresolved = node.child( "background" ).child( "resolvedRegion" );
auto unresolved = node.child( "background" ).child( "unresolvedRegion" );
auto fast = node.child( "background" ).child( "fastRegion" );
}
else {
Expand Down
2 changes: 2 additions & 0 deletions src/dryad/format/gnds/createTabulatedEnergyDistribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace gnds {

/**
* @brief Create a TabulatedEnergyDistribution from a GNDS XYs1d node
*
* @todo is it possible to have a regions1d version?
*/
static std::pair< std::optional< double >,
TabulatedEnergyDistribution >
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/createTabulatedMultiplicity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace format {
namespace gnds {

/**
* @brief Create a TabulatedMultiplicity from a GNDS node
* @brief Create a TabulatedMultiplicity from a GNDS multiplicity node
*/
static TabulatedMultiplicity
createTabulatedMultiplicity( const pugi::xml_node& multiplicity,
Expand Down
3 changes: 1 addition & 2 deletions src/dryad/format/gnds/createTwoBodyDistributionData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace gnds {
* @brief Create a TwoBodyDistributionData from a GNDS angularTwoBody node
*/
static TwoBodyDistributionData
createTwoBodyDistributionData( const pugi::xml_node& twobody,
const std::string& style = "eval" ) {
createTwoBodyDistributionData( const pugi::xml_node& twobody ) {

// check that this is a valid angularTwoBody node
throwExceptionOnWrongNode( twobody, "angularTwoBody" );
Expand Down
3 changes: 1 addition & 2 deletions src/dryad/format/gnds/createUncorrelatedDistributionData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace gnds {
* @brief Create a UncorrelatedDistributionData from a GNDS uncorrelated node
*/
static UncorrelatedDistributionData
createUncorrelatedDistributionData( const pugi::xml_node& uncorrelated,
const std::string& style = "eval" ) {
createUncorrelatedDistributionData( const pugi::xml_node& uncorrelated ) {

// check that this is a valid uncorrelated node
throwExceptionOnWrongNode( uncorrelated, "uncorrelated" );
Expand Down
2 changes: 1 addition & 1 deletion src/dryad/format/gnds/throwExceptionOnWrongNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace gnds {
}
else {

Log::error( "The XML element does not define a GNDS axes node, the node is undefined" );
Log::error( "The XML element does not define a GNDS node, the node is undefined" );
throw std::exception();
}
}
Expand Down

0 comments on commit 755b525

Please sign in to comment.