Skip to content

Commit

Permalink
Silence a std::string warning in radiation (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz authored Oct 10, 2023
1 parent b53d0d8 commit a14174b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/driver/Castro_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,15 +685,15 @@ Castro::variableSetUp ()
std::cout << "Radiation::nGroups = " << Radiation::nGroups << std::endl;
}

char rad_name[10];
std::string rad_name;
if (!Radiation::do_multigroup) {
desc_lst
.setComponent(Rad_Type, Rad, "rad", bc,
genericBndryFunc);
}
else {
for (int i = 0; i < Radiation::nGroups; i++) {
sprintf(rad_name, "rad%d", i);
rad_name = "rad" + std::to_string(i);
desc_lst
.setComponent(Rad_Type, i, rad_name, bc,
genericBndryFunc);
Expand Down
4 changes: 2 additions & 2 deletions Source/radiation/energy_diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Castro::do_energy_diagnostics()
r += getLevel(lev).volWgtSum("rad", prev_time + dt);
}
else {
char rad_name[10];
std::string rad_name;
for (int igroup = 0; igroup < Radiation::nGroups; igroup++) {
sprintf(rad_name, "rad%d", igroup);
rad_name = "rad" + std::to_string(igroup);
r += getLevel(lev).volWgtSum(rad_name, prev_time + dt);
}
}
Expand Down

0 comments on commit a14174b

Please sign in to comment.