Skip to content

Conversation

@anu1217
Copy link
Contributor

@anu1217 anu1217 commented Nov 6, 2025

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 units keyword is added in the output section 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

@gonuke
Copy link
Member

gonuke commented Dec 29, 2025

There is a merge conflict to be resolved here thanks to #215

@anu1217
Copy link
Contributor Author

anu1217 commented Dec 31, 2025

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.

@anu1217 anu1217 marked this pull request as ready for review December 31, 2025 13:51
Copy link
Member

@gonuke gonuke left a 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.

break;
case (OUTFMT_CDOSE) :
sprintf(buffer,Out_Types_Str[outTypeNum],
ptr->contactDose->getFileName());
Copy link
Member

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

Copy link
Contributor Author

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

@anu1217 anu1217 force-pushed the output_s branch 4 times, most recently from 85748c1 to 81d5d7f Compare January 7, 2026 17:34
anu1217 and others added 4 commits January 7, 2026 11:44
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>
@anu1217
Copy link
Contributor Author

anu1217 commented Jan 7, 2026

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.

Copy link
Member

@gonuke gonuke left a 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"
Copy link
Member

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

Comment on lines +145 to +153
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);
}
Copy link
Member

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)

Comment on lines -608 to +617
metricMult = 1;
}
cooltime_units = cooltimeType;
}
Copy link
Member

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?

Comment on lines +188 to +189
input >> token;
next->cooltimeUnits = new char[strlen(token)+2];
Copy link
Member

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;
Copy link
Member

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

Suggested change
break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add option to print time in seconds in output tables

2 participants