Skip to content

Commit

Permalink
Merge Pull Request #13376 from gsjaardema/Trilinos/SEACAS-Snapshot-20…
Browse files Browse the repository at this point in the history
…24-08-20

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'SEACAS: Snapshot 2024-08-20'
PR Author: gsjaardema
  • Loading branch information
trilinos-autotester authored Aug 22, 2024
2 parents 80caab6 + 28d63a2 commit 94b60d0
Show file tree
Hide file tree
Showing 138 changed files with 4,001 additions and 1,150 deletions.
20 changes: 18 additions & 2 deletions packages/seacas/applications/aprepro/aprepro.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions
// Copyright(C) 1999-2021, 2023, 2024, 2024 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand All @@ -14,6 +14,17 @@

#include "aprepro.h"

namespace {
bool is_double(const std::string &myString)
{
std::istringstream iss(myString);
double f;
iss >> std::noskipws >> f; // noskipws considers leading whitespace invalid
// Check the entire string was consumed and if either failbit or badbit is set
return iss.eof() && !iss.fail();
}
} // namespace

int main(int argc, char *argv[])
{
SEAMS::Aprepro aprepro;
Expand Down Expand Up @@ -42,7 +53,9 @@ int main(int argc, char *argv[])
value = value.substr(1, value.length() - 2);
aprepro.add_variable(var, value, true); // Make it immutable
}
else {
// See if `value` contains any characters that are invalid for a number...

else if (is_double(value)) {
try {
double dval = std::stod(value);
aprepro.add_variable(var, dval, true);
Expand All @@ -58,6 +71,9 @@ int main(int argc, char *argv[])
}
}
}
else {
aprepro.add_variable(var, value, true); // Make it immutable
}
}
else {
input_files.emplace_back(argv[ai]);
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/blot/linthc.blk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
Expand All @@ -8,7 +8,7 @@ C See packages/seacas/LICENSE for details
REAL MSHBND, BLKBND, ELEBND
C -- Line thickness specification for lines appearing
C -- on mesh plots. Specification is a real value in the
C -- range 0. - 1000., with 0. being the thinest line and
C -- range 0. - 1000., with 0. being the thinnest line and
C -- 1000. being the thickest.
C -- MSHBND - Thickness of lines forming the mesh boundary.
C -- BLKBND - Thickness of lines forming element block boundaries.
Expand Down
20 changes: 14 additions & 6 deletions packages/seacas/applications/cpup/CP_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ void Cpup::SystemInterface::enroll_options()
options_.enroll("steps", GetLongOption::MandatoryValue,
"Specify subset of timesteps to transfer to output file.\n"
"\t\tFormat is beg:end:step. 1:10:2 --> 1,3,5,7,9\n"
"\t\tIf the 'beg' or 'end' is < 0, then it is the \"-Nth\" step...\n"
"\t\t-1 is \"first last\" or last, -3 is \"third last\"\n"
"\t\tTo copy just the last 3 steps, do: `-steps -3:-1`\n"
"\t\tEnter LAST for last step",
"1:", nullptr, true);

options_.enroll("extension", GetLongOption::MandatoryValue,
"CGNS database extension for the input files", "cgns");

Expand Down Expand Up @@ -466,7 +470,11 @@ void Cpup::SystemInterface::parse_step_option(const char *tokens)
//: <li>":Y" -- 1 to Y by 1</li>
//: <li>"::Z" -- 1 to oo by Z</li>
//: </ul>
//: The count and step must always be >= 0
//: The step must always be > 0
//: If the 'from' or 'to' is < 0, then it is the "-Nth" step...
//: -1 is "first last" or last
//: -4 is "fourth last step"
//: To copy just the last 3 steps, do: `-steps -3:-1`

// Break into tokens separated by ":"

Expand All @@ -482,24 +490,24 @@ void Cpup::SystemInterface::parse_step_option(const char *tokens)
for (auto &val : vals) {
// Parse 'i'th field
char tmp_str[128];
int k = 0;

int k = 0;
while (tokens[j] != '\0' && tokens[j] != ':') {
tmp_str[k++] = tokens[j++];
}

tmp_str[k] = '\0';
if (strlen(tmp_str) > 0) {
val = strtoul(tmp_str, nullptr, 0);
val = strtol(tmp_str, nullptr, 0);
}

if (tokens[j++] == '\0') {
break; // Reached end of string
}
}
stepMin_ = abs(vals[0]);
stepMax_ = abs(vals[1]);
stepInterval_ = abs(vals[2]);
stepMin_ = vals[0];
stepMax_ = vals[1];
stepInterval_ = abs(vals[2]); // step is always positive...
}
else if (str_equal("LAST", tokens)) {
stepMin_ = stepMax_ = -1;
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/cpup/CP_Version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2023 National Technology & Engineering Solutions
* Copyright(C) 1999-2024 National Technology & Engineering Solutions
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
* NTESS, the U.S. Government retains certain rights in this software.
*
Expand All @@ -8,4 +8,4 @@
#pragma once
#include <array>
#include <string>
static const std::array<std::string, 3> qainfo{"cpup", "0.95 beta", "2023/04/25"};
static const std::array<std::string, 3> qainfo{"cpup", "0.96 beta", "2024/08/06"};
10 changes: 6 additions & 4 deletions packages/seacas/applications/cpup/cpup.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2023 National Technology & Engineering Solutions
// Copyright(C) 1999-2024 National Technology & Engineering Solutions
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
// NTESS, the U.S. Government retains certain rights in this software.
//
Expand Down Expand Up @@ -406,9 +406,11 @@ template <typename INT> void cpup(Cpup::SystemInterface &interFace, INT /*dummy*
int ts_max = interFace.step_max();
int ts_step = interFace.step_interval();

if (ts_min == -1 && ts_max == -1) {
ts_min = num_time_steps;
ts_max = num_time_steps;
if (ts_min < 0) {
ts_min = num_time_steps + 1 + ts_min;
}
if (ts_max < 0) {
ts_max = num_time_steps + 1 + ts_max;
}

// Time steps for output file
Expand Down
27 changes: 16 additions & 11 deletions packages/seacas/applications/ejoin/EJ_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ void SystemInterface::enroll_options()
options_.enroll("steps", GetLongOption::MandatoryValue,
"Specify subset of timesteps to transfer to output file.\n"
"\t\tFormat is beg:end:step. 1:10:2 --> 1,3,5,7,9\n"
"\t\tTo only transfer last step, use '-steps LAST'",
"1:");
"\t\tIf the 'beg' or 'end' is < 0, then it is the \"-Nth\" step...\n"
"\t\t-1 is \"first last\" or last, -3 is \"third last\"\n"
"\t\tTo copy just the last 3 steps, do: `-steps -3:-1`\n"
"\t\tEnter LAST for last step",
"1:", nullptr, true);

options_.enroll("gvar", GetLongOption::MandatoryValue,
"Comma-separated list of global variables to be joined or ALL or NONE.", nullptr);
Expand Down Expand Up @@ -478,15 +481,17 @@ void SystemInterface::parse_step_option(const char *tokens)
//: The defined formats for the count attribute are:<br>
//: <ul>
//: <li><missing> -- default -- 1 <= count <= oo (all steps)</li>
//: <li>"X" -- X <= count <= X (just step X). If X == LAST, last step
// only</li>
//: <li>"X" -- X <= count <= X (just step X) LAST for last step.</li>
//: <li>"X:Y" -- X to Y by 1</li>
//: <li>"X:" -- X to oo by 1</li>
//: <li>":Y" -- 1 to Y by 1</li>
//: <li>"::Z" -- 1 to oo by Z</li>
//: <li>"LAST" -- last step only</li>
//: </ul>
//: The count and step must always be >= 0
//: The step must always be > 0
//: If the 'from' or 'to' is < 0, then it is the "-Nth" step...
//: -1 is "first last" or last
//: -4 is "fourth last step"
//: To copy just the last 3 steps, do: `-steps -3:-1`

// Break into tokens separated by ":"

Expand All @@ -502,24 +507,24 @@ void SystemInterface::parse_step_option(const char *tokens)
for (auto &val : vals) {
// Parse 'i'th field
char tmp_str[128];
int k = 0;

int k = 0;
while (tokens[j] != '\0' && tokens[j] != ':') {
tmp_str[k++] = tokens[j++];
}

tmp_str[k] = '\0';
if (strlen(tmp_str) > 0) {
val = strtoul(tmp_str, nullptr, 0);
val = strtol(tmp_str, nullptr, 0);
}

if (tokens[j++] == '\0') {
break; // Reached end of string
}
}
stepMin_ = abs(vals[0]);
stepMax_ = abs(vals[1]);
stepInterval_ = abs(vals[2]);
stepMin_ = vals[0];
stepMax_ = vals[1];
stepInterval_ = abs(vals[2]); // step is always positive...
}
else if (str_equal("LAST", tokens)) {
stepMin_ = stepMax_ = -1;
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/ejoin/EJ_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

static const std::array<std::string, 3> qainfo{
"ejoin",
"2024/02/21",
"1.6.3",
"2024/08/06",
"1.6.4",
};
8 changes: 5 additions & 3 deletions packages/seacas/applications/ejoin/EJoin.C
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,11 @@ double ejoin(SystemInterface &interFace, std::vector<Ioss::Region *> &part_mesh,
int ts_step = interFace.step_interval();
int num_steps = static_cast<int>(global_times.size());

if (ts_min == -1 && ts_max == -1) {
ts_min = num_steps;
ts_max = num_steps;
if (ts_min < 0) {
ts_min = num_steps + 1 + ts_min;
}
if (ts_max < 0) {
ts_max = num_steps + 1 + ts_max;
}
ts_max = ts_max < num_steps ? ts_max : num_steps;

Expand Down
25 changes: 14 additions & 11 deletions packages/seacas/applications/epu/EP_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ void Excn::SystemInterface::enroll_options()
options_.enroll("steps", GetLongOption::MandatoryValue,
"Specify subset of timesteps to transfer to output file.\n"
"\t\tFormat is beg:end:step. 1:10:2 --> 1,3,5,7,9\n"
"\t\tIf the 'beg' or 'end' is < 0, then it is the \"-Nth\" step...\n"
"\t\t-1 is \"first last\" or last, -3 is \"third last\"\n"
"\t\tTo copy just the last 3 steps, do: `-steps -3:-1`\n"
"\t\tEnter LAST for last step",
"1:", nullptr, true);

Expand Down Expand Up @@ -545,7 +548,11 @@ void Excn::SystemInterface::parse_step_option(const char *tokens)
//: <li>":Y" -- 1 to Y by 1</li>
//: <li>"::Z" -- 1 to oo by Z</li>
//: </ul>
//: The count and step must always be >= 0
//: The step must always be > 0
//: If the 'from' or 'to' is < 0, then it is the "-Nth" step...
//: -1 is "first last" or last
//: -4 is "fourth last step"
//: To copy just the last 3 steps, do: `-steps -3:-1`

// Break into tokens separated by ":"

Expand All @@ -555,34 +562,30 @@ void Excn::SystemInterface::parse_step_option(const char *tokens)
if (strchr(tokens, ':') != nullptr) {
// The string contains a separator

int vals[3];
vals[0] = stepMin_;
vals[1] = stepMax_;
vals[2] = stepInterval_;
std::array<int, 3> vals{stepMin_, stepMax_, stepInterval_};

int j = 0;
for (auto &val : vals) {
// Parse 'i'th field
char tmp_str[128];
;
int k = 0;

int k = 0;
while (tokens[j] != '\0' && tokens[j] != ':') {
tmp_str[k++] = tokens[j++];
}

tmp_str[k] = '\0';
if (strlen(tmp_str) > 0) {
val = strtoul(tmp_str, nullptr, 0);
val = strtol(tmp_str, nullptr, 0);
}

if (tokens[j++] == '\0') {
break; // Reached end of string
}
}
stepMin_ = abs(vals[0]);
stepMax_ = abs(vals[1]);
stepInterval_ = abs(vals[2]);
stepMin_ = vals[0];
stepMax_ = vals[1];
stepInterval_ = abs(vals[2]); // step is always positive...
}
else if (str_equal("LAST", tokens)) {
stepMin_ = stepMax_ = -1;
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/epu/EP_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

static const std::array<std::string, 3> qainfo{
"epu -- E Pluribus Unum",
"6.09",
"2024/04/18",
"6.10",
"2024/08/06",
};
8 changes: 5 additions & 3 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -1325,9 +1325,11 @@ int epu(SystemInterface &interFace, int start_part, int part_count, int cycle, T
int ts_max = interFace.step_max();
int ts_step = interFace.step_interval();

if (ts_min == -1 && ts_max == -1) {
ts_min = num_time_steps;
ts_max = num_time_steps;
if (ts_min < 0) {
ts_min = num_time_steps + 1 + ts_min;
}
if (ts_max < 0) {
ts_max = num_time_steps + 1 + ts_max;
}

// Time steps for output file
Expand Down
Loading

0 comments on commit 94b60d0

Please sign in to comment.