Skip to content

Commit

Permalink
fix: Correct CGNS_ENUMV usage
Browse files Browse the repository at this point in the history
- also something with references that my compiler wasn't happy about
  with regards to the `const auto &m : components` statement
  • Loading branch information
jrwrigh committed Jul 20, 2023
1 parent 97523f8 commit 4a17a60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apf/apfCGNS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@ void WriteCGNS(const char *prefix, apf::Mesh *m, const apf::CGNSBCMap &cgnsBCMap
auto communicator = PCU_Get_Comm();
cgp_mpi_comm(communicator);
//
cgp_pio_mode(CGNS_ENUMV(CGP_INDEPENDENT));
cgp_pio_mode(CGP_INDEPENDENT);

CGNS cgns;
cgns.fname = std::string(prefix);
if (cgp_open(prefix, CGNS_ENUMV(CG_MODE_WRITE), &cgns.index))
if (cgp_open(prefix, CG_MODE_WRITE, &cgns.index))
cgp_error_exit();

{
Expand Down
10 changes: 5 additions & 5 deletions mds/mdsCGNS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ struct MeshDataGroup
if (components.size() == 1)
{
std::cout << "Scalar Group has " << components.size() << " related componenets: " << std::endl;
for (const auto m : components)
for (const auto &m : components)
std::cout << "Field " << m.second.name << " @ " << m.second.si << " " << m.second.fi << std::endl;
}
else if (components.size() == 3)
{
std::cout << "Vector Group has " << components.size() << " related componenets: " << std::endl;
for (const auto m : components)
for (const auto &m : components)
std::cout << "Field " << m.second.name << " @ " << m.second.si << " " << m.second.fi << std::endl;
}
else if (components.size() == 9)
{
std::cout << "Matrix Group has " << components.size() << " related componenets: " << std::endl;
for (const auto m : components)
for (const auto &m : components)
std::cout << "Field " << m.second.name << " @ " << m.second.si << " " << m.second.fi << std::endl;
}
else
Expand Down Expand Up @@ -1056,8 +1056,8 @@ apf::Mesh2 *DoIt(gmi_model *g, const std::string &fname, apf::CGNSBCMap &cgnsBCM
int cgid = -1;
auto comm = PCU_Get_Comm();
cgp_mpi_comm(comm);
cgp_pio_mode(CGNS_ENUMV(CGP_INDEPENDENT));
cgp_open(fname.c_str(), CGNS_ENUMV(CG_MODE_READ), &cgid);
cgp_pio_mode(CGP_INDEPENDENT);
cgp_open(fname.c_str(), CG_MODE_READ, &cgid);

int nbases = -1;
cg_nbases(cgid, &nbases);
Expand Down

0 comments on commit 4a17a60

Please sign in to comment.