Skip to content

Commit

Permalink
clang-format new version
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Mar 11, 2024
1 parent 88e9a7e commit 0d5efc6
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 106 deletions.
12 changes: 4 additions & 8 deletions packages/seacas/applications/aprepro/aprepro.C
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,17 @@ int main(int argc, char *argv[])
else {
exit_status = EXIT_FAILURE;
std::cerr << "There were " << aprepro.get_error_count() << " errors and "
<< aprepro.get_warning_count() << " warnings."
<< "\n";
<< aprepro.get_warning_count() << " warnings." << "\n";
if (aprepro.ap_options.errors_and_warnings_fatal) {
std::cerr << "Errors and warnings are fatal. No output has been written"
<< "\n";
std::cerr << "Errors and warnings are fatal. No output has been written" << "\n";
}
else if (aprepro.ap_options.errors_fatal) {
std::cerr << "Errors are fatal. No output has been written."
<< "\n";
std::cerr << "Errors are fatal. No output has been written." << "\n";
}
else {
std::cerr << "Neither errors nor warnings are fatal. "
<< "If you see this message, then there is a bug in Aprepro. "
<< "No output has been written."
<< "\n";
<< "No output has been written." << "\n";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/applications/ejoin/EJoin.C
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ double ejoin(SystemInterface &interFace, std::vector<Ioss::Region *> &part_mesh,
transfer_sidesets(*part_mesh[p], output_region, false);
}
if (!interFace.omit_assemblies()) {
transfer_assembly(*part_mesh[p], output_region, false);
transfer_assembly(*part_mesh[p], output_region, false);
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/applications/epu/epu.C
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ namespace {
part_block_offset += element_count;

} // end if blocks[p][b].entity_count() (non-zero length block)
} // end for p=0..part_count-1
} // end for p=0..part_count-1
}
}

Expand Down Expand Up @@ -4081,7 +4081,7 @@ namespace {
part_block_offset += edge_count;

} // end if edgeblocks[p][b].entity_count() (non-zero length block)
} // end for p=0..part_count-1
} // end for p=0..part_count-1
}
}

Expand Down Expand Up @@ -4460,7 +4460,7 @@ namespace {
part_block_offset += face_count;

} // end if faceblocks[p][b].entity_count() (non-zero length block)
} // end for p=0..part_count-1
} // end for p=0..part_count-1
}
}

