Skip to content

Commit

Permalink
Merge pull request #30 from njoy/feature/resolve
Browse files Browse the repository at this point in the history
Feature/resolve
  • Loading branch information
whaeck authored Aug 24, 2020
2 parents edf4ef0 + 87278b0 commit cc83f61
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/elementary/ParticlePairID/src/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ static bool validate( const std::string& string ) {
if ( ReactionType::isRegistered( string ) ) {

ReactionType type( string );
if ( ( not type.particles().size() ) and
( type != ReactionType( "elastic" ) ) ) {
if ( ( type.isSpecial() or ( type.name() == "capture" ) ) and
( type.name() != "elastic" ) ) {

return true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/elementary/ParticlePairID/test/ParticlePairID.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ SCENARIO( "ParticlePairID" ) {
// using a string - from a registered reaction type
ParticlePairID id3( "total" );
CHECK( "total" == id3.symbol() );

id3 = ParticlePairID( "capture" );
CHECK( "capture" == id3.symbol() );
} // THEN
} // GIVEN

Expand Down
4 changes: 2 additions & 2 deletions src/elementary/ParticleTupleID/src/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ static bool validate( const std::string& string ) {
if ( ReactionType::isRegistered( string ) ) {

ReactionType type( string );
if ( ( not type.particles().size() ) and
( type != ReactionType( "elastic" ) ) ) {
if ( ( type.isSpecial() or ( type.name() == "capture" ) ) and
( type.name() != "elastic" ) ) {

return true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/elementary/ParticleTupleID/test/ParticleTupleID.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ SCENARIO( "ParticleTupleID" ) {
ParticleTupleID id6( "total" );
CHECK( "total" == id6.symbol() );

id6 = ParticleTupleID( "capture" );
CHECK( "capture" == id6.symbol() );

// using a particle pair
ParticleTupleID id7( ParticlePairID( ParticleID( "n" ),
ParticleID( "Fe56" ) ) );
Expand Down
3 changes: 3 additions & 0 deletions src/elementary/ReactionID/test/ReactionID.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ SCENARIO( "ParticlePairID" ) {
ReactionID id3( "n,Fe56->n,Fe56" );
CHECK( "n,Fe56->n,Fe56" == id3.symbol() );

id3 = ReactionID( "n,Fe56->capture" );
CHECK( "n,Fe56->capture" == id3.symbol() );

// using a reaction type
ReactionID id4( ParticleID( "n" ), ParticleID( "Fe56" ), ReactionType( "elastic" ) );
CHECK( "n,Fe56->n,Fe56" == id4.symbol() );
Expand Down

0 comments on commit cc83f61

Please sign in to comment.