-
Notifications
You must be signed in to change notification settings - Fork 24
Add option to convert cooling times in output file to seconds #148
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
base: main
Are you sure you want to change the base?
Conversation
|
There is a merge conflict to be resolved here thanks to #215 |
|
I've pulled from this branch and tested out these changes, and they appear to be working as expected. Some documentation changes are likely still needed. |
gonuke
left a comment
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'm a little surprised that this compiles, given some mismatches in the header and code.
src/OutputFormat.C
Outdated
| break; | ||
| case (OUTFMT_CDOSE) : | ||
| sprintf(buffer,Out_Types_Str[outTypeNum], | ||
| ptr->contactDose->getFileName()); |
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 think we need to write the cooling time units for these ones, too, probably
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.
Should print out the units for the other responses now
85748c1 to
81d5d7f
Compare
Co-authored-by: Paul Wilson <paul.wilson@wisc.edu>
Co-authored-by: Paul Wilson <paul.wilson@wisc.edu>
Co-authored-by: Paul Wilson <paul.wilson@wisc.edu>
|
Before marking this as ready for review, I changed my approach to this problem and pushed all my changes to a different branch, before merging the new branch into this one. I believe this didn't execute the way I expected and left some extraneous changes, which I think have all been resolved now. |
gonuke
left a comment
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.
Sorry - this review was 1/2 done a while ago and got lost...
| #include "alara.h" | ||
| #include <vector> | ||
| #include <string> | ||
| #include "Output_def.h" |
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.
Shouldn't need this header here.. it's only needed in the ".C" file
| if (cooltime_units == COOLTIME_S) // print cooling time converted to seconds | ||
| { | ||
| double t_sec = convertTime(ptr->coolingTime, ptr->units); | ||
| sprintf(textBuf, "%9.3e s ", t_sec); | ||
| } | ||
| else // print cooling time in default units | ||
| { | ||
| sprintf(textBuf, "%7g %c ", ptr->coolingTime, ptr->units); | ||
| } |
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 a short function
std::string coolingTimeStr(int coolTimeUnit)
That does this to ensure consistency across different places we do this (currently only two)
| metricMult = 1; | ||
| } | ||
| cooltime_units = cooltimeType; | ||
| } |
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'm not sure this is right...
Don't we still want to make sure metricMult is set correctly in the default case? An don't we want to update cooltime_units regardless of the value of normType?
| input >> token; | ||
| next->cooltimeUnits = new char[strlen(token)+2]; |
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.
For better or worse, this is not backwards compatible and will make old input files fail. We should discuss how important that is...
| next->cooltimeType = COOLTIME_DEF; | ||
| break; | ||
| } | ||
| break; |
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 you need/want this line
| break; |
This PR introduces changes that allow the user to select the units (default or seconds) in which cooling times are printed in the headers of the output tables, if the
unitskeyword is added in theoutputsection of the input file.Adding this in as a draft for now as this change has had many moving pieces, with changes to function definitions in multiple files, and I anticipate more work being necessary for everything to work as intended.
fixes #137