Expand Down
10 changes: 6 additions & 4 deletions packages/seacas/applications/exodiff/check.C
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace {
Assembly<INT> *assembly1 = file1.Get_Assembly_by_Index(b);
if (assembly1 != nullptr) {
Assembly<INT> *assembly2 = nullptr;
assembly2 = file2.Get_Assembly_by_Name(assembly1->Name());
assembly2 = file2.Get_Assembly_by_Name(assembly1->Name());
if (assembly2 == nullptr) {
Warning(fmt::format(".. Assembly '{}' with id {} exists in first "
"file but not the second.\n",
Expand All @@ -280,7 +280,7 @@ namespace {
Assembly<INT> *assembly2 = file2.Get_Assembly_by_Index(b);
if (assembly2 != nullptr) {
Assembly<INT> *assembly1 = nullptr;
assembly1 = file1.Get_Assembly_by_Name(assembly2->Name());
assembly1 = file1.Get_Assembly_by_Name(assembly2->Name());
if (assembly1 == nullptr) {
Warning(fmt::format(".. Assembly '{}' with id {} exists in second "
"file but not the first.\n",
Expand Down Expand Up @@ -407,10 +407,12 @@ namespace {
}
if (assembly1->Size() != assembly2->Size()) {
Warning(fmt::format(".. Assembly '{}': number of entities doesn't agree ({} != {}).\n",
assembly1->Name(), assembly1->Entities().size(), assembly2->Entities().size()));
assembly1->Name(), assembly1->Entities().size(),
assembly2->Entities().size()));
is_same = false;
}
if ((assembly1->Type() == assembly2->Type()) && (assembly1->Entities().size() == assembly2->Entities().size())) {
if ((assembly1->Type() == assembly2->Type()) &&
(assembly1->Entities().size() == assembly2->Entities().size())) {
// Check membership of the entities list...
if (!std::is_permutation(assembly1->Entities().begin(), assembly1->Entities().end(),
assembly2->Entities().begin())) {
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/applications/exodiff/map.C
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void Compute_Maps(std::vector<INT> &node_map, std::vector<INT> &elmt_map, ExoII_
Error(out);
}
} // End of local node loop on file1's element.
} // End of local node search block.
} // End of local node search block.

++e1;

Expand Down Expand Up @@ -543,7 +543,7 @@ void Compute_Partial_Maps(std::vector<INT> &node_map, std::vector<INT> &elmt_map
Error(out);
}
} // End of local node loop on file1's element.
} // End of local node search block.
} // End of local node search block.

++e1;

Expand Down
20 changes: 10 additions & 10 deletions packages/seacas/applications/nem_slice/elb_exo.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

/* Function prototypes */
template <typename INT>
int read_exo_weights(Problem_Description *prob, /* Pointer to problem info structure */
Weight_Description *weight, /* Pointer to weight info structure */
INT dummy);
int read_exo_weights(Problem_Description *prob, /* Pointer to problem info structure */
Weight_Description *weight, /* Pointer to weight info structure */
INT dummy);

template <typename INT>
int read_mesh_params(const std::string &exo_file, /* Name of ExodusII geometry file */
Expand All @@ -22,12 +22,12 @@ int read_mesh_params(const std::string &exo_file, /* Name of ExodusII geomet
Sphere_Info *sphere); /* Sphere element info structure */

template <typename INT>
int read_mesh(const std::string &exo_file, /* Name of ExodusII geometry file */
Problem_Description *problem, /* Problem information */
Mesh_Description<INT> *mesh, /* Mesh information structure */
Weight_Description *weight); /* Weight specification structure */
int read_mesh(const std::string &exo_file, /* Name of ExodusII geometry file */
Problem_Description *problem, /* Problem information */
Mesh_Description<INT> *mesh, /* Mesh information structure */
Weight_Description *weight); /* Weight specification structure */

template <typename INT>
int init_weight_struct(Problem_Description *problem, /* Problem information */
Mesh_Description<INT> *mesh, /* Mesh information structure */
Weight_Description *weight); /* Weight specification structure */
int init_weight_struct(Problem_Description *problem, /* Problem information */
Mesh_Description<INT> *mesh, /* Mesh information structure */
Weight_Description *weight); /* Weight specification structure */
22 changes: 11 additions & 11 deletions packages/seacas/applications/nem_slice/elb_graph.C
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace {
}
}
} /* End "for(ecnt=0; ecnt < graph->nsur_elem[ncnt]; ecnt++)" */
} /* End "for(ncnt=0; ncnt < mesh->num_nodes; ncnt++)" */
} /* End "for(ncnt=0; ncnt < mesh->num_nodes; ncnt++)" */
}
/* Find the adjacency for a elemental based decomposition */
else {
Expand Down Expand Up @@ -310,7 +310,7 @@ namespace {
}
}
} /* End "for(ncnt=0; ...)" */
} /* End: "if (problem->face_adj == 0)" */
} /* End: "if (problem->face_adj == 0)" */

/* So if this is a 3-d element and we're forcing face
* adjacency, if it gets to this else below
Expand Down Expand Up @@ -608,12 +608,12 @@ namespace {
count++;
fmt::print("Now we have {} bad element connections.\n", count);
} /* End "if (sid > 0)" */
} /* End: "if(ecnt != entry)" */
} /* End: "if(ecnt != entry)" */
}
} /* End: "for(i=0; i < nelem; i++)" */
} /* End: "if (nelem > 1)" */
} /* End: "for (nscnt = 0; nscnt < nsides; nscnt++)" */
} /* End: "if(element_3d)" */
} /* End: "if (nelem > 1)" */
} /* End: "for (nscnt = 0; nscnt < nsides; nscnt++)" */
} /* End: "if(element_3d)" */

else {

Expand Down Expand Up @@ -655,15 +655,15 @@ namespace {
}
}
} /* End: if(ecnt != entry) */
} /* for(i=0; i < graph->nsur_elem[node]; i++) */
} /* End "for(ncnt=0; ...)" */
} /* End: "else" (if !element_3d) */
} /* End: "else" (if face_adj != 0) */
} /* for(i=0; i < graph->nsur_elem[node]; i++) */
} /* End "for(ncnt=0; ...)" */
} /* End: "else" (if !element_3d) */
} /* End: "else" (if face_adj != 0) */

cnt++;

} /* End "if(etype != SPHERE)" */
} /* End "for(ecnt=0; ecnt < mesh->num_elems; ecnt++)" */
} /* End "for(ecnt=0; ecnt < mesh->num_elems; ecnt++)" */
}

