Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Source/driver/Castro.H
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef CASTRO_H
#define CASTRO_H

#include <format>

#include <state_indices.H>

// runtime parameters
Expand Down Expand Up @@ -1131,7 +1133,7 @@ public:
///
bool oversubscribing() { // NOLINT(readability-convert-member-functions-to-static)
#ifdef AMREX_USE_GPU
return (amrex::MultiFab::queryMemUsage("AmrLevel_Level_" + std::to_string(level)) >=
return (amrex::MultiFab::queryMemUsage(std::format("AmrLevel_Level_{}", level)) >=
static_cast<Long>(amrex::Gpu::Device::totalGlobalMem()));
#else
return false;
Expand Down
11 changes: 6 additions & 5 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <ctime>
#include <memory>
#include <numbers>
#include <format>

#include <AMReX_Utility.H>
#include <AMReX_CONSTANTS.H>
Expand Down Expand Up @@ -693,7 +694,7 @@ Castro::Castro (Amr& papa,
{
BL_PROFILE("Castro::Castro()");

MultiFab::RegionTag amrlevel_tag("AmrLevel_Level_" + std::to_string(lev));
MultiFab::RegionTag amrlevel_tag(std::format("AmrLevel_Level_{}", lev));

buildMetrics();

Expand Down Expand Up @@ -3475,8 +3476,8 @@ Castro::allocOldData ()
{
BL_PROFILE("Castro::allocOldData");

MultiFab::RegionTag amrlevel_tag("AmrLevel_Level_" + std::to_string(level));
MultiFab::RegionTag statedata_tag("StateData_Level_" + std::to_string(level));
MultiFab::RegionTag amrlevel_tag(std::format("AmrLevel_Level_{}", level));
MultiFab::RegionTag statedata_tag(std::format("StateData_Level_{}", level));
for (int k = 0; k < num_state_type; k++) {
state[k].allocOldData();
}
Expand Down Expand Up @@ -4240,8 +4241,8 @@ Castro::swap_state_time_levels(const Real dt)

BL_PROFILE("Castro::swap_state_time_levels()");

MultiFab::RegionTag statedata_tag("StateData_Level_" + std::to_string(level));
MultiFab::RegionTag amrlevel_tag("AmrLevel_Level_" + std::to_string(level));
MultiFab::RegionTag statedata_tag(std::format("StateData_Level_{}", level));
MultiFab::RegionTag amrlevel_tag(std::format("AmrLevel_Level_{}", level));

for (int k = 0; k < num_state_type; k++) {

Expand Down
3 changes: 2 additions & 1 deletion Source/driver/Castro_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <cmath>
#include <climits>
#include <format>

#include <problem_initialize_state_data.H>

Expand Down Expand Up @@ -48,7 +49,7 @@ Castro::advance (Real time,

wall_time_start = ParallelDescriptor::second();

MultiFab::RegionTag amrlevel_tag("AmrLevel_Level_" + std::to_string(level));
MultiFab::RegionTag amrlevel_tag(std::format("AmrLevel_Level_{}", level));

Real dt_new = dt;

Expand Down
7 changes: 4 additions & 3 deletions Source/driver/Castro_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <iomanip>
#include <iostream>
#include <format>
#include <string>
#include <ctime>

Expand Down Expand Up @@ -1096,7 +1097,7 @@ Castro::plotFileOutput(const std::string& dir,
const DeriveRec* rec = derive_lst.get(name);
if (rec->numDerive() > 1) {
for (int i = 0; i < rec->numDerive(); ++i) {
os << rec->variableName(0) + '_' + std::to_string(i) + '\n';
os << std::format("{}_{}\n", rec->variableName(0), i);
}
}
else {
Expand Down Expand Up @@ -1171,12 +1172,12 @@ Castro::plotFileOutput(const std::string& dir,
// The name is relative to the directory containing the Header file.
//
static const std::string BaseName = "/Cell";
std::string Level = "Level_" + std::to_string(level);
std::string Level = std::format("Level_{}", level);
//
// Now for the full pathname of that directory.
//
std::string FullPath = dir;
if (!FullPath.empty() && FullPath[FullPath.size()-1] != '/') {
if (!FullPath.ends_with('/')) {
FullPath += '/';
}
FullPath += Level;
Expand Down
9 changes: 5 additions & 4 deletions Source/driver/Castro_setup.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <cstdio>

#include <array>
#include <format>

#include <AMReX_LevelBld.H>
#include <AMReX_ParmParse.H>
Expand Down Expand Up @@ -493,7 +494,7 @@ Castro::variableSetUp ()
{
set_scalar_bc(bc, phys_bc);
bcs[UFA+i] = bc;
name[UFA+i] = "adv_" + std::to_string(i);
name[UFA+i] = std::format("adv_{}", i);
}


Expand Down Expand Up @@ -642,7 +643,7 @@ Castro::variableSetUp ()
}
else if (castro::time_integration_method == SimplifiedSpectralDeferredCorrections) {
for (int n = 0; n < sdc_iters+1; n++) {
burn_weight_names.emplace_back("burn_weights_iter_" + std::to_string(n+1));
burn_weight_names.emplace_back(std::format("burn_weights_iter_{}", n + 1));
}
}
}
Expand All @@ -655,7 +656,7 @@ Castro::variableSetUp ()
replace_inflow_bc(bc);

desc_lst.setComponent(Simplified_SDC_React_Type, i,
"sdc_react_source_" + std::to_string(i),
std::format("sdc_react_source_{}", i),
bc, genericBndryFunc);
}
}
Expand All @@ -682,7 +683,7 @@ Castro::variableSetUp ()
}
else {
for (int i = 0; i < Radiation::nGroups; i++) {
rad_name = "rad" + std::to_string(i);
rad_name = std::format("rad{}", i);
desc_lst
.setComponent(Rad_Type, i, rad_name, bc,
genericBndryFunc);
Expand Down
Loading