From 9cad5d783f12b28ca8b349476c9d416346bc155b Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 25 Jan 2024 14:31:48 -0700 Subject: [PATCH] NEM_SLICE: Remove a template array which was not needed to be a template --- packages/seacas/applications/nem_slice/elb.h | 12 +++++------ .../seacas/applications/nem_slice/elb_exo.h | 7 ++++--- .../applications/nem_slice/elb_exo_util.C | 20 +++++++++---------- .../seacas/applications/nem_slice/elb_graph.C | 10 +++++----- .../seacas/applications/nem_slice/elb_graph.h | 4 ++-- .../seacas/applications/nem_slice/elb_inp.C | 18 ++++++++--------- .../seacas/applications/nem_slice/elb_inp.h | 8 ++++---- .../applications/nem_slice/elb_loadbal.C | 6 +++--- .../applications/nem_slice/elb_loadbal.h | 4 ++-- .../seacas/applications/nem_slice/elb_main.C | 8 ++++---- .../seacas/applications/nem_slice/elb_util.C | 8 ++++++-- .../seacas/applications/nem_slice/elb_util.h | 4 ++-- 12 files changed, 57 insertions(+), 52 deletions(-) diff --git a/packages/seacas/applications/nem_slice/elb.h b/packages/seacas/applications/nem_slice/elb.h index ebc957f935..20321841df 100644 --- a/packages/seacas/applications/nem_slice/elb.h +++ b/packages/seacas/applications/nem_slice/elb.h @@ -13,7 +13,7 @@ #include #include -#define ELB_VERSION "4.19" +#define ELB_VERSION "4.20" #define UTIL_NAME "nem_slice" #define ELB_FALSE 0 #define ELB_TRUE 1 @@ -141,7 +141,7 @@ struct Solver_Description /* Structure used to store information about the weighting scheme, if * any, that is to be used. */ -template struct Weight_Description +struct Weight_Description { int type{-1}; /* See weight type below for possible types */ int ow_read{0}; /* 1 if element block settings overwrite exodus file read */ @@ -156,16 +156,16 @@ template struct Weight_Description int nvals{0}; /* vectors to hold element block weights */ - std::vector elemblk{}; /* Id of element block */ - std::vector elemblk_wgt{}; /* Weight of that element block */ + std::vector elemblk{}; /* Id of element block */ + std::vector elemblk_wgt{}; /* Weight of that element block */ /* vector to indicate if weight value has already been overwritten */ - std::vector ow{}; + std::vector ow{}; std::vector vertices{}; std::vector edges{}; - Weight_Description() = default; + Weight_Description() = default; }; /* Structure used to store information about the FEM mesh */ diff --git a/packages/seacas/applications/nem_slice/elb_exo.h b/packages/seacas/applications/nem_slice/elb_exo.h index ab3522fe59..3bd1b8d245 100644 --- a/packages/seacas/applications/nem_slice/elb_exo.h +++ b/packages/seacas/applications/nem_slice/elb_exo.h @@ -12,7 +12,8 @@ /* Function prototypes */ template int read_exo_weights(Problem_Description *prob, /* Pointer to problem info structure */ - Weight_Description *weight); /* Pointer to weight info structure */ + Weight_Description *weight, /* Pointer to weight info structure */ + INT dummy); template int read_mesh_params(const std::string &exo_file, /* Name of ExodusII geometry file */ @@ -24,9 +25,9 @@ template int read_mesh(const std::string &exo_file, /* Name of ExodusII geometry file */ Problem_Description *problem, /* Problem information */ Mesh_Description *mesh, /* Mesh information structure */ - Weight_Description *weight); /* Weight specification structure */ + Weight_Description *weight); /* Weight specification structure */ template int init_weight_struct(Problem_Description *problem, /* Problem information */ Mesh_Description *mesh, /* Mesh information structure */ - Weight_Description *weight); /* Weight specification structure */ + Weight_Description *weight); /* Weight specification structure */ diff --git a/packages/seacas/applications/nem_slice/elb_exo_util.C b/packages/seacas/applications/nem_slice/elb_exo_util.C index bf5620901c..a8e99deaa5 100644 --- a/packages/seacas/applications/nem_slice/elb_exo_util.C +++ b/packages/seacas/applications/nem_slice/elb_exo_util.C @@ -19,7 +19,7 @@ #include #include -#include "elb.h" // for Weight_Description, etc +#include "elb.h" // for Weight_Description, etc #include "elb_elem.h" // for get_elem_type, E_Type, etc #include "elb_err.h" // for Gen_Error, MAX_ERR_MSG #include "elb_exo.h" @@ -34,11 +34,11 @@ * This function reads the nodal or elemental values from an ExodusII file * which will be used by Chaco for weighting of the graph. *****************************************************************************/ -template int read_exo_weights(Problem_Description *prob, Weight_Description *weight); -template int read_exo_weights(Problem_Description *prob, Weight_Description *weight); +template int read_exo_weights(Problem_Description *prob, Weight_Description *weight, int dummy); +template int read_exo_weights(Problem_Description *prob, Weight_Description *weight, int64_t dummy); template -int read_exo_weights(Problem_Description *prob, Weight_Description *weight) +int read_exo_weights(Problem_Description *prob, Weight_Description *weight, INT /*dummy*/) { int exoid; /*---------------------------Execution Begins--------------------------------*/ @@ -276,13 +276,13 @@ int read_mesh_params(const std::string &exo_file, Problem_Description *problem, * This function reads in the finite element mesh. *****************************************************************************/ template int read_mesh(const std::string &exo_file, Problem_Description *problem, - Mesh_Description *mesh, Weight_Description *weight); + Mesh_Description *mesh, Weight_Description *weight); template int read_mesh(const std::string &exo_file, Problem_Description *problem, - Mesh_Description *mesh, Weight_Description *weight); + Mesh_Description *mesh, Weight_Description *weight); template int read_mesh(const std::string &exo_file, Problem_Description *problem, - Mesh_Description *mesh, Weight_Description *weight) + Mesh_Description *mesh, Weight_Description *weight) { float version; float *xptr; @@ -451,13 +451,13 @@ int read_mesh(const std::string &exo_file, Problem_Description *problem, * This function initializes the weight structure given the current mesh. *****************************************************************************/ template int init_weight_struct(Problem_Description *problem, Mesh_Description *mesh, - Weight_Description *weight); + Weight_Description *weight); template int init_weight_struct(Problem_Description *problem, Mesh_Description *mesh, - Weight_Description *weight); + Weight_Description *weight); template int init_weight_struct(Problem_Description *problem, Mesh_Description *mesh, - Weight_Description *weight) + Weight_Description *weight) { if (problem->type == NODAL) { weight->nvals = mesh->num_nodes; diff --git a/packages/seacas/applications/nem_slice/elb_graph.C b/packages/seacas/applications/nem_slice/elb_graph.C index 71f88a55de..81c234ea7c 100644 --- a/packages/seacas/applications/nem_slice/elb_graph.C +++ b/packages/seacas/applications/nem_slice/elb_graph.C @@ -33,7 +33,7 @@ namespace { template int find_adjacency(Problem_Description * /*problem*/, Mesh_Description * /*mesh*/, - Graph_Description * /*graph*/, Weight_Description * /*weight*/, + Graph_Description * /*graph*/, Weight_Description * /*weight*/, Sphere_Info * /*sphere*/); } // namespace /*****************************************************************************/ @@ -44,16 +44,16 @@ namespace { * This function does the work to generate the graph from the FE mesh. *****************************************************************************/ template int generate_graph(Problem_Description *problem, Mesh_Description *mesh, - Graph_Description *graph, Weight_Description *weight, + Graph_Description *graph, Weight_Description *weight, Sphere_Info *sphere); template int generate_graph(Problem_Description *problem, Mesh_Description *mesh, - Graph_Description *graph, Weight_Description *weight, + Graph_Description *graph, Weight_Description *weight, Sphere_Info *sphere); template int generate_graph(Problem_Description *problem, Mesh_Description *mesh, - Graph_Description *graph, Weight_Description *weight, + Graph_Description *graph, Weight_Description *weight, Sphere_Info *sphere) { double time1 = get_time(); @@ -180,7 +180,7 @@ namespace { *****************************************************************************/ template int find_adjacency(Problem_Description *problem, Mesh_Description *mesh, - Graph_Description *graph, Weight_Description *weight, + Graph_Description *graph, Weight_Description *weight, Sphere_Info *sphere) { std::vector pt_list; diff --git a/packages/seacas/applications/nem_slice/elb_graph.h b/packages/seacas/applications/nem_slice/elb_graph.h index fbb801e976..b30c28e69e 100644 --- a/packages/seacas/applications/nem_slice/elb_graph.h +++ b/packages/seacas/applications/nem_slice/elb_graph.h @@ -11,7 +11,7 @@ struct Problem_Description; struct Sphere_Info; template struct Graph_Description; template struct Mesh_Description; -template struct Weight_Description; +struct Weight_Description; template int generate_graph(Problem_Description *problem, /* Pointer to structure containing information @@ -19,6 +19,6 @@ int generate_graph(Problem_Description *problem, /* Pointer to structure cont Mesh_Description *mesh, /* Pointer to structure containing the mesh */ Graph_Description *graph, /* Pointer to structure in which to store * the graph. */ - Weight_Description *weight, /* Pointer to structure for graph weighting */ + Weight_Description *weight, /* Pointer to structure for graph weighting */ Sphere_Info *sphere /* Pointer to sphere adjustment structure */ ); diff --git a/packages/seacas/applications/nem_slice/elb_inp.C b/packages/seacas/applications/nem_slice/elb_inp.C index cb0a205313..9f45047c89 100644 --- a/packages/seacas/applications/nem_slice/elb_inp.C +++ b/packages/seacas/applications/nem_slice/elb_inp.C @@ -60,13 +60,13 @@ template int cmd_line_arg_parse(int argc, char *argv[], std::string &exoII_inp_f std::string &ascii_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *prob, Solver_Description *solver, - Weight_Description *weight); + Weight_Description *weight); template int cmd_line_arg_parse(int argc, char *argv[], std::string &exoII_inp_file, std::string &ascii_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *prob, Solver_Description *solver, - Weight_Description *weight); + Weight_Description *weight); template int cmd_line_arg_parse(int argc, char *argv[], /* Args as passed by main() */ @@ -77,7 +77,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe LB_Description *lb, /* Structure for load balance description */ Problem_Description *prob, /* Structure for various problem params */ Solver_Description *solver, /* Structure for eigen solver params */ - Weight_Description *weight /* Structure for weighting graph */ + Weight_Description *weight /* Structure for weighting graph */ ) { int opt_let; @@ -633,17 +633,17 @@ value\n"); template int read_cmd_file(std::string &ascii_inp_file, std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *problem, - Solver_Description *solver, Weight_Description *weight); + Solver_Description *solver, Weight_Description *weight); template int read_cmd_file(std::string &ascii_inp_file, std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *problem, - Solver_Description *solver, Weight_Description *weight); + Solver_Description *solver, Weight_Description *weight); template int read_cmd_file(std::string &ascii_inp_file, std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *problem, Solver_Description *solver, - Weight_Description *weight) + Weight_Description *weight) { FILE *inp_fd; std::string ctemp; @@ -1301,18 +1301,18 @@ int read_cmd_file(std::string &ascii_inp_file, std::string &exoII_inp_file, template int check_inp_specs(std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *prob, Solver_Description *solver, - Weight_Description *weight); + Weight_Description *weight); template int check_inp_specs(std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *prob, Solver_Description *solver, - Weight_Description *weight); + Weight_Description *weight); template int check_inp_specs(std::string &exoII_inp_file, std::string &nemI_out_file, Machine_Description *machine, LB_Description *lb, Problem_Description *prob, Solver_Description *solver, - Weight_Description *weight) + Weight_Description *weight) { /* Check that an input ExodusII file name was specified */ if (exoII_inp_file.empty()) { diff --git a/packages/seacas/applications/nem_slice/elb_inp.h b/packages/seacas/applications/nem_slice/elb_inp.h index f1e01bf45f..f122a8602c 100644 --- a/packages/seacas/applications/nem_slice/elb_inp.h +++ b/packages/seacas/applications/nem_slice/elb_inp.h @@ -12,7 +12,7 @@ struct Machine_Description; struct Problem_Description; struct Solver_Description; template struct LB_Description; -template struct Weight_Description; +struct Weight_Description; /* Prototype for command-line parsing function */ template @@ -30,7 +30,7 @@ int cmd_line_arg_parse( * information about the run */ Solver_Description *solver, /* Pointer to structure in which to place parameters * for the eigensolver */ - Weight_Description *weight /* Pointer to structure in which to place parameters + Weight_Description *weight /* Pointer to structure in which to place parameters * for the graph weighting scheme */ ); @@ -47,7 +47,7 @@ int read_cmd_file(std::string &ascii_inp_file, /* The ASCII input file n * information about the run */ Solver_Description *solver, /* Pointer to structure in which to place parameters * for the eigensolver */ - Weight_Description *weight /* Pointer to structure in which to place + Weight_Description *weight /* Pointer to structure in which to place * parameters for the eigensolver */ ); @@ -63,7 +63,7 @@ int check_inp_specs(std::string &exoII_inp_file, /* The ExodusII input F * information about the run */ Solver_Description *solver, /* Pointer to structure in which to place parameters * for the eigensolver */ - Weight_Description *weight /* Pointer to structure in which to place + Weight_Description *weight /* Pointer to structure in which to place * parameters for the weighting scheme */ ); diff --git a/packages/seacas/applications/nem_slice/elb_loadbal.C b/packages/seacas/applications/nem_slice/elb_loadbal.C index 61124d49a4..5b036f6345 100644 --- a/packages/seacas/applications/nem_slice/elb_loadbal.C +++ b/packages/seacas/applications/nem_slice/elb_loadbal.C @@ -104,12 +104,12 @@ namespace { template int generate_loadbal(Machine_Description *machine, Problem_Description *problem, Mesh_Description *mesh, LB_Description *lb, Solver_Description *solve, Graph_Description *graph, - Weight_Description *weight, Sphere_Info *sphere, int argc, + Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]); template int generate_loadbal(Machine_Description *machine, Problem_Description *problem, Mesh_Description *mesh, LB_Description *lb, Solver_Description *solve, Graph_Description *graph, - Weight_Description *weight, Sphere_Info *sphere, int argc, + Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]); /* Variables used in Chaco */ @@ -123,7 +123,7 @@ template int generate_loadbal(Machine_Description *machine, Problem_Description *problem, Mesh_Description *mesh, LB_Description *lb, Solver_Description *solve, Graph_Description *graph, - Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]) + Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]) { const char *assignfile = nullptr; diff --git a/packages/seacas/applications/nem_slice/elb_loadbal.h b/packages/seacas/applications/nem_slice/elb_loadbal.h index 5987c1a42e..322a3a06b2 100644 --- a/packages/seacas/applications/nem_slice/elb_loadbal.h +++ b/packages/seacas/applications/nem_slice/elb_loadbal.h @@ -14,13 +14,13 @@ struct Sphere_Info; template struct Graph_Description; template struct LB_Description; template struct Mesh_Description; -template struct Weight_Description; +struct Weight_Description; template int generate_loadbal(Machine_Description *machine, Problem_Description *problem, Mesh_Description *mesh, LB_Description *lb, Solver_Description *solve, Graph_Description *graph, - Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]); + Weight_Description *weight, Sphere_Info *sphere, int argc, char *argv[]); template int generate_maps(Machine_Description *machine, Problem_Description *problem, diff --git a/packages/seacas/applications/nem_slice/elb_main.C b/packages/seacas/applications/nem_slice/elb_main.C index 3b3b08bfbf..933177bc84 100644 --- a/packages/seacas/applications/nem_slice/elb_main.C +++ b/packages/seacas/applications/nem_slice/elb_main.C @@ -37,7 +37,7 @@ namespace { template void print_input(Machine_Description * /*machine*/, LB_Description * /*lb*/, Problem_Description * /*prob*/, Solver_Description * /*solver*/, - Weight_Description * /*weight*/); + Weight_Description * /*weight*/); } // namespace /*****************************************************************************/ @@ -174,7 +174,7 @@ template int internal_main(int argc, char *argv[], INT /* dummy * LB_Description lb; Problem_Description problem; Solver_Description solver; - Weight_Description weight; + Weight_Description weight; Mesh_Description mesh; Sphere_Info sphere; Graph_Description graph; @@ -266,7 +266,7 @@ template int internal_main(int argc, char *argv[], INT /* dummy * /* If desired, read in the weighting factors from the ExodusII file */ if (weight.type & READ_EXO) { time1 = get_time(); - if (!read_exo_weights(&problem, &weight)) { + if (!read_exo_weights(&problem, &weight, (INT)0)) { fmt::print(stderr, "Error during read of ExodusII weights\n"); error_report(); exit(1); @@ -515,7 +515,7 @@ template int internal_main(int argc, char *argv[], INT /* dummy * namespace { template void print_input(Machine_Description *machine, LB_Description *lb, Problem_Description *prob, - Solver_Description *solver, Weight_Description *weight) + Solver_Description *solver, Weight_Description *weight) { fmt::print("{} version {}\n", UTIL_NAME, ELB_VERSION); diff --git a/packages/seacas/applications/nem_slice/elb_util.C b/packages/seacas/applications/nem_slice/elb_util.C index c26f5dbdcc..fe26cb3828 100644 --- a/packages/seacas/applications/nem_slice/elb_util.C +++ b/packages/seacas/applications/nem_slice/elb_util.C @@ -393,8 +393,10 @@ int64_t find_int(INT value1, INT value2, size_t start, size_t stop, INT *vector1 *****************************************************************************/ template int64_t in_list(int value, size_t count, const int *vector); template int64_t in_list(int64_t value, size_t count, const int64_t *vector); +template int64_t in_list(int value, size_t count, const int64_t *vector); +template int64_t in_list(int64_t value, size_t count, const int *vector); -template int64_t in_list(INT value, size_t count, const INT *vector) +template int64_t in_list(INT value, size_t count, const INT2 *vector) { for (size_t i = 0; i < count; i++) { if (vector[i] == value) { @@ -406,8 +408,10 @@ template int64_t in_list(INT value, size_t count, const INT *vect template int64_t in_list(int value, const std::vector &vector); template int64_t in_list(int64_t value, const std::vector &vector); +template int64_t in_list(int value, const std::vector &vector); +template int64_t in_list(int64_t value, const std::vector &vector); -template int64_t in_list(INT value, const std::vector &vector) +template int64_t in_list(INT value, const std::vector &vector) { size_t count = vector.size(); for (size_t i = 0; i < count; i++) { diff --git a/packages/seacas/applications/nem_slice/elb_util.h b/packages/seacas/applications/nem_slice/elb_util.h index b58818c669..4121fc98b3 100644 --- a/packages/seacas/applications/nem_slice/elb_util.h +++ b/packages/seacas/applications/nem_slice/elb_util.h @@ -95,9 +95,9 @@ void find_first_last(INT val, size_t vecsize, INT *vector, INT *first, INT *last template int64_t find_int(INT value1, INT value2, size_t start, size_t stop, INT *vector1, INT *vector2); -template int64_t in_list(INT value, size_t count, const INT *vector); +template int64_t in_list(INT value, size_t count, const INT2 *vector); -template int64_t in_list(INT value, const std::vector &vector); +template int64_t in_list(INT value, const std::vector &vector); extern int roundfloat(float value /* the value to be rounded */ );