-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/thermr #34
Feature/thermr #34
Conversation
"file that corresponds to an MF (endf file label) = 7 (thermal \n" | ||
"scattering).\n" | ||
"\n" | ||
"nendf values are restricted to equal either 0, some integer with\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a value of 0
is valid for nendf
. If nothing provided, what processing can be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So test problem 1 in the manual has a value of zero, and pg. 174 of the manual states
"The required ENDF tape (nendf) is only used for MF=7 data; it can be set to zero if only free-gas scattering is needed."
Which this makes me think, I should probably set a check to ensure that if nendf == 0, then card2's iin should be equal to 1 (free gas).
} | ||
} // THEN | ||
} // WHEN | ||
WHEN( "nout input is equal to nendf value" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about when nout
is equal to nin
?
REQUIRE( card1.nout.value == 22 ); | ||
} // THEN | ||
} // WHEN | ||
WHEN( "thermal scattering data not provided" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I don't think nendf=0
is valid. If I'm wrong, please show me.
} // THEN | ||
} // WHEN | ||
WHEN( "an input tape is out of range" ){ | ||
iRecordStream<char> iss1( std::istringstream("20 21 100\n") ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job being thorough.
} // GIVEN | ||
|
||
GIVEN( "invalid icoh values" ){ | ||
std::vector<int> invalidValues{-1, 4, 10, 14}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
argument::extract< THERMR::Card3::Tempr >(iss, ntemp) ); | ||
} // THEN | ||
} // WHEN | ||
WHEN( "there are too many temprerature values" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temprerature -> temperature
static std::string description(){ | ||
return | ||
"The emax argument is the maximum energy for thermal treatment. For\n" | ||
"temperatures greater than 3000 kelvin, emax and the energy grid are\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kelvin
should be capitalized.
"linear interpolation is within a specified fractional tolerance (tol)\n" | ||
"of the exact cross section at every point.\n" | ||
"\n" | ||
"tol must be some decimal value greater than 1.0e-6."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you find this limit? It sounds reasonable, but I don't know where it comes from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a definition of tol_min
in the thermr.f90 file, on line 708, so I assumed that would be the reasonable lower bound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good detective work.
} // GIVEN | ||
|
||
GIVEN( "invalid Card4 inputs" ){ | ||
WHEN( "an input tape is out of range" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThisWHEN
statement isn't correct.
REQUIRE_THROWS( THERMR( iss2 ) ); | ||
} // THEN | ||
} // WHEN | ||
WHEN( "card1 input files repeated" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice thoroughness.
It seems there is a bug in the code and it won't compile all the way. Probably a simple fix @ameliajo |
if ( not nendf.value and i != 1 ){ | ||
Log::warning("iin value indicates that the material will not be treated\n" | ||
"as a free gas, which conflicts with earlier definition of\n" | ||
"card1 nendf input. If nendf equals 0, iin must equal 1.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
return false; | ||
} | ||
// Make sure temperatures are in increasing order | ||
auto unsortedStart = std::is_sorted_until( temps.begin(), temps.end() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
"The tempr argument is a list of ntemp temperatures (where ntemp was\n" | ||
"defined in card2). These tempr inputs are the temperatures at which\n" | ||
"the thermal scattering cross sections are evaluated. Each\n" | ||
"temperature is in kelvin, and therefore must be positive."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention sorted order
|
||
static bool verify( const Value_t& temps, | ||
const Argument< THERMR::Card2::Ntemp > & ntemp ){ | ||
if ( long(temps.size()) != ntemp.value ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vector parser does this before the verification is called. This check is redundant.
} | ||
|
||
// Make sure all temperatures are positive | ||
auto found = std::find_if( temps.begin(), temps.end(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good use of the standard algorithms
argument::extract< THERMR::Card3::Tempr >(iss, ntemp) ); | ||
} // THEN | ||
} // WHEN | ||
WHEN( "there are too many temperature values" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test ought not be done here. That check is normally done when you call to Card::clear
argument::extract< THERMR::Card3::Tempr >(iss, ntemp) ); | ||
} // THEN | ||
} // WHEN | ||
WHEN( "there are not enough temperature values" ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll notice that you don't see the error message here you might have expected
} | ||
|
||
|
||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge needs to be resolved
THERMR input checks for all cards