Skip to content

Commit

Permalink
Merge Pull Request #11582 from gsjaardema/Trilinos/SEACAS-snapshot-20…
Browse files Browse the repository at this point in the history
…23-02-21

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Automatic snapshot commit from seacas at d4492cbf0f
PR Author: gsjaardema
  • Loading branch information
trilinos-autotester authored Feb 23, 2023
2 parents 8c391a9 + 4319c60 commit 87b609e
Show file tree
Hide file tree
Showing 81 changed files with 4,578 additions and 4,429 deletions.
138 changes: 69 additions & 69 deletions packages/seacas/applications/conjoin/CJ_Internals.C

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/seacas/applications/conjoin/CJ_Variables.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
// Copyright(C) 1999-2020, 2022, 2023 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 @@ -19,7 +19,7 @@ namespace Excn {
struct Variables
{
explicit Variables(ObjectType otype, bool arg_add_status = false)
: objectType(otype), outputCount(0), addStatus(arg_add_status)
: objectType(otype), addStatus(arg_add_status)
{
SMART_ASSERT(otype == ObjectType::EBLK || otype == ObjectType::NSET ||
otype == ObjectType::SSET || otype == ObjectType::NODE ||
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace Excn {
bool add_status() const { return addStatus; }

ObjectType objectType;
int outputCount;
int outputCount{0};
bool addStatus;
IntVector index_{};
std::string type_{};
Expand Down
18 changes: 9 additions & 9 deletions packages/seacas/applications/conjoin/Conjoin.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2022 National Technology & Engineering Solutions
// Copyright(C) 1999-2023 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 @@ -44,6 +44,14 @@
#error "Requires exodusII version 4.68 or later"
#endif

#include "CJ_ExodusEntity.h"
#include "CJ_ExodusFile.h"
#include "CJ_Internals.h"
#include "CJ_ObjectType.h"
#include "CJ_SystemInterface.h"
#include "CJ_Variables.h"
#include "CJ_Version.h"

namespace {
template <typename T> void clear(std::vector<T> &vec)
{
Expand Down Expand Up @@ -111,14 +119,6 @@ struct NodeInfo
using GlobalMap = std::vector<NodeInfo>;
using GMapIter = GlobalMap::iterator;

#include "CJ_ExodusEntity.h"
#include "CJ_ExodusFile.h"
#include "CJ_Internals.h"
#include "CJ_ObjectType.h"
#include "CJ_SystemInterface.h"
#include "CJ_Variables.h"
#include "CJ_Version.h"

extern double seacas_timer();

namespace {
Expand Down
7 changes: 6 additions & 1 deletion packages/seacas/applications/ejoin/EJoin.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2022 National Technology & Engineering Solutions
// Copyright(C) 1999-2023 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 @@ -257,6 +257,11 @@ int main(int argc, char *argv[])
add_to_log(argv[0], time);

#ifdef SEACAS_HAVE_MPI
MPI_Comm parent_comm;
MPI_Comm_get_parent(&parent_comm);
if (parent_comm != MPI_COMM_NULL) {
MPI_Barrier(parent_comm);
}
MPI_Finalize();
#endif

Expand Down
4 changes: 3 additions & 1 deletion packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace {
}
}

void exodus_error(int lineno)
[[noreturn]] void exodus_error(int lineno)
{
std::ostringstream errmsg;
fmt::print(errmsg,
Expand Down Expand Up @@ -3895,6 +3895,7 @@ namespace {
size_t maximum_nodes = edgeblocks[p][b].entity_count();
maximum_nodes *= edgeblocks[p][b].nodesPerEdge;
std::vector<INT> local_linkage(maximum_nodes);
SMART_ASSERT(block_linkage != nullptr);

ex_entity_id bid = edgeblocks[p][b].id;
error = ex_get_conn(id, EX_EDGE_BLOCK, bid, local_linkage.data(), nullptr, nullptr);
Expand Down Expand Up @@ -4271,6 +4272,7 @@ namespace {
size_t maximum_nodes = faceblocks[p][b].entity_count();
maximum_nodes *= faceblocks[p][b].nodesPerFace;
std::vector<INT> local_linkage(maximum_nodes);
SMART_ASSERT(block_linkage != nullptr);

ex_entity_id bid = faceblocks[p][b].id;
error = ex_get_conn(id, EX_FACE_BLOCK, bid, local_linkage.data(), nullptr, nullptr);
Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/exo_format/exo_format.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2021 National Technology & Engineering Solutions
* Copyright(C) 1999-2021, 2023 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 @@ -55,7 +55,6 @@ int main(int argc, char *argv[])
int int64_status = 0;
int max_name_length = 0;
int fn_idx = 1;
char cversion[9];

CPU_word_size = 0; /* float or double */
IO_word_size = 0; /* use what is stored in file */
Expand Down Expand Up @@ -210,7 +209,8 @@ int main(int argc, char *argv[])
}

version += 0.00005F;
sprintf(cversion, "%4.2f", version);
char cversion[9];
snprintf(cversion, 9, "%4.2f", version);

k = strlen(cversion);
for (j = 0; j < k; j++) {
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/applications/exodiff/ED_SystemInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <SL_tokenize.h>

namespace {
void Parse_Die(const char *line)
[[noreturn]] void Parse_Die(const char *line)
{
std::string sline = line;
chop_whitespace(sline);
Expand Down
30 changes: 16 additions & 14 deletions packages/seacas/applications/exodiff/exodiff.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright(C) 1999-2022 National Technology & Engineering Solutions
// Copyright(C) 1999-2023 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 @@ -1506,7 +1506,7 @@ bool diff_globals(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
const std::string &name = (interFace.glob_var_names)[out_idx];
int idx1 = find_string(file1.Global_Var_Names(), name, interFace.nocase_var_names);
int idx2 = find_string(file2.Global_Var_Names(), name, interFace.nocase_var_names);
if (idx1 < 0 || idx2 < 0 || vals2 == nullptr) {
if (idx1 < 0 || idx2 < 0) {
Error(fmt::format("Unable to find global variable named '{}' on database.\n", name));
}
gvals[out_idx] = FileDiff(vals1[idx1], vals2[idx2], interFace.output_type);
Expand Down Expand Up @@ -1792,7 +1792,9 @@ bool diff_element(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con

if (el_flag >= 0) {
if (elmt_map.empty()) {
v2 = vals2[e];
if (vals2 != nullptr) {
v2 = vals2[e];
}
}
else {
// With mapping, map global index from file 1 to global index
Expand Down Expand Up @@ -1844,7 +1846,7 @@ bool diff_element(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
}

eblock1->Free_Results();
if (elmt_map.empty()) {
if (elmt_map.empty() && eblock2 != nullptr) {
eblock2->Free_Results();
}

Expand Down Expand Up @@ -1967,9 +1969,9 @@ bool diff_nodeset(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
if (!interFace.quiet_flag) {
Node_Set<INT> *nset = file1.Get_Node_Set_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, node {})", name,
name_length(), interFace.ns_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[nset->Node_Id(max_diff.id) - 1]);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, node {})", name,
name_length(), interFace.ns_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[nset->Node_Id(max_diff.id) - 1]);
DIFF_OUT(buf);
}
else {
Expand Down Expand Up @@ -2077,10 +2079,10 @@ bool diff_sideset(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, con
if (!interFace.quiet_flag) {
Side_Set<INT> *sset = file1.Get_Side_Set_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, side {}.{})", name,
name_length(), interFace.ss_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[sset->Side_Id(max_diff.id).first - 1],
(int)sset->Side_Id(max_diff.id).second);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (set {}, side {}.{})", name,
name_length(), interFace.ss_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, id_map[sset->Side_Id(max_diff.id).first - 1],
(int)sset->Side_Id(max_diff.id).second);
DIFF_OUT(buf);
}
else {
Expand Down Expand Up @@ -2331,9 +2333,9 @@ bool diff_edgeblock(ExoII_Read<INT> &file1, ExoII_Read<INT> &file2, int step1, c
if (!interFace.quiet_flag) {
Edge_Block<INT> *eblock = file1.Get_Edge_Block_by_Id(max_diff.blk);
std::string buf = fmt::format(
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (edge block {}, edge {})", name,
name_length(), interFace.eb_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, eblock->Edge_Index(max_diff.id) + 1);
" {:<{}} {} diff: {:14.7e} ~ {:14.7e} ={:12.5e} (edge block {}, edge {})", name,
name_length(), interFace.eb_var[e_idx].abrstr(), max_diff.val1, max_diff.val2,
max_diff.diff, max_diff.blk, eblock->Edge_Index(max_diff.id) + 1);
DIFF_OUT(buf);
}
else {
Expand Down
10 changes: 5 additions & 5 deletions packages/seacas/applications/exodiff/util.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2022 National Technology & Engineering Solutions
* Copyright(C) 1999-2023 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,9 +14,9 @@ int name_length();
char **get_name_array(int size, int length);
void free_name_array(char **names, int size);

void Error(const std::string &x);
void Error(std::ostringstream &buf);
void Warning(const std::string &x);
void ERR_OUT(std::ostringstream &buf);
[[noreturn]] void Error(const std::string &x);
[[noreturn]] void Error(std::ostringstream &buf);
void Warning(const std::string &x);
void ERR_OUT(std::ostringstream &buf);
void DIFF_OUT(std::ostringstream &buf, fmt::detail::color_type color = fmt::color::red);
void DIFF_OUT(const std::string &buf, fmt::detail::color_type color = fmt::color::red);
12 changes: 6 additions & 6 deletions packages/seacas/applications/exotec2/tec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2022 National Technology & Engineering Solutions
* Copyright(C) 1999-2023 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 @@ -425,17 +425,17 @@ void teczone(int nblk, int nnode, int elem_id, char *elem_type, int node_per_ele
inode);
char zname[80];
char eltype[16];
sprintf(zname, "Zone %s_%d", elem_type, elem_id);
snprintf(zname, 80, "Zone %s_%d", elem_type, elem_id);

if (ndim == 3 && (node_per_elem == 8 || (node_per_elem == 4 && ifac == 2) ||
(node_per_elem == 2 && ifac == 4)))
sprintf(eltype, "BRICK");
snprintf(eltype, 16, "BRICK");
else if (ndim == 3 && node_per_elem == 4)
sprintf(eltype, "TETRAHEDRON");
snprintf(eltype, 16, "TETRAHEDRON");
else if (ndim == 2 && (node_per_elem == 4 || (node_per_elem == 2 && ifac == 2)))
sprintf(eltype, "QUADRILATERAL");
snprintf(eltype, 16, "QUADRILATERAL");
else if (ndim == 2 && node_per_elem == 3)
sprintf(eltype, "TRIANGLE");
snprintf(eltype, 16, "TRIANGLE");
else {
printf("\nBad element type found in teczone\n");
printf(" Dimensions = %d\n", ndim);
Expand Down
17 changes: 8 additions & 9 deletions packages/seacas/applications/nem_slice/elb_loadbal.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2021 National Technology & Engineering Solutions
* Copyright(C) 1999-2021, 2023 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 @@ -149,7 +149,6 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem,
int tmp_lev;
int *tmp_v2p = nullptr;

float *x_ptr = nullptr, *y_ptr = nullptr, *z_ptr = nullptr;
float *x_node_ptr = nullptr, *y_node_ptr = nullptr, *z_node_ptr = nullptr;
std::vector<float> x_elem_ptr, y_elem_ptr, z_elem_ptr;
float *tmp_x = nullptr, *tmp_y = nullptr, *tmp_z = nullptr;
Expand Down Expand Up @@ -216,16 +215,15 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem,
y_node_ptr = (float *)calloc(mesh->num_nodes, sizeof(float));
z_node_ptr = (float *)calloc(mesh->num_nodes, sizeof(float));
break;

default: Gen_Error(0, "FATAL: Invalid mesh dimension. Must be 1, 2, or 3."); return 0;
}
}
else {
x_node_ptr = y_node_ptr = z_node_ptr = nullptr;
}

/* now set the pointers that are being sent to Chaco */
x_ptr = x_node_ptr;
y_ptr = y_node_ptr;
z_ptr = z_node_ptr;
float *x_ptr = x_node_ptr;
float *y_ptr = y_node_ptr;
float *z_ptr = z_node_ptr;

/*
* For an elemental decomposition using inertial, ZPINCH, BRICK
Expand Down Expand Up @@ -634,7 +632,8 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem,
tmp_z = z_ptr;
tmp_v2p = lb->vertex2proc;

for (int cnt = 0; cnt < machine->num_dims; cnt++) {
int upper = machine->num_dims > 3 ? 3 : machine->num_dims;
for (int cnt = 0; cnt < upper; cnt++) {
tmpdim[cnt] = machine->dim[cnt];
}
if (machine->type == MESH) {
Expand Down
13 changes: 7 additions & 6 deletions packages/seacas/applications/nem_slice/fix_column_partitions.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2021 National Technology & Engineering Solutions
* Copyright(C) 1999-2021, 2023 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 @@ -39,16 +39,16 @@ namespace {

// Get nodes of this side (face) of the element

int nsnodes = is_hex(etype) ? 4 : 3;
INT side_nodes[9]; // SHELL9 has 9 nodes on a face.
int nsnodes = is_hex(etype) ? 4 : 3;
INT side_nodes[9] = {0}; // SHELL9 has 9 nodes on a face.

INT *elnodes = mesh->connect[cur_elem];
ss_to_node_list(etype, elnodes, side_id, side_nodes);

// How would these side's nodes be if they were viewed from the
// adjacent element

INT side_nodes_flipped[9]; // Realistically: 4, max possible: 9
INT side_nodes_flipped[9] = {0}; // Realistically: 4, max possible: 9
get_ss_mirror(etype, side_nodes, side_id, side_nodes_flipped);

for (int i = 0; i < nadj; i++) {
Expand Down Expand Up @@ -139,7 +139,8 @@ int fix_column_partitions(LB_Description<INT> *lb, Mesh_Description<INT> const *

int count = 0;
for (int j = 0; j < nelfaces; j++) {
INT fnodes[9]; // Should only need 4, but ss_to_node_list can potentially access 9 (SHELL9).
INT fnodes[9] = {
0}; // Should only need 4, but ss_to_node_list can potentially access 9 (SHELL9).

int nfn = 4;
if (is_wedge(etype)) {
Expand All @@ -155,7 +156,7 @@ int fix_column_partitions(LB_Description<INT> *lb, Mesh_Description<INT> const *
ss_to_node_list(etype, mesh->connect[i], j + 1, fnodes);

// Translate global IDs of side nodes to local IDs in element
int fnodes_loc[9];
int fnodes_loc[9] = {0};
for (int k = 0; k < nfn; k++) {
bool found = false;
for (int k2 = 0; k2 < nelnodes; k2++) {
Expand Down
7 changes: 6 additions & 1 deletion packages/seacas/applications/slice/Slice.C
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,12 @@ namespace {

size_t proc_count = proc_region.size();

size_t node_count = region.get_property("node_count").get_int();
size_t node_count = region.get_property("node_count").get_int();
if (node_count == 0) {
// Should never happen, but makes static analyzers happy...
return;
}

std::vector<std::vector<int>> proc_node(node_count);

// Assume that the majority of nodes will be on 2 or less
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/aprepro_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SET(SOURCES
apr_units.cc
apr_tokenize.cc
apr_scanner.cc
apr_getline_int.c
apr_getline.cc
${BISON_LIB_SOURCE}
apr_exodus.cc
apr_array.cc
Expand Down
Loading

0 comments on commit 87b609e

Please sign in to comment.