graph->start[problem->num_vertices] = graph->adj.size();
Expand Down
14 changes: 7 additions & 7 deletions packages/seacas/applications/nem_slice/elb_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ template <typename INT> struct Mesh_Description;
struct Weight_Description;

template <typename INT>
int generate_graph(Problem_Description *problem, /* Pointer to structure containing information
* about the type of decomposition */
Mesh_Description<INT> *mesh, /* Pointer to structure containing the mesh */
Graph_Description<INT> *graph, /* Pointer to structure in which to store
* the graph. */
Weight_Description *weight, /* Pointer to structure for graph weighting */
Sphere_Info *sphere /* Pointer to sphere adjustment structure */
int generate_graph(Problem_Description *problem, /* Pointer to structure containing information
* about the type of decomposition */
Mesh_Description<INT> *mesh, /* Pointer to structure containing the mesh */
Graph_Description<INT> *graph, /* Pointer to structure in which to store
* the graph. */
Weight_Description *weight, /* Pointer to structure for graph weighting */
Sphere_Info *sphere /* Pointer to sphere adjustment structure */
);
8 changes: 4 additions & 4 deletions packages/seacas/applications/nem_slice/elb_inp.C
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passed by

} /* End "switch(my_getsubopt(&sub_opt, weight_subopts, &value))" */

} /* End "while(*sub_opt != '\0')" */
} /* End "while(*sub_opt != '\0')" */
break; /* End "case 'w'" */

case 'a':
Expand Down Expand Up @@ -438,7 +438,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passed by

} /* End "switch(my_getsubopt(&sub_opt, mach_subopts, &value))" */

} /* End "while(*sub_opt != '\0')" */
} /* End "while(*sub_opt != '\0')" */
break; /* End "case 'm'" */

case 'l':
Expand Down Expand Up @@ -527,7 +527,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passed by

} /* End "switch(my_getsubopt(&sup_opt, mach_subopts, &value))" */

} /* End "while(*sup_opt != '\0')" */
} /* End "while(*sup_opt != '\0')" */
break; /* End "case 'l'" */

case 'S': prob->no_sph = 1; break;
Expand Down Expand Up @@ -581,7 +581,7 @@ value\n");

} /* End "switch(my_getsubopt(&sub_opt, solve_subopts, &value))" */

} /* End "while(sub_opt != '\0')" */
} /* End "while(sub_opt != '\0')" */
break; /* End "case 's'" */

case 'g':
Expand Down
39 changes: 19 additions & 20 deletions packages/seacas/applications/nem_slice/elb_inp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@ struct Weight_Description;

/* Prototype for command-line parsing function */
template <typename INT>
int cmd_line_arg_parse(
int argc, /* The command line argument count */
char *argv[], /* The command line arguments array */
std::string &exoII_inp_file, /* The ExodusII input FEM file name */
std::string &ascii_inp_file, /* The ASCII input file name */
std::string &nemI_out_file, /* The output NemesisI file name */
Machine_Description *machine, /* Pointer to structure in which to place machine
* information */
LB_Description<INT> *lb, /* Pointer to structure in which to place load
* balance parameters */
Problem_Description *prob, /* Pointer to structure in which to place general
* 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
* for the graph weighting scheme */
int cmd_line_arg_parse(int argc, /* The command line argument count */
char *argv[], /* The command line arguments array */
std::string &exoII_inp_file, /* The ExodusII input FEM file name */
std::string &ascii_inp_file, /* The ASCII input file name */
std::string &nemI_out_file, /* The output NemesisI file name */
Machine_Description *machine, /* Pointer to structure in which to place
* machine information */
LB_Description<INT> *lb, /* Pointer to structure in which to place load
* balance parameters */
Problem_Description *prob, /* Pointer to structure in which to place general
* 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 for the graph weighting scheme */
);

/* Prototype for function which reads in the ASCII input file */
Expand All @@ -47,8 +46,8 @@ 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
* parameters for the eigensolver */
Weight_Description *weight /* Pointer to structure in which to place
* parameters for the eigensolver */
);

/* Prototype for function which checks the user specified input */
Expand All @@ -63,8 +62,8 @@ 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
* parameters for the weighting scheme */
Weight_Description *weight /* Pointer to structure in which to place
* parameters for the weighting scheme */
);

/* Various defines used by the input routines */
Expand Down
32 changes: 16 additions & 16 deletions packages/seacas/applications/nem_slice/elb_loadbal.C
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem,
z_ptr = Data(z_elem_ptr);

} /* End "if (problem->num_vertices > 0)" */
} /* End "if ((problem->type == ELEMENTAL) &&
(lb->type==INERTIAL||ZPINCH||BRICK||ZOLTAN))"*/
} /* End "if ((problem->type == ELEMENTAL) &&
(lb->type==INERTIAL||ZPINCH||BRICK||ZOLTAN))"*/

/* Allocate memory for the vertex to processor vector */
if (problem->type == ELEMENTAL) {
Expand Down Expand Up @@ -767,7 +767,7 @@ int generate_loadbal(Machine_Description *machine, Problem_Description *problem,
}
}
} /* End: "for (iloop = 0; iloop < nloops; iloop++)" */
} /* End: "if (sphere->num < mesh->num_elems)" */
} /* End: "if (sphere->num < mesh->num_elems)" */

/* Free up coordinates if used */
if (problem->read_coords == ELB_TRUE) {
Expand Down Expand Up @@ -1450,7 +1450,7 @@ namespace {
}
}
} /* End "for(i=0; i < nnodes; i++)" */
} /* End "for(ecnt=0; ecnt < graph->nsur_elem[ncnt]; ecnt++)" */
} /* End "for(ecnt=0; ecnt < graph->nsur_elem[ncnt]; ecnt++)" */

if (internal) {
/* "ncnt" is an internal node */
Expand Down Expand Up @@ -1877,11 +1877,11 @@ namespace {
return 0; /* and get out of here */

} /* End "if sid < 0 && !problem>skip_checks" */
} /* End "if (sid > 0)" */
} /* End "if (proc != proc2)" */
} /* End "for (ncnt = 0; ncnt < nelem; ncnt++)" */
} /* End "if (nelem > 1)" */
} /* End "for (nscnt = 0; nscnt < nsides; nscnt++)" */
} /* End "if (sid > 0)" */
} /* End "if (proc != proc2)" */
} /* End "for (ncnt = 0; ncnt < nelem; ncnt++)" */
} /* End "if (nelem > 1)" */
} /* End "for (nscnt = 0; nscnt < nsides; nscnt++)" */

if (internal) {
lb->int_elems[proc].push_back(ecnt);
Expand Down Expand Up @@ -1931,8 +1931,8 @@ namespace {
lb->bor_nodes[proc2].push_back(ncnt);
}
} /* if (proc != lb->vertex2proc[graph->sur_elem[ncnt][ecnt]]) */
} /* for(ecnt=1; ecnt < graph->nsur_elem[ncnt]; ecnt++) */
} /* if(graph->nsur_elem[ncnt]) */
} /* for(ecnt=1; ecnt < graph->nsur_elem[ncnt]; ecnt++) */
} /* if(graph->nsur_elem[ncnt]) */

if (internal) {
/*
Expand Down Expand Up @@ -1968,9 +1968,9 @@ namespace {
lb->born_procs[pcnt][ncnt].push_back(proc);
}
} /* End "if(proc != pcnt)" */
} /* End "for(ecnt=0; ecnt < graph->nsur_elems[node]; ecnt++)" */
} /* End "for(ncnt=0; ncnt < lb->num_bor_nodes[pcnt]; ncnt++)" */
} /* End "for(pcnt=0; pcnt < machine->num_procs; pcnt++)" */
} /* End "for(ecnt=0; ecnt < graph->nsur_elems[node]; ecnt++)" */
} /* End "for(ncnt=0; ncnt < lb->num_bor_nodes[pcnt]; ncnt++)" */
} /* End "for(pcnt=0; pcnt < machine->num_procs; pcnt++)" */

time2 = get_time();
fmt::print("Find procs for border nodes: {}s\n", time2 - time1);
Expand Down Expand Up @@ -2095,8 +2095,8 @@ namespace {
(&lb->e_cmap_sides[pcnt2][fv2]));

} /* End "if(fv1 >= 0)" */
} /* End "for(pcnt2=0; pcnt2 < pcnt; pcnt2++)" */
} /* End "for(pcnt=0; pcnt < machine->num_procs; pcnt++)" */
} /* End "for(pcnt2=0; pcnt2 < pcnt; pcnt2++)" */
} /* End "for(pcnt=0; pcnt < machine->num_procs; pcnt++)" */

time2 = get_time();
fmt::print("Make cmaps consistent: {}s\n", time2 - time1);
Expand Down
Loading

0 comments on commit 0d5efc6

Please sign in to comment.