From 1df072da71e520a6a5074229d1b866fd403e5383 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Mon, 22 Dec 2025 10:36:26 -0600 Subject: [PATCH 01/27] add cooling time variables --- src/OutputFormat.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OutputFormat.h b/src/OutputFormat.h index 34664208..0396acb3 100644 --- a/src/OutputFormat.h +++ b/src/OutputFormat.h @@ -44,6 +44,10 @@ class OutputFormat /// including metric prefix) is being used for this output block. int normType; + /// This is used to store the type of units used for the cooling times + /// in the output tables (default vs seconds) + int cooltimeType; + /// This STL set is used to store a unique list of filenames. filenameList wdrFilenames; @@ -55,6 +59,10 @@ class OutputFormat /// the results are being shown in (cm3 v. m3 v. g v. kg). char *normUnits; + /// This string is used to display cooling time units in the default (def) + /// units or in seconds (s) in the header of the output tables + char *cooltimeUnits + /// This stores the multiplication factor for the activity units. /** If necessary (based on actUnits), it will store the conversion between Ci and Bq. */ From 81d5d7f12aa10464f26bf249a60a41f7d63dc28c Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Mon, 22 Dec 2025 11:25:53 -0600 Subject: [PATCH 02/27] add cooling time integers --- src/Output_def.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Output_def.h b/src/Output_def.h index b072f443..5daa576a 100644 --- a/src/Output_def.h +++ b/src/Output_def.h @@ -31,4 +31,7 @@ #define CM3_M3 1e-6 #define G_KG 1e-3 +#define COOLTIME_DEF 1 +#define COOLTIME_S 2 + #endif From a53e8ea8e64b9220b18c603d91970711c054d232 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Tue, 30 Dec 2025 14:34:59 -0600 Subject: [PATCH 03/27] add Output_def.h to CoolingTime.h --- src/CoolingTime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CoolingTime.h b/src/CoolingTime.h index 1499f0da..cfbc69e8 100644 --- a/src/CoolingTime.h +++ b/src/CoolingTime.h @@ -2,6 +2,7 @@ #include "alara.h" #include #include +#include "Output_def.h" #ifndef COOLINGTIME_H #define COOLINGTIME_H From 55c8258f56134cb15aaadfc090c41d43ced6063e Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Tue, 30 Dec 2025 14:40:22 -0600 Subject: [PATCH 04/27] add cooltime_units as argument to writeTotalHeader() --- src/CoolingTime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoolingTime.h b/src/CoolingTime.h index cfbc69e8..5f744eee 100644 --- a/src/CoolingTime.h +++ b/src/CoolingTime.h @@ -56,7 +56,7 @@ class CoolingTime void getCoolTimesStrings(std::vector&); /// This function writes a header for the table of totals. - void writeTotalHeader(const char*); + void writeTotalHeader(const char*, int cooltime_units); /// This function writes an appropriately sized separator of /// "===...===" to frame the table. From bb93e50615d6739b84b6d85fd5723de4a897a100 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Tue, 30 Dec 2025 19:41:44 -0600 Subject: [PATCH 05/27] add condition to convert units for total header --- src/CoolingTime.C | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/CoolingTime.C b/src/CoolingTime.C index 2cda703e..f68c9ba1 100644 --- a/src/CoolingTime.C +++ b/src/CoolingTime.C @@ -12,6 +12,7 @@ #include "CoolingTime.h" #include "Input_def.h" +#include "Output_def.h" /*************************** ********* Service ********* @@ -168,7 +169,7 @@ void CoolingTime::getCoolTimesStrings(std::vector& coolTimesList) /** There is a column indicating the counter for the total in question, one column for @ shutdown results, and then one column for each of the after-shutdown cooling times. */ -void CoolingTime::writeTotalHeader(const char* type) +void CoolingTime::writeTotalHeader(const char* type, int cooltime_units) { CoolingTime *ptr = this; char textBuf[16]; @@ -181,7 +182,16 @@ void CoolingTime::writeTotalHeader(const char* type) while (ptr->next != NULL) { ptr = ptr->next; - sprintf(textBuf,"%7g %c ",ptr->coolingTime, ptr->units); + if (cooltime_mode == 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); + } + cout << textBuf; } cout << endl; From a7228d18ae6c688b23a163f87828d2bcc6cf208f Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 00:51:36 -0600 Subject: [PATCH 06/27] add cooltimeUnits --- src/OutputFormat.C | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 985ef430..d2ead12b 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -51,6 +51,10 @@ OutputFormat::OutputFormat(int type) strcpy(normUnits,"/cm3"); normType = 1; + cooltimeUnits = new char[5]; + strcpy(cooltimeUnits,"def"); + cooltimeType = 1; + gammaSrc = NULL; contactDose = NULL; @@ -58,7 +62,7 @@ OutputFormat::OutputFormat(int type) } OutputFormat::OutputFormat(const OutputFormat& o) : - resolution(o.resolution), outTypes(o.outTypes), normType(o.normType), actMult(o.actMult) + resolution(o.resolution), outTypes(o.outTypes), normType(o.normType), actMult(o.actMult), cooltimeType(o.cooltimeType) { actUnits = new char[strlen(o.actUnits)+1]; @@ -67,6 +71,9 @@ OutputFormat::OutputFormat(const OutputFormat& o) : normUnits = new char[strlen(o.normUnits)+1]; strcpy(normUnits,o.normUnits); + cooltimeUnits = new char[strlen(o.cooltimeUnits)+1]; + strcpy(cooltimeUnits,o.cooltimeUnits); + next = NULL; } @@ -74,6 +81,7 @@ OutputFormat::~OutputFormat() { delete[] actUnits; delete[] normUnits; + delete[] cooltimeUnits; delete gammaSrc; delete contactDose; delete next; @@ -282,7 +290,7 @@ void OutputFormat::write(Volume* volList, Mixture* mixList, Loading* loadList, /* units */ outTypeNum = 0; cout << "\t" << Out_Types_Str[outTypeNum] << ": " - << ptr->actUnits << " " << ptr->normUnits << endl; + << ptr->actUnits << " " << ptr->normUnits << " " << ptr->cooltimeUnits << endl; /* regular singular responses */ for (++outTypeNum;outTypeNumoutTypes & 1<actUnits,ptr->normUnits); + ptr->actUnits,ptr->normUnits,ptr->cooltimeUnits); break; case (OUTFMT_SRC) : sprintf(buffer,Out_Types_Str[outTypeNum], /* deliver gamma src filename, */ - ptr->normUnits, ptr->gammaSrc->getFileName(),ptr->actUnits,ptr->normUnits); + ptr->normUnits, ptr->gammaSrc->getFileName(),ptr->actUnits,ptr->normUnits,ptr->cooltimeUnits); break; case (OUTFMT_CDOSE) : sprintf(buffer,Out_Types_Str[outTypeNum], From 9b4edba85ab5d5d10902aa4a19150d2475a77b12 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 00:56:23 -0600 Subject: [PATCH 07/27] add cooltimeType as argument to setNorm() --- src/OutputFormat.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index d2ead12b..64ec50ca 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -341,7 +341,7 @@ void OutputFormat::write(Volume* volList, Mixture* mixList, Loading* loadList, cout << endl << endl; /* set units for activity */ - Result::setNorm(ptr->actMult,ptr->normType); + Result::setNorm(ptr->actMult,ptr->normType,ptr->cooltimeType); /* for each indicated response */ for (outTypeNum=firstResponse;outTypeNum Date: Wed, 31 Dec 2025 06:27:11 -0600 Subject: [PATCH 08/27] add cooltime_units to Result --- src/CoolingTime.C | 2 +- src/Loading.C | 2 +- src/Mixture.C | 2 +- src/OutputFormat.C | 15 +++++++++++++++ src/Result.C | 19 ++++++++++++++++++- src/Result.h | 6 +++++- src/Volume.C | 2 +- 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/CoolingTime.C b/src/CoolingTime.C index f68c9ba1..076438d2 100644 --- a/src/CoolingTime.C +++ b/src/CoolingTime.C @@ -182,7 +182,7 @@ void CoolingTime::writeTotalHeader(const char* type, int cooltime_units) while (ptr->next != NULL) { ptr = ptr->next; - if (cooltime_mode == COOLTIME_S) // print cooling time converted to seconds + 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); diff --git a/src/Loading.C b/src/Loading.C index 11083757..51d0bb06 100644 --- a/src/Loading.C +++ b/src/Loading.C @@ -470,7 +470,7 @@ void Loading::write(int response, int writeComp, CoolingTime* coolList, cout << Result::getReminderStr() << endl; /* write header for totals */ - coolList->writeTotalHeader("zone"); + coolList->writeTotalHeader("zone", Result::getCooltimeMode()); /* for each zone */ while (ptr->next != NULL) diff --git a/src/Mixture.C b/src/Mixture.C index 85b17f68..6a030963 100644 --- a/src/Mixture.C +++ b/src/Mixture.C @@ -616,7 +616,7 @@ void Mixture::write(int response, int writeComp, CoolingTime* coolList, cout << Result::getReminderStr() << endl; /* write header for totals */ - coolList->writeTotalHeader("mixture"); + coolList->writeTotalHeader("mixture", Result::getCooltimeMode()); /* for each mixture */ while (ptr->next != NULL) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 64ec50ca..1023b986 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -183,7 +183,22 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) next->normType = OUTNORM_CM3; break; } + + input >> token; + + switch (tolower(token[0])) + { + case 's': + next->cooltimeType = COOLTIME_S; + break; + case 'def': + next->cooltimeType = COOLTIME_DEF; + break; + default: + next->cooltimeType = COOLTIME_DEF;; + } break; + case OUTFMT_WDR: next->outTypes |= 1<> token; diff --git a/src/Result.C b/src/Result.C index 7961de22..292324bd 100644 --- a/src/Result.C +++ b/src/Result.C @@ -34,6 +34,7 @@ double Result::actMult = 1; double Result::metricMult = 1; GammaSrc* Result::gammaSrc = NULL; char* Result::outReminderStr = NULL; +int Result::cooltimeMode = COOLTIME_DEF; /** When called with no arguments, the default constructor sets 'kza' and 'next' to 0 and NULL, respectively. Otherwise, they are set, @@ -582,7 +583,13 @@ void Result::readDump() } } -void Result::setNorm(double passedActMult, int normType) +int Result::getCooltimeMode() const +{ + return cooltime_units; +} + + +void Result::setNorm(double passedActMult, int normType, int cooltimeType) { actMult = passedActMult; @@ -597,6 +604,16 @@ void Result::setNorm(double passedActMult, int normType) default: metricMult = 1; } + switch (cooltimeType) { + case COOLTIME_S: + cooltime_units = 2; + break; + case COOLTIME_DEF: + cooltime_units = 1; + break; + default: + cooltime_units = 1; + } } diff --git a/src/Result.h b/src/Result.h index 6fdc7f32..ba5265cb 100644 --- a/src/Result.h +++ b/src/Result.h @@ -60,6 +60,8 @@ class Result /// data is for. int kza; + static int cooltime_units; + /// This is an array of results, one for each cooling time and at /// shutdown. double *N; @@ -129,7 +131,9 @@ class Result /// This function is used to set actMult from the first argument and /// metricMult by interpretation of the second argument. - static void setNorm(double,int); + static void setNorm(double,int,int); + + int getCooltimeMode() const; /// This function is used to set outReminderStr so that each table /// makes it clear what is being written. Corresponding function to query diff --git a/src/Volume.C b/src/Volume.C index b1b6ecde..18b8a785 100644 --- a/src/Volume.C +++ b/src/Volume.C @@ -778,7 +778,7 @@ void Volume::write(int response, int writeComp, CoolingTime* coolList, cout << Result::getReminderStr() << endl; /* write header for totals */ - coolList->writeTotalHeader("interval"); + coolList->writeTotalHeader("interval", Result::getCooltimeMode()); /* for each interval */ while (ptr->next != NULL) From 182e4877bf4e01d8ab34d35221054532e9702ade Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:32:41 -0600 Subject: [PATCH 09/27] add missing ; --- src/OutputFormat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OutputFormat.h b/src/OutputFormat.h index 0396acb3..1c9ac12b 100644 --- a/src/OutputFormat.h +++ b/src/OutputFormat.h @@ -61,7 +61,7 @@ class OutputFormat /// This string is used to display cooling time units in the default (def) /// units or in seconds (s) in the header of the output tables - char *cooltimeUnits + char *cooltimeUnits; /// This stores the multiplication factor for the activity units. /** If necessary (based on actUnits), it will store the conversion From 266d1f44f3d5b1a1ca6ccaed96f1f5522c155abb Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:36:55 -0600 Subject: [PATCH 10/27] turn getCooltimeMode into a static function --- src/Result.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Result.h b/src/Result.h index ba5265cb..5cca26ae 100644 --- a/src/Result.h +++ b/src/Result.h @@ -133,7 +133,10 @@ class Result /// metricMult by interpretation of the second argument. static void setNorm(double,int,int); - int getCooltimeMode() const; + static int getCooltimeMode() + { + return cooltimeMode; + } /// This function is used to set outReminderStr so that each table /// makes it clear what is being written. Corresponding function to query From 59945799af8acc81e5df5344f44e2e789cd4812d Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:38:36 -0600 Subject: [PATCH 11/27] change name of returned object --- src/Result.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Result.h b/src/Result.h index 5cca26ae..9b6fda79 100644 --- a/src/Result.h +++ b/src/Result.h @@ -135,7 +135,7 @@ class Result static int getCooltimeMode() { - return cooltimeMode; + return cooltime_units; } /// This function is used to set outReminderStr so that each table From 4bc23ae4e1e0a2e727cf16878ff59f379a6e7b84 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:42:55 -0600 Subject: [PATCH 12/27] reflect getCooltimeMode being changed to static --- src/Result.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Result.C b/src/Result.C index 292324bd..e53ce579 100644 --- a/src/Result.C +++ b/src/Result.C @@ -34,7 +34,7 @@ double Result::actMult = 1; double Result::metricMult = 1; GammaSrc* Result::gammaSrc = NULL; char* Result::outReminderStr = NULL; -int Result::cooltimeMode = COOLTIME_DEF; +int Result::cooltime_units = COOLTIME_DEF; /** When called with no arguments, the default constructor sets 'kza' and 'next' to 0 and NULL, respectively. Otherwise, they are set, @@ -583,7 +583,7 @@ void Result::readDump() } } -int Result::getCooltimeMode() const +int Result::getCooltimeMode() { return cooltime_units; } From b142877b9f135d1297f01fc695b1b59a120f6c06 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:45:48 -0600 Subject: [PATCH 13/27] only declare function in Result.h --- src/Result.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Result.h b/src/Result.h index 9b6fda79..41b9201c 100644 --- a/src/Result.h +++ b/src/Result.h @@ -133,10 +133,7 @@ class Result /// metricMult by interpretation of the second argument. static void setNorm(double,int,int); - static int getCooltimeMode() - { - return cooltime_units; - } + static int getCooltimeMode(); /// This function is used to set outReminderStr so that each table /// makes it clear what is being written. Corresponding function to query From bbc962ac37b5219bef4d6dc4ce1efdcc7cae0694 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 06:55:16 -0600 Subject: [PATCH 14/27] add logic to writeHeader() --- src/CoolingTime.C | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/CoolingTime.C b/src/CoolingTime.C index 076438d2..6bbad304 100644 --- a/src/CoolingTime.C +++ b/src/CoolingTime.C @@ -142,7 +142,16 @@ void CoolingTime::writeHeader() while (ptr->next != NULL) { ptr = ptr->next; - sprintf(textBuf,"%7g %c ",ptr->coolingTime, ptr->units); + 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); + } + cout << textBuf; } cout << endl; From ef8928925a950bf0320cb37fe8d46532fc21311d Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 07:12:24 -0600 Subject: [PATCH 15/27] fix arguments for writeHeader() --- src/CoolingTime.C | 2 +- src/CoolingTime.h | 2 +- src/Result.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CoolingTime.C b/src/CoolingTime.C index 6bbad304..43077244 100644 --- a/src/CoolingTime.C +++ b/src/CoolingTime.C @@ -132,7 +132,7 @@ int CoolingTime::makeCoolingTimes(double *& coolingTimes) /** There is a column for the isotope, a column for the @shutdown result, and then a column for each after-shutdown cooling time. */ -void CoolingTime::writeHeader() +void CoolingTime::writeHeader(int cooltime_units) { CoolingTime *ptr = this; char textBuf[16]; diff --git a/src/CoolingTime.h b/src/CoolingTime.h index 5f744eee..5b4ed709 100644 --- a/src/CoolingTime.h +++ b/src/CoolingTime.h @@ -50,7 +50,7 @@ class CoolingTime int makeCoolingTimes(double *&); /// This function writes a header for the standard response table. - void writeHeader(); + void writeHeader(int cooltime_units); /// This function returns a string containing the nth shutdown time void getCoolTimesStrings(std::vector&); diff --git a/src/Result.C b/src/Result.C index e53ce579..ecaa53a6 100644 --- a/src/Result.C +++ b/src/Result.C @@ -339,7 +339,7 @@ void Result::write(int response, int targetKza, Mixture *mixPtr, cout << outReminderStr << endl;; /* write a standard header for this table */ - coolList->writeHeader(); + coolList->writeHeader(Result::getCooltimeMode()); if (response == OUTFMT_SRC) { From 8fec07e1bfed9ac84dbb3aae978f3d44e0775df9 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 31 Dec 2025 07:35:32 -0600 Subject: [PATCH 16/27] fix logic --- src/OutputFormat.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 1023b986..73afc1ec 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -195,10 +195,11 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) next->cooltimeType = COOLTIME_DEF; break; default: - next->cooltimeType = COOLTIME_DEF;; + next->cooltimeType = COOLTIME_DEF; + break; } - break; - + break; + case OUTFMT_WDR: next->outTypes |= 1<> token; From 6eba7c6424c752c22292cc683318e099d727ca34 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra <113371601+anu1217@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:44:19 -0600 Subject: [PATCH 17/27] Apply suggestion from @gonuke Co-authored-by: Paul Wilson --- src/Result.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Result.C b/src/Result.C index ecaa53a6..6d29b64f 100644 --- a/src/Result.C +++ b/src/Result.C @@ -609,8 +609,6 @@ void Result::setNorm(double passedActMult, int normType, int cooltimeType) cooltime_units = 2; break; case COOLTIME_DEF: - cooltime_units = 1; - break; default: cooltime_units = 1; } From 3d950f2eaee5d79c5bf6ee6008496eb1cc9ee57f Mon Sep 17 00:00:00 2001 From: Anupama Rajendra <113371601+anu1217@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:45:11 -0600 Subject: [PATCH 18/27] Apply suggestion from @gonuke Co-authored-by: Paul Wilson --- src/OutputFormat.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 73afc1ec..ba5e9e89 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -192,8 +192,6 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) next->cooltimeType = COOLTIME_S; break; case 'def': - next->cooltimeType = COOLTIME_DEF; - break; default: next->cooltimeType = COOLTIME_DEF; break; From 20dab871e61b34257a1bf417edd73b3fabd02718 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra <113371601+anu1217@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:48:09 -0600 Subject: [PATCH 19/27] Apply suggestion from @gonuke Co-authored-by: Paul Wilson --- src/Result.C | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Result.C b/src/Result.C index 6d29b64f..a4281f15 100644 --- a/src/Result.C +++ b/src/Result.C @@ -602,16 +602,7 @@ void Result::setNorm(double passedActMult, int normType, int cooltimeType) metricMult = 1.0/G_KG; break; default: - metricMult = 1; - } - switch (cooltimeType) { - case COOLTIME_S: - cooltime_units = 2; - break; - case COOLTIME_DEF: - default: - cooltime_units = 1; - } + cooltime_units = cooltimeType; } From 582f8b0797a0b747f0af32a5746ccf6ef3d3830d Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 13:12:11 -0600 Subject: [PATCH 20/27] add missing curly braces --- src/Result.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Result.C b/src/Result.C index 53093456..47944c2d 100644 --- a/src/Result.C +++ b/src/Result.C @@ -604,7 +604,8 @@ void Result::setNorm(double passedActMult, int normType, int cooltimeType) actMult = passedActMult; - switch (normType) { + switch (normType) + { case OUTNORM_M3: metricMult = 1.0/CM3_M3; break; @@ -612,7 +613,8 @@ void Result::setNorm(double passedActMult, int normType, int cooltimeType) metricMult = 1.0/G_KG; break; default: - cooltime_units = cooltimeType; + cooltime_units = cooltimeType; + } } From 32fea3044539e72a4c0db47478a7d3a9cff79df9 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 13:43:22 -0600 Subject: [PATCH 21/27] add condition to ensure cooltime units are printed to top header --- src/OutputFormat.C | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index ba5e9e89..a2238e1c 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -183,8 +183,16 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) next->normType = OUTNORM_CM3; break; } - + + delete[] next->cooltimeUnits; input >> token; + next->cooltimeUnits = new char[strlen(token)+2]; + strcpy((next->cooltimeUnits)+1,token); + if (tolower(token[0]) == 's') { + next->cooltimeUnits[0] = 's'; + } else { + next->cooltimeUnits = 'def'; + } switch (tolower(token[0])) { From 5da0c695bc75851b9cfbebc898cc77364fc30ebf Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 13:49:55 -0600 Subject: [PATCH 22/27] redefine char --- src/OutputFormat.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index a2238e1c..9b81e600 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -191,7 +191,7 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) if (tolower(token[0]) == 's') { next->cooltimeUnits[0] = 's'; } else { - next->cooltimeUnits = 'def'; + next->cooltimeUnits[0] = 'def'; } switch (tolower(token[0])) From ba06de0af1cd41be9b4a70f0acae1699cdb1249a Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 13:55:54 -0600 Subject: [PATCH 23/27] remove conditional statement --- src/OutputFormat.C | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 9b81e600..db45a29c 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -188,11 +188,12 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) input >> token; next->cooltimeUnits = new char[strlen(token)+2]; strcpy((next->cooltimeUnits)+1,token); - if (tolower(token[0]) == 's') { - next->cooltimeUnits[0] = 's'; - } else { - next->cooltimeUnits[0] = 'def'; - } + // if (tolower(token[0]) == 's') { + // next->cooltimeUnits[0] = ' '; + // } else { + // next->cooltimeUnits[0] = ' '; + // } + next->cooltimeUnits[0] = ' '; switch (tolower(token[0])) { From 73212f22f112857db195ba39a7075d3f29576d37 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 14:10:28 -0600 Subject: [PATCH 24/27] remove commented lines --- src/OutputFormat.C | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index db45a29c..4ef4512a 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -188,12 +188,7 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) input >> token; next->cooltimeUnits = new char[strlen(token)+2]; strcpy((next->cooltimeUnits)+1,token); - // if (tolower(token[0]) == 's') { - // next->cooltimeUnits[0] = ' '; - // } else { - // next->cooltimeUnits[0] = ' '; - // } - next->cooltimeUnits[0] = ' '; + next->cooltimeUnits[0] = ''; switch (tolower(token[0])) { From 257c8d8b78fdda2ca6c36c1a8eab1db696689b0b Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Wed, 7 Jan 2026 15:22:16 -0600 Subject: [PATCH 25/27] add cooltimeUnits to other responses --- src/OutputFormat.C | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 4ef4512a..97f84d17 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -326,23 +326,23 @@ void OutputFormat::write(Volume* volList, Mixture* mixList, Loading* loadList, break; case (OUTFMT_CDOSE) : sprintf(buffer,Out_Types_Str[outTypeNum], - ptr->contactDose->getFileName()); + ptr->contactDose->getFileName(),ptr->cooltimeUnits); break; case (OUTFMT_ADJ) : sprintf(buffer,Out_Types_Str[outTypeNum], - ptr->adjointDose->getFileName()); + ptr->adjointDose->getFileName(),ptr->cooltimeUnits); break; case (OUTFMT_EXP) : sprintf(buffer, Out_Types_Str[outTypeNum], - ptr->exposureDose->getFileName()); + ptr->exposureDose->getFileName(),ptr->cooltimeUnits); break; case (OUTFMT_EXP_CYL_VOL) : sprintf(buffer, Out_Types_Str[outTypeNum], - ptr->exposureCylVolDose->getFileName()); + ptr->exposureCylVolDose->getFileName(),ptr->cooltimeUnits); break; default: sprintf(buffer,Out_Types_Str[outTypeNum], - ptr->normUnits); + ptr->normUnits,ptr->cooltimeUnits); } cout << "\t" << buffer << endl; } From 31d3c5eb2f0290c76506189ea97ff6aab853ed13 Mon Sep 17 00:00:00 2001 From: Anupama Rajendra Date: Tue, 24 Feb 2026 14:15:36 -0600 Subject: [PATCH 26/27] remove unused header correctly set metric multiplier and cooltime units remove unused break address feedback --- src/CoolingTime.h | 1 - src/OutputFormat.C | 1 - src/Result.C | 5 +++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/CoolingTime.h b/src/CoolingTime.h index 5b4ed709..bcd4b259 100644 --- a/src/CoolingTime.h +++ b/src/CoolingTime.h @@ -2,7 +2,6 @@ #include "alara.h" #include #include -#include "Output_def.h" #ifndef COOLINGTIME_H #define COOLINGTIME_H diff --git a/src/OutputFormat.C b/src/OutputFormat.C index 97f84d17..e1bdf9bb 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -200,7 +200,6 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) next->cooltimeType = COOLTIME_DEF; break; } - break; case OUTFMT_WDR: next->outTypes |= 1< Date: Tue, 24 Feb 2026 15:33:17 -0600 Subject: [PATCH 27/27] ensure backwards compatibility if cooltimeUnits are not added add std namespace avoid crossing initialization move initialization of pos declare pos in block remove extra space reinitialize cooltimeUnits so that there is no extra space initialize cooltimeUnits with the length of the units token account for nonexisting cooling time units check condition with first character of token --- src/OutputFormat.C | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/OutputFormat.C b/src/OutputFormat.C index e1bdf9bb..fc63ff5c 100644 --- a/src/OutputFormat.C +++ b/src/OutputFormat.C @@ -149,6 +149,7 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) switch (1<outTypes |= 1<actUnits; input >> token; @@ -185,22 +186,32 @@ OutputFormat* OutputFormat::getOutFmts(istream& input) } delete[] next->cooltimeUnits; - input >> token; - next->cooltimeUnits = new char[strlen(token)+2]; - strcpy((next->cooltimeUnits)+1,token); - next->cooltimeUnits[0] = ''; + next->cooltimeUnits = new char[strlen(token)+1]; + strcpy(next->cooltimeUnits, ""); - switch (tolower(token[0])) - { - case 's': + next->cooltimeType = COOLTIME_DEF; + std::streampos pos = input.tellg(); + + if (input >> token) + { + if (tolower(token[0]) == 's') + { next->cooltimeType = COOLTIME_S; - break; - case 'def': - default: - next->cooltimeType = COOLTIME_DEF; - break; - } + delete[] next->cooltimeUnits; + next->cooltimeUnits = new char[strlen(token)+1]; + strcpy(next->cooltimeUnits, token); + } + else if (tolower(token[0]) == 'd') + { + input.seekg(pos); + } + else + { + error(230, "Unknown cooling time unit '%s'", token); + } + } + } case OUTFMT_WDR: next->outTypes |= 1<> token;