diff --git a/Docs/Migration/Migration.md b/Docs/Migration/Migration.md index de6fd294bea..86d3df741f7 100644 --- a/Docs/Migration/Migration.md +++ b/Docs/Migration/Migration.md @@ -88,4 +88,18 @@ AMRex, we have renamed several directories: A script `Tools/Migration/step-4-dirname/dirname.sh` can be used to the the search and replace. +### Step 5 + +AMReX `migration/5-namespace` branch should be used in this step. +BoxLib has a `BoxLib` namspace, but most of BoxLib classes are not in +the namespace. In AMReX, all classes and functions have been moved +into the `amrex` namespace. In this step, you can use +`Tools/Migration/step-5-amrex-namespace/amrex-namespace.sh` to replace +`BoxLib::` with `amrex::` for those already in `BoxLib` namespace. +However, the rest of work is expected to be performed manually, +because C++ is too a complicated language for shell scripting. For +most `.cpp` files, you can put a `using namespace amrex;` line after +the last `include` line, or you can add `amrex::` to wherever needed. +However, for header files, it is considered bad practice to have +`using namespace` because it pollutes the namespace. diff --git a/Docs/Readme.profiling b/Docs/Readme.profiling index 22842441bc3..4095dcac804 100644 --- a/Docs/Readme.profiling +++ b/Docs/Readme.profiling @@ -49,7 +49,7 @@ For main, add these: int main(...) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); // add this @@ -58,7 +58,7 @@ int main(...) { BL_PROFILE_VAR_STOP(pmain); // add this BL_PROFILE_SET_RUN_TIME(Your_timers_time_for_the_run); // optional - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/MiniApps/FillBoundary/MultiFabFillBoundaryTest.cpp b/MiniApps/FillBoundary/MultiFabFillBoundaryTest.cpp index 62daed7bee8..eff9612cf4e 100644 --- a/MiniApps/FillBoundary/MultiFabFillBoundaryTest.cpp +++ b/MiniApps/FillBoundary/MultiFabFillBoundaryTest.cpp @@ -31,7 +31,7 @@ const int maxGrid(64); // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) { if(ParallelDescriptor::IOProcessor()) { std::cerr << "**** Error: nprocs = " << nprocs << " is not currently supported." << std::endl; } - BoxLib::Error("We require that the number of processors be a perfect cube"); + amrex::Error("We require that the number of processors be a perfect cube"); } if(ParallelDescriptor::IOProcessor()) { std::cout << "N = " << N << std::endl; @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) { BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/MiniApps/MultiGrid_C/main.cpp b/MiniApps/MultiGrid_C/main.cpp index 6b43f37628e..17cb82cbd4c 100644 --- a/MiniApps/MultiGrid_C/main.cpp +++ b/MiniApps/MultiGrid_C/main.cpp @@ -49,7 +49,7 @@ void solve(MultiFab& soln, const MultiFab& anaSoln, int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -80,7 +80,7 @@ int main(int argc, char* argv[]) if(ParallelDescriptor::IOProcessor()) { std::cerr << "**** Error: nprocs = " << nprocs << " is not currently supported." << std::endl; } - BoxLib::Error("We require that the number of processors be a perfect cube"); + amrex::Error("We require that the number of processors be a perfect cube"); } if(ParallelDescriptor::IOProcessor()) { std::cout << "N = " << N << std::endl; @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); } void compute_analyticSolution(MultiFab& anaSoln) diff --git a/MiniApps/PGAS_SMC/SMC_io.cpp b/MiniApps/PGAS_SMC/SMC_io.cpp index fcf575a4940..d82c3695627 100644 --- a/MiniApps/PGAS_SMC/SMC_io.cpp +++ b/MiniApps/PGAS_SMC/SMC_io.cpp @@ -9,7 +9,7 @@ void SMC::writePlotFile (int istep) { - const std::string& dir = BoxLib::Concatenate("plt",istep,5); + const std::string& dir = amrex::Concatenate("plt",istep,5); MultiFab mf(U.boxArray(), nplot, 0); #ifdef _OPENMP @@ -30,8 +30,8 @@ SMC::writePlotFile (int istep) // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -52,7 +52,7 @@ SMC::writePlotFile (int istep) // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -98,7 +98,7 @@ SMC::writePlotFile (int istep) // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -110,8 +110,8 @@ SMC::writePlotFile (int istep) // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/MiniApps/PGAS_SMC/main.cpp b/MiniApps/PGAS_SMC/main.cpp index f7dc690acbc..ca5c984ab82 100644 --- a/MiniApps/PGAS_SMC/main.cpp +++ b/MiniApps/PGAS_SMC/main.cpp @@ -5,7 +5,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -16,5 +16,5 @@ main (int argc, char* argv[]) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Src/Amr/AMReX_Amr.cpp b/Src/Amr/AMReX_Amr.cpp index c938f6f25a2..863b4b7bd1e 100644 --- a/Src/Amr/AMReX_Amr.cpp +++ b/Src/Amr/AMReX_Amr.cpp @@ -122,7 +122,7 @@ Amr::Initialize () plot_headerversion = VisMF::Header::Version_v1; checkpoint_headerversion = VisMF::Header::Version_v1; - BoxLib::ExecOnFinalize(Amr::Finalize); + amrex::ExecOnFinalize(Amr::Finalize); initialized = true; } @@ -363,11 +363,11 @@ Amr::InitAmr () else if (numvals == 0) { if (ParallelDescriptor::IOProcessor()) - BoxLib::Warning("Using default regrid_int = 1 at all levels"); + amrex::Warning("Using default regrid_int = 1 at all levels"); } else if (numvals < max_level) { - BoxLib::Error("You did not specify enough values of regrid_int"); + amrex::Error("You did not specify enough values of regrid_int"); } else { @@ -384,7 +384,7 @@ Amr::InitAmr () std::ifstream is(initial_grids_file.c_str(),std::ios::in); if (!is.good()) - BoxLib::FileOpenFailed(initial_grids_file); + amrex::FileOpenFailed(initial_grids_file); int in_finest,ngrid; @@ -394,7 +394,7 @@ Amr::InitAmr () use_fixed_upto_level = in_finest; if (in_finest > max_level) - BoxLib::Error("You have fewer levels in your inputs file then in your grids file!"); + amrex::Error("You have fewer levels in your inputs file then in your grids file!"); for (int lev = 1; lev <= in_finest; lev++) { @@ -424,7 +424,7 @@ Amr::InitAmr () std::ifstream is(regrid_grids_file.c_str(),std::ios::in); if (!is.good()) - BoxLib::FileOpenFailed(regrid_grids_file); + amrex::FileOpenFailed(regrid_grids_file); int in_finest,ngrid; @@ -445,7 +445,7 @@ Amr::InitAmr () if (bx.longside() > max_grid_size[lev]) { std::cout << "Grid " << bx << " too large" << '\n'; - BoxLib::Error(); + amrex::Error(); } bl.push_back(bx); } @@ -603,7 +603,7 @@ Amr::setRecordGridInfo (const std::string& filename) { gridlog.open(filename.c_str(),std::ios::out|std::ios::app); if (!gridlog.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); } ParallelDescriptor::Barrier("Amr::setRecordGridInfo"); } @@ -616,7 +616,7 @@ Amr::setRecordRunInfo (const std::string& filename) { runlog.open(filename.c_str(),std::ios::out|std::ios::app); if (!runlog.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); } ParallelDescriptor::Barrier("Amr::setRecordRunInfo"); } @@ -629,7 +629,7 @@ Amr::setRecordRunInfoTerse (const std::string& filename) { runlog_terse.open(filename.c_str(),std::ios::out|std::ios::app); if (!runlog_terse.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); } ParallelDescriptor::Barrier("Amr::setRecordRunInfoTerse"); } @@ -642,7 +642,7 @@ Amr::setRecordDataInfo (int i, const std::string& filename) datalog[i].reset(new std::fstream); datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app); if (!datalog[i]->good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); } ParallelDescriptor::Barrier("Amr::setRecordDataInfo"); } @@ -718,7 +718,7 @@ Amr::writePlotFile () Real dPlotFileTime0 = ParallelDescriptor::second(); - const std::string& pltfile = BoxLib::Concatenate(plot_file_root,level_steps[0],file_name_digits); + const std::string& pltfile = amrex::Concatenate(plot_file_root,level_steps[0],file_name_digits); if (verbose > 0 && ParallelDescriptor::IOProcessor()) { std::cout << "PLOTFILE: file = " << pltfile << '\n'; @@ -728,7 +728,7 @@ Amr::writePlotFile () runlog << "PLOTFILE: file = " << pltfile << '\n'; } - BoxLib::StreamRetry sretry(pltfile, abort_on_stream_retry_failure, + amrex::StreamRetry sretry(pltfile, abort_on_stream_retry_failure, stream_max_tries); const std::string pltfileTemp(pltfile + ".temp"); @@ -743,14 +743,14 @@ Amr::writePlotFile () // if(precreateDirectories) { // ---- make all directories at once - BoxLib::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier + amrex::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier if(ParallelDescriptor::IOProcessor()) { std::cout << "IOIOIOIO: precreating directories for " << pltfileTemp << std::endl; } - BoxLib::PreBuildDirectorHierarchy(pltfileTemp, "Level_", finest_level + 1, true); // call barrier + amrex::PreBuildDirectorHierarchy(pltfileTemp, "Level_", finest_level + 1, true); // call barrier } else { - BoxLib::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier - BoxLib::UtilCreateCleanDirectory(pltfileTemp, true); // call barrier + amrex::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier + amrex::UtilCreateCleanDirectory(pltfileTemp, true); // call barrier } std::string HeaderFileName(pltfileTemp + "/Header"); @@ -770,7 +770,7 @@ Amr::writePlotFile () HeaderFile.open(HeaderFileName.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); if ( ! HeaderFile.good()) { - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); } old_prec = HeaderFile.precision(15); } @@ -782,7 +782,7 @@ Amr::writePlotFile () if (ParallelDescriptor::IOProcessor()) { HeaderFile.precision(old_prec); if ( ! HeaderFile.good()) { - BoxLib::Error("Amr::writePlotFile() failed"); + amrex::Error("Amr::writePlotFile() failed"); } } @@ -842,7 +842,7 @@ Amr::writeSmallPlotFile () Real dPlotFileTime0 = ParallelDescriptor::second(); - const std::string& pltfile = BoxLib::Concatenate(small_plot_file_root, + const std::string& pltfile = amrex::Concatenate(small_plot_file_root, level_steps[0], file_name_digits); @@ -854,7 +854,7 @@ Amr::writeSmallPlotFile () runlog << "SMALL PLOTFILE: file = " << pltfile << '\n'; } - BoxLib::StreamRetry sretry(pltfile, abort_on_stream_retry_failure, + amrex::StreamRetry sretry(pltfile, abort_on_stream_retry_failure, stream_max_tries); const std::string pltfileTemp(pltfile + ".temp"); @@ -868,15 +868,15 @@ Amr::writeSmallPlotFile () // it to a bad suffix if there were stream errors. // if(precreateDirectories) { // ---- make all directories at once - BoxLib::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier - BoxLib::UtilCreateCleanDirectory(pltfileTemp, false); // dont call barrier + amrex::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier + amrex::UtilCreateCleanDirectory(pltfileTemp, false); // dont call barrier for(int i(0); i <= finest_level; ++i) { amr_level[i]->CreateLevelDirectory(pltfileTemp); } ParallelDescriptor::Barrier("Amr::precreate smallplotfile Directories"); } else { - BoxLib::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier - BoxLib::UtilCreateCleanDirectory(pltfileTemp, true); // call barrier + amrex::UtilRenameDirectoryToOld(pltfile, false); // dont call barrier + amrex::UtilCreateCleanDirectory(pltfileTemp, true); // call barrier } @@ -897,7 +897,7 @@ Amr::writeSmallPlotFile () HeaderFile.open(HeaderFileName.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); if ( ! HeaderFile.good()) { - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); } old_prec = HeaderFile.precision(15); } @@ -909,7 +909,7 @@ Amr::writeSmallPlotFile () if (ParallelDescriptor::IOProcessor()) { HeaderFile.precision(old_prec); if ( ! HeaderFile.good()) { - BoxLib::Error("Amr::writeSmallPlotFile() failed"); + amrex::Error("Amr::writeSmallPlotFile() failed"); } } @@ -946,7 +946,7 @@ void Amr::checkInput () { if (max_level < 0) - BoxLib::Error("checkInput: max_level not set"); + amrex::Error("checkInput: max_level not set"); // // Check that blocking_factor is a power of 2. // @@ -956,7 +956,7 @@ Amr::checkInput () while ( k > 0 && (k%2 == 0) ) k /= 2; if (k != 1) - BoxLib::Error("Amr::checkInputs: blocking_factor not power of 2"); + amrex::Error("Amr::checkInputs: blocking_factor not power of 2"); } // // Check level dependent values. @@ -964,11 +964,11 @@ Amr::checkInput () for (int i = 0; i < max_level; i++) { if (MaxRefRatio(i) < 2 || MaxRefRatio(i) > 12) - BoxLib::Error("checkInput bad ref_ratios"); + amrex::Error("checkInput bad ref_ratios"); } const Box& domain = Geom(0).Domain(); if (!domain.ok()) - BoxLib::Error("level 0 domain bad or not set"); + amrex::Error("level 0 domain bad or not set"); // // Check that domain size is a multiple of blocking_factor[0]. // @@ -976,7 +976,7 @@ Amr::checkInput () { int len = domain.length(i); if (len%blocking_factor[0] != 0) - BoxLib::Error("domain size not divisible by blocking_factor"); + amrex::Error("domain size not divisible by blocking_factor"); } // // Check that max_grid_size is even. @@ -984,7 +984,7 @@ Amr::checkInput () for (int i = 0; i < max_level; i++) { if (max_grid_size[i]%2 != 0) - BoxLib::Error("max_grid_size is not even"); + amrex::Error("max_grid_size is not even"); } // @@ -993,11 +993,11 @@ Amr::checkInput () for (int i = 0; i < max_level; i++) { if (max_grid_size[i]%blocking_factor[i] != 0) - BoxLib::Error("max_grid_size not divisible by blocking_factor"); + amrex::Error("max_grid_size not divisible by blocking_factor"); } if( ! Geometry::ProbDomain().ok()) { - BoxLib::Error("checkInput: bad physical problem size"); + amrex::Error("checkInput: bad physical problem size"); } if(verbose > 0 && ParallelDescriptor::IOProcessor()) { @@ -1367,7 +1367,7 @@ Amr::restart (const std::string& filename) if (spdim != BL_SPACEDIM) { std::cerr << "Amr::restart(): bad spacedim = " << spdim << '\n'; - BoxLib::Abort(); + amrex::Abort(); } is >> cumtime; @@ -1443,7 +1443,7 @@ Amr::restart (const std::string& filename) for (int i(1); i <= finest_level; ++i) { if (dt_level[i] != dt_level[i-1]) { - BoxLib::Error("restart: must have same dt at all levels if not subcycling"); + amrex::Error("restart: must have same dt at all levels if not subcycling"); } } } @@ -1454,7 +1454,7 @@ Amr::restart (const std::string& filename) if (regrid_int[0] > 0) { level_count[0] = regrid_int[0]; } else { - BoxLib::Error("restart: can't have regrid_on_restart and regrid_int <= 0"); + amrex::Error("restart: can't have regrid_on_restart and regrid_int <= 0"); } } @@ -1480,7 +1480,7 @@ Amr::restart (const std::string& filename) } else { if (ParallelDescriptor::IOProcessor()) { - BoxLib::Warning("Amr::restart(): max_level is lower than before"); + amrex::Warning("Amr::restart(): max_level is lower than before"); } int new_finest_level = std::min(max_level,finest_level); @@ -1522,7 +1522,7 @@ Amr::restart (const std::string& filename) if (regrid_int[0] > 0) { level_count[0] = regrid_int[0]; } else { - BoxLib::Error("restart: can't have regrid_on_restart and regrid_int <= 0"); + amrex::Error("restart: can't have regrid_on_restart and regrid_int <= 0"); } } @@ -1560,7 +1560,7 @@ Amr::restart (const std::string& filename) std::cout << "Amr::restart() failed -- box from inputs file does not " << "equal box from restart file." << std::endl; } - BoxLib::Abort(); + amrex::Abort(); } } @@ -1605,7 +1605,7 @@ Amr::checkPoint () Real dCheckPointTime0 = ParallelDescriptor::second(); - const std::string& ckfile = BoxLib::Concatenate(check_file_root,level_steps[0],file_name_digits); + const std::string& ckfile = amrex::Concatenate(check_file_root,level_steps[0],file_name_digits); if(verbose > 0 && ParallelDescriptor::IOProcessor()) { std::cout << "CHECKPOINT: file = " << ckfile << std::endl; @@ -1616,7 +1616,7 @@ Amr::checkPoint () } - BoxLib::StreamRetry sretry(ckfile, abort_on_stream_retry_failure, + amrex::StreamRetry sretry(ckfile, abort_on_stream_retry_failure, stream_max_tries); const std::string ckfileTemp(ckfile + ".temp"); @@ -1634,15 +1634,15 @@ Amr::checkPoint () // if(precreateDirectories) { // ---- make all directories at once - BoxLib::UtilRenameDirectoryToOld(ckfile, false); // dont call barrier - BoxLib::UtilCreateCleanDirectory(ckfileTemp, false); // dont call barrier + amrex::UtilRenameDirectoryToOld(ckfile, false); // dont call barrier + amrex::UtilCreateCleanDirectory(ckfileTemp, false); // dont call barrier for(int i(0); i <= finest_level; ++i) { amr_level[i]->CreateLevelDirectory(ckfileTemp); } ParallelDescriptor::Barrier("Amr::precreateDirectories"); } else { - BoxLib::UtilRenameDirectoryToOld(ckfile, false); // dont call barrier - BoxLib::UtilCreateCleanDirectory(ckfileTemp, true); // call barrier + amrex::UtilRenameDirectoryToOld(ckfile, false); // dont call barrier + amrex::UtilCreateCleanDirectory(ckfileTemp, true); // call barrier } std::string HeaderFileName = ckfileTemp + "/Header"; @@ -1664,7 +1664,7 @@ Amr::checkPoint () std::ios::binary); if ( ! HeaderFile.good()) { - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); } old_prec = HeaderFile.precision(17); @@ -1705,7 +1705,7 @@ Amr::checkPoint () std::ios::out | std::ios::trunc | std::ios::binary); if ( ! FAHeaderFile.good()) { - BoxLib::FileOpenFailed(FAHeaderFilesName); + amrex::FileOpenFailed(FAHeaderFilesName); } for(int i(0); i < FAHeaderNames.size(); ++i) { @@ -1718,7 +1718,7 @@ Amr::checkPoint () HeaderFile.precision(old_prec); if( ! HeaderFile.good()) { - BoxLib::Error("Amr::checkpoint() failed"); + amrex::Error("Amr::checkpoint() failed"); } } @@ -2000,7 +2000,7 @@ Amr::coarseTimeStep (Real stop_time) #endif #ifndef BL_MEM_PROFILING - long min_fab_kilobytes = BoxLib::TotalBytesAllocatedInFabsHWM()/1024; + long min_fab_kilobytes = amrex::TotalBytesAllocatedInFabsHWM()/1024; long max_fab_kilobytes = min_fab_kilobytes; #ifdef BL_LAZY @@ -2229,7 +2229,7 @@ Amr::defBaseLevel (Real strt_time, for (int idir = 0; idir < BL_SPACEDIM; idir++) if (d_len[idir]%2 != 0) - BoxLib::Error("defBaseLevel: must have even number of cells"); + amrex::Error("defBaseLevel: must have even number of cells"); BoxArray lev0; @@ -2239,9 +2239,9 @@ Amr::defBaseLevel (Real strt_time, BoxArray domain_ba(domain); if (!domain_ba.contains(*lev0_grids)) - BoxLib::Error("defBaseLevel: domain does not contain lev0_grids!"); + amrex::Error("defBaseLevel: domain does not contain lev0_grids!"); if (!lev0_grids->contains(domain_ba)) - BoxLib::Error("defBaseLevel: lev0_grids does not contain domain"); + amrex::Error("defBaseLevel: lev0_grids does not contain domain"); lev0 = *lev0_grids; @@ -2475,7 +2475,7 @@ Amr::regrid_level_0_on_restart() // Coarsening before we split the grids ensures that each resulting // grid will have an even number of cells in each direction. // - BoxArray lev0(BoxLib::coarsen(Geom(0).Domain(),2)); + BoxArray lev0(amrex::coarsen(Geom(0).Domain(),2)); // // Now split up into list of grids within max_grid_size[0] limit. // @@ -2866,7 +2866,7 @@ Amr::initSubcycle () if (nosub > 0) sub_cycle = false; else - BoxLib::Error("nosub <= 0 not allowed.\n"); + amrex::Error("nosub <= 0 not allowed.\n"); subcycling_mode = "None"; } else @@ -2910,19 +2910,19 @@ Amr::initSubcycle () pp.getarr("subcycling_iterations",n_cycle,0,max_level+1); if (n_cycle[0] != 1) { - BoxLib::Error("First entry of subcycling_iterations must be 1"); + amrex::Error("First entry of subcycling_iterations must be 1"); } } else { - BoxLib::Error("Must provide a valid subcycling_iterations if mode is Manual"); + amrex::Error("Must provide a valid subcycling_iterations if mode is Manual"); } for (int i = 1; i <= max_level; i++) { if (n_cycle[i] > MaxRefRatio(i-1)) - BoxLib::Error("subcycling iterations must always be <= ref_ratio"); + amrex::Error("subcycling iterations must always be <= ref_ratio"); if (n_cycle[i] <= 0) - BoxLib::Error("subcycling iterations must always be > 0"); + amrex::Error("subcycling iterations must always be > 0"); } } else if (subcycling_mode == "Auto") @@ -2946,7 +2946,7 @@ Amr::initSubcycle () else { std::string err_message = "Unrecognzied subcycling mode: " + subcycling_mode + "\n"; - BoxLib::Error(err_message.c_str()); + amrex::Error(err_message.c_str()); } } @@ -2978,7 +2978,7 @@ Amr::initPltAndChk () if (check_int > 0 && check_per > 0) { if (ParallelDescriptor::IOProcessor()) - BoxLib::Warning("Warning: both amr.check_int and amr.check_per are > 0."); + amrex::Warning("Warning: both amr.check_int and amr.check_per are > 0."); } plot_file_root = "plt"; @@ -2993,7 +2993,7 @@ Amr::initPltAndChk () if (plot_int > 0 && plot_per > 0) { if (ParallelDescriptor::IOProcessor()) - BoxLib::Warning("Warning: both amr.plot_int and amr.plot_per are > 0."); + amrex::Warning("Warning: both amr.plot_int and amr.plot_per are > 0."); } small_plot_file_root = "smallplt"; @@ -3008,7 +3008,7 @@ Amr::initPltAndChk () if (small_plot_int > 0 && small_plot_per > 0) { if (ParallelDescriptor::IOProcessor()) - BoxLib::Warning("Warning: both amr.small_plot_int and amr.small_plot_per are > 0."); + amrex::Warning("Warning: both amr.small_plot_int and amr.small_plot_per are > 0."); } write_plotfile_with_checkpoint = 1; @@ -3273,7 +3273,7 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { allIntsSize = allInts.size(); } - BoxLib::BroadcastArray(allInts, scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastArray(allInts, scsMyId, ioProcNumAll, scsComm); // ---- unpack the ints if(scsMyId != ioProcNumSCS) { @@ -3359,7 +3359,7 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { allLongs.push_back(VisMF::GetIOBufferSize()); } - BoxLib::BroadcastArray(allLongs, scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastArray(allLongs, scsMyId, ioProcNumAll, scsComm); // ---- unpack the longs if(scsMyId != ioProcNumSCS) { @@ -3385,7 +3385,7 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { allRealsSize = allReals.size(); } - BoxLib::BroadcastArray(allReals, scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastArray(allReals, scsMyId, ioProcNumAll, scsComm); // ---- unpack the Reals if(scsMyId != ioProcNumSCS) { @@ -3435,7 +3435,7 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { allBoolsSize = allBools.size(); } - BoxLib::BroadcastArray(allBools, scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastArray(allBools, scsMyId, ioProcNumAll, scsComm); // ---- unpack the bools if(scsMyId != ioProcNumSCS) { @@ -3492,16 +3492,16 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { allStrings.push_back(*lit); } - serialStrings = BoxLib::SerializeStringArray(allStrings); + serialStrings = amrex::SerializeStringArray(allStrings); serialStringsSize = serialStrings.size(); } - BoxLib::BroadcastArray(serialStrings, scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastArray(serialStrings, scsMyId, ioProcNumAll, scsComm); // ---- unpack the strings if(scsMyId != ioProcNumSCS) { int count(0); - allStrings = BoxLib::UnSerializeStringArray(serialStrings); + allStrings = amrex::UnSerializeStringArray(serialStrings); regrid_grids_file = allStrings[count++]; initial_grids_file = allStrings[count++]; @@ -3560,10 +3560,10 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { // ---- BoxArrays for(int i(0); i < initial_ba.size(); ++i) { - BoxLib::BroadcastBoxArray(initial_ba[i], scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastBoxArray(initial_ba[i], scsMyId, ioProcNumAll, scsComm); } for(int i(0); i < regrid_ba.size(); ++i) { - BoxLib::BroadcastBoxArray(regrid_ba[i], scsMyId, ioProcNumAll, scsComm); + amrex::BroadcastBoxArray(regrid_ba[i], scsMyId, ioProcNumAll, scsComm); } @@ -3610,7 +3610,7 @@ Amr::AddProcsToComp(int nSidecarProcs, int prevSidecarProcs) { BroadcastBoundaryPointList(intersect_hiz, scsMyId, ioProcNumSCS, scsComm); #ifdef USE_STATIONDATA - BoxLib::Abort("**** Error: USE_STATIONDATA not yet supported in sidecar resize."); + amrex::Abort("**** Error: USE_STATIONDATA not yet supported in sidecar resize."); // ---- handle station if(scsMyId != ioProcNumSCS) { } @@ -3709,9 +3709,9 @@ Amr::BroadcastBoundaryPointList(BoundaryPointList &bpl, int myLocalId, int rootI bplD.push_back(it->second); } } - BoxLib::BroadcastArray(pF, myLocalId, rootId, comm); - BoxLib::BroadcastArray(pS, myLocalId, rootId, comm); - BoxLib::BroadcastArray(bplD, myLocalId, rootId, comm); + amrex::BroadcastArray(pF, myLocalId, rootId, comm); + amrex::BroadcastArray(pS, myLocalId, rootId, comm); + amrex::BroadcastArray(bplD, myLocalId, rootId, comm); BL_ASSERT(pF.size() == pS.size()); BL_ASSERT(pS.size() == bplD.size()); diff --git a/Src/Amr/AMReX_AmrLevel.cpp b/Src/Amr/AMReX_AmrLevel.cpp index 87e6ec579a3..8996c5275a2 100644 --- a/Src/Amr/AMReX_AmrLevel.cpp +++ b/Src/Amr/AMReX_AmrLevel.cpp @@ -178,7 +178,7 @@ AmrLevel::restart (Amr& papa, if (bReadSpecial) { - BoxLib::readBoxArray(grids, is, bReadSpecial); + amrex::readBoxArray(grids, is, bReadSpecial); } else { @@ -213,7 +213,7 @@ AmrLevel::restart (Amr& papa, void AmrLevel::set_state_in_checkpoint (Array& state_in_checkpoint) { - BoxLib::Error("Class derived AmrLevel has to handle this!"); + amrex::Error("Class derived AmrLevel has to handle this!"); } void @@ -303,8 +303,8 @@ AmrLevel::checkPoint (const std::string& dir, // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // - std::string PathNameInHdr = BoxLib::Concatenate(LevelDir + "/SD_", i, 1); - std::string FullPathName = BoxLib::Concatenate(FullPath + "/SD_", i, 1); + std::string PathNameInHdr = amrex::Concatenate(LevelDir + "/SD_", i, 1); + std::string FullPathName = amrex::Concatenate(FullPath + "/SD_", i, 1); state[i].checkPoint(PathNameInHdr, FullPathName, os, how, dump_old); } @@ -361,7 +361,7 @@ AmrLevel::get_data (int state_indx, return get_new_data(state_indx); } - BoxLib::Error("get_data: invalid time"); + amrex::Error("get_data: invalid time"); static MultiFab bogus; return bogus; } @@ -530,7 +530,7 @@ FillPatchIteratorHelper::Initialize (int boxGrow, m_fbox.insert(m_fbox.end(),v2)->second.resize(m_amrlevel.level+1); m_cbox.insert(m_cbox.end(),v2)->second.resize(m_amrlevel.level+1); - m_ba.insert(m_ba.end(),std::map::value_type(i,BoxLib::grow(m_leveldata.boxArray()[i],m_growsize))); + m_ba.insert(m_ba.end(),std::map::value_type(i,amrex::grow(m_leveldata.boxArray()[i],m_growsize))); } BoxList tempUnfillable(boxType); @@ -588,7 +588,7 @@ FillPatchIteratorHelper::Initialize (int boxGrow, if (shbox.ok()) { - BoxList bl = BoxLib::boxDiff(shbox,box); + BoxList bl = amrex::boxDiff(shbox,box); unfilledThisLevel.insert(unfilledThisLevel.end(), bl.begin(), bl.end()); } @@ -768,7 +768,7 @@ FillPatchIterator::Initialize (int boxGrow, else { if (level == 1 || - BoxLib::ProperlyNested(m_amrlevel.crse_ratio, + amrex::ProperlyNested(m_amrlevel.crse_ratio, m_amrlevel.parent->blockingFactor(m_amrlevel.level), boxGrow, boxType, desc.interp(SComp))) { @@ -780,7 +780,7 @@ FillPatchIterator::Initialize (int boxGrow, if (ParallelDescriptor::IOProcessor()) { int new_blocking_factor = 2*m_amrlevel.parent->blockingFactor(m_amrlevel.level); for (int i = 0; i < 10; ++i) { - if (BoxLib::ProperlyNested(m_amrlevel.crse_ratio, + if (amrex::ProperlyNested(m_amrlevel.crse_ratio, new_blocking_factor, boxGrow, boxType, desc.interp(SComp))) { break; @@ -851,7 +851,7 @@ FillPatchIterator::FillFromLevel0 (Real time, int index, int scomp, int dcomp, i StateDataPhysBCFunct physbcf(statedata,scomp,geom); - BoxLib::FillPatchSingleLevel (m_fabs, time, smf, stime, scomp, dcomp, ncomp, geom, physbcf); + amrex::FillPatchSingleLevel (m_fabs, time, smf, stime, scomp, dcomp, ncomp, geom, physbcf); } void @@ -882,7 +882,7 @@ FillPatchIterator::FillFromTwoLevels (Real time, int index, int scomp, int dcomp const StateDescriptor& desc = AmrLevel::desc_lst[index]; - BoxLib::FillPatchTwoLevels(m_fabs, time, + amrex::FillPatchTwoLevels(m_fabs, time, smf_crse, stime_crse, smf_fine, stime_fine, scomp, dcomp, ncomp, @@ -1150,7 +1150,7 @@ FillPatchIteratorHelper::fill (FArrayBox& fab, // // Get boundary conditions for the fine patch. // - BoxLib::setBC(finefab.box(), + amrex::setBC(finefab.box(), fDomain, m_scomp, 0, @@ -1298,14 +1298,14 @@ AmrLevel::FillCoarsePatch (MultiFab& mf, for (int j = 0, N = crseBA.size(); j < N; ++j) { BL_ASSERT(mf_BA[j].ixType() == desc.getType()); - const Box& bx = BoxLib::grow(mf_BA[j],nghost) & domain_g; + const Box& bx = amrex::grow(mf_BA[j],nghost) & domain_g; crseBA.set(j,mapper->CoarseBox(bx, crse_ratio)); } MultiFab crseMF(crseBA,NComp,0); if ( level == 1 - || BoxLib::ProperlyNested(crse_ratio, parent->blockingFactor(level), + || amrex::ProperlyNested(crse_ratio, parent->blockingFactor(level), nghost, mf_BA.ixType(), mapper) ) { StateData& statedata = clev.state[index]; @@ -1318,7 +1318,7 @@ AmrLevel::FillCoarsePatch (MultiFab& mf, StateDataPhysBCFunct physbcf(statedata,SComp,cgeom); - BoxLib::FillPatchSingleLevel(crseMF,time,smf,stime,SComp,0,NComp,cgeom,physbcf); + amrex::FillPatchSingleLevel(crseMF,time,smf,stime,SComp,0,NComp,cgeom,physbcf); } else { @@ -1330,11 +1330,11 @@ AmrLevel::FillCoarsePatch (MultiFab& mf, #endif for (MFIter mfi(mf); mfi.isValid(); ++mfi) { - const Box& dbx = BoxLib::grow(mfi.validbox(),nghost) & domain_g; + const Box& dbx = amrex::grow(mfi.validbox(),nghost) & domain_g; Array bcr(ncomp); - BoxLib::setBC(dbx,pdomain,SComp,0,NComp,desc.getBCs(),bcr); + amrex::setBC(dbx,pdomain,SComp,0,NComp,desc.getBCs(),bcr); mapper->interp(crseMF[mfi], 0, @@ -1441,7 +1441,7 @@ AmrLevel::derive (const std::string& name, BCREC_3D(bcr), &level,&grid_no); } else { - BoxLib::Error("AmeLevel::derive: no function available"); + amrex::Error("AmeLevel::derive: no function available"); } } #else @@ -1479,7 +1479,7 @@ AmrLevel::derive (const std::string& name, BCREC_3D(bcr), &level,&grid_no); } else { - BoxLib::Error("AmeLevel::derive: no function available"); + amrex::Error("AmeLevel::derive: no function available"); } } #endif @@ -1491,7 +1491,7 @@ AmrLevel::derive (const std::string& name, // std::string msg("AmrLevel::derive(MultiFab*): unknown variable: "); msg += name; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } return mf; @@ -1577,7 +1577,7 @@ AmrLevel::derive (const std::string& name, BCREC_3D(bcr), &level,&idx); } else { - BoxLib::Error("AmeLevel::derive: no function available"); + amrex::Error("AmeLevel::derive: no function available"); } } #else @@ -1615,7 +1615,7 @@ AmrLevel::derive (const std::string& name, BCREC_3D(bcr), &level,&idx); } else { - BoxLib::Error("AmeLevel::derive: no function available"); + amrex::Error("AmeLevel::derive: no function available"); } } #endif @@ -1627,7 +1627,7 @@ AmrLevel::derive (const std::string& name, // std::string msg("AmrLevel::derive(MultiFab*): unknown variable: "); msg += name; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } } @@ -1831,7 +1831,7 @@ void AmrLevel::constructAreaNotToTag() m_AreaToTag = tagarea; // We disallow tagging in the remaining part of the domain. - BoxArray tagba = BoxLib::boxComplement(parent->Geom(level).Domain(),m_AreaToTag); + BoxArray tagba = amrex::boxComplement(parent->Geom(level).Domain(),m_AreaToTag); m_AreaNotToTag = tagba; BoxArray bxa(parent->Geom(level).Domain()); @@ -1844,7 +1844,7 @@ void AmrLevel::constructAreaNotToTag() tagarea.refine(parent->refRatio(level-1)); tagarea.grow(-parent->blockingFactor(level)); m_AreaToTag = tagarea; - BoxArray tagba = BoxLib::boxComplement(parent->Geom(level).Domain(),m_AreaToTag); + BoxArray tagba = amrex::boxComplement(parent->Geom(level).Domain(),m_AreaToTag); m_AreaNotToTag = tagba; } } @@ -1887,7 +1887,7 @@ AmrLevel::AddProcsToComp(Amr *aptr, int nSidecarProcs, int prevSidecarProcs, for(int i(0); i < BL_SPACEDIM; ++i) { allIntVects.push_back(crse_ratio[i]); } for(int i(0); i < BL_SPACEDIM; ++i) { allIntVects.push_back(fine_ratio[i]); } } - BoxLib::BroadcastArray(allIntVects, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastArray(allIntVects, scsMyId, ioProcNumSCS, scsComm); if(scsMyId != ioProcNumSCS) { int count(0); @@ -1897,18 +1897,18 @@ AmrLevel::AddProcsToComp(Amr *aptr, int nSidecarProcs, int prevSidecarProcs, // ---- Boxes - BoxLib::BroadcastBox(m_AreaToTag, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBox(m_AreaToTag, scsMyId, ioProcNumSCS, scsComm); // ---- Geometry Geometry::BroadcastGeometry(geom, ioProcNumSCS, scsComm); // ---- BoxArrays - BoxLib::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); - BoxLib::BroadcastBoxArray(m_AreaNotToTag, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBoxArray(m_AreaNotToTag, scsMyId, ioProcNumSCS, scsComm); #ifdef USE_SLABSTAT - BoxLib::Abort("**** Error in AmrLevel::MSS: USE_SLABSTAT not implemented"); + amrex::Abort("**** Error in AmrLevel::MSS: USE_SLABSTAT not implemented"); #endif // ---- state @@ -1944,7 +1944,7 @@ AmrLevel::LevelDirectoryNames(const std::string &dir, std::string &LevelDir, std::string &FullPath) { - LevelDir = BoxLib::Concatenate("Level_", level, 1); + LevelDir = amrex::Concatenate("Level_", level, 1); // // Now for the full pathname of that directory. // @@ -1965,8 +1965,8 @@ AmrLevel::CreateLevelDirectory (const std::string &dir) LevelDirectoryNames(dir, LevelDir, FullPath); if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(FullPath, 0755)) { - BoxLib::CreateDirectoryFailed(FullPath); + if( ! amrex::UtilCreateDirectory(FullPath, 0755)) { + amrex::CreateDirectoryFailed(FullPath); } } diff --git a/Src/Amr/AMReX_AuxBoundaryData.cpp b/Src/Amr/AMReX_AuxBoundaryData.cpp index 1e0df557a6e..e79c5379153 100644 --- a/Src/Amr/AMReX_AuxBoundaryData.cpp +++ b/Src/Amr/AMReX_AuxBoundaryData.cpp @@ -65,7 +65,7 @@ AuxBoundaryData::initialize (const BoxArray& ba, m_ngrow = n_grow; - BoxList gcells = BoxLib::GetBndryCells(ba,n_grow); + BoxList gcells = amrex::GetBndryCells(ba,n_grow); // // Remove any intersections with periodically shifted valid region. // diff --git a/Src/Amr/AMReX_Derive.cpp b/Src/Amr/AMReX_Derive.cpp index c8a21193212..2b7e1f9c947 100644 --- a/Src/Amr/AMReX_Derive.cpp +++ b/Src/Amr/AMReX_Derive.cpp @@ -14,7 +14,7 @@ DeriveRec::TheSameBox (const Box& box) Box DeriveRec::GrowBoxByOne (const Box& box) { - return BoxLib::grow(box,1); + return amrex::grow(box,1); } diff --git a/Src/Amr/AMReX_SlabStat.cpp b/Src/Amr/AMReX_SlabStat.cpp index a82c51348ce..3fcc4cfebdf 100644 --- a/Src/Amr/AMReX_SlabStat.cpp +++ b/Src/Amr/AMReX_SlabStat.cpp @@ -133,7 +133,7 @@ Boxes (const std::string& file, std::ifstream is(file.c_str(),std::ios::in); if (!is.good()) - BoxLib::FileOpenFailed(file); + amrex::FileOpenFailed(file); #define STRIP while( is.get() != '\n' ) @@ -180,7 +180,7 @@ Boxes (const std::string& file, is.close(); if (ba_dflt.size() == 0 && ba_name.size() == 0) - BoxLib::Abort("slabstats.boxes doesn't have appropriate structure"); + amrex::Abort("slabstats.boxes doesn't have appropriate structure"); boxes = ba_name.size() ? ba_name : ba_dflt; boxesLevel = ba_name.size() ? bxLvl_name : bxLvl_dflt; @@ -205,7 +205,7 @@ SlabStatRec::SlabStatRec (const std::string& name, std::string file; if (!pp.query("boxes", file)) - BoxLib::Abort("SlabStatRec: slabstat.boxes isn't defined"); + amrex::Abort("SlabStatRec: slabstat.boxes isn't defined"); Boxes(file, m_name, m_boxes, m_level); @@ -308,17 +308,17 @@ SlabStatList::checkPoint (Array >& amrLevels, int leve // std::string statdir = "slabstats"; if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(statdir, 0755)) - BoxLib::CreateDirectoryFailed(statdir); + if (!amrex::UtilCreateDirectory(statdir, 0755)) + amrex::CreateDirectoryFailed(statdir); statdir = statdir + "/stats"; - statdir = BoxLib::Concatenate(statdir, level0_step); + statdir = amrex::Concatenate(statdir, level0_step); // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(statdir, 0755)) - BoxLib::CreateDirectoryFailed(statdir); + if (!amrex::UtilCreateDirectory(statdir, 0755)) + amrex::CreateDirectoryFailed(statdir); // // Force other processors to wait till directory is built. // @@ -336,7 +336,7 @@ SlabStatList::checkPoint (Array >& amrLevels, int leve HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); int prec = HeaderFile.precision(30); @@ -370,7 +370,7 @@ SlabStatList::checkPoint (Array >& amrLevels, int leve HeaderFile.precision(prec); if (!HeaderFile.good()) - BoxLib::Error("SlabStat::checkPoint() failed"); + amrex::Error("SlabStat::checkPoint() failed"); } // // Write out the SlabStat MultiFabs. diff --git a/Src/Amr/AMReX_StateData.cpp b/Src/Amr/AMReX_StateData.cpp index b3d946734a6..f193ac981ec 100644 --- a/Src/Amr/AMReX_StateData.cpp +++ b/Src/Amr/AMReX_StateData.cpp @@ -257,7 +257,7 @@ StateData::restart (std::istream& is, is >> domain_in; grids_in.readFrom(is); BL_ASSERT(domain_in == domain); - BL_ASSERT(BoxLib::match(grids_in,grids)); + BL_ASSERT(amrex::match(grids_in,grids)); } restartDoit(is, chkfile); @@ -297,7 +297,7 @@ StateData::restartDoit (std::istream& is, const std::string& chkfile) } else if(ns == 2) { whichMF = old_data; } else { - BoxLib::Abort("**** Error in StateData::restart: invalid nsets."); + amrex::Abort("**** Error in StateData::restart: invalid nsets."); } MultiFab data_in; @@ -324,7 +324,7 @@ StateData::restartDoit (std::istream& is, const std::string& chkfile) } VisMF::Read(data_in, FullPathName, faHeader); - BL_ASSERT(BoxLib::match(grids, data_in.boxArray())); + BL_ASSERT(amrex::match(grids, data_in.boxArray())); BL_ASSERT(whichMF->nComp() == data_in.nComp()); BL_ASSERT(whichMF->nGrow() == data_in.nGrow()); @@ -368,7 +368,7 @@ BCRec StateData::getBC (int comp, int i) const { BCRec bcr; - BoxLib::setBC(grids[i],domain,desc->getBC(comp),bcr); + amrex::setBC(grids[i],domain,desc->getBC(comp),bcr); return bcr; } @@ -381,7 +381,7 @@ StateData::setOldTimeLevel (Real time) } else { - BoxLib::Error("StateData::setOldTimeLevel called with Interval"); + amrex::Error("StateData::setOldTimeLevel called with Interval"); } } @@ -394,7 +394,7 @@ StateData::setNewTimeLevel (Real time) } else { - BoxLib::Error("StateData::setNewTimeLevel called with Interval"); + amrex::Error("StateData::setNewTimeLevel called with Interval"); } } @@ -518,7 +518,7 @@ StateData::FillBoundary (FArrayBox& dest, for (int j = 0; j < groupsize; j++) { - BoxLib::setBC(bx,domain,desc->getBC(sc+j),bcr); + amrex::setBC(bx,domain,desc->getBC(sc+j),bcr); const int* bc = bcr.vect(); @@ -535,14 +535,14 @@ StateData::FillBoundary (FArrayBox& dest, } else { - BoxLib::setBC(bx,domain,desc->getBC(sc),bcr); + amrex::setBC(bx,domain,desc->getBC(sc),bcr); desc->bndryFill(sc)(dat,dlo,dhi,plo,phi,dx,xlo,&time,bcr.vect()); i++; } } else { - BoxLib::setBC(bx,domain,desc->getBC(sc),bcr); + amrex::setBC(bx,domain,desc->getBC(sc),bcr); desc->bndryFill(sc)(dat,dlo,dhi,plo,phi,dx,xlo,&time,bcr.vect()); i++; } @@ -584,7 +584,7 @@ StateData::InterpAddBox (MultiFabCopyDescriptor& multiFabCopyDesc, } else { - BoxLib::InterpAddBox(multiFabCopyDesc, + amrex::InterpAddBox(multiFabCopyDesc, unfillableBoxes, returnedFillBoxIds, subbox, @@ -627,7 +627,7 @@ StateData::InterpAddBox (MultiFabCopyDescriptor& multiFabCopyDesc, } else { - BoxLib::Error("StateData::Interp(): cannot interp"); + amrex::Error("StateData::Interp(): cannot interp"); } } } @@ -652,7 +652,7 @@ StateData::InterpFillFab (MultiFabCopyDescriptor& multiFabCopyDesc, } else { - BoxLib::InterpFillFab(multiFabCopyDesc, + amrex::InterpFillFab(multiFabCopyDesc, fillBoxIds, mfid[MFOLDDATA], mfid[MFNEWDATA], @@ -682,7 +682,7 @@ StateData::InterpFillFab (MultiFabCopyDescriptor& multiFabCopyDesc, } else { - BoxLib::Error("StateData::Interp(): cannot interp"); + amrex::Error("StateData::Interp(): cannot interp"); } } } @@ -738,7 +738,7 @@ StateData::getData (Array& data, } else { - BoxLib::Error("StateData::getData(): how did we get here?"); + amrex::Error("StateData::getData(): how did we get here?"); } } } @@ -947,10 +947,10 @@ void StateData::AddProcsToComp(const StateDescriptor &sdPtr, ParallelDescriptor::Bcast(&old_time.stop, 1, ioProcNumSCS, scsComm); // ---- Boxes - BoxLib::BroadcastBox(domain, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBox(domain, scsMyId, ioProcNumSCS, scsComm); // ---- BoxArrays - BoxLib::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); // ---- MultiFabs int makeNewDataId(-7), makeOldDataId(-7); diff --git a/Src/Amr/AMReX_StationData.cpp b/Src/Amr/AMReX_StationData.cpp index 9ba29c60ebb..a1c27e6ae37 100644 --- a/Src/Amr/AMReX_StationData.cpp +++ b/Src/Amr/AMReX_StationData.cpp @@ -60,7 +60,7 @@ StationData::init (const Array >& levels, const int fi std::cerr << "StationData::init(): `" << m_vars[i] << "' is not a state or derived variable\n"; - BoxLib::Abort(); + amrex::Abort(); } } } @@ -131,7 +131,7 @@ StationData::init (const Array >& levels, const int fi } } if(Geometry::ProbDomain().contains(m_stn[i].pos) == false) { - BoxLib::Abort("Bad Stations coord."); + amrex::Abort("Bad Stations coord."); } } @@ -145,8 +145,8 @@ StationData::init (const Array >& levels, const int fi static const std::string Dir("Stations"); if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(Dir, 0755)) - BoxLib::CreateDirectoryFailed(Dir); + if (!amrex::UtilCreateDirectory(Dir, 0755)) + amrex::CreateDirectoryFailed(Dir); // // Everyone must wait till directory is built. // @@ -156,7 +156,7 @@ StationData::init (const Array >& levels, const int fi // const int MyProc = ParallelDescriptor::MyProc(); - std::string datafile = BoxLib::Concatenate("Stations/stn_CPU_", MyProc, 4); + std::string datafile = amrex::Concatenate("Stations/stn_CPU_", MyProc, 4); m_ofile.open(datafile.c_str(), std::ios::out|std::ios::app); diff --git a/Src/AmrCore/AMReX_AmrCore.cpp b/Src/AmrCore/AMReX_AmrCore.cpp index a8b27c6aacb..124ffa8f8fd 100644 --- a/Src/AmrCore/AMReX_AmrCore.cpp +++ b/Src/AmrCore/AMReX_AmrCore.cpp @@ -113,7 +113,7 @@ AmrCore::InitAmrCore (int max_level_in, const Array& n_cell_in) if (got_int == 1 && got_vect == 1 && ParallelDescriptor::IOProcessor()) { - BoxLib::Warning("Only input *either* ref_ratio or ref_ratio_vect"); + amrex::Warning("Only input *either* ref_ratio or ref_ratio_vect"); } else if (got_vect == 1) { @@ -135,7 +135,7 @@ AmrCore::InitAmrCore (int max_level_in, const Array& n_cell_in) else { if (ParallelDescriptor::IOProcessor()) - BoxLib::Warning("Using default ref_ratio = 2 at all levels"); + amrex::Warning("Using default ref_ratio = 2 at all levels"); } } @@ -281,7 +281,7 @@ AmrCore::ChopGrids (int lev, BoxArray& ba, int target_size) const BoxArray AmrCore::MakeBaseGrids () const { - BoxArray ba(BoxLib::coarsen(geom[0].Domain(),2)); + BoxArray ba(amrex::coarsen(geom[0].Domain(),2)); ba.maxSize(max_grid_size[0]/2); ba.refine(2); if (refine_grid_layout) { @@ -322,7 +322,7 @@ AmrCore::MakeNewGrids (int lbase, Real time, int& new_finest, Array& n rr_lev[i][n] = (ref_ratio[i][n]*bf_lev[i][n])/bf_lev[i+1][n]; } for (int i = lbase; i <= max_crse; i++) { - pc_domain[i] = BoxLib::coarsen(Geom(i).Domain(),bf_lev[i]); + pc_domain[i] = amrex::coarsen(Geom(i).Domain(),bf_lev[i]); } // // Construct proper nesting domains. @@ -440,7 +440,7 @@ AmrCore::MakeNewGrids (int lbase, Real time, int& new_finest, Array& n blt->growHi(idir,nerr); } } - Box mboxF = BoxLib::grow(bl_tagged.minimalBox(),1); + Box mboxF = amrex::grow(bl_tagged.minimalBox(),1); BoxList blFcomp; blFcomp.complementIn(mboxF,bl_tagged); blFcomp.simplify(); @@ -546,7 +546,7 @@ AmrCore::MakeNewGrids (int lbase, Real time, int& new_finest, Array& n if ( !(Geom(levc).Domain().contains(BoxArray(new_bx).minimalBox())) ) { // Chop new grids outside domain, note that this is likely to result in // new grids that violate blocking_factor....see warning checking below - new_bx = BoxLib::intersect(new_bx,Geom(levc).Domain()); + new_bx = amrex::intersect(new_bx,Geom(levc).Domain()); } } @@ -590,7 +590,7 @@ AmrCore::MakeNewGrids (int lbase, Real time, int& new_finest, Array& n if (new_bx.size()>0) { if ( !(Geom(levf).Domain().contains(BoxArray(new_bx).minimalBox())) ) { - new_bx = BoxLib::intersect(new_bx,Geom(levf).Domain()); + new_bx = amrex::intersect(new_bx,Geom(levf).Domain()); } if (ParallelDescriptor::IOProcessor()) { for (int d=0; d& n ok &= (len/bf) * bf == len; } if (!ok) { - BoxLib::Warning("WARNING: New grids violate blocking factor near upper boundary"); + amrex::Warning("WARNING: New grids violate blocking factor near upper boundary"); } } } diff --git a/Src/AmrCore/AMReX_Cluster.cpp b/Src/AmrCore/AMReX_Cluster.cpp index ad22da99279..343daf1f38d 100644 --- a/Src/AmrCore/AMReX_Cluster.cpp +++ b/Src/AmrCore/AMReX_Cluster.cpp @@ -447,7 +447,7 @@ ClusterList::intersect (const BoxDomain& dom) { BoxDomain bxdom; - BoxLib::intersect(bxdom, dom, c->box()); + amrex::intersect(bxdom, dom, c->box()); if (bxdom.size() > 0) { diff --git a/Src/AmrCore/AMReX_FillPatchUtil.cpp b/Src/AmrCore/AMReX_FillPatchUtil.cpp index 5ec83755b40..f16e391af34 100644 --- a/Src/AmrCore/AMReX_FillPatchUtil.cpp +++ b/Src/AmrCore/AMReX_FillPatchUtil.cpp @@ -101,7 +101,7 @@ namespace BoxLib } } else { - BoxLib::Abort("FillPatchSingleLevel: high-order interpolation in time not implemented yet"); + amrex::Abort("FillPatchSingleLevel: high-order interpolation in time not implemented yet"); } physbcf.FillBoundary(mf, dcomp, ncomp, time); @@ -154,7 +154,7 @@ namespace BoxLib const Box& dbx = fpc.dst_boxes[li]; Array bcr(ncomp); - BoxLib::setBC(dbx,fdomain,scomp,0,ncomp,bcs,bcr); + amrex::setBC(dbx,fdomain,scomp,0,ncomp,bcs,bcr); mapper->interp(mf_crse_patch[mfi], 0, @@ -204,7 +204,7 @@ namespace BoxLib { // TODO: later we might want to cache this for (int i = 0, N = ba.size(); i < N; ++i) { - Box bx = BoxLib::convert(BoxLib::grow(ba[i],ngrow), typ); + Box bx = amrex::convert(amrex::grow(ba[i],ngrow), typ); bx &= fdomain_g; ba_crse_patch.set(i, coarsener.doit(bx)); } @@ -227,7 +227,7 @@ namespace BoxLib const Box& dbx = dfab.box() & fdomain_g; Array bcr(ncomp); - BoxLib::setBC(dbx,fdomain,scomp,0,ncomp,bcs,bcr); + amrex::setBC(dbx,fdomain,scomp,0,ncomp,bcs,bcr); mapper->interp(mf_crse_patch[mfi], 0, diff --git a/Src/AmrCore/AMReX_FluxRegister.cpp b/Src/AmrCore/AMReX_FluxRegister.cpp index 8f5d1b01247..ab217b35eb4 100644 --- a/Src/AmrCore/AMReX_FluxRegister.cpp +++ b/Src/AmrCore/AMReX_FluxRegister.cpp @@ -284,7 +284,7 @@ FluxRegister::FineAdd (const FArrayBox& flux, FArrayBox& loreg = bndry[Orientation(dir,Orientation::low)][boxno]; #ifndef NDEBUG - Box cbox = BoxLib::coarsen(flux.box(),ratio); + Box cbox = amrex::coarsen(flux.box(),ratio); BL_ASSERT(cbox.contains(loreg.box())); #endif const int* rlo = loreg.box().loVect(); @@ -331,7 +331,7 @@ FluxRegister::FineAdd (const FArrayBox& flux, FArrayBox& loreg = bndry[Orientation(dir,Orientation::low)][boxno]; #ifndef NDEBUG - Box cbox = BoxLib::coarsen(flux.box(),ratio); + Box cbox = amrex::coarsen(flux.box(),ratio); BL_ASSERT(cbox.contains(loreg.box())); #endif const int* rlo = loreg.box().loVect(); @@ -449,10 +449,10 @@ FluxRegister::ClearInternalBorders (const Geometry& geom) } if (geom.isPeriodic(dir)) { if (bx.smallEnd(dir) == domain.smallEnd(dir)) { - const Box& sbx = BoxLib::shift(bx, dir, domain.length(dir)); + const Box& sbx = amrex::shift(bx, dir, domain.length(dir)); const std::vector >& isects2 = bahi.intersections(sbx); for (int ii = 0; ii < isects2.size(); ++ii) { - const Box& bx2 = BoxLib::shift(isects2[ii].second, dir, -domain.length(dir)); + const Box& bx2 = amrex::shift(isects2[ii].second, dir, -domain.length(dir)); frlo[fsi].setVal(0.0, bx2, 0, ncomp); } } @@ -467,10 +467,10 @@ FluxRegister::ClearInternalBorders (const Geometry& geom) } if (geom.isPeriodic(dir)) { if (bx.bigEnd(dir) == domain.bigEnd(dir)) { - const Box& sbx = BoxLib::shift(bx, dir, -domain.length(dir)); + const Box& sbx = amrex::shift(bx, dir, -domain.length(dir)); const std::vector >& isects2 = balo.intersections(sbx); for (int ii = 0; ii < isects2.size(); ++ii) { - const Box& bx2 = BoxLib::shift(isects2[ii].second, dir, domain.length(dir)); + const Box& bx2 = amrex::shift(isects2[ii].second, dir, domain.length(dir)); frhi[fsi].setVal(0.0, bx2, 0, ncomp); } } diff --git a/Src/AmrCore/AMReX_Interpolater.cpp b/Src/AmrCore/AMReX_Interpolater.cpp index 04fb9a63b94..5e8e4b2bfc9 100644 --- a/Src/AmrCore/AMReX_Interpolater.cpp +++ b/Src/AmrCore/AMReX_Interpolater.cpp @@ -50,7 +50,7 @@ Box NodeBilinear::CoarseBox (const Box& fine, int ratio) { - Box b = BoxLib::coarsen(fine,ratio); + Box b = amrex::coarsen(fine,ratio); for (int i = 0; i < BL_SPACEDIM; i++) { @@ -70,7 +70,7 @@ Box NodeBilinear::CoarseBox (const Box& fine, const IntVect& ratio) { - Box b = BoxLib::coarsen(fine,ratio); + Box b = amrex::coarsen(fine,ratio); for (int i = 0; i < BL_SPACEDIM; i++) { @@ -142,7 +142,7 @@ CellBilinear::CoarseBox (const Box& fine, const int* lo = fine.loVect(); const int* hi = fine.hiVect(); - Box crse(BoxLib::coarsen(fine,ratio)); + Box crse(amrex::coarsen(fine,ratio)); const int* clo = crse.loVect(); const int* chi = crse.hiVect(); @@ -174,7 +174,7 @@ CellBilinear::interp (const FArrayBox& crse, { BL_PROFILE("CellBilinear::interp()"); #if (BL_SPACEDIM == 3) - BoxLib::Error("interp: not implemented"); + amrex::Error("interp: not implemented"); #endif // // Set up to call FORTRAN. @@ -240,7 +240,7 @@ Box CellConservativeLinear::CoarseBox (const Box& fine, const IntVect& ratio) { - Box crse = BoxLib::coarsen(fine,ratio); + Box crse = amrex::coarsen(fine,ratio); crse.grow(1); return crse; } @@ -249,7 +249,7 @@ Box CellConservativeLinear::CoarseBox (const Box& fine, int ratio) { - Box crse(BoxLib::coarsen(fine,ratio)); + Box crse(amrex::coarsen(fine,ratio)); crse.grow(1); return crse; } @@ -287,7 +287,7 @@ CellConservativeLinear::interp (const FArrayBox& crse, // // Make a refinement of cslope_bx // - Box fine_version_of_cslope_bx = BoxLib::refine(cslope_bx,ratio); + Box fine_version_of_cslope_bx = amrex::refine(cslope_bx,ratio); // // Get coarse and fine edge-centered volume coordinates. // @@ -397,7 +397,7 @@ Box CellQuadratic::CoarseBox (const Box& fine, const IntVect& ratio) { - Box crse = BoxLib::coarsen(fine,ratio); + Box crse = amrex::coarsen(fine,ratio); crse.grow(1); return crse; } @@ -406,7 +406,7 @@ Box CellQuadratic::CoarseBox (const Box& fine, int ratio) { - Box crse = BoxLib::coarsen(fine,ratio); + Box crse = amrex::coarsen(fine,ratio); crse.grow(1); return crse; } @@ -432,8 +432,8 @@ CellQuadratic::interp (const FArrayBox& crse, // Box target_fine_region = fine_region & fine.box(); - Box crse_bx(BoxLib::coarsen(target_fine_region,ratio)); - Box fslope_bx(BoxLib::refine(crse_bx,ratio)); + Box crse_bx(amrex::coarsen(target_fine_region,ratio)); + Box fslope_bx(amrex::refine(crse_bx,ratio)); Box cslope_bx(crse_bx); cslope_bx.grow(1); BL_ASSERT(crse.box().contains(cslope_bx)); @@ -518,14 +518,14 @@ Box PCInterp::CoarseBox (const Box& fine, int ratio) { - return BoxLib::coarsen(fine,ratio); + return amrex::coarsen(fine,ratio); } Box PCInterp::CoarseBox (const Box& fine, const IntVect& ratio) { - return BoxLib::coarsen(fine,ratio); + return amrex::coarsen(fine,ratio); } void @@ -553,7 +553,7 @@ PCInterp::interp (const FArrayBox& crse, const int* fblo = fine_region.loVect(); const int* fbhi = fine_region.hiVect(); - Box cregion(BoxLib::coarsen(fine_region,ratio)); + Box cregion(amrex::coarsen(fine_region,ratio)); const int* cblo = cregion.loVect(); const int* cbhi = cregion.hiVect(); @@ -589,7 +589,7 @@ Box CellConservativeProtected::CoarseBox (const Box& fine, const IntVect& ratio) { - Box crse = BoxLib::coarsen(fine,ratio); + Box crse = amrex::coarsen(fine,ratio); crse.grow(1); return crse; } @@ -598,7 +598,7 @@ Box CellConservativeProtected::CoarseBox (const Box& fine, int ratio) { - Box crse(BoxLib::coarsen(fine,ratio)); + Box crse(amrex::coarsen(fine,ratio)); crse.grow(1); return crse; } @@ -635,7 +635,7 @@ CellConservativeProtected::interp (const FArrayBox& crse, // // Make a refinement of cslope_bx // - Box fine_version_of_cslope_bx = BoxLib::refine(cslope_bx,ratio); + Box fine_version_of_cslope_bx = amrex::refine(cslope_bx,ratio); // // Get coarse and fine edge-centered volume coordinates. // @@ -838,7 +838,7 @@ Box CellConservativeQuartic::CoarseBox (const Box& fine, int ratio) { - Box crse(BoxLib::coarsen(fine,ratio)); + Box crse(amrex::coarsen(fine,ratio)); crse.grow(2); return crse; } @@ -847,7 +847,7 @@ Box CellConservativeQuartic::CoarseBox (const Box& fine, const IntVect& ratio) { - Box crse = BoxLib::coarsen(fine,ratio); + Box crse = amrex::coarsen(fine,ratio); crse.grow(2); return crse; } @@ -887,7 +887,7 @@ CellConservativeQuartic::interp (const FArrayBox& crse, Box crse_bx2(crse_bx); crse_bx2.grow(-2); - Box fine_bx2 = BoxLib::refine(crse_bx2,ratio); + Box fine_bx2 = amrex::refine(crse_bx2,ratio); Real* fdat = fine.dataPtr(fine_comp); const Real* cdat = crse.dataPtr(crse_comp); diff --git a/Src/AmrCore/AMReX_TagBox.cpp b/Src/AmrCore/AMReX_TagBox.cpp index a857b49ef6f..52d2c875655 100644 --- a/Src/AmrCore/AMReX_TagBox.cpp +++ b/Src/AmrCore/AMReX_TagBox.cpp @@ -35,7 +35,7 @@ TagBox::coarsen (const IntVect& ratio, bool owner) const int* fhi = hiv.getVect(); const int* flen = d_length.getVect(); - const Box& cbox = BoxLib::coarsen(domain,ratio); + const Box& cbox = amrex::coarsen(domain,ratio); this->resize(cbox); @@ -45,7 +45,7 @@ TagBox::coarsen (const IntVect& ratio, bool owner) IntVect cbox_len = cbox.size(); const int* clen = cbox_len.getVect(); - Box b1(BoxLib::refine(cbox,ratio)); + Box b1(amrex::refine(cbox,ratio)); const int* lo = b1.loVect(); int longlen = b1.longside(); diff --git a/Src/Base/AMReX_BCRec.cpp b/Src/Base/AMReX_BCRec.cpp index d47936933cc..a39cae1d4c8 100644 --- a/Src/Base/AMReX_BCRec.cpp +++ b/Src/Base/AMReX_BCRec.cpp @@ -43,7 +43,7 @@ BCRec::BCRec (const Box& bx, } void -BoxLib::setBC (const Box& bx, +amrex::setBC (const Box& bx, const Box& domain, int src_comp, int dest_comp, @@ -70,7 +70,7 @@ BoxLib::setBC (const Box& bx, } void -BoxLib::setBC (const Box& bx, +amrex::setBC (const Box& bx, const Box& domain, const BCRec& bc_dom, BCRec& bcr) diff --git a/Src/Base/AMReX_BLBackTrace.cpp b/Src/Base/AMReX_BLBackTrace.cpp index 5e6943ae759..46d55b38112 100644 --- a/Src/Base/AMReX_BLBackTrace.cpp +++ b/Src/Base/AMReX_BLBackTrace.cpp @@ -17,16 +17,16 @@ BLBackTrace::handler(int s) { switch (s) { case SIGSEGV: - BoxLib::write_to_stderr_without_buffering("Segfault"); + amrex::write_to_stderr_without_buffering("Segfault"); break; case SIGFPE: - BoxLib::write_to_stderr_without_buffering("Erroneous arithmetic operation"); + amrex::write_to_stderr_without_buffering("Erroneous arithmetic operation"); break; case SIGINT: - BoxLib::write_to_stderr_without_buffering("SIGINT"); + amrex::write_to_stderr_without_buffering("SIGINT"); break; case SIGABRT: - BoxLib::write_to_stderr_without_buffering("SIGABRT"); + amrex::write_to_stderr_without_buffering("SIGABRT"); break; } @@ -92,7 +92,7 @@ BLBackTrace::print_backtrace_info (FILE* f) fclose(fp); have_addr2line = 1; } - cmd += " -Cfie " + BoxLib::exename; + cmd += " -Cfie " + amrex::exename; fprintf(f, "=== If no file names and line numbers are shown below, one can run\n"); fprintf(f, " addr2line -Cfie my_exefile my_line_address\n"); diff --git a/Src/Base/AMReX_BLPgas.cpp b/Src/Base/AMReX_BLPgas.cpp index 81b3258d943..530194c767a 100644 --- a/Src/Base/AMReX_BLPgas.cpp +++ b/Src/Base/AMReX_BLPgas.cpp @@ -179,10 +179,10 @@ BLPgas::alloc (std::size_t _sz) std::cout << " Failed to allocate " << _sz << " bytes global address space memory!\n"; std::cout << " Please try to increase the GASNET_MAX_SEGSIZE environment variable.\n"; std::cout << " For example, export GASNET_MAX_SEGSIZE=512MB\n"; - std::cout << " Total Bytes Allocated in Fabs: " << BoxLib::TotalBytesAllocatedInFabs(); - std::cout << " Highest Watermark in Fabs: " << BoxLib::TotalBytesAllocatedInFabsHWM(); + std::cout << " Total Bytes Allocated in Fabs: " << amrex::TotalBytesAllocatedInFabs(); + std::cout << " Highest Watermark in Fabs: " << amrex::TotalBytesAllocatedInFabsHWM(); std::cout << std::endl; - BoxLib::Abort("BLPgas: upcxx::allocate failed"); + amrex::Abort("BLPgas: upcxx::allocate failed"); } return p; } diff --git a/Src/Base/AMReX_BLProfiler.cpp b/Src/Base/AMReX_BLProfiler.cpp index f12b3bda0f8..34be856f476 100644 --- a/Src/Base/AMReX_BLProfiler.cpp +++ b/Src/Base/AMReX_BLProfiler.cpp @@ -478,7 +478,7 @@ void BLProfiler::Finalize() { { localStrings.push_back(it->first); } - BoxLib::SyncStrings(localStrings, syncedStrings, alreadySynced); + amrex::SyncStrings(localStrings, syncedStrings, alreadySynced); if( ! alreadySynced) { // ---- add the new name for(int i(0); i < syncedStrings.size(); ++i) { @@ -589,7 +589,7 @@ void BLProfiler::Finalize() { std::string cdir(blProfDirName); if( ! blProfDirCreated) { - BoxLib::UtilCreateCleanDirectory(cdir); + amrex::UtilCreateCleanDirectory(cdir); blProfDirCreated = true; } @@ -958,7 +958,7 @@ void BLProfiler::WriteCallTrace(bool bFlushing) { // ---- write call trace dat std::string cFileName(cdir + '/' + cFilePrefix + "_D_"); if( ! blProfDirCreated) { - BoxLib::UtilCreateCleanDirectory(cdir); + amrex::UtilCreateCleanDirectory(cdir); blProfDirCreated = true; } @@ -970,7 +970,7 @@ void BLProfiler::WriteCallTrace(bool bFlushing) { // ---- write call trace dat { localStrings.push_back(it->first); } - BoxLib::SyncStrings(localStrings, syncedStrings, alreadySynced); + amrex::SyncStrings(localStrings, syncedStrings, alreadySynced); if( ! alreadySynced) { // ---- need to remap names and numbers if(ParallelDescriptor::IOProcessor()) { @@ -986,7 +986,7 @@ void BLProfiler::WriteCallTrace(bool bFlushing) { // ---- write call trace dat csGlobalHeaderFile.open(globalHeaderFileName.c_str(), std::ios::out | std::ios::trunc); if( ! csGlobalHeaderFile.good()) { - BoxLib::FileOpenFailed(globalHeaderFileName); + amrex::FileOpenFailed(globalHeaderFileName); } csGlobalHeaderFile << "CallStatsProfVersion " << CallStats::cstatsVersion << '\n'; csGlobalHeaderFile << "NProcs " << nProcs << '\n'; @@ -1000,7 +1000,7 @@ void BLProfiler::WriteCallTrace(bool bFlushing) { // ---- write call trace dat } for(int i(0); i < nOutFiles; ++i) { std::string headerName(cFilePrefix + "_H_"); - headerName = BoxLib::Concatenate(headerName, i, NFilesIter::GetMinDigits()); + headerName = amrex::Concatenate(headerName, i, NFilesIter::GetMinDigits()); csGlobalHeaderFile << "HeaderFile " << headerName << '\n'; } csGlobalHeaderFile.flush(); @@ -1090,7 +1090,7 @@ void BLProfiler::WriteCallTrace(bool bFlushing) { // ---- write call trace dat csDFile.open(csPatch.fileName.c_str(), std::ios::in | std::ios::out | std::ios::binary); if( ! csDFile.good()) { - BoxLib::FileOpenFailed(csPatch.fileName); + amrex::FileOpenFailed(csPatch.fileName); } csDFile.seekg(csPatch.seekPos, std::ios::beg); csDFile.read((char *) &csOnDisk, sizeof(CallStats)); @@ -1154,7 +1154,7 @@ void BLProfiler::WriteCommStats(bool bFlushing) { std::string cdir(blProfDirName); std::string commprofPrefix("bl_comm_prof"); if( ! blProfDirCreated) { - BoxLib::UtilCreateCleanDirectory(cdir); + amrex::UtilCreateCleanDirectory(cdir); blProfDirCreated = true; } @@ -1177,7 +1177,7 @@ void BLProfiler::WriteCommStats(bool bFlushing) { std::ofstream csGlobalHeaderFile; csGlobalHeaderFile.open(globalHeaderFileName.c_str(), std::ios::out | std::ios::trunc); if( ! csGlobalHeaderFile.good()) { - BoxLib::FileOpenFailed(globalHeaderFileName); + amrex::FileOpenFailed(globalHeaderFileName); } csGlobalHeaderFile << "CommProfVersion " << CommStats::csVersion << '\n'; csGlobalHeaderFile << "NProcs " << nProcs << '\n'; @@ -1195,7 +1195,7 @@ void BLProfiler::WriteCommStats(bool bFlushing) { #endif for(int i(0); i < nOutFiles; ++i) { std::string headerName(commprofPrefix + "_H_"); - headerName = BoxLib::Concatenate(headerName, i, NFilesIter::GetMinDigits()); + headerName = amrex::Concatenate(headerName, i, NFilesIter::GetMinDigits()); csGlobalHeaderFile << "HeaderFile " << headerName << '\n'; } diff --git a/Src/Base/AMReX_BLassert.H b/Src/Base/AMReX_BLassert.H index 4de9c3c56e3..4ef5f323d61 100644 --- a/Src/Base/AMReX_BLassert.H +++ b/Src/Base/AMReX_BLassert.H @@ -22,7 +22,7 @@ expression evaluates to false, a message is output detailing the file and line number of the BL_ASSERT(EX) statement, as well as the literal expression EX itself, and then exits via abort() using - BoxLib::Assert(). The idea is that if the assertion fails, something + amrex::Assert(). The idea is that if the assertion fails, something has gone terribly wrong somewhere. If the DEBUG macro is not set to TRUE, the BL_ASSERT(EX) call becomes @@ -40,9 +40,9 @@ // void argument to the ternary operator. Currently SGI's OCC and CC on // HP-UX 9.0.1 have this problem. // -#define BL_ASSERT(EX) if ((EX)) ; else BoxLib::Assert( # EX , __FILE__, __LINE__) +#define BL_ASSERT(EX) if ((EX)) ; else amrex::Assert( # EX , __FILE__, __LINE__) #else -#define BL_ASSERT(EX) (EX)?((void)0):BoxLib::Assert( # EX , __FILE__, __LINE__) +#define BL_ASSERT(EX) (EX)?((void)0):amrex::Assert( # EX , __FILE__, __LINE__) #endif #endif #endif diff --git a/Src/Base/AMReX_BaseFab.H b/Src/Base/AMReX_BaseFab.H index 25af11677de..4a850f165bf 100644 --- a/Src/Base/AMReX_BaseFab.H +++ b/Src/Base/AMReX_BaseFab.H @@ -1171,7 +1171,7 @@ BaseFab::define () BL_ASSERT(std::numeric_limits::max()/nvar > numpts); truesize = nvar*numpts; - dptr = static_cast(BoxLib::The_Arena()->alloc(truesize*sizeof(T))); + dptr = static_cast(amrex::The_Arena()->alloc(truesize*sizeof(T))); ptr_owner = true; // // Now call T::T() on the raw memory so we have valid Ts. @@ -1185,7 +1185,7 @@ BaseFab::define () new (ptr) T; } - BoxLib::update_fab_stats(numpts, truesize, sizeof(T)); + amrex::update_fab_stats(numpts, truesize, sizeof(T)); } template @@ -1239,14 +1239,14 @@ BaseFab::resize (const Box& b, if (dptr == 0) { if (shared_memory) - BoxLib::Abort("BaseFab::resize: BaseFab in shared memory cannot increase size"); + amrex::Abort("BaseFab::resize: BaseFab in shared memory cannot increase size"); define(); } else if (nvar*numpts > truesize) { if (shared_memory) - BoxLib::Abort("BaseFab::resize: BaseFab in shared memory cannot increase size"); + amrex::Abort("BaseFab::resize: BaseFab in shared memory cannot increase size"); clear(); @@ -1275,19 +1275,19 @@ BaseFab::clear () { if (shared_memory) { - BoxLib::Abort("BaseFab::clear: BaseFab cannot be owner of shared memory"); + amrex::Abort("BaseFab::clear: BaseFab cannot be owner of shared memory"); } for (long i = 0; i < truesize; i++, ptr++) { ptr->~T(); } - BoxLib::The_Arena()->free(dptr); + amrex::The_Arena()->free(dptr); if (nvar > 1) { - BoxLib::update_fab_stats(-truesize/nvar, -truesize, sizeof(T)); + amrex::update_fab_stats(-truesize/nvar, -truesize, sizeof(T)); } else { - BoxLib::update_fab_stats(0, -truesize, sizeof(T)); + amrex::update_fab_stats(0, -truesize, sizeof(T)); } } @@ -1730,7 +1730,7 @@ BaseFab::setComplement (T x, int ns, int num) { - BoxList b_lst = BoxLib::boxDiff(domain,b); + BoxList b_lst = amrex::boxDiff(domain,b); for (BoxList::iterator bli = b_lst.begin(), End = b_lst.end(); bli != End; ++bli) performSetVal(x, *bli, ns, num); } @@ -1834,7 +1834,7 @@ BaseFab::norm (const Box& subbox, } else { - BoxLib::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); + amrex::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); } delete [] tmp; @@ -2734,6 +2734,6 @@ namespace BoxLib }; } -static BoxLib::BF_init file_scope_BF_init_object; +static amrex::BF_init file_scope_BF_init_object; #endif /*BL_BASEFAB_H*/ diff --git a/Src/Base/AMReX_BaseFab.cpp b/Src/Base/AMReX_BaseFab.cpp index fa581627386..e2c42704e33 100644 --- a/Src/Base/AMReX_BaseFab.cpp +++ b/Src/Base/AMReX_BaseFab.cpp @@ -16,19 +16,19 @@ #include #endif -long BoxLib::private_total_bytes_allocated_in_fabs = 0L; -long BoxLib::private_total_bytes_allocated_in_fabs_hwm = 0L; -long BoxLib::private_total_cells_allocated_in_fabs = 0L; -long BoxLib::private_total_cells_allocated_in_fabs_hwm = 0L; +long amrex::private_total_bytes_allocated_in_fabs = 0L; +long amrex::private_total_bytes_allocated_in_fabs_hwm = 0L; +long amrex::private_total_cells_allocated_in_fabs = 0L; +long amrex::private_total_cells_allocated_in_fabs_hwm = 0L; -int BoxLib::BF_init::m_cnt = 0; +int amrex::BF_init::m_cnt = 0; namespace { Arena* the_arena = 0; } -BoxLib::BF_init::BF_init () +amrex::BF_init::BF_init () { if (m_cnt++ == 0) { @@ -43,31 +43,31 @@ BoxLib::BF_init::BF_init () #ifdef _OPENMP #pragma omp parallel { - BoxLib::private_total_bytes_allocated_in_fabs = 0; - BoxLib::private_total_bytes_allocated_in_fabs_hwm = 0; - BoxLib::private_total_cells_allocated_in_fabs = 0; - BoxLib::private_total_cells_allocated_in_fabs_hwm = 0; + amrex::private_total_bytes_allocated_in_fabs = 0; + amrex::private_total_bytes_allocated_in_fabs_hwm = 0; + amrex::private_total_cells_allocated_in_fabs = 0; + amrex::private_total_cells_allocated_in_fabs_hwm = 0; } #endif #ifdef BL_MEM_PROFILING MemProfiler::add("Fab", std::function ([] () -> MemProfiler::MemInfo { - return {BoxLib::TotalBytesAllocatedInFabs(), - BoxLib::TotalBytesAllocatedInFabsHWM()}; + return {amrex::TotalBytesAllocatedInFabs(), + amrex::TotalBytesAllocatedInFabsHWM()}; })); #endif } } -BoxLib::BF_init::~BF_init () +amrex::BF_init::~BF_init () { if (--m_cnt == 0) delete the_arena; } long -BoxLib::TotalBytesAllocatedInFabs() +amrex::TotalBytesAllocatedInFabs() { #ifdef _OPENMP long r=0; @@ -82,7 +82,7 @@ BoxLib::TotalBytesAllocatedInFabs() } long -BoxLib::TotalBytesAllocatedInFabsHWM() +amrex::TotalBytesAllocatedInFabsHWM() { #ifdef _OPENMP long r=0; @@ -97,7 +97,7 @@ BoxLib::TotalBytesAllocatedInFabsHWM() } long -BoxLib::TotalCellsAllocatedInFabs() +amrex::TotalCellsAllocatedInFabs() { #ifdef _OPENMP long r=0; @@ -112,7 +112,7 @@ BoxLib::TotalCellsAllocatedInFabs() } long -BoxLib::TotalCellsAllocatedInFabsHWM() +amrex::TotalCellsAllocatedInFabsHWM() { #ifdef _OPENMP long r=0; @@ -127,7 +127,7 @@ BoxLib::TotalCellsAllocatedInFabsHWM() } void -BoxLib::ResetTotalBytesAllocatedInFabsHWM() +amrex::ResetTotalBytesAllocatedInFabsHWM() { #ifdef _OPENMP #pragma omp parallel @@ -138,24 +138,24 @@ BoxLib::ResetTotalBytesAllocatedInFabsHWM() } void -BoxLib::update_fab_stats (long n, long s, size_t szt) +amrex::update_fab_stats (long n, long s, size_t szt) { long tst = s*szt; - BoxLib::private_total_bytes_allocated_in_fabs += tst; - BoxLib::private_total_bytes_allocated_in_fabs_hwm - = std::max(BoxLib::private_total_bytes_allocated_in_fabs_hwm, - BoxLib::private_total_bytes_allocated_in_fabs); + amrex::private_total_bytes_allocated_in_fabs += tst; + amrex::private_total_bytes_allocated_in_fabs_hwm + = std::max(amrex::private_total_bytes_allocated_in_fabs_hwm, + amrex::private_total_bytes_allocated_in_fabs); if(szt == sizeof(Real)) { - BoxLib::private_total_cells_allocated_in_fabs += n; - BoxLib::private_total_cells_allocated_in_fabs_hwm - = std::max(BoxLib::private_total_cells_allocated_in_fabs_hwm, - BoxLib::private_total_cells_allocated_in_fabs); + amrex::private_total_cells_allocated_in_fabs += n; + amrex::private_total_cells_allocated_in_fabs_hwm + = std::max(amrex::private_total_cells_allocated_in_fabs_hwm, + amrex::private_total_cells_allocated_in_fabs); } } Arena* -BoxLib::The_Arena () +amrex::The_Arena () { BL_ASSERT(the_arena != 0); @@ -273,7 +273,7 @@ BaseFab::norm (const Box& bx, } else { - BoxLib::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); + amrex::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); } return nrm; diff --git a/Src/Base/AMReX_Box.cpp b/Src/Base/AMReX_Box.cpp index 72ffe2cc6e3..77d59feff5d 100644 --- a/Src/Base/AMReX_Box.cpp +++ b/Src/Base/AMReX_Box.cpp @@ -81,7 +81,7 @@ Box::convert (IndexType t) } Box -BoxLib::convert (const Box& b, const IntVect& typ) +amrex::convert (const Box& b, const IntVect& typ) { Box bx(b); bx.convert(typ); @@ -89,7 +89,7 @@ BoxLib::convert (const Box& b, const IntVect& typ) } Box -BoxLib::convert (const Box& b, const IndexType& t) +amrex::convert (const Box& b, const IndexType& t) { Box bx(b); bx.convert(t); @@ -97,7 +97,7 @@ BoxLib::convert (const Box& b, const IndexType& t) } Box -BoxLib::surroundingNodes (const Box& b, +amrex::surroundingNodes (const Box& b, int dir) { Box bx(b); @@ -120,7 +120,7 @@ Box::surroundingNodes (int dir) } Box -BoxLib::surroundingNodes (const Box& b) +amrex::surroundingNodes (const Box& b) { Box bx(b); bx.surroundingNodes(); @@ -138,7 +138,7 @@ Box::surroundingNodes () } Box -BoxLib::enclosedCells (const Box& b, +amrex::enclosedCells (const Box& b, int dir) { Box bx(b); @@ -161,7 +161,7 @@ Box::enclosedCells (int dir) } Box -BoxLib::enclosedCells (const Box& b) +amrex::enclosedCells (const Box& b) { Box bx(b); bx.enclosedCells(); @@ -179,7 +179,7 @@ Box::enclosedCells () } Box -BoxLib::grow (const Box& b, +amrex::grow (const Box& b, int i) { Box result = b; @@ -188,7 +188,7 @@ BoxLib::grow (const Box& b, } Box -BoxLib::grow (const Box& b, +amrex::grow (const Box& b, const IntVect& v) { Box result = b; @@ -245,7 +245,7 @@ Box::numPts () const if (!numPtsOK(result)) { std::cout << "Bad box: " << *this << std::endl; - BoxLib::Error("Arithmetic overflow in Box::numPts()"); + amrex::Error("Arithmetic overflow in Box::numPts()"); } return result; } @@ -302,7 +302,7 @@ Box::volume () const { long result; if (!volumeOK(result)) - BoxLib::Error("Arithmetic overflow in Box::volume()"); + amrex::Error("Arithmetic overflow in Box::volume()"); return result; } @@ -416,7 +416,7 @@ Box::next (IntVect& p, } Box -BoxLib::refine (const Box& b, +amrex::refine (const Box& b, int ref_ratio) { Box result = b; @@ -431,7 +431,7 @@ Box::refine (int ref_ratio) } Box -BoxLib::refine (const Box& b, +amrex::refine (const Box& b, const IntVect& ref_ratio) { Box result = b; @@ -452,7 +452,7 @@ Box::refine (const IntVect& ref_ratio) } Box -BoxLib::shift (const Box& b, int dir, int nzones) +amrex::shift (const Box& b, int dir, int nzones) { Box result = b; result.shift(dir, nzones); @@ -552,7 +552,7 @@ Box::chop (int dir, } Box -BoxLib::coarsen (const Box& b, +amrex::coarsen (const Box& b, int ref_ratio) { Box result = b; @@ -567,7 +567,7 @@ Box::coarsen (int ref_ratio) } Box -BoxLib::coarsen (const Box& b, +amrex::coarsen (const Box& b, const IntVect& ref_ratio) { Box result = b; @@ -615,7 +615,7 @@ operator<< (std::ostream& os, << ')'; if (os.fail()) - BoxLib::Error("operator<<(ostream&,Box&) failed"); + amrex::Error("operator<<(ostream&,Box&) failed"); return os; } @@ -662,19 +662,19 @@ operator>> (std::istream& is, } else { - BoxLib::Error("operator>>(istream&,Box&): expected \'(\'"); + amrex::Error("operator>>(istream&,Box&): expected \'(\'"); } b = Box(lo,hi,typ); if (is.fail()) - BoxLib::Error("operator>>(istream&,Box&) failed"); + amrex::Error("operator>>(istream&,Box&) failed"); return is; } Box -BoxLib::minBox (const Box& b, +amrex::minBox (const Box& b, const Box& o) { Box result = b; @@ -693,7 +693,7 @@ Box::minBox (const Box &b) } Box -BoxLib::bdryLo (const Box& b, +amrex::bdryLo (const Box& b, int dir, int len) { @@ -711,7 +711,7 @@ BoxLib::bdryLo (const Box& b, } Box -BoxLib::bdryHi (const Box& b, +amrex::bdryHi (const Box& b, int dir, int len) { @@ -730,7 +730,7 @@ BoxLib::bdryHi (const Box& b, } Box -BoxLib::bdryNode (const Box& b, +amrex::bdryNode (const Box& b, Orientation face, int len) { @@ -759,7 +759,7 @@ BoxLib::bdryNode (const Box& b, } Box -BoxLib::adjCellLo (const Box& b, +amrex::adjCellLo (const Box& b, int dir, int len) { @@ -778,7 +778,7 @@ BoxLib::adjCellLo (const Box& b, } Box -BoxLib::adjCellHi (const Box& b, +amrex::adjCellHi (const Box& b, int dir, int len) { @@ -798,7 +798,7 @@ BoxLib::adjCellHi (const Box& b, } Box -BoxLib::adjCell (const Box& b, +amrex::adjCell (const Box& b, Orientation face, int len) { @@ -866,7 +866,7 @@ Box::isSquare () const #endif } -Array BoxLib::SerializeBox(const Box &b) +Array amrex::SerializeBox(const Box &b) { int count(0); Array retArray(BL_SPACEDIM * 3); @@ -887,12 +887,12 @@ Array BoxLib::SerializeBox(const Box &b) } -int BoxLib::SerializeBoxSize() { +int amrex::SerializeBoxSize() { return (BL_SPACEDIM * 3); } -Box BoxLib::UnSerializeBox(const Array &serarray) +Box amrex::UnSerializeBox(const Array &serarray) { BL_ASSERT(serarray.size() == (3 * BL_SPACEDIM)); const int *iptr = serarray.dataPtr(); diff --git a/Src/Base/AMReX_BoxArray.H b/Src/Base/AMReX_BoxArray.H index 72b26798faa..7769fe44acb 100644 --- a/Src/Base/AMReX_BoxArray.H +++ b/Src/Base/AMReX_BoxArray.H @@ -112,7 +112,7 @@ struct LnClassPtrCallBack { // This will be called when a unique ref is about to be deleted. void operator() (BARef* ref) { - BoxLib::clearCoarseBoxArrayCache(ref->getRefID()); + amrex::clearCoarseBoxArrayCache(ref->getRefID()); } }; @@ -181,7 +181,7 @@ struct BATypeTransformer { return m_typ.ixType(); } virtual Box operator() (const Box& bx) const override - { return BoxLib::convert(bx, m_typ); } + { return amrex::convert(bx, m_typ); } bool operator== (const BATypeTransformer& rhs) const { return m_typ == rhs.m_typ; } diff --git a/Src/Base/AMReX_BoxArray.cpp b/Src/Base/AMReX_BoxArray.cpp index 10056b0651f..1b3cf915ea6 100644 --- a/Src/Base/AMReX_BoxArray.cpp +++ b/Src/Base/AMReX_BoxArray.cpp @@ -86,7 +86,7 @@ BARef::define (std::istream& is) is >> *it; is.ignore(bl_ignore_max, ')'); if (is.fail()) - BoxLib::Error("BoxArray::define(istream&) failed"); + amrex::Error("BoxArray::define(istream&) failed"); } void @@ -133,7 +133,7 @@ void BARef::updateMemoryUsage_box (int s) { if (m_abox.size() > 1) { - long b = BoxLib::bytesOf(m_abox); + long b = amrex::bytesOf(m_abox); if (s > 0) { total_box_bytes += b; total_box_bytes_hwm = std::max(total_box_bytes_hwm, total_box_bytes); @@ -152,8 +152,8 @@ BARef::updateMemoryUsage_hash (int s) if (hash.size() > 0) { long b = sizeof(hash); for (const auto& x: hash) { - b += BoxLib::gcc_map_node_extra_bytes - + sizeof(IntVect) + BoxLib::bytesOf(x.second); + b += amrex::gcc_map_node_extra_bytes + + sizeof(IntVect) + amrex::bytesOf(x.second); } if (s > 0) { total_hash_bytes += b; @@ -207,7 +207,7 @@ BoxArray::BoxArray (const Box& bx) m_transformer(new BATypeTransformer(bx.ixType())), m_ref(new BARef(1)) { - m_ref->m_abox[0] = BoxLib::enclosedCells(bx); + m_ref->m_abox[0] = amrex::enclosedCells(bx); } BoxArray::BoxArray (const BoxList& bl) @@ -231,7 +231,7 @@ BoxArray::BoxArray (const Box* bxvec, m_ref(new BARef(nbox)) { for (int i = 0; i < nbox; i++) { - m_ref->m_abox[i] = BoxLib::enclosedCells(*bxvec++); + m_ref->m_abox[i] = amrex::enclosedCells(*bxvec++); } } @@ -270,7 +270,7 @@ BoxArray::define (const Box& bx) BL_ASSERT(size() == 0); clear(); m_transformer->setIxType(bx.ixType()); - m_ref->define(BoxLib::enclosedCells(bx)); + m_ref->define(amrex::enclosedCells(bx)); } void @@ -373,7 +373,7 @@ BoxArray::writeOn (std::ostream& os) const os << ')'; if (os.fail()) - BoxLib::Error("BoxArray::writeOn(ostream&) failed"); + amrex::Error("BoxArray::writeOn(ostream&) failed"); return os; } @@ -691,7 +691,7 @@ BoxArray::set (int i, } } - m_ref->m_abox[i] = BoxLib::enclosedCells(ibox); + m_ref->m_abox[i] = amrex::enclosedCells(ibox); } bool @@ -871,7 +871,7 @@ BoxArray::intersections (const Box& bx, { BL_ASSERT(bx.ixType() == ixType()); - Box gbx = BoxLib::grow(bx,ng); + Box gbx = amrex::grow(bx,ng); IntVect glo = gbx.smallEnd(); IntVect ghi = gbx.bigEnd(); @@ -881,8 +881,8 @@ BoxArray::intersections (const Box& bx, gbx.setSmall(glo - doihi).setBig(ghi + doilo); gbx.coarsen(m_ref->crsn); - const IntVect& sm = BoxLib::max(gbx.smallEnd()-1, m_ref->bbox.smallEnd()); - const IntVect& bg = BoxLib::min(gbx.bigEnd(), m_ref->bbox.bigEnd()); + const IntVect& sm = amrex::max(gbx.smallEnd()-1, m_ref->bbox.smallEnd()); + const IntVect& bg = amrex::min(gbx.bigEnd(), m_ref->bbox.bigEnd()); Box cbx(sm,bg); @@ -901,7 +901,7 @@ BoxArray::intersections (const Box& bx, ++v_it) { const int index = *v_it; - const Box& isect = bx & BoxLib::grow(get(index),ng); + const Box& isect = bx & amrex::grow(get(index),ng); if (isect.ok()) { @@ -935,8 +935,8 @@ BoxArray::complement (const Box& bx) const gbx.setSmall(glo - doihi).setBig(ghi + doilo); gbx.coarsen(m_ref->crsn); - const IntVect& sm = BoxLib::max(gbx.smallEnd()-1, m_ref->bbox.smallEnd()); - const IntVect& bg = BoxLib::min(gbx.bigEnd(), m_ref->bbox.bigEnd()); + const IntVect& sm = amrex::max(gbx.smallEnd()-1, m_ref->bbox.smallEnd()); + const IntVect& bg = amrex::min(gbx.bigEnd(), m_ref->bbox.bigEnd()); Box cbx(sm,bg); @@ -961,7 +961,7 @@ BoxArray::complement (const Box& bx) const { for (BoxList::iterator bli = bl.begin(); bli != bl.end(); ) { - BoxList diff = BoxLib::boxDiff(*bli, isect); + BoxList diff = amrex::boxDiff(*bli, isect); bl.splice_front(diff); bl.remove(bli++); } @@ -1025,7 +1025,7 @@ BoxArray::removeOverlap () Box& bx = m_ref->m_abox[isects[j].first]; - bl = BoxLib::boxDiff(bx, isects[j].second); + bl = amrex::boxDiff(bx, isects[j].second); bx = EmptyBox; @@ -1033,7 +1033,7 @@ BoxArray::removeOverlap () { m_ref->m_abox.push_back(*it); - BoxHashMap[BoxLib::coarsen(it->smallEnd(),m_ref->crsn)].push_back(size()-1); + BoxHashMap[amrex::coarsen(it->smallEnd(),m_ref->crsn)].push_back(size()-1); } } } @@ -1088,7 +1088,7 @@ void BoxArray::SendBoxArray(const BoxArray &ba, int whichSidecar) { const int MPI_IntraGroup_Broadcast_Rank = ParallelDescriptor::IOProcessor() ? MPI_ROOT : MPI_PROC_NULL; - Array ba_serial = BoxLib::SerializeBoxArray(ba); + Array ba_serial = amrex::SerializeBoxArray(ba); int ba_serial_size = ba_serial.size(); ParallelDescriptor::Bcast(&ba_serial_size, 1, MPI_IntraGroup_Broadcast_Rank, ParallelDescriptor::CommunicatorInter(whichSidecar)); @@ -1105,7 +1105,7 @@ BoxArray::RecvBoxArray(BoxArray &ba, int whichSidecar) Array ba_serial(ba_serial_size); ParallelDescriptor::Bcast(ba_serial.dataPtr(), ba_serial_size, 0, ParallelDescriptor::CommunicatorInter(whichSidecar)); - ba = BoxLib::UnSerializeBoxArray(ba_serial); + ba = amrex::UnSerializeBoxArray(ba_serial); } #endif @@ -1148,7 +1148,7 @@ BoxArray::getHashMap () const for (int i = 0; i < N; ++i) { const Box& bx = m_ref->m_abox[i]; - maxext = BoxLib::max(maxext, bx.size()); + maxext = amrex::max(maxext, bx.size()); } IntVect lob = IntVect::TheMaxVector(); @@ -1157,10 +1157,10 @@ BoxArray::getHashMap () const for (int i = 0; i < N; i++) { const IntVect& crsnsmlend - = BoxLib::coarsen(m_ref->m_abox[i].smallEnd(),maxext); + = amrex::coarsen(m_ref->m_abox[i].smallEnd(),maxext); BoxHashMap[crsnsmlend].push_back(i); - lob = BoxLib::min(lob, crsnsmlend); - hib = BoxLib::max(hib, crsnsmlend); + lob = amrex::min(lob, crsnsmlend); + hib = amrex::max(hib, crsnsmlend); } m_ref->crsn = maxext; @@ -1201,27 +1201,27 @@ operator<< (std::ostream& os, os << ")\n"; if (os.fail()) - BoxLib::Error("operator<<(ostream& os,const BoxArray&) failed"); + amrex::Error("operator<<(ostream& os,const BoxArray&) failed"); return os; } BoxArray -BoxLib::boxComplement (const Box& b1in, +amrex::boxComplement (const Box& b1in, const Box& b2) { - return BoxArray(BoxLib::boxDiff(b1in, b2)); + return BoxArray(amrex::boxDiff(b1in, b2)); } BoxArray -BoxLib::complementIn (const Box& b, +amrex::complementIn (const Box& b, const BoxArray& ba) { - return BoxArray(BoxLib::complementIn(b,ba.boxList())); + return BoxArray(amrex::complementIn(b,ba.boxList())); } BoxArray -BoxLib::intersect (const BoxArray& ba, +amrex::intersect (const BoxArray& ba, const Box& b, int ng) { @@ -1240,14 +1240,14 @@ BoxLib::intersect (const BoxArray& ba, } BoxArray -BoxLib::intersect (const BoxArray& lhs, +amrex::intersect (const BoxArray& lhs, const BoxArray& rhs) { if (lhs.size() == 0 || rhs.size() == 0) return BoxArray(); BoxList bl(lhs[0].ixType()); for (int i = 0, Nl = lhs.size(); i < Nl; ++i) { - BoxArray ba = BoxLib::intersect(rhs, lhs[i]); + BoxArray ba = amrex::intersect(rhs, lhs[i]); BoxList tmp = ba.boxList(); bl.catenate(tmp); } @@ -1255,14 +1255,14 @@ BoxLib::intersect (const BoxArray& lhs, } BoxArray -BoxLib::convert (const BoxArray& ba, IndexType typ) +amrex::convert (const BoxArray& ba, IndexType typ) { BoxArray ba2 = ba; return ba2.convert(typ); } BoxList -BoxLib::GetBndryCells (const BoxArray& ba, +amrex::GetBndryCells (const BoxArray& ba, int ngrow) { BL_ASSERT(ba.ok()); @@ -1283,7 +1283,7 @@ BoxLib::GetBndryCells (const BoxArray& ba, for (int i = 0, N = tba.size(); i < N; ++i) { const Box& bx = tba[i]; - bcells = BoxLib::boxDiff(BoxLib::grow(bx,ngrow),bx); + bcells = amrex::boxDiff(amrex::grow(bx,ngrow),bx); gcells.catenate(bcells); } @@ -1308,7 +1308,7 @@ BoxLib::GetBndryCells (const BoxArray& ba, BoxList pieces(btype), leftover(btype); for (int i = 0, N = isects.size(); i < N; i++) pieces.push_back(isects[i].second); - leftover = BoxLib::complementIn(*it,pieces); + leftover = amrex::complementIn(*it,pieces); bcells.catenate(leftover); } } @@ -1318,7 +1318,7 @@ BoxLib::GetBndryCells (const BoxArray& ba, // gcells.clear(); - gcells = BoxLib::removeOverlap(bcells); + gcells = amrex::removeOverlap(bcells); bcells.clear(); @@ -1329,7 +1329,7 @@ BoxLib::GetBndryCells (const BoxArray& ba, void -BoxLib::readBoxArray (BoxArray& ba, +amrex::readBoxArray (BoxArray& ba, std::istream& is, bool bReadSpecial) { @@ -1353,11 +1353,11 @@ BoxLib::readBoxArray (BoxArray& ba, is.ignore(bl_ignore_max, ')'); if (is.fail()) - BoxLib::Error("readBoxArray(BoxArray&,istream&,int) failed"); + amrex::Error("readBoxArray(BoxArray&,istream&,int) failed"); } } -void BoxLib::clearCoarseBoxArrayCache (ptrdiff_t key) +void amrex::clearCoarseBoxArrayCache (ptrdiff_t key) { // Note that deleting a BoxArray may trigger a call to this function // resulting in modifying the cache map. Because of the recusion, @@ -1380,12 +1380,12 @@ void BoxLib::clearCoarseBoxArrayCache (ptrdiff_t key) } -Array BoxLib::SerializeBoxArray(const BoxArray &ba) +Array amrex::SerializeBoxArray(const BoxArray &ba) { int nIntsInBox(3 * BL_SPACEDIM); Array retArray(ba.size() * nIntsInBox, -1); for(int i(0); i < ba.size(); ++i) { - Array aiBox(BoxLib::SerializeBox(ba[i])); + Array aiBox(amrex::SerializeBox(ba[i])); BL_ASSERT(aiBox.size() == nIntsInBox); for(int j(0); j < aiBox.size(); ++j) { retArray[i * aiBox.size() + j] = aiBox[j]; @@ -1395,7 +1395,7 @@ Array BoxLib::SerializeBoxArray(const BoxArray &ba) } -BoxArray BoxLib::UnSerializeBoxArray(const Array &serarray) +BoxArray amrex::UnSerializeBoxArray(const Array &serarray) { int nIntsInBox(3 * BL_SPACEDIM); int nBoxes(serarray.size() / nIntsInBox); @@ -1405,13 +1405,13 @@ BoxArray BoxLib::UnSerializeBoxArray(const Array &serarray) for(int j(0); j < nIntsInBox; ++j) { aiBox[j] = serarray[i * nIntsInBox + j]; } - ba.set(i, BoxLib::UnSerializeBox(aiBox)); + ba.set(i, amrex::UnSerializeBox(aiBox)); } return ba; } -bool BoxLib::match (const BoxArray& x, const BoxArray& y) +bool amrex::match (const BoxArray& x, const BoxArray& y) { if (x == y) { return true; diff --git a/Src/Base/AMReX_BoxDomain.cpp b/Src/Base/AMReX_BoxDomain.cpp index 155acb18a48..a12b614b001 100644 --- a/Src/Base/AMReX_BoxDomain.cpp +++ b/Src/Base/AMReX_BoxDomain.cpp @@ -13,7 +13,7 @@ BoxDomain::intersect (const Box& b) } void -BoxLib::intersect (BoxDomain& dest, +amrex::intersect (BoxDomain& dest, const BoxDomain& fin, const Box& b) { @@ -30,7 +30,7 @@ BoxDomain::refine (int ratio) } void -BoxLib::refine (BoxDomain& dest, +amrex::refine (BoxDomain& dest, const BoxDomain& fin, int ratio) { @@ -39,7 +39,7 @@ BoxLib::refine (BoxDomain& dest, } void -BoxLib::accrete (BoxDomain& dest, +amrex::accrete (BoxDomain& dest, const BoxDomain& fin, int sz) { @@ -48,7 +48,7 @@ BoxLib::accrete (BoxDomain& dest, } void -BoxLib::coarsen (BoxDomain& dest, +amrex::coarsen (BoxDomain& dest, const BoxDomain& fin, int ratio) { @@ -66,7 +66,7 @@ BoxDomain::complementIn (const Box& b, } BoxDomain -BoxLib::complementIn (const Box& b, +amrex::complementIn (const Box& b, const BoxDomain& bl) { BoxDomain result; @@ -129,7 +129,7 @@ BoxDomain::add (const Box& b) // part of it that is outside bln and collect // those boxes in the tmp list. // - BoxList tmpbl(BoxLib::boxDiff(*ci, *bli)); + BoxList tmpbl(amrex::boxDiff(*ci, *bli)); tmp.splice(tmp.end(), tmpbl.listBox()); check.erase(ci++); } @@ -153,7 +153,7 @@ BoxDomain::add (const BoxList& bl) { BoxList bl2 = bl; bl2.catenate(*this); - BoxList nbl = BoxLib::removeOverlap(bl2); + BoxList nbl = amrex::removeOverlap(bl2); this->catenate(nbl); } @@ -168,7 +168,7 @@ BoxDomain::rmBox (const Box& b) { if (bli->intersects(b)) { - BoxList tmpbl(BoxLib::boxDiff(*bli,b)); + BoxList tmpbl(amrex::boxDiff(*bli,b)); tmp.splice(tmp.end(), tmpbl.listBox()); lbox.erase(bli++); } @@ -237,7 +237,7 @@ operator<< (std::ostream& os, { os << "(BoxDomain " << bd.boxList() << ")" << std::flush; if (os.fail()) - BoxLib::Error("operator<<(ostream&,BoxDomain&) failed"); + amrex::Error("operator<<(ostream&,BoxDomain&) failed"); return os; } diff --git a/Src/Base/AMReX_BoxLib.H b/Src/Base/AMReX_BoxLib.H index bda9ca17618..d6788cebb58 100644 --- a/Src/Base/AMReX_BoxLib.H +++ b/Src/Base/AMReX_BoxLib.H @@ -39,7 +39,7 @@ namespace BoxLib void ExecOnFinalize (PTR_TO_VOID_FUNC); void ExecOnInitialize (PTR_TO_VOID_FUNC); // - // Print out message to cerr and exit via BoxLib::Abort(). + // Print out message to cerr and exit via amrex::Abort(). // void Error (const char * msg = 0); // @@ -62,13 +62,13 @@ namespace BoxLib // Prints out an out-of-memory message and aborts. It is // called by various BoxLib routines when a call to new fails. // - // Called as BoxLib::OutOfMemory(__FILE__, __LINE__); + // Called as amrex::OutOfMemory(__FILE__, __LINE__); // void OutOfMemory (const char* file, int line); // - // This is used by BoxLib::Error(), BoxLib::Abort(), and BoxLib::Assert() + // This is used by amrex::Error(), amrex::Abort(), and amrex::Assert() // to ensure that when writing the message to stderr, that no additional // heap-based memory is allocated. // diff --git a/Src/Base/AMReX_BoxLib.cpp b/Src/Base/AMReX_BoxLib.cpp index 99ce9fddbe7..094ab3bba71 100644 --- a/Src/Base/AMReX_BoxLib.cpp +++ b/Src/Base/AMReX_BoxLib.cpp @@ -75,13 +75,13 @@ namespace BoxLib } // -// This is used by BoxLib::Error(), BoxLib::Abort(), and BoxLib::Assert() +// This is used by amrex::Error(), amrex::Abort(), and amrex::Assert() // to ensure that when writing the message to stderr, that no additional // heap-based memory is allocated. // void -BoxLib::write_to_stderr_without_buffering (const char* str) +amrex::write_to_stderr_without_buffering (const char* str) { // // Flush all buffers. @@ -103,7 +103,7 @@ BoxLib::write_to_stderr_without_buffering (const char* str) void BL_this_is_a_dummy_routine_to_force_version_into_executable () { - BoxLib::write_to_stderr_without_buffering(version); + amrex::write_to_stderr_without_buffering(version); } static @@ -111,7 +111,7 @@ void write_lib_id(const char* msg) { fflush(0); - const char* const boxlib = "BoxLib::"; + const char* const boxlib = "amrex::"; fwrite(boxlib, strlen(boxlib), 1, stderr); if ( msg ) { @@ -121,7 +121,7 @@ write_lib_id(const char* msg) } void -BoxLib::Error (const char* msg) +amrex::Error (const char* msg) { write_lib_id("Error"); write_to_stderr_without_buffering(msg); @@ -169,7 +169,7 @@ BL_FORT_PROC_DECL(BL_ERROR_CPP,bl_error_cpp) { std::string res = "FORTRAN:"; res += Fint_2_string(istr, *NSTR); - BoxLib::Error(res.c_str()); + amrex::Error(res.c_str()); } BL_FORT_PROC_DECL(BL_WARNING_CPP,bl_warning_cpp) @@ -179,7 +179,7 @@ BL_FORT_PROC_DECL(BL_WARNING_CPP,bl_warning_cpp) { std::string res = "FORTRAN:"; res += Fint_2_string(istr, *NSTR); - BoxLib::Warning(res.c_str()); + amrex::Warning(res.c_str()); } BL_FORT_PROC_DECL(BL_ABORT_CPP,bl_abort_cpp) @@ -189,11 +189,11 @@ BL_FORT_PROC_DECL(BL_ABORT_CPP,bl_abort_cpp) { std::string res = "FORTRAN:"; res += Fint_2_string(istr, *NSTR); - BoxLib::Abort(res.c_str()); + amrex::Abort(res.c_str()); } void -BoxLib::Abort (const char* msg) +amrex::Abort (const char* msg) { write_lib_id("Abort"); write_to_stderr_without_buffering(msg); @@ -201,7 +201,7 @@ BoxLib::Abort (const char* msg) } void -BoxLib::Warning (const char* msg) +amrex::Warning (const char* msg) { if (msg) { @@ -210,7 +210,7 @@ BoxLib::Warning (const char* msg) } void -BoxLib::Assert (const char* EX, +amrex::Assert (const char* EX, const char* file, int line) { @@ -232,24 +232,24 @@ BoxLib::Assert (const char* EX, namespace { - std::stack The_Finalize_Function_Stack; - std::stack The_Initialize_Function_Stack; + std::stack The_Finalize_Function_Stack; + std::stack The_Initialize_Function_Stack; } void -BoxLib::ExecOnFinalize (PTR_TO_VOID_FUNC fp) +amrex::ExecOnFinalize (PTR_TO_VOID_FUNC fp) { The_Finalize_Function_Stack.push(fp); } void -BoxLib::ExecOnInitialize (PTR_TO_VOID_FUNC fp) +amrex::ExecOnInitialize (PTR_TO_VOID_FUNC fp) { The_Initialize_Function_Stack.push(fp); } void -BoxLib::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi_comm) +amrex::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi_comm) { ParallelDescriptor::StartParallel(&argc, &argv, mpi_comm); @@ -257,14 +257,14 @@ BoxLib::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi // // Make sure to catch new failures. // - std::set_new_handler(BoxLib::OutOfMemory); + std::set_new_handler(amrex::OutOfMemory); if (argv[0][0] != '/') { int bufSize(1024); char temp[bufSize]; char *rCheck = getcwd(temp, bufSize); if(rCheck == 0) { - BoxLib::Abort("**** Error: getcwd buffer too small."); + amrex::Abort("**** Error: getcwd buffer too small."); } exename = temp; exename += "/"; @@ -275,7 +275,7 @@ BoxLib::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi #ifdef BL_USE_UPCXX upcxx::init(&argc, &argv); if (upcxx::myrank() != ParallelDescriptor::MyProc()) - BoxLib::Abort("UPC++ rank != MPI rank"); + amrex::Abort("UPC++ rank != MPI rank"); #endif #ifdef BL_USE_MPI3 @@ -300,7 +300,7 @@ BoxLib::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi // // Initialize random seed after we're running in parallel. // - BoxLib::InitRandom(ParallelDescriptor::MyProc()+1, ParallelDescriptor::NProcs()); + amrex::InitRandom(ParallelDescriptor::MyProc()+1, ParallelDescriptor::NProcs()); #ifdef BL_USE_MPI if (ParallelDescriptor::IOProcessor()) @@ -407,7 +407,7 @@ BoxLib::Initialize (int& argc, char**& argv, bool build_parm_parse, MPI_Comm mpi } void -BoxLib::Finalize (bool finalize_parallel) +amrex::Finalize (bool finalize_parallel) { BL_PROFILE_FINALIZE(); @@ -430,7 +430,7 @@ BoxLib::Finalize (bool finalize_parallel) // The MemPool stuff is not using The_Finalize_Function_Stack so that // it can be used in Fortran BoxLib. #ifndef BL_AMRPROF - if (BoxLib::verbose) + if (amrex::verbose) { int mp_min, mp_max, mp_tot; mempool_get_stats(mp_min, mp_max, mp_tot); // in MB diff --git a/Src/Base/AMReX_BoxList.cpp b/Src/Base/AMReX_BoxList.cpp index 346e158b8c5..6f00945e07b 100644 --- a/Src/Base/AMReX_BoxList.cpp +++ b/Src/Base/AMReX_BoxList.cpp @@ -58,7 +58,7 @@ BoxList::remove (iterator bli) } BoxList -BoxLib::intersect (const BoxList& bl, +amrex::intersect (const BoxList& bl, const Box& b) { BL_ASSERT(bl.ixType() == b.ixType()); @@ -68,7 +68,7 @@ BoxLib::intersect (const BoxList& bl, } BoxList -BoxLib::intersect (const BoxList& bl, +amrex::intersect (const BoxList& bl, const BoxList& br) { BL_ASSERT(bl.ixType() == br.ixType()); @@ -78,7 +78,7 @@ BoxLib::intersect (const BoxList& bl, } BoxList -BoxLib::refine (const BoxList& bl, +amrex::refine (const BoxList& bl, int ratio) { BoxList nbl(bl); @@ -87,7 +87,7 @@ BoxLib::refine (const BoxList& bl, } BoxList -BoxLib::coarsen (const BoxList& bl, +amrex::coarsen (const BoxList& bl, int ratio) { BoxList nbl(bl); @@ -96,7 +96,7 @@ BoxLib::coarsen (const BoxList& bl, } BoxList -BoxLib::accrete (const BoxList& bl, +amrex::accrete (const BoxList& bl, int sz) { BoxList nbl(bl); @@ -105,7 +105,7 @@ BoxLib::accrete (const BoxList& bl, } BoxList -BoxLib::removeOverlap (const BoxList& bl) +amrex::removeOverlap (const BoxList& bl) { BoxArray ba(bl); ba.removeOverlap(); @@ -227,7 +227,7 @@ BoxList::contains (const Box& b) const BL_ASSERT(ixType() == b.ixType()); - BoxList bnew = BoxLib::complementIn(b,*this); + BoxList bnew = amrex::complementIn(b,*this); return bnew.isEmpty(); } @@ -302,7 +302,7 @@ BoxList::intersect (const BoxList& b) } BoxList -BoxLib::complementIn (const Box& b, +amrex::complementIn (const Box& b, const BoxList& bl) { BL_ASSERT(bl.ixType() == b.ixType()); @@ -324,14 +324,14 @@ BoxList::complementIn (const Box& b, } else if (bl.size() == 1) { - *this = BoxLib::boxDiff(b,bl.front()); + *this = amrex::boxDiff(b,bl.front()); } else { clear(); Box mbox = bl.minimalBox(); - BoxList diff = BoxLib::boxDiff(b,mbox); + BoxList diff = amrex::boxDiff(b,mbox); catenate(diff); @@ -388,7 +388,7 @@ BoxList::complementIn_base (const Box& b, { if (newbli->intersects(*bli)) { - diff = BoxLib::boxDiff(*newbli, *bli); + diff = amrex::boxDiff(*newbli, *bli); lbox.splice(lbox.begin(), diff.lbox); lbox.erase(newbli++); } @@ -499,7 +499,7 @@ BoxList::shiftHalf (const IntVect& iv) // BoxList -BoxLib::boxDiff (const Box& b1in, +amrex::boxDiff (const Box& b1in, const Box& b2) { BL_ASSERT(b1in.sameType(b2)); @@ -805,7 +805,7 @@ operator<< (std::ostream& os, os << ')' << '\n'; if (os.fail()) - BoxLib::Error("operator<<(ostream&,BoxList&) failed"); + amrex::Error("operator<<(ostream&,BoxList&) failed"); return os; } diff --git a/Src/Base/AMReX_DistributionMapping.cpp b/Src/Base/AMReX_DistributionMapping.cpp index 6e4966c27ac..47fb67efaf2 100644 --- a/Src/Base/AMReX_DistributionMapping.cpp +++ b/Src/Base/AMReX_DistributionMapping.cpp @@ -104,7 +104,7 @@ DistributionMapping::strategy (DistributionMapping::Strategy how) m_BuildMap = &DistributionMapping::RRSFCProcessorMap; break; default: - BoxLib::Error("Bad DistributionMapping::Strategy"); + amrex::Error("Bad DistributionMapping::Strategy"); } } @@ -181,7 +181,7 @@ DistributionMapping::Initialize () { std::string msg("Unknown strategy: "); msg += theStrategy; - BoxLib::Warning(msg.c_str()); + amrex::Warning(msg.c_str()); } } else @@ -203,7 +203,7 @@ DistributionMapping::Initialize () DistributionMapping::nDistMaps = 0; - BoxLib::ExecOnFinalize(DistributionMapping::Finalize); + amrex::ExecOnFinalize(DistributionMapping::Finalize); initialized = true; } @@ -251,7 +251,7 @@ DistributionMapping::LeastUsedCPUs (int nprocs, Array bytes(ParallelDescriptor::NProcs()); - long thisbyte = BoxLib::TotalBytesAllocatedInFabs()/1024; + long thisbyte = amrex::TotalBytesAllocatedInFabs()/1024; BL_COMM_PROFILE(BLProfiler::Allgather, sizeof(long), BLProfiler::BeforeCall(), BLProfiler::NoTag()); @@ -302,7 +302,7 @@ DistributionMapping::LeastUsedTeams (Array & rteam, Array bytes(ParallelDescriptor::NProcs()); - long thisbyte = BoxLib::TotalBytesAllocatedInFabs()/1024; + long thisbyte = amrex::TotalBytesAllocatedInFabs()/1024; BL_COMM_PROFILE(BLProfiler::Allgather, sizeof(long), BLProfiler::BeforeCall(), BLProfiler::NoTag()); @@ -584,7 +584,7 @@ DistributionMapping::~DistributionMapping () { } void DistributionMapping::FlushCache () { - if (BoxLib::verbose) { + if (amrex::verbose) { CacheStats(std::cout); } // @@ -628,7 +628,7 @@ DistributionMapping::PutInCache () r = m_Cache.insert(std::make_pair(std::make_pair(m_ref->m_pmap.size(),m_color.to_int()), m_ref)); if (r.second == false) { - BoxLib::Abort("DistributionMapping::PutInCache: pmap of given length already exists"); + amrex::Abort("DistributionMapping::PutInCache: pmap of given length already exists"); } } @@ -648,7 +648,7 @@ DistributionMapping::RoundRobinDoIt (int nboxes, nteams = ParallelDescriptor::NTeams(); nworkers = ParallelDescriptor::TeamSize(); if (ParallelDescriptor::NColors() > 1) - BoxLib::Abort("Team and color together are not supported yet"); + amrex::Abort("Team and color together are not supported yet"); #endif Array ord; @@ -965,7 +965,7 @@ DistributionMapping::KnapSackDoIt (const std::vector& wgts, nteams = ParallelDescriptor::NTeams(); nworkers = ParallelDescriptor::TeamSize(); if (ParallelDescriptor::NColors() > 1) - BoxLib::Abort("Team and color together are not supported yet"); + amrex::Abort("Team and color together are not supported yet"); #endif std::vector< std::vector > vec; @@ -1210,7 +1210,7 @@ DistributionMapping::SFCProcessorMapDoIt (const BoxArray& boxes, nteams = ParallelDescriptor::NTeams(); nworkers = ParallelDescriptor::TeamSize(); if (ParallelDescriptor::NColors() > 1) - BoxLib::Abort("Team and color together are not supported yet"); + amrex::Abort("Team and color together are not supported yet"); #else if (node_size > 0) { nteams = nprocs/node_size; @@ -1437,11 +1437,11 @@ DistributionMapping::RRSFCDoIt (const BoxArray& boxes, BL_PROFILE("DistributionMapping::RRSFCDoIt()"); #if defined (BL_USE_TEAM) - BoxLib::Abort("Team support is not implemented yet in RRSFC"); + amrex::Abort("Team support is not implemented yet in RRSFC"); #endif if (ParallelDescriptor::NColors() > 1) - BoxLib::Abort("RRSFCMap does not support multi colors"); + amrex::Abort("RRSFCMap does not support multi colors"); std::vector tokens; @@ -1543,7 +1543,7 @@ DistributionMapping::CurrentBytesUsed (int nprocs, Array& result) #ifdef BL_USE_MPI BL_PROFILE("DistributionMapping::CurrentBytesUsed()"); - long thisbyte = BoxLib::TotalBytesAllocatedInFabs(); + long thisbyte = amrex::TotalBytesAllocatedInFabs(); BL_COMM_PROFILE(BLProfiler::Allgather, sizeof(long), BLProfiler::BeforeCall(), BLProfiler::NoTag()); @@ -1590,7 +1590,7 @@ DistributionMapping::CurrentCellsUsed (int nprocs, Array& result) #ifdef BL_USE_MPI BL_PROFILE("DistributionMapping::CurrentCellsUsed()"); - long thiscell = BoxLib::TotalCellsAllocatedInFabs(); + long thiscell = amrex::TotalCellsAllocatedInFabs(); BL_COMM_PROFILE(BLProfiler::Allgather, sizeof(long), BLProfiler::BeforeCall(), BLProfiler::NoTag()); @@ -1619,11 +1619,11 @@ DistributionMapping::PFCProcessorMapDoIt (const BoxArray& boxes, BL_PROFILE("DistributionMapping::PFCProcessorMapDoIt()"); #if defined (BL_USE_TEAM) - BoxLib::Abort("Team support is not implemented yet in PFC"); + amrex::Abort("Team support is not implemented yet in PFC"); #endif if (ParallelDescriptor::NColors() > 1) - BoxLib::Abort("PFCProcessorMap does not support multi colors"); + amrex::Abort("PFCProcessorMap does not support multi colors"); std::vector< std::vector > vec(nprocs); std::vector tokens; @@ -1665,7 +1665,7 @@ DistributionMapping::PFCProcessorMapDoIt (const BoxArray& boxes, totalNewCellsB += boxes[i].numPts(); } if(totalNewCells != totalNewCellsB) { - BoxLib::Abort("tnc"); + amrex::Abort("tnc"); } volpercpu = static_cast(totalNewCells) / nprocs; @@ -1877,7 +1877,7 @@ DistributionMapping::MultiLevelMapPFC (const Array &refRatio, for(int level(finestLevel); level >= 0; --level) { for(int i(0), N(allBoxes[level].size()); i < N; ++i) { Box box(allBoxes[level][i]); - Box fine(BoxLib::refine(box, cRR)); + Box fine(amrex::refine(box, cRR)); tokens.push_back(PFCMultiLevelToken(level, idxAll, i, box.smallEnd(), fine.smallEnd(), box.numPts())); } @@ -1960,7 +1960,7 @@ DistributionMapping::MultiLevelMapPFC (const Array &refRatio, } if(staggeredProxMap[iProc] >= nProcs) { std::cout << "Stagger: ERROR!" << std::endl; - BoxLib::Abort("*****"); + amrex::Abort("*****"); } } @@ -2070,8 +2070,8 @@ DistributionMapping::MultiLevelMapRandom (const Array &refRatio, if(ParallelDescriptor::IOProcessor()) { int range(maxRank - minRank); for(int ir(0); ir < localPMaps[n].size() - 1; ++ir) { - //localPMaps[n][ir] = BoxLib::Random_int(maxRank + 1); - localPMaps[n][ir] = minRank + BoxLib::Random_int(range + 1); + //localPMaps[n][ir] = amrex::Random_int(maxRank + 1); + localPMaps[n][ir] = minRank + amrex::Random_int(range + 1); } } ParallelDescriptor::Bcast(localPMaps[n].dataPtr(), localPMaps[n].size()); @@ -2164,7 +2164,7 @@ DistributionMapping::PFCMultiLevelMap (const Array &refRatio, for(int level(finestLevel); level >= 0; --level) { for(int i(0), N(allBoxes[level].size()); i < N; ++i) { Box box(allBoxes[level][i]); - Box fine(BoxLib::refine(box, cRR)); + Box fine(amrex::refine(box, cRR)); tokens.push_back(PFCMultiLevelToken(level, idxAll, i, box.smallEnd(), fine.smallEnd(), box.numPts())); } @@ -2421,10 +2421,10 @@ DistributionMapping::InitProximityMap(bool makeMap, bool reinit) } else if(bRandomClusters) { if(proximityMap.size() != proximityOrder.size()) { - BoxLib::Abort("**** Error: prox size bad."); + amrex::Abort("**** Error: prox size bad."); } Array rSS(proximityMap.size()); - BoxLib::UniqueRandomSubset(rSS, proximityMap.size(), proximityMap.size()); + amrex::UniqueRandomSubset(rSS, proximityMap.size(), proximityMap.size()); for(int i(0); i < proximityMap.size(); ++i) { std::cout << "rSS[" << i << "] = " << rSS[i] << std::endl; proximityMap[i] = rSS[i]; @@ -2688,7 +2688,7 @@ DistributionMapping::PrintDiagnostics(const std::string &filename) int nprocs(ParallelDescriptor::NProcs()); Array bytes(nprocs, 0); - long thisbyte = BoxLib::TotalBytesAllocatedInFabs(); + long thisbyte = amrex::TotalBytesAllocatedInFabs(); ParallelDescriptor::Gather(&thisbyte, 1, @@ -2748,7 +2748,7 @@ void DistributionMapping::ReadCheckPointHeader(const std::string &filename, if(spdim != BL_SPACEDIM) { std::cerr << "Amr::restart(): bad spacedim = " << spdim << '\n'; - BoxLib::Abort(); + amrex::Abort(); } is >> calcTime; @@ -2846,7 +2846,7 @@ DistributionMapping::Check () const std::cout << ParallelDescriptor::MyProc() << ":: **** error 1 in DistributionMapping::Check() " << "bad rank: nProcs dmrank = " << ParallelDescriptor::NProcs() << " " << m_ref->m_pmap[i] << std::endl; - BoxLib::Abort("Bad DistributionMapping::Check"); + amrex::Abort("Bad DistributionMapping::Check"); } } if(m_ref->m_pmap[m_ref->m_pmap.size() - 1] != ParallelDescriptor::MyProc()) { @@ -2854,7 +2854,7 @@ DistributionMapping::Check () const std::cout << ParallelDescriptor::MyProc() << ":: **** error 2 in DistributionMapping::Check() " << "bad sentinel: myProc sentinel = " << ParallelDescriptor::MyProc() << " " << m_ref->m_pmap[m_ref->m_pmap.size() - 1] << std::endl; - BoxLib::Abort("Bad DistributionMapping::Check"); + amrex::Abort("Bad DistributionMapping::Check"); } return ok; } @@ -2929,7 +2929,7 @@ operator<< (std::ostream& os, os << ')' << '\n'; if (os.fail()) - BoxLib::Error("operator<<(ostream &, DistributionMapping &) failed"); + amrex::Error("operator<<(ostream &, DistributionMapping &) failed"); return os; } diff --git a/Src/Base/AMReX_FArrayBox.cpp b/Src/Base/AMReX_FArrayBox.cpp index 96538e151a1..bd66e51f2bb 100644 --- a/Src/Base/AMReX_FArrayBox.cpp +++ b/Src/Base/AMReX_FArrayBox.cpp @@ -139,7 +139,7 @@ FABio::write_header (std::ostream& os, { BL_PROFILE("FABio::write_header"); BL_ASSERT(nvar <= f.nComp()); - BoxLib::StreamRetry sr(os, "FABio_write_header", 4); + amrex::StreamRetry sr(os, "FABio_write_header", 4); while(sr.TryOutput()) { os << f.box() << ' ' << nvar << '\n'; } @@ -366,7 +366,7 @@ FArrayBox::setFormat (FABio::Format fmt) fio = new FABio_binary(FPC::NativeRealDescriptor().clone()); break; case FABio::FAB_IEEE: - //BoxLib::Warning("FABio::FAB_IEEE has been deprecated"); + //amrex::Warning("FABio::FAB_IEEE has been deprecated"); // // Fall through ... // @@ -378,7 +378,7 @@ FArrayBox::setFormat (FABio::Format fmt) break; default: std::cerr << "FArrayBox::setFormat(): Bad FABio::Format = " << fmt; - BoxLib::Abort(); + amrex::Abort(); } FArrayBox::format = fmt; @@ -389,27 +389,27 @@ FArrayBox::setFormat (FABio::Format fmt) void FArrayBox::setOrdering (FABio::Ordering ordering_) { - //BoxLib::Warning("FArrayBox::setOrdering() has been deprecated"); + //amrex::Warning("FArrayBox::setOrdering() has been deprecated"); ordering = ordering_; } FABio::Ordering FArrayBox::getOrdering () { - //BoxLib::Warning("FArrayBox::getOrdering() has been deprecated"); + //amrex::Warning("FArrayBox::getOrdering() has been deprecated"); return ordering; } void FArrayBox::setPrecision (FABio::Precision) { - BoxLib::Warning("FArrayBox::setPrecision() has been deprecated"); + amrex::Warning("FArrayBox::setPrecision() has been deprecated"); } FABio::Precision FArrayBox::getPrecision () { - BoxLib::Warning("FArrayBox::getPrecision() has been deprecated"); + amrex::Warning("FArrayBox::getPrecision() has been deprecated"); return FABio::FAB_FLOAT; } @@ -484,7 +484,7 @@ FArrayBox::Initialize () if (fmt == "IEEE") { FArrayBox::format = FABio::FAB_IEEE; - //BoxLib::Warning("IEEE fmt in ParmParse files is deprecated"); + //amrex::Warning("IEEE fmt in ParmParse files is deprecated"); } else { @@ -495,7 +495,7 @@ FArrayBox::Initialize () else { std::cerr << "FArrayBox::init(): Bad FABio::Format = " << fmt; - BoxLib::Abort(); + amrex::Abort(); } setFABio(fio); @@ -526,7 +526,7 @@ FArrayBox::Initialize () else { std::cerr << "FArrayBox::init(): Bad FABio::Ordering = " << ord; - BoxLib::Abort(); + amrex::Abort(); } } @@ -538,7 +538,7 @@ FArrayBox::Initialize () pp.query("do_initval", do_initval); pp.query("init_snan", init_snan); - BoxLib::ExecOnFinalize(FArrayBox::Finalize); + amrex::ExecOnFinalize(FArrayBox::Finalize); } void @@ -569,11 +569,11 @@ FABio::read_header (std::istream& is, char c; is >> c; - if(c != 'F') BoxLib::Error("FABio::read_header(): expected \'F\'"); + if(c != 'F') amrex::Error("FABio::read_header(): expected \'F\'"); is >> c; - if(c != 'A') BoxLib::Error("FABio::read_header(): expected \'A\'"); + if(c != 'A') amrex::Error("FABio::read_header(): expected \'A\'"); is >> c; - if(c != 'B') BoxLib::Error("FABio::read_header(): expected \'B\'"); + if(c != 'B') amrex::Error("FABio::read_header(): expected \'B\'"); is >> c; if(c == ':') { // ---- The "old" FAB format. @@ -604,7 +604,7 @@ FABio::read_header (std::istream& is, fio = new FABio_binary(rd); break; default: - BoxLib::Error("FABio::read_header(): Unrecognized FABio header"); + amrex::Error("FABio::read_header(): Unrecognized FABio header"); } } else { // ---- The "new" FAB format. is.putback(c); @@ -621,7 +621,7 @@ FABio::read_header (std::istream& is, } if(is.fail()) { - BoxLib::Error("FABio::read_header() failed"); + amrex::Error("FABio::read_header() failed"); } return fio; @@ -642,11 +642,11 @@ FABio::read_header (std::istream& is, char c; is >> c; - if(c != 'F') BoxLib::Error("FABio::read_header(): expected \'F\'"); + if(c != 'F') amrex::Error("FABio::read_header(): expected \'F\'"); is >> c; - if(c != 'A') BoxLib::Error("FABio::read_header(): expected \'A\'"); + if(c != 'A') amrex::Error("FABio::read_header(): expected \'A\'"); is >> c; - if(c != 'B') BoxLib::Error("FABio::read_header(): expected \'B\'"); + if(c != 'B') amrex::Error("FABio::read_header(): expected \'B\'"); is >> c; if(c == ':') { // ---- The "old" FAB format. @@ -679,7 +679,7 @@ FABio::read_header (std::istream& is, fio = new FABio_binary(rd); break; default: - BoxLib::Error("FABio::read_header(): Unrecognized FABio header"); + amrex::Error("FABio::read_header(): Unrecognized FABio header"); } } else { // ---- The "new" FAB format. is.putback(c); @@ -698,7 +698,7 @@ FABio::read_header (std::istream& is, } if(is.fail()) { - BoxLib::Error("FABio::read_header() failed"); + amrex::Error("FABio::read_header() failed"); } return fio; @@ -779,7 +779,7 @@ FABio_ascii::write (std::ostream& os, os << '\n'; if(os.fail()) { - BoxLib::Error("FABio_ascii::write() failed"); + amrex::Error("FABio_ascii::write() failed"); } } @@ -800,7 +800,7 @@ FABio_ascii::read (std::istream& is, << " should be " << p << '\n'; - BoxLib::Error("FABio_ascii::read() bad IntVect"); + amrex::Error("FABio_ascii::read() bad IntVect"); } for(int k(0); k < f.nComp(); ++k) { is >> f(p, k); @@ -808,7 +808,7 @@ FABio_ascii::read (std::istream& is, } if(is.fail()) { - BoxLib::Error("FABio_ascii::read() failed"); + amrex::Error("FABio_ascii::read() failed"); } } @@ -824,7 +824,7 @@ FABio_ascii::skip (std::istream& is, FArrayBox& f, int nCompToSkip) const { - BoxLib::Error("FABio_ascii::skip(..., int nCompToSkip) not implemented"); + amrex::Error("FABio_ascii::skip(..., int nCompToSkip) not implemented"); } void @@ -873,7 +873,7 @@ FABio_8bit::write (std::ostream& os, delete [] c; if(os.fail()) { - BoxLib::Error("FABio_8bit::write() failed"); + amrex::Error("FABio_8bit::write() failed"); } } @@ -902,7 +902,7 @@ FABio_8bit::read (std::istream& is, } } if(is.fail()) { - BoxLib::Error("FABio_8bit::read() failed"); + amrex::Error("FABio_8bit::read() failed"); } delete [] c; @@ -925,7 +925,7 @@ FABio_8bit::skip (std::istream& is, } if(is.fail()) { - BoxLib::Error("FABio_8bit::skip() failed"); + amrex::Error("FABio_8bit::skip() failed"); } } @@ -947,7 +947,7 @@ FABio_8bit::skip (std::istream& is, } if(is.fail()) { - BoxLib::Error("FABio_8bit::skip() failed"); + amrex::Error("FABio_8bit::skip() failed"); } } @@ -986,7 +986,7 @@ FABio_binary::read (std::istream& is, const long siz = base_siz*f.nComp(); RealDescriptor::convertToNativeFormat(comp_ptr, siz, is, *realDesc); if(is.fail()) { - BoxLib::Error("FABio_binary::read() failed"); + amrex::Error("FABio_binary::read() failed"); } } @@ -1006,7 +1006,7 @@ FABio_binary::write (std::ostream& os, RealDescriptor::convertFromNativeFormat(os, siz, comp_ptr, *realDesc); if(os.fail()) { - BoxLib::Error("FABio_binary::write() failed"); + amrex::Error("FABio_binary::write() failed"); } } @@ -1019,7 +1019,7 @@ FABio_binary::skip (std::istream& is, long siz = base_siz * f.nComp(); is.seekg(siz*realDesc->numBytes(), std::ios::cur); if(is.fail()) { - BoxLib::Error("FABio_binary::skip() failed"); + amrex::Error("FABio_binary::skip() failed"); } } @@ -1033,7 +1033,7 @@ FABio_binary::skip (std::istream& is, long siz = base_siz * nCompToSkip; is.seekg(siz*realDesc->numBytes(), std::ios::cur); if(is.fail()) { - BoxLib::Error("FABio_binary::skip(..., int nCompToSkip) failed"); + amrex::Error("FABio_binary::skip(..., int nCompToSkip) failed"); } } diff --git a/Src/Base/AMReX_FabArray.H b/Src/Base/AMReX_FabArray.H index 3976b43514f..efc29e5b128 100644 --- a/Src/Base/AMReX_FabArray.H +++ b/Src/Base/AMReX_FabArray.H @@ -1113,7 +1113,7 @@ protected: if (win != MPI_WIN_NULL) MPI_Win_free(&win); #endif if (alloc) - BoxLib::update_fab_stats(-n_points, -n_values, sizeof(value_type)); + amrex::update_fab_stats(-n_points, -n_values, sizeof(value_type)); } bool alloc; long n_values; @@ -1377,7 +1377,7 @@ FabArrayBase::PostRcvs (const std::map& m_RcvVols, BL_ASSERT((TotalRcvsVolume*sizeof(T)) < std::numeric_limits::max()); - the_recv_data = static_cast(BoxLib::The_Arena()->alloc(TotalRcvsVolume*sizeof(T))); + the_recv_data = static_cast(amrex::The_Arena()->alloc(TotalRcvsVolume*sizeof(T))); int Offset = 0; @@ -1426,7 +1426,7 @@ FabArrayBase::PostRcvs_MPI_Onesided ( BL_ASSERT((TotalRcvsVolume*sizeof(T)) < std::numeric_limits::max()); - the_recv_data = static_cast(BoxLib::The_Arena()->alloc(TotalRcvsVolume*sizeof(T))); + the_recv_data = static_cast(amrex::The_Arena()->alloc(TotalRcvsVolume*sizeof(T))); MPI_Win_attach(win, the_recv_data, TotalRcvsVolume*sizeof(T)); @@ -1478,7 +1478,7 @@ FabArrayBase::WaitForAsyncSends (int N_snds, BL_COMM_PROFILE_WAITSOME(BLProfiler::Waitall, send_reqs, N_snds, indx, stats, false); for (int i = 0; i < N_snds; i++) - BoxLib::The_Arena()->free(send_data[i]); + amrex::The_Arena()->free(send_data[i]); #endif /*BL_USE_MPI*/ } @@ -1870,7 +1870,7 @@ FabArray::AllocFabs () #else - BoxLib::Abort("BaseFab::define: to allocate shared memory, either USE_UPCXX or USE_MPI3 must be true"); + amrex::Abort("BaseFab::define: to allocate shared memory, either USE_UPCXX or USE_MPI3 must be true"); #endif @@ -1885,7 +1885,7 @@ FabArray::AllocFabs () new (mfp) value_type; } - BoxLib::update_fab_stats(shmem.n_points, shmem.n_values, sizeof(value_type)); + amrex::update_fab_stats(shmem.n_points, shmem.n_values, sizeof(value_type)); } #endif } @@ -2164,7 +2164,7 @@ FabArray::copy (const FabArray& src, #ifdef BL_USE_UPCXX (BLPgas::alloc(N*sizeof(value_type))); #else - (BoxLib::The_Arena()->alloc(N*sizeof(value_type))); + (amrex::The_Arena()->alloc(N*sizeof(value_type))); #endif send_data.push_back(data); @@ -2257,7 +2257,7 @@ FabArray::copy (const FabArray& src, for (int j=0; jfree(send_data[j]); + amrex::The_Arena()->free(send_data[j]); } } } @@ -2391,11 +2391,11 @@ FabArray::copy (const FabArray& src, if (ParallelDescriptor::MPIOneSided()) { #if defined(BL_USE_MPI3) MPI_Win_detach(ParallelDescriptor::cp_win, the_recv_data); - BoxLib::The_Arena()->free(the_recv_data); + amrex::The_Arena()->free(the_recv_data); recv_disp.clear(); #endif } else { - BoxLib::The_Arena()->free(the_recv_data); + amrex::The_Arena()->free(the_recv_data); } #endif recv_from.clear(); @@ -2412,7 +2412,7 @@ FabArray::copy (const FabArray& src, if (ParallelDescriptor::MPIOneSided()) { #if defined(BL_USE_MPI3) for (int i = 0; i < N_snds; ++i) - BoxLib::The_Arena()->free(send_data[i]); + amrex::The_Arena()->free(send_data[i]); #endif } else { if (FabArrayBase::do_async_sends && ! thecpc.m_SndTags->empty()) { @@ -2515,7 +2515,7 @@ FabArray::copyTo (FAB& dest, { for (int j = 0, N = size(); j < N; ++j) { - const Box& bx = BoxLib::grow(boxarray[j],nghost); + const Box& bx = amrex::grow(boxarray[j],nghost); const Box& destbox = bx & subbox; if (destbox.ok()) { @@ -2667,14 +2667,14 @@ FabArray::copyInter (FabArray *src, FabArray *dest, destPMapAll[destPMapAll.size()-1] = myProcBoth; // ---- set the sentinel } - BoxLib::BroadcastBoxArray(srcBoxArray, myProcBoth, bcastRootSrc, commBoth); + amrex::BroadcastBoxArray(srcBoxArray, myProcBoth, bcastRootSrc, commBoth); - BoxLib::BroadcastBoxArray(destBoxArray, myProcBoth, bcastRootDest, commBoth); + amrex::BroadcastBoxArray(destBoxArray, myProcBoth, bcastRootDest, commBoth); BL_ASSERT(destBoxArray[0].ixType() == srcBoxArray[0].ixType()); - BoxLib::BroadcastArray(srcPMapAll, myProcBoth, bcastRootSrc, commBoth); - BoxLib::BroadcastArray(destPMapAll, myProcBoth, bcastRootDest, commBoth); + amrex::BroadcastArray(srcPMapAll, myProcBoth, bcastRootSrc, commBoth); + amrex::BroadcastArray(destPMapAll, myProcBoth, bcastRootDest, commBoth); srcDMAll.define(srcPMapAll, putInCache); destDMAll.define(destPMapAll, putInCache); @@ -2754,7 +2754,7 @@ FabArray::copyInter (FabArray *src, FabArray *dest, BL_ASSERT(N < std::numeric_limits::max()); - value_type* data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); + value_type* data = static_cast(amrex::The_Arena()->alloc(N*sizeof(value_type))); send_data.push_back(data); send_N .push_back(N); @@ -2796,7 +2796,7 @@ FabArray::copyInter (FabArray *src, FabArray *dest, for (int j=0; jfree(send_data[j]); + amrex::The_Arena()->free(send_data[j]); } } @@ -2884,7 +2884,7 @@ FabArray::copyInter (FabArray *src, FabArray *dest, } } - BoxLib::The_Arena()->free(the_recv_data); + amrex::The_Arena()->free(the_recv_data); if (FabArrayBase::do_async_sends && ! thecpc.m_SndTags->empty()) { FabArrayBase::WaitForAsyncSends(thecpc.m_SndTags->size(),send_reqs,send_data,stats); @@ -3017,11 +3017,11 @@ FabArray::CheckFAPointers (bool abortOnError) if(allocFAPSize != FabArray::allocatedFAPointers.size()) { if(abortOnError) { - BoxLib::USleep(ParallelDescriptor::MyProcAll()); + amrex::USleep(ParallelDescriptor::MyProcAll()); std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: allocFAPSize != " << "FabArray::allocatedFAPointers.size() : " << allocFAPSize << " " << FabArray::allocatedFAPointers.size() << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad allocFAPSize."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad allocFAPSize."); } } @@ -3034,11 +3034,11 @@ FabArray::CheckFAPointers (bool abortOnError) ParallelDescriptor::Bcast(&fapCMapSize, 1, iopNumber); if(fapCMapSize != faPtrCachedMap.size()) { if(abortOnError) { - BoxLib::USleep(ParallelDescriptor::MyProcAll()); + amrex::USleep(ParallelDescriptor::MyProcAll()); std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: fapCMapSize != " << "faPtrCachedMap.size() : " << fapCMapSize << " " << faPtrCachedMap.size() << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad fapCMapSize."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad fapCMapSize."); } } @@ -3046,10 +3046,10 @@ FabArray::CheckFAPointers (bool abortOnError) ParallelDescriptor::Bcast(&distmapNGrids, 1, iopNumber); if(distmapNGrids != afapIter->first-1) { if(abortOnError) { - BoxLib::USleep(ParallelDescriptor::MyProcAll()); + amrex::USleep(ParallelDescriptor::MyProcAll()); std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: distmapNGrids != " << "afapIter->first-1 : " << distmapNGrids << " " << afapIter->first-1 << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad distmapNGrids."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad distmapNGrids."); } } @@ -3079,13 +3079,13 @@ FabArray::CheckFAPointers (bool abortOnError) nDMCheck = nDM; fabsAllocedCheck = fabsAlloced; } - BoxLib::BroadcastArray(fapIdCheck, ParallelDescriptor::MyProc(), iopNumber, + amrex::BroadcastArray(fapIdCheck, ParallelDescriptor::MyProc(), iopNumber, ParallelDescriptor::Communicator()); - BoxLib::BroadcastArray(dmIdCheck, ParallelDescriptor::MyProc(), iopNumber, + amrex::BroadcastArray(dmIdCheck, ParallelDescriptor::MyProc(), iopNumber, ParallelDescriptor::Communicator()); - BoxLib::BroadcastArray(nDMCheck, ParallelDescriptor::MyProc(), iopNumber, + amrex::BroadcastArray(nDMCheck, ParallelDescriptor::MyProc(), iopNumber, ParallelDescriptor::Communicator()); - BoxLib::BroadcastArray(fabsAllocedCheck, ParallelDescriptor::MyProc(), iopNumber, + amrex::BroadcastArray(fabsAllocedCheck, ParallelDescriptor::MyProc(), iopNumber, ParallelDescriptor::Communicator()); for(int i(0); i < fapId.size(); ++i) { if(fapId[i] != fapIdCheck[i]) { @@ -3093,7 +3093,7 @@ FabArray::CheckFAPointers (bool abortOnError) std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: fapId[" << i << "] != fapIdCheck[" << i << "] : " << fapId[i] << " " << fapIdCheck[i] << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad fapId."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad fapId."); } } } @@ -3103,7 +3103,7 @@ FabArray::CheckFAPointers (bool abortOnError) std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: dmId[" << i << "] != dmIdCheck[" << i << "] : " << dmId[i] << " " << dmIdCheck[i] << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad dmId."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad dmId."); } } } @@ -3113,7 +3113,7 @@ FabArray::CheckFAPointers (bool abortOnError) std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: nDM[" << i << "] != nDMCheck[" << i << "] : " << nDM[i] << " " << nDMCheck[i] << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad nDM."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad nDM."); } } } @@ -3123,7 +3123,7 @@ FabArray::CheckFAPointers (bool abortOnError) std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: fabsAlloced[" << i << "] != fabsAllocedCheck[" << i << "] : " << fabsAlloced[i] << " " << fabsAllocedCheck[i] << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad fabsAlloced."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad fabsAlloced."); } } } @@ -3134,7 +3134,7 @@ FabArray::CheckFAPointers (bool abortOnError) if(abortOnError) { std::cout << ParallelDescriptor::MyProcAll() << ":: **** ERROR: " << "pLocked != pLockedCheck : " << pLocked << " " << pLockedCheck << std::endl; - BoxLib::Abort("**** Error in FabArray::CheckFAPointers(): bad pLocked."); + amrex::Abort("**** Error in FabArray::CheckFAPointers(): bad pLocked."); } } } @@ -3179,11 +3179,11 @@ FabArray::AddProcsToComp (int ioProcNumSCS, int ioProcNumAll, flushTileArrayCache(); // ---- BoxArrays - BoxLib::BroadcastBoxArray(boxarray, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBoxArray(boxarray, scsMyId, ioProcNumSCS, scsComm); // ---- DistributionMapping int sentinelProc(ParallelDescriptor::MyProcComp()); - BoxLib::BroadcastDistributionMapping(distributionMap, sentinelProc, + amrex::BroadcastDistributionMapping(distributionMap, sentinelProc, scsMyId, ioProcNumSCS, scsComm, true); // ---- ints @@ -3208,7 +3208,7 @@ FabArray::AddProcsToComp (int ioProcNumSCS, int ioProcNumAll, for(int i(0); i < BL_SPACEDIM; ++i) { allIntVects.push_back(mfiter_tile_size[i]); } for(int i(0); i < BL_SPACEDIM; ++i) { allIntVects.push_back(comm_tile_size[i]); } } - BoxLib::BroadcastArray(allIntVects, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastArray(allIntVects, scsMyId, ioProcNumSCS, scsComm); if(scsMyId != ioProcNumSCS) { int count(0); for(int i(0); i < BL_SPACEDIM; ++i) { mfiter_tile_size[i] = allIntVects[count++]; } @@ -3255,7 +3255,7 @@ FabArray::AddProcsToComp (int ioProcNumSCS, int ioProcNumAll, setArray.push_back(*it); } } - BoxLib::BroadcastArray(setArray, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastArray(setArray, scsMyId, ioProcNumSCS, scsComm); if(scsMyId != ioProcNumSCS) { noallocFAPIds.insert(std::begin(setArray), std::end(setArray)); } @@ -3306,7 +3306,7 @@ FabArray::MoveAllFabs (const Array &newDistMapArray) { FabArray *faPtr = it->second; if(faPtr->ok() == false) { - BoxLib::Abort("**** Error 0 in MoveAllFabs: faPtr not ok"); + amrex::Abort("**** Error 0 in MoveAllFabs: faPtr not ok"); } faPtr->flushFPinfo(); @@ -3340,7 +3340,7 @@ FabArray::MoveAllFabs (const Array &newDistMapArray) { FabArray *faPtr = it->second; if(faPtr->ok() == false) { - BoxLib::Abort("**** Error 2 in MoveAllFabs: faPtr not ok"); + amrex::Abort("**** Error 2 in MoveAllFabs: faPtr not ok"); } } @@ -3369,10 +3369,10 @@ FabArray::MoveFabs (const Array &newDistMapArray) if(newDistMapArray.size() != distributionMap.size()) { std::cout << "ndma.size dm.size = " << newDistMapArray.size() << " " << distributionMap.size() << std::endl; - BoxLib::Abort("**** Error: bad newDistMap:0"); + amrex::Abort("**** Error: bad newDistMap:0"); } if(newDistMapArray[newDistMapArray.size() - 1] != myProc) { - BoxLib::Abort("**** Error: bad newDistMap:1"); + amrex::Abort("**** Error: bad newDistMap:1"); } for(int idm(0); idm < newDistMapArray.size(); ++idm) { if(newDistMapArray[idm] < 0 || @@ -3380,7 +3380,7 @@ FabArray::MoveFabs (const Array &newDistMapArray) { std::cout << "**** idm ndm[idm] np = " << newDistMapArray[idm] << " " << ParallelDescriptor::NProcs() << std::endl; - BoxLib::Abort("**** Error: bad newDistMap:2"); + amrex::Abort("**** Error: bad newDistMap:2"); } } if(newDistMapArray == distributionMap.ProcessorMap()) { @@ -3418,14 +3418,14 @@ FabArray::MoveFabs (const Array &newDistMapArray) typename std::map::iterator tIFiter; if(fabMoves.size() > 0) { // ---- there are fabs on this proc to send || recv | both if(indexArray.size() != m_fabs_v.size()) { - BoxLib::Abort("**** Error: indexArray size != m_fabs_v.size()"); + amrex::Abort("**** Error: indexArray size != m_fabs_v.size()"); } for(int iim(0); iim < indexArray.size(); ++iim) { tIFiter = tempIndexFABs.find(indexArray[iim]); if(tIFiter == tempIndexFABs.end()) { tempIndexFABs.insert(std::pair(indexArray[iim], m_fabs_v[iim])); } else { - BoxLib::Abort("**** Error: index not in indexArray."); + amrex::Abort("**** Error: index not in indexArray."); } } } @@ -3454,7 +3454,7 @@ FabArray::MoveFabs (const Array &newDistMapArray) FAB *fabPtr; tIFiter = tempIndexFABs.find(dmi); if(tIFiter == tempIndexFABs.end()) { - BoxLib::Abort("**** Error: index not in tempIndexFABs."); + amrex::Abort("**** Error: index not in tempIndexFABs."); } else { fabPtr = tIFiter->second; } @@ -3494,7 +3494,7 @@ FabArray::MoveFabs (const Array &newDistMapArray) if(myProc == moveThisFab.fromRank) { // ---- delete sent fab tIFiter = tempIndexFABs.find(moveThisFab.distMapIndex); if(tIFiter == tempIndexFABs.end()) { - BoxLib::Abort("**** Error: index not in tempIndexFABs when deleting."); + amrex::Abort("**** Error: index not in tempIndexFABs when deleting."); } else { delete tIFiter->second; tempIndexFABs.erase(tIFiter); @@ -3582,7 +3582,7 @@ FabArrayCopyDescriptor::AddBoxDoIt (FabArrayId fabarrayid, if(remoteProc >= ParallelDescriptor::NProcs()) { std::cout << ParallelDescriptor::MyProcAll() << ":: _in AddBoxDoIt: nProcs remoteProc = " << ParallelDescriptor::NProcs() << " " << remoteProc << std::endl; - BoxLib::Abort("Bad remoteProc"); + amrex::Abort("Bad remoteProc"); } fcd->fillBoxId = nextFillBoxId; fcd->subBox = intersect; @@ -4181,7 +4181,7 @@ FabArrayCopyDescriptor::CollectData () N += cnt; } - md_recv_data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(int))); + md_recv_data = static_cast(amrex::The_Arena()->alloc(N*sizeof(int))); for (int i = 0; i < N_snds; ++i) { @@ -4200,7 +4200,7 @@ FabArrayCopyDescriptor::CollectData () int Nmds = it->second; int cnt = Nmds * Nints; - int* p = static_cast(BoxLib::The_Arena()->alloc(cnt*sizeof(int))); + int* p = static_cast(amrex::The_Arena()->alloc(cnt*sizeof(int))); md_send_data.push_back(p); const FabComTagIterContainer& tags = RcvTags[rank]; @@ -4234,7 +4234,7 @@ FabArrayCopyDescriptor::CollectData () if (N_rcvs > 0) { - recv_data = static_cast(BoxLib::The_Arena()->alloc(Total_Rcvs_Size*sizeof(value_type))); + recv_data = static_cast(amrex::The_Arena()->alloc(Total_Rcvs_Size*sizeof(value_type))); // Post receives for data int Idx = 0; @@ -4291,7 +4291,7 @@ FabArrayCopyDescriptor::CollectData () BL_ASSERT(N < std::numeric_limits::max()); - value_type* data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); + value_type* data = static_cast(amrex::The_Arena()->alloc(N*sizeof(value_type))); value_type* dptr = data; send_data.push_back(data); @@ -4304,7 +4304,7 @@ FabArrayCopyDescriptor::CollectData () data_send_reqs.push_back(ParallelDescriptor::Asend(data,N,rank,SeqNum_data).req()); } - BoxLib::The_Arena()->free(md_recv_data); + amrex::The_Arena()->free(md_recv_data); } // Wait and upack data @@ -4314,7 +4314,7 @@ FabArrayCopyDescriptor::CollectData () BL_MPI_REQUIRE (MPI_Waitall(N_rcvs, md_send_reqs.dataPtr(), stats.dataPtr()) ); for (int i = 0; i < N_rcvs; ++i) { - BoxLib::The_Arena()->free(md_send_data[i]); + amrex::The_Arena()->free(md_send_data[i]); } BL_MPI_REQUIRE( MPI_Waitall(N_rcvs, data_recv_reqs.dataPtr(), stats.dataPtr()) ); @@ -4364,7 +4364,7 @@ FabArrayCopyDescriptor::CollectData () } } - BoxLib::The_Arena()->free(recv_data); + amrex::The_Arena()->free(recv_data); } // Finished send @@ -4376,7 +4376,7 @@ FabArrayCopyDescriptor::CollectData () BL_COMM_PROFILE(BLProfiler::Waitall, sizeof(value_type), BLProfiler::AfterCall(), N_snds); for (int i = 0; i < N_snds; ++i) { - BoxLib::The_Arena()->free(send_data[i]); + amrex::The_Arena()->free(send_data[i]); } } @@ -4690,7 +4690,7 @@ FabArray::FBEP_nowait (int scomp, int ncomp, const Periodicity& period, boo #ifdef BL_USE_UPCXX (BLPgas::alloc(N*sizeof(value_type))); #else - (BoxLib::The_Arena()->alloc(N*sizeof(value_type))); + (amrex::The_Arena()->alloc(N*sizeof(value_type))); #endif send_data.push_back(data); @@ -4911,11 +4911,11 @@ FabArray::FillBoundary_finish () if (ParallelDescriptor::MPIOneSided()) { #if defined(BL_USE_MPI3) MPI_Win_detach(ParallelDescriptor::fb_win, fb_the_recv_data); - BoxLib::The_Arena()->free(fb_the_recv_data); + amrex::The_Arena()->free(fb_the_recv_data); fb_recv_disp.clear(); #endif } else { - BoxLib::The_Arena()->free(fb_the_recv_data); + amrex::The_Arena()->free(fb_the_recv_data); } #endif @@ -4933,7 +4933,7 @@ FabArray::FillBoundary_finish () if (ParallelDescriptor::MPIOneSided()) { #if defined(BL_USE_MPI3) for (int i = 0; i < N_snds; ++i) - BoxLib::The_Arena()->free(fb_send_data[i]); + amrex::The_Arena()->free(fb_send_data[i]); #endif } else { Array stats; @@ -5034,7 +5034,7 @@ FabArray::BuildMask (const Box& phys_domain, const Periodicity& period, const CopyComTagsContainer& LocTags = *(TheFB.m_LocTags); const MapOfCopyComTagContainers& RcvTags = *(TheFB.m_RcvTags); - Box domain = BoxLib::convert(phys_domain, boxArray().ixType()); + Box domain = amrex::convert(phys_domain, boxArray().ixType()); for (int i = 0; i < BL_SPACEDIM; ++i) { if (period.isPeriodic(i)) { domain.grow(i, ngrow); diff --git a/Src/Base/AMReX_FabArray.cpp b/Src/Base/AMReX_FabArray.cpp index 3f9128476bb..fe5af385c04 100644 --- a/Src/Base/AMReX_FabArray.cpp +++ b/Src/Base/AMReX_FabArray.cpp @@ -104,7 +104,7 @@ FabArrayBase::Initialize () FabArrayBase::nFabArrays = 0; - BoxLib::ExecOnFinalize(FabArrayBase::Finalize); + amrex::ExecOnFinalize(FabArrayBase::Finalize); #ifdef BL_MEM_PROFILING MemProfiler::add(m_TAC_stats.name, std::function @@ -137,7 +137,7 @@ FabArrayBase::~FabArrayBase () {} Box FabArrayBase::fabbox (int K) const { - return BoxLib::grow(boxarray[K], n_grow); + return amrex::grow(boxarray[K], n_grow); } long @@ -145,8 +145,8 @@ FabArrayBase::bytesOfMapOfCopyComTagContainers (const FabArrayBase::MapOfCopyCom { long r = sizeof(MapOfCopyComTagContainers); for (MapOfCopyComTagContainers::const_iterator it = m.begin(); it != m.end(); ++it) { - r += sizeof(it->first) + BoxLib::bytesOf(it->second) - + BoxLib::gcc_map_node_extra_bytes; + r += sizeof(it->first) + amrex::bytesOf(it->second) + + amrex::gcc_map_node_extra_bytes; } return r; } @@ -157,7 +157,7 @@ FabArrayBase::CPC::bytes () const long cnt = sizeof(FabArrayBase::CPC); if (m_LocTags) - cnt += BoxLib::bytesOf(*m_LocTags); + cnt += amrex::bytesOf(*m_LocTags); if (m_SndTags) cnt += FabArrayBase::bytesOfMapOfCopyComTagContainers(*m_SndTags); @@ -166,10 +166,10 @@ FabArrayBase::CPC::bytes () const cnt += FabArrayBase::bytesOfMapOfCopyComTagContainers(*m_RcvTags); if (m_SndVols) - cnt += BoxLib::bytesOf(*m_SndVols); + cnt += amrex::bytesOf(*m_SndVols); if (m_RcvVols) - cnt += BoxLib::bytesOf(*m_RcvVols); + cnt += amrex::bytesOf(*m_RcvVols); return cnt; } @@ -180,7 +180,7 @@ FabArrayBase::FB::bytes () const int cnt = sizeof(FabArrayBase::FB); if (m_LocTags) - cnt += BoxLib::bytesOf(*m_LocTags); + cnt += amrex::bytesOf(*m_LocTags); if (m_SndTags) cnt += FabArrayBase::bytesOfMapOfCopyComTagContainers(*m_SndTags); @@ -189,10 +189,10 @@ FabArrayBase::FB::bytes () const cnt += FabArrayBase::bytesOfMapOfCopyComTagContainers(*m_RcvTags); if (m_SndVols) - cnt += BoxLib::bytesOf(*m_SndVols); + cnt += amrex::bytesOf(*m_SndVols); if (m_RcvVols) - cnt += BoxLib::bytesOf(*m_RcvVols); + cnt += amrex::bytesOf(*m_RcvVols); return cnt; } @@ -201,9 +201,9 @@ long FabArrayBase::TileArray::bytes () const { return sizeof(*this) - + (BoxLib::bytesOf(this->indexMap) - sizeof(this->indexMap)) - + (BoxLib::bytesOf(this->localIndexMap) - sizeof(this->localIndexMap)) - + (BoxLib::bytesOf(this->tileArray) - sizeof(this->tileArray)); + + (amrex::bytesOf(this->indexMap) - sizeof(this->indexMap)) + + (amrex::bytesOf(this->localIndexMap) - sizeof(this->localIndexMap)) + + (amrex::bytesOf(this->tileArray) - sizeof(this->tileArray)); } // @@ -288,7 +288,7 @@ FabArrayBase::CPC::define (const BoxArray& ba_dst, const DistributionMapping& dm for (int i = 0; i < nlocal_src; ++i) { const int k_src = imap_src[i]; - const Box& bx_src = BoxLib::grow(ba_src[k_src], ng_src); + const Box& bx_src = amrex::grow(ba_src[k_src], ng_src); for (std::vector::const_iterator pit=pshifts.begin(); pit!=pshifts.end(); ++pit) { @@ -327,7 +327,7 @@ FabArrayBase::CPC::define (const BoxArray& ba_dst, const DistributionMapping& dm for (int i = 0; i < nlocal_dst; ++i) { const int k_dst = imap_dst[i]; - const Box& bx_dst = BoxLib::grow(ba_dst[k_dst], ng_dst); + const Box& bx_dst = amrex::grow(ba_dst[k_dst], ng_dst); if (check_local) { localtouch.resize(bx_dst); @@ -569,7 +569,7 @@ FabArrayBase::FB::define_fb(const FabArrayBase& fa) const DistributionMapping& dm = fa.DistributionMap(); const Array& imap = fa.IndexArray(); - BL_ASSERT(BoxLib::convert(ba,IndexType::TheCellType()).isDisjoint()); + BL_ASSERT(amrex::convert(ba,IndexType::TheCellType()).isDisjoint()); // For local copy, all workers in the same team will have the identical copy of tags // so that they can share work. But for remote communication, they are all different. @@ -601,7 +601,7 @@ FabArrayBase::FB::define_fb(const FabArrayBase& fa) if (ParallelDescriptor::sameTeam(dst_owner)) { continue; // local copy will be dealt with later } else if (MyProc == dm[ksnd]) { - const BoxList& bl = BoxLib::boxDiff(bx, ba[krcv]); + const BoxList& bl = amrex::boxDiff(bx, ba[krcv]); for (BoxList::const_iterator lit = bl.begin(); lit != bl.end(); ++lit) send_tags[dst_owner].push_back(CopyComTag(*lit, (*lit)-(*pit), krcv, ksnd)); } @@ -635,7 +635,7 @@ FabArrayBase::FB::define_fb(const FabArrayBase& fa) { const int krcv = imap[i]; const Box& vbx = ba[krcv]; - const Box& bxrcv = BoxLib::grow(vbx, ng); + const Box& bxrcv = amrex::grow(vbx, ng); if (check_local) { localtouch.resize(bxrcv); @@ -657,7 +657,7 @@ FabArrayBase::FB::define_fb(const FabArrayBase& fa) const Box& dst_bx = isects[j].second - *pit; const int src_owner = dm[ksnd]; - const BoxList& bl = BoxLib::boxDiff(dst_bx, vbx); + const BoxList& bl = amrex::boxDiff(dst_bx, vbx); for (BoxList::const_iterator lit = bl.begin(); lit != bl.end(); ++lit) { const Box& blbx = *lit; @@ -803,7 +803,7 @@ FabArrayBase::FB::define_epo (const FabArrayBase& fa) for (int i = 0; i < nlocal; ++i) { const int ksnd = imap[i]; - Box bxsnd = BoxLib::grow(ba[ksnd],ng); + Box bxsnd = amrex::grow(ba[ksnd],ng); bxsnd &= pdomain; // source must be inside the periodic domain. if (!bxsnd.ok()) continue; @@ -823,7 +823,7 @@ FabArrayBase::FB::define_epo (const FabArrayBase& fa) if (ParallelDescriptor::sameTeam(dst_owner)) { continue; // local copy will be dealt with later } else if (MyProc == dm[ksnd]) { - const BoxList& bl = BoxLib::boxDiff(bx, pdomain); + const BoxList& bl = amrex::boxDiff(bx, pdomain); for (BoxList::const_iterator lit = bl.begin(); lit != bl.end(); ++lit) { send_tags[dst_owner].push_back(CopyComTag(*lit, (*lit)-(*pit), krcv, ksnd)); } @@ -852,7 +852,7 @@ FabArrayBase::FB::define_epo (const FabArrayBase& fa) { const int krcv = imap[i]; const Box& vbx = ba[krcv]; - const Box& bxrcv = BoxLib::grow(vbx, ng); + const Box& bxrcv = amrex::grow(vbx, ng); if (pdomain.contains(bxrcv)) continue; @@ -878,7 +878,7 @@ FabArrayBase::FB::define_epo (const FabArrayBase& fa) const Box& dst_bx = isects[j].second - *pit; const int src_owner = dm[ksnd]; - const BoxList& bl = BoxLib::boxDiff(dst_bx, pdomain); + const BoxList& bl = amrex::boxDiff(dst_bx, pdomain); for (BoxList::const_iterator lit = bl.begin(); lit != bl.end(); ++lit) { @@ -1214,7 +1214,7 @@ FabArrayBase::Finalize () FabArrayBase::flushTileArrayCache(); - if (ParallelDescriptor::IOProcessor() && BoxLib::verbose) { + if (ParallelDescriptor::IOProcessor() && amrex::verbose) { m_FA_stats.print(); m_TAC_stats.print(); m_FBC_stats.print(); @@ -1702,7 +1702,7 @@ MFGhostIter::Initialize () const Box& vbx = fabArray.box(K); const Box& fbx = fabArray.fabbox(K); - const BoxList& diff = BoxLib::boxDiff(fbx, vbx); + const BoxList& diff = amrex::boxDiff(fbx, vbx); for (BoxList::const_iterator bli = diff.begin(); bli != diff.end(); ++bli) { BoxList tiles(*bli, FabArrayBase::mfghostiter_tile_size); diff --git a/Src/Base/AMReX_FabConv.cpp b/Src/Base/AMReX_FabConv.cpp index fccd32385ce..114ba764221 100644 --- a/Src/Base/AMReX_FabConv.cpp +++ b/Src/Base/AMReX_FabConv.cpp @@ -151,7 +151,7 @@ selectOrdering (int prec, case FABio::FAB_REVERSE_ORDER_2: return FPC::reverse_float_order_2; default: - BoxLib::Error("selectOrdering(): Crazy ordering"); + amrex::Error("selectOrdering(): Crazy ordering"); } break; case FABio::FAB_DOUBLE: @@ -164,11 +164,11 @@ selectOrdering (int prec, case FABio::FAB_REVERSE_ORDER_2: return FPC::reverse_double_order_2; default: - BoxLib::Error("selectOrdering(): Crazy ordering"); + amrex::Error("selectOrdering(): Crazy ordering"); } break; default: - BoxLib::Error("selectOrdering(): Crazy precision"); + amrex::Error("selectOrdering(): Crazy precision"); } return 0; } @@ -202,7 +202,7 @@ RealDescriptor::newRealDescriptor (int iot, } case FABio::FAB_NATIVE: default: - BoxLib::Error("RealDescriptor::newRealDescriptor(): Crazy precision"); + amrex::Error("RealDescriptor::newRealDescriptor(): Crazy precision"); } rd = new RealDescriptor; return rd; @@ -780,24 +780,24 @@ getarray (std::istream& is, \ char c; \ is >> c; \ if (c != '(') \ - BoxLib::Error("getarray(istream&): expected a \'(\'"); \ + amrex::Error("getarray(istream&): expected a \'(\'"); \ int size; \ is >> size; \ is >> c; \ if ( c != ',') \ - BoxLib::Error("getarray(istream&): expected a \',\'"); \ + amrex::Error("getarray(istream&): expected a \',\'"); \ is >> c; \ if (c != '(') \ - BoxLib::Error("getarray(istream&): expected a \'(\'"); \ + amrex::Error("getarray(istream&): expected a \'(\'"); \ ar.resize(size); \ for(int i = 0; i < size; ++i) \ is >> ar[i]; \ is >> c; \ if (c != ')') \ - BoxLib::Error("getarray(istream&): expected a \')\'"); \ + amrex::Error("getarray(istream&): expected a \')\'"); \ is >> c; \ if (c != ')') \ - BoxLib::Error("getarray(istream&): expected a \')\'"); \ + amrex::Error("getarray(istream&): expected a \')\'"); \ } GETARRAY(int) GETARRAY(long) @@ -829,7 +829,7 @@ std::ostream& operator<< (std::ostream& os, const RealDescriptor& id) { - BoxLib::StreamRetry sr(os, "opRD", 4); + amrex::StreamRetry sr(os, "opRD", 4); while(sr.TryOutput()) { os << "("; @@ -848,17 +848,17 @@ operator>> (std::istream& is, char c; is >> c; if (c != '(') - BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \'(\'"); + amrex::Error("operator>>(istream&,RealDescriptor&): expected a \'(\'"); Array fmt; getarray(is, fmt); is >> c; if (c != ',') - BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \',\'"); + amrex::Error("operator>>(istream&,RealDescriptor&): expected a \',\'"); Array ord; getarray(is, ord); is >> c; if (c != ')') - BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \')\'"); + amrex::Error("operator>>(istream&,RealDescriptor&): expected a \')\'"); rd = RealDescriptor(fmt.dataPtr(),ord.dataPtr(),ord.size()); return is; } @@ -962,7 +962,7 @@ RealDescriptor::convertToNativeFormat (Real* out, } if(is.fail()) { - BoxLib::Error("convert(Real*,long,istream&,RealDescriptor&) failed"); + amrex::Error("convert(Real*,long,istream&,RealDescriptor&) failed"); } delete [] bufr; @@ -1003,7 +1003,7 @@ RealDescriptor::convertFromNativeFormat (std::ostream& os, long nitemsSave(nitems); long buffSize(std::min(long(writeBufferSize), nitems)); const Real *inSave(in); - BoxLib::StreamRetry sr(os, "RD_cFNF", 4); + amrex::StreamRetry sr(os, "RD_cFNF", 4); while(sr.TryOutput()) { nitems = nitemsSave; diff --git a/Src/Base/AMReX_Geometry.cpp b/Src/Base/AMReX_Geometry.cpp index e0e905c549c..b2b9937436b 100644 --- a/Src/Base/AMReX_Geometry.cpp +++ b/Src/Base/AMReX_Geometry.cpp @@ -171,7 +171,7 @@ Geometry::Setup (const RealBox* rb, int coord, int* isper) is_periodic[n] = isper[n]; } - BoxLib::ExecOnFinalize(Geometry::Finalize); + amrex::ExecOnFinalize(Geometry::Finalize); } void @@ -201,7 +201,7 @@ Geometry::GetVolume (FArrayBox& vol, int idx, int ngrow) const { - CoordSys::GetVolume(vol, BoxLib::grow(grds[idx],ngrow)); + CoordSys::GetVolume(vol, amrex::grow(grds[idx],ngrow)); } #if (BL_SPACEDIM <= 2) @@ -255,7 +255,7 @@ Geometry::GetFaceArea (FArrayBox& area, int dir, int ngrow) const { - CoordSys::GetFaceArea(area, BoxLib::grow(grds[idx],ngrow), dir); + CoordSys::GetFaceArea(area, amrex::grow(grds[idx],ngrow), dir); } void @@ -389,13 +389,13 @@ Geometry::BroadcastGeometry (Geometry &geom, int fromProc, MPI_Comm comm, bool b is_periodic[n] = geom.isPeriodic(n); } coord = geom.CoordInt(); - baseBoxAI = BoxLib::SerializeBox(geom.Domain()); + baseBoxAI = amrex::SerializeBox(geom.Domain()); } // ---- do the broadcasts if( ! bcastSource) { - baseBoxAI.resize(BoxLib::SerializeBoxSize()); + baseBoxAI.resize(amrex::SerializeBoxSize()); } ParallelDescriptor::Bcast(baseBoxAI.dataPtr(), baseBoxAI.size(), fromProc, comm); @@ -408,7 +408,7 @@ Geometry::BroadcastGeometry (Geometry &geom, int fromProc, MPI_Comm comm, bool b if( ! bcastSource) { // ---- define the destination geometry - Box baseBox(BoxLib::UnSerializeBox(baseBoxAI)); + Box baseBox(amrex::UnSerializeBox(baseBoxAI)); RealBox realBox(realBox_lo, realBox_hi); geom.define(baseBox, &realBox, coord, is_periodic); diff --git a/Src/Base/AMReX_IArrayBox.cpp b/Src/Base/AMReX_IArrayBox.cpp index e0959a4d668..ae1733016fb 100644 --- a/Src/Base/AMReX_IArrayBox.cpp +++ b/Src/Base/AMReX_IArrayBox.cpp @@ -78,7 +78,7 @@ IArrayBox::Initialize () { if (initialized) return; // ParmParse pp("iab"); - BoxLib::ExecOnFinalize(IArrayBox::Finalize); + amrex::ExecOnFinalize(IArrayBox::Finalize); initialized = true; } diff --git a/Src/Base/AMReX_IndexType.cpp b/Src/Base/AMReX_IndexType.cpp index 1c4cf77f110..598be4dd518 100644 --- a/Src/Base/AMReX_IndexType.cpp +++ b/Src/Base/AMReX_IndexType.cpp @@ -39,7 +39,7 @@ operator<< (std::ostream& os, << ',' << (it.test(2)?'N':'C')) << ')' << std::flush; if (os.fail()) - BoxLib::Error("operator<<(ostream&,IndexType&) failed"); + amrex::Error("operator<<(ostream&,IndexType&) failed"); return os; } @@ -65,7 +65,7 @@ operator>> (std::istream& is, BL_ASSERT(t2 == 'C' || t2 == 'N'); t2=='N'?it.set(2):it.unset(2)); if (is.fail()) - BoxLib::Error("operator>>(ostream&,IndexType&) failed"); + amrex::Error("operator>>(ostream&,IndexType&) failed"); return is; } diff --git a/Src/Base/AMReX_IntVect.cpp b/Src/Base/AMReX_IntVect.cpp index 2e9887efd2f..e34166fee3a 100644 --- a/Src/Base/AMReX_IntVect.cpp +++ b/Src/Base/AMReX_IntVect.cpp @@ -116,7 +116,7 @@ IntVect::lexGT (const IntVect& s) const } IntVect -BoxLib::min (const IntVect& p1, +amrex::min (const IntVect& p1, const IntVect& p2) { IntVect p(p1); @@ -125,7 +125,7 @@ BoxLib::min (const IntVect& p1, } IntVect -BoxLib::max (const IntVect& p1, +amrex::max (const IntVect& p1, const IntVect& p2) { IntVect p(p1); @@ -134,7 +134,7 @@ BoxLib::max (const IntVect& p1, } IntVect -BoxLib::BASISV (int dir) +amrex::BASISV (int dir) { BL_ASSERT(dir >= 0 && dir < BL_SPACEDIM); IntVect tmp; @@ -143,13 +143,13 @@ BoxLib::BASISV (int dir) } IntVect -BoxLib::scale (const IntVect& p, int s) +amrex::scale (const IntVect& p, int s) { return IntVect(D_DECL(s * p[0], s * p[1], s * p[2])); } IntVect -BoxLib::reflect (const IntVect& a, +amrex::reflect (const IntVect& a, int ref_ix, int idir) { @@ -160,13 +160,13 @@ BoxLib::reflect (const IntVect& a, } IntVect -BoxLib::diagShift (const IntVect& p, int s) +amrex::diagShift (const IntVect& p, int s) { return IntVect(D_DECL(p[0] + s, p[1] + s, p[2] + s)); } IntVect -BoxLib::coarsen (const IntVect& p, +amrex::coarsen (const IntVect& p, int s) { BL_ASSERT(s > 0); @@ -176,7 +176,7 @@ BoxLib::coarsen (const IntVect& p, } IntVect -BoxLib::coarsen (const IntVect& p1, +amrex::coarsen (const IntVect& p1, const IntVect& p2) { IntVect v = p1; @@ -216,7 +216,7 @@ operator<< (std::ostream& os, ',' << p[1] , << ',' << p[2]) << ')'; if (os.fail()) - BoxLib::Error("operator<<(ostream&,IntVect&) failed"); + amrex::Error("operator<<(ostream&,IntVect&) failed"); return os; } @@ -243,11 +243,11 @@ operator>> (std::istream& is, } else { - BoxLib::Error("operator>>(istream&,IntVect&): expected \'(\'"); + amrex::Error("operator>>(istream&,IntVect&): expected \'(\'"); } if (is.fail()) - BoxLib::Error("operator>>(istream&,IntVect&) failed"); + amrex::Error("operator>>(istream&,IntVect&) failed"); return is; } diff --git a/Src/Base/AMReX_MemProfiler.cpp b/Src/Base/AMReX_MemProfiler.cpp index 59acd8b264d..80e0df890c7 100644 --- a/Src/Base/AMReX_MemProfiler.cpp +++ b/Src/Base/AMReX_MemProfiler.cpp @@ -23,7 +23,7 @@ MemProfiler::add (const std::string& name, std::function&& f) auto it = std::find(mprofiler.the_names.begin(), mprofiler.the_names.end(), name); if (it != mprofiler.the_names.end()) { std::string s = "MemProfiler::add (MemInfo) failed because " + name + " already existed"; - BoxLib::Abort(s.c_str()); + amrex::Abort(s.c_str()); } mprofiler.the_names.push_back(name); mprofiler.the_funcs.push_back(std::forward >(f)); @@ -36,7 +36,7 @@ MemProfiler::add (const std::string& name, std::function&& f) auto it = std::find(mprofiler.the_names_builds.begin(), mprofiler.the_names_builds.end(), name); if (it != mprofiler.the_names_builds.end()) { std::string s = "MemProfiler::add (NBuildsInfo) failed because " + name + " already existed"; - BoxLib::Abort(s.c_str()); + amrex::Abort(s.c_str()); } mprofiler.the_names_builds.push_back(name); mprofiler.the_funcs_builds.push_back(std::forward >(f)); diff --git a/Src/Base/AMReX_MultiFab.cpp b/Src/Base/AMReX_MultiFab.cpp index ed7b47c31bc..df3f2840a5a 100644 --- a/Src/Base/AMReX_MultiFab.cpp +++ b/Src/Base/AMReX_MultiFab.cpp @@ -348,7 +348,7 @@ MultiFab::Initialize () if (initialized) return; initialized = true; - BoxLib::ExecOnFinalize(MultiFab::Finalize); + amrex::ExecOnFinalize(MultiFab::Finalize); #ifdef BL_MEM_PROFILING MemProfiler::add("MultiFab", std::function @@ -667,7 +667,7 @@ MultiFab::minIndex (int comp, for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - const Box& box = BoxLib::grow(mfi.validbox(),nghost); + const Box& box = amrex::grow(mfi.validbox(),nghost); const Real lmn = get(mfi).min(box,comp); if (lmn < priv_mn) @@ -752,7 +752,7 @@ MultiFab::maxIndex (int comp, for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - const Box& box = BoxLib::grow(mfi.validbox(),nghost); + const Box& box = amrex::grow(mfi.validbox(),nghost); const Real lmx = get(mfi).max(box,comp); if (lmx > priv_mx) @@ -830,7 +830,7 @@ MultiFab::norm0 (int comp, const BoxArray& ba, int nghost, bool local) const for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - ba.intersections(BoxLib::grow(mfi.validbox(),nghost),isects); + ba.intersections(amrex::grow(mfi.validbox(),nghost),isects); for (int i = 0, N = isects.size(); i < N; i++) { @@ -1288,7 +1288,7 @@ MultiFab::negate (const Box& region, } void -BoxLib::InterpAddBox (MultiFabCopyDescriptor& fabCopyDesc, +amrex::InterpAddBox (MultiFabCopyDescriptor& fabCopyDesc, BoxList* returnUnfilledBoxes, Array& returnedFillBoxIds, const Box& subbox, @@ -1350,7 +1350,7 @@ BoxLib::InterpAddBox (MultiFabCopyDescriptor& fabCopyDesc, } void -BoxLib::InterpFillFab (MultiFabCopyDescriptor& fabCopyDesc, +amrex::InterpFillFab (MultiFabCopyDescriptor& fabCopyDesc, const Array& fillBoxIds, MultiFabId faid1, MultiFabId faid2, diff --git a/Src/Base/AMReX_MultiFabUtil.cpp b/Src/Base/AMReX_MultiFabUtil.cpp index c9a103ea574..5fc511b2c2d 100644 --- a/Src/Base/AMReX_MultiFabUtil.cpp +++ b/Src/Base/AMReX_MultiFabUtil.cpp @@ -140,11 +140,11 @@ namespace BoxLib if (S_fine.is_nodal() || S_crse.is_nodal()) { - BoxLib::Error("Can't use BoxLib::average_down for nodal MultiFab!"); + amrex::Error("Can't use amrex::average_down for nodal MultiFab!"); } #if (BL_SPACEDIM == 3) - BoxLib::average_down(S_fine, S_crse, scomp, ncomp, ratio); + amrex::average_down(S_fine, S_crse, scomp, ncomp, ratio); return; #else @@ -263,7 +263,7 @@ namespace BoxLib void fill_boundary(MultiFab& mf, const Geometry& geom, bool cross) { - BoxLib::fill_boundary(mf, 0, mf.nComp(), geom, cross); + amrex::fill_boundary(mf, 0, mf.nComp(), geom, cross); } // ************************************************************************************************************* diff --git a/Src/Base/AMReX_NFiles.H b/Src/Base/AMReX_NFiles.H index 28b6ae31a23..2cc4267a961 100644 --- a/Src/Base/AMReX_NFiles.H +++ b/Src/Base/AMReX_NFiles.H @@ -104,7 +104,7 @@ class NFilesIter int whichProc, bool groupSets) { BL_ASSERT(whichProc >= 0 && whichProc < ParallelDescriptor::NProcs()); - return ( BoxLib::Concatenate(filePrefix, + return ( amrex::Concatenate(filePrefix, FileNumber(ActualNFiles(nOutFiles), whichProc, groupSets), minDigits ) ); } @@ -112,7 +112,7 @@ class NFilesIter static std::string FileName(int fileNumber, const std::string &filePrefix) { - return ( BoxLib::Concatenate(filePrefix, fileNumber, minDigits ) ); + return ( amrex::Concatenate(filePrefix, fileNumber, minDigits ) ); } // ---- this is the processor coordinating dynamic set selection diff --git a/Src/Base/AMReX_NFiles.cpp b/Src/Base/AMReX_NFiles.cpp index 6b105322211..eac528a86f4 100644 --- a/Src/Base/AMReX_NFiles.cpp +++ b/Src/Base/AMReX_NFiles.cpp @@ -125,7 +125,7 @@ NFilesIter::NFilesIter(const std::string &filename, for(int i(0); i < readRanks.size(); ++i) { if(myProc == readRanks[i]) { if(myReadIndex != indexUndefined) { - BoxLib::Abort("**** Error in NFilesIter: readRanks not unique."); + amrex::Abort("**** Error in NFilesIter: readRanks not unique."); } myReadIndex = i; } @@ -171,7 +171,7 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { std::ios::out | std::ios::app | std::ios::binary); } if( ! fileStream.good()) { - BoxLib::FileOpenFailed(fullFileName); + amrex::FileOpenFailed(fullFileName); } return true; } @@ -193,7 +193,7 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { if(mySetPosition == 0) { // ---- return true, ready to write data - fullFileName = BoxLib::Concatenate(filePrefix, fileNumber, minDigits); + fullFileName = amrex::Concatenate(filePrefix, fileNumber, minDigits); if(appendFirst) { fileStream.open(fullFileName.c_str(), std::ios::out | std::ios::app | std::ios::binary); @@ -202,7 +202,7 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { std::ios::out | std::ios::trunc | std::ios::binary); } if( ! fileStream.good()) { - BoxLib::FileOpenFailed(fullFileName); + amrex::FileOpenFailed(fullFileName); } return true; @@ -226,12 +226,12 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { ParallelDescriptor::Message rmess = ParallelDescriptor::Recv(&fileNumber, 1, MPI_ANY_SOURCE, writeTag); coordinatorProc = rmess.pid(); - fullFileName = BoxLib::Concatenate(filePrefix, fileNumber, minDigits); + fullFileName = amrex::Concatenate(filePrefix, fileNumber, minDigits); fileStream.open(fullFileName.c_str(), std::ios::out | std::ios::app | std::ios::binary); if( ! fileStream.good()) { - BoxLib::FileOpenFailed(fullFileName); + amrex::FileOpenFailed(fullFileName); } return true; @@ -247,7 +247,7 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { fileStream.open(fullFileName.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); if( ! fileStream.good()) { - BoxLib::FileOpenFailed(fullFileName); + amrex::FileOpenFailed(fullFileName); } return true; #endif @@ -269,7 +269,7 @@ bool NFilesIter::ReadyToRead() { fileStream.open(fullFileName.c_str(), std::ios::in | std::ios::binary); if( ! fileStream.good()) { - BoxLib::FileOpenFailed(fullFileName); + amrex::FileOpenFailed(fullFileName); } return true; } diff --git a/Src/Base/AMReX_Orientation.cpp b/Src/Base/AMReX_Orientation.cpp index 5ad18323e5d..98555dbf16b 100644 --- a/Src/Base/AMReX_Orientation.cpp +++ b/Src/Base/AMReX_Orientation.cpp @@ -10,7 +10,7 @@ operator<< (std::ostream& os, { os << '('<< int(o) << ')' ; if (os.fail()) - BoxLib::Error("operator<<(ostream&,Orientation&) failed"); + amrex::Error("operator<<(ostream&,Orientation&) failed"); return os; } @@ -33,11 +33,11 @@ operator>> (std::istream& is, } else { - BoxLib::Error("operator>>(istream&,Orientation&): expected \'(\'"); + amrex::Error("operator>>(istream&,Orientation&): expected \'(\'"); } if (is.fail()) - BoxLib::Error("operator>>(ostream&,Orientation&) failed"); + amrex::Error("operator>>(ostream&,Orientation&) failed"); return is; } diff --git a/Src/Base/AMReX_ParallelDescriptor.H b/Src/Base/AMReX_ParallelDescriptor.H index 22a70506f22..9081cd9b400 100644 --- a/Src/Base/AMReX_ParallelDescriptor.H +++ b/Src/Base/AMReX_ParallelDescriptor.H @@ -546,7 +546,7 @@ namespace ParallelDescriptor { os << color.c; if (os.fail()) - BoxLib::Error("operator<<(ostream&,Const Color&) failed"); + amrex::Error("operator<<(ostream&,Const Color&) failed"); return os; } diff --git a/Src/Base/AMReX_ParallelDescriptor.cpp b/Src/Base/AMReX_ParallelDescriptor.cpp index e27c2ca76d8..5c7df1cbf14 100644 --- a/Src/Base/AMReX_ParallelDescriptor.cpp +++ b/Src/Base/AMReX_ParallelDescriptor.cpp @@ -81,7 +81,7 @@ namespace ParallelDescriptor MPI_Group m_group_comp = MPI_GROUP_NULL; Array m_group_sidecar; #else - // Set these for non-mpi codes that do not call BoxLib::Initialize(...) + // Set these for non-mpi codes that do not call amrex::Initialize(...) int m_MyId_all = 0; int m_MyId_comp = 0; int m_MyId_sub = 0; @@ -192,7 +192,7 @@ namespace ParallelDescriptor void MPI_Error (const char* file, int line, const char* str, int rc) { - BoxLib::Error(the_message_string(file, line, str, rc)); + amrex::Error(the_message_string(file, line, str, rc)); } } @@ -246,22 +246,22 @@ ParallelDescriptor::Message::test () int ParallelDescriptor::Message::tag () const { - if ( !m_finished ) BoxLib::Error("Message::tag: Not Finished!"); + if ( !m_finished ) amrex::Error("Message::tag: Not Finished!"); return m_stat.MPI_TAG; } int ParallelDescriptor::Message::pid () const { - if ( !m_finished ) BoxLib::Error("Message::pid: Not Finished!"); + if ( !m_finished ) amrex::Error("Message::pid: Not Finished!"); return m_stat.MPI_SOURCE; } size_t ParallelDescriptor::Message::count () const { - if ( m_type == MPI_DATATYPE_NULL ) BoxLib::Error("Message::count: Bad Type!"); - if ( !m_finished ) BoxLib::Error("Message::count: Not Finished!"); + if ( m_type == MPI_DATATYPE_NULL ) amrex::Error("Message::count: Bad Type!"); + if ( !m_finished ) amrex::Error("Message::count: Not Finished!"); int cnt; BL_MPI_REQUIRE( MPI_Get_count(&m_stat, m_type, &cnt) ); return cnt; @@ -302,7 +302,7 @@ ParallelDescriptor::StartParallel (int* argc, #ifdef BL_USE_MPI3 int mpi_version, mpi_subversion; BL_MPI_REQUIRE( MPI_Get_version(&mpi_version, &mpi_subversion) ); - if (mpi_version < 3) BoxLib::Abort("MPI 3 is needed because USE_MPI3=TRUE"); + if (mpi_version < 3) amrex::Abort("MPI 3 is needed because USE_MPI3=TRUE"); #endif SetNProcsSidecars(0); // ---- users resize these later @@ -352,7 +352,7 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, // ---- check validity of the rank arrays and set inComp if(compRanksInAll[0] != 0) { // ---- we require this for now - BoxLib::Abort("**** Error in SetNProcsSidecars: compRanksInAll[0] != 0"); + amrex::Abort("**** Error in SetNProcsSidecars: compRanksInAll[0] != 0"); } std::set rankSet; for(int i(0); i < compRanksInAll.size(); ++i) { @@ -374,13 +374,13 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, if(rankSet.size() != m_nProcs_all) { std::cerr << "**** rankSet.size() != m_nProcs_all: " << rankSet.size() << " != " << m_nProcs_all << std::endl; - BoxLib::Abort("**** Error in SetNProcsSidecars: rankSet.size() != m_nProcs_all."); + amrex::Abort("**** Error in SetNProcsSidecars: rankSet.size() != m_nProcs_all."); } int rankCheck(0); std::set::const_iterator cit; for(cit = rankSet.begin(); cit != rankSet.end(); ++cit) { if(*cit != rankCheck) { - BoxLib::Abort("**** Error in SetNProcsSidecars: rankSet is not correct."); + amrex::Abort("**** Error in SetNProcsSidecars: rankSet is not correct."); } ++rankCheck; } @@ -427,7 +427,7 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, } } if(ocrSet.size() > 0 && criaSet.size() > 0) { // ---- this is currently not allowed - BoxLib::Abort("**** Error in SetNProcsSidecars: adding and removing ranks from comp not supported."); + amrex::Abort("**** Error in SetNProcsSidecars: adding and removing ranks from comp not supported."); } } @@ -541,7 +541,7 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, if(inComp) { // ---- in the computation group if(inWhichSidecar >= 0) { - BoxLib::Abort("**** Error 0: bad inWhichSidecar in SetNProcsSidecars()"); + amrex::Abort("**** Error 0: bad inWhichSidecar in SetNProcsSidecars()"); } BL_MPI_REQUIRE( MPI_Group_rank(m_group_comp, &m_MyId_comp) ); BL_MPI_REQUIRE( MPI_Intercomm_create(m_comm_comp, 0, m_comm_all, sidecarRanksInAll[i][0], @@ -549,7 +549,7 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, m_MyId_sidecar = myId_notInGroup; } else { // ---- in a sidecar group if(inWhichSidecar < 0) { - BoxLib::Abort("**** Error 1: bad inWhichSidecar in SetNProcsSidecars()"); + amrex::Abort("**** Error 1: bad inWhichSidecar in SetNProcsSidecars()"); } if(inWhichSidecar == i) { BL_MPI_REQUIRE( MPI_Group_rank(m_group_sidecar[i], &m_MyId_sidecar) ); @@ -582,7 +582,7 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, if(m_nCommColors > 1) { m_nProcs_sub = m_nProcs_comp / m_nCommColors; if (m_nProcs_sub * m_nCommColors != m_nProcs_comp) { - BoxLib::Abort("# of processors is not divisible by boxlib.ncolors"); + amrex::Abort("# of processors is not divisible by boxlib.ncolors"); } m_MyCommSubColor = Color(MyProc()/m_nProcs_sub); m_MyCommCompColor = Color(m_nCommColors); // special color for CommComp color @@ -605,27 +605,27 @@ ParallelDescriptor::SetNProcsSidecars (const Array &compRanksInAll, { std::cerr << "m_MyId_all m_MyId_comp m_MyId_sidecar = " << m_MyId_all << " " << m_MyId_comp << " " << m_MyId_sidecar << std::endl; - BoxLib::Abort("**** Error 2: bad MyId in ParallelDescriptor::SetNProcsSidecars()"); + amrex::Abort("**** Error 2: bad MyId in ParallelDescriptor::SetNProcsSidecars()"); } if(m_nProcs_all == nProcs_undefined || m_nProcs_comp == nProcs_undefined) { std::cerr << "m_nProcs_all m_nProcs_comp = " << m_nProcs_all << " " << m_nProcs_comp << std::endl; - BoxLib::Abort("**** Error 3: bad nProcs in ParallelDescriptor::SetNProcsSidecars()"); + amrex::Abort("**** Error 3: bad nProcs in ParallelDescriptor::SetNProcsSidecars()"); } int nSCSum(0); for(int i(0); i < sidecarRanksInAll.size(); ++i) { nSCSum += sidecarRanksInAll[i].size(); if(m_nProcs_sidecar[i] == nProcs_undefined) { std::cerr << "m_nProcs_sidecar[" << i << "] = " << m_nProcs_sidecar[i] << std::endl; - BoxLib::Abort("**** Error 4: bad m_nProcs_sidecar in ParallelDescriptor::SetNProcsSidecars()"); + amrex::Abort("**** Error 4: bad m_nProcs_sidecar in ParallelDescriptor::SetNProcsSidecars()"); } } if(m_nProcs_comp + nSCSum != m_nProcs_all) { std::cerr << "m_nProcs_all m_nProcs_comp + nSCSum = " << m_nProcs_all << " " << m_nProcs_comp + nSCSum << std::endl; - BoxLib::Abort("**** Error 5: bad nProcs in ParallelDescriptor::SetNProcsSidecars()"); + amrex::Abort("**** Error 5: bad nProcs in ParallelDescriptor::SetNProcsSidecars()"); } #ifdef BL_USE_FORTRAN_MPI @@ -702,18 +702,18 @@ ParallelDescriptor::StartSubCommunicator () #if defined(BL_USE_MPI3) || defined(BL_USE_UPCXX) // m_nCommColors = 1; - BoxLib::Abort("boxlib.ncolors > 1 not supported for MPI3 and UPCXX"); + amrex::Abort("boxlib.ncolors > 1 not supported for MPI3 and UPCXX"); if (doTeamReduce()) - BoxLib::Abort("boxlib.ncolors > 1 not supported with team.reduce on"); + amrex::Abort("boxlib.ncolors > 1 not supported with team.reduce on"); #endif #ifdef BL_LAZY - BoxLib::Abort("boxlib.ncolors > 1 not supported for LAZY=TRUE"); + amrex::Abort("boxlib.ncolors > 1 not supported for LAZY=TRUE"); #endif m_nProcs_sub = m_nProcs_comp / m_nCommColors; if (m_nProcs_sub * m_nCommColors != m_nProcs_comp) { - BoxLib::Abort("# of processors is not divisible by boxlib.ncolors"); + amrex::Abort("# of processors is not divisible by boxlib.ncolors"); } m_MyCommSubColor = Color(MyProc()/m_nProcs_sub); m_MyCommCompColor = Color(m_nCommColors); // special color for CommComp color @@ -2035,7 +2035,7 @@ void ParallelDescriptor::Bcast(void *, int, MPI_Datatype, int, MPI_Comm) {} double ParallelDescriptor::second () { - return BoxLib::wsecond(); + return amrex::wsecond(); } void @@ -2078,7 +2078,7 @@ ParallelDescriptor::SeqNum (int getsetinc, int newvalue) break; default: // ---- error { - BoxLib::Abort("**** Error in ParallelDescriptor::SeqNum: bad getsetinc."); + amrex::Abort("**** Error in ParallelDescriptor::SeqNum: bad getsetinc."); result = -1; } } @@ -2117,7 +2117,7 @@ ParallelDescriptor::SubSeqNum (int getsetinc, int newvalue) break; default: // ---- error { - BoxLib::Abort("**** Error in ParallelDescriptor::SeqNum: bad getsetinc."); + amrex::Abort("**** Error in ParallelDescriptor::SeqNum: bad getsetinc."); result = -1; } } @@ -2311,7 +2311,7 @@ ParallelDescriptor::ReadAndBcastFile (const std::string& filename, iss.open(filename.c_str(), std::ios::in); if ( ! iss.good()) { if(bExitOnError) { - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); } else { fileLength = -1; } @@ -2358,7 +2358,7 @@ ParallelDescriptor::StartTeams () int rank = ParallelDescriptor::MyProc(); if (nprocs % team_size != 0) - BoxLib::Abort("Number of processes not divisible by team size"); + amrex::Abort("Number of processes not divisible by team size"); m_Team.m_numTeams = nprocs / team_size; m_Team.m_size = team_size; diff --git a/Src/Base/AMReX_ParmParse.cpp b/Src/Base/AMReX_ParmParse.cpp index b1a7a06c950..6e7d8ad1fbc 100644 --- a/Src/Base/AMReX_ParmParse.cpp +++ b/Src/Base/AMReX_ParmParse.cpp @@ -111,7 +111,7 @@ operator<< (std::ostream& os, const ParmParse::PP_entry& pp) if ( !os ) { - BoxLib::Error("write on ostream failed"); + amrex::Error("write on ostream failed"); } return os; } @@ -239,7 +239,7 @@ getToken (const char*& str, std::cerr << "STATE = " << state_name[state] \ << ", next char = " << ch << '\n'; \ std::cerr << ", rest of input = \n" << str << '\n'; \ - BoxLib::Abort() + amrex::Abort() // // Eat white space and comments. // @@ -261,7 +261,7 @@ getToken (const char*& str, char ch = *str; if ( ch == 0 ) { - BoxLib::Error("ParmParse::getToken: EOF while parsing"); + amrex::Error("ParmParse::getToken: EOF while parsing"); } switch (state) { @@ -480,7 +480,7 @@ addDefn (std::string& def, if ( val.empty() ) { std::cerr << "ParmParse::addDefn(): no values for definition " << def << "\n"; - BoxLib::Abort(); + amrex::Abort(); } // // Check if this defn is a file include directive. @@ -517,7 +517,7 @@ addTable (std::string& def, if ( val.empty() ) { std::cerr << "ParmParse::addTable(): no values for Table " << def << "\n"; - BoxLib::Abort(); + amrex::Abort(); } tab.push_back(ParmParse::PP_entry(def, val)); val.clear(); @@ -544,7 +544,7 @@ bldTable (const char*& str, case pCloseBracket: if ( !cur_name.empty() && cur_list.empty() ) { - BoxLib::Abort("ParmParse::bldTable() defn with no list"); + amrex::Abort("ParmParse::bldTable() defn with no list"); } case pEOF: addDefn(cur_name,cur_list,tab); @@ -552,7 +552,7 @@ bldTable (const char*& str, case pOpenBracket: if ( cur_name.empty() ) { - BoxLib::Abort("ParmParse::bldTabe() '{' with no blocknamne"); + amrex::Abort("ParmParse::bldTabe() '{' with no blocknamne"); } if ( !cur_list.empty() ) { @@ -567,7 +567,7 @@ bldTable (const char*& str, case pEQ_sign: if ( cur_name.empty() ) { - BoxLib::Abort("ParmParse::bldTable() EQ with no current defn"); + amrex::Abort("ParmParse::bldTable() EQ with no current defn"); } if ( !cur_list.empty() ) { @@ -594,7 +594,7 @@ bldTable (const char*& str, { std::string msg("ParmParse::bldTable(): value with no defn: "); msg += tokname; - BoxLib::Abort(msg.c_str()); + amrex::Abort(msg.c_str()); } cur_list.push_back(tokname); break; @@ -636,7 +636,7 @@ squeryval (const ParmParse::Table& table, std::cerr << " occurence " << occurence << " of "; } std::cerr << def->m_name << '\n' << *def << '\n'; - BoxLib::Abort(); + amrex::Abort(); } const std::string& valname = def->m_vals[ival]; @@ -660,7 +660,7 @@ squeryval (const ParmParse::Table& table, << "\" type which can't be parsed from the string \"" << valname << "\"\n" << *def << '\n'; - BoxLib::Abort(); + amrex::Abort(); } return true; } @@ -688,7 +688,7 @@ sgetval (const ParmParse::Table& table, << " not found in table" << '\n'; ParmParse::dumpTable(std::cerr); - BoxLib::Abort(); + amrex::Abort(); } } @@ -737,7 +737,7 @@ squeryarr (const ParmParse::Table& table, std::cerr << " occurence " << occurence << " of "; } std::cerr << def->m_name << '\n' << *def << '\n'; - BoxLib::Abort(); + amrex::Abort(); } for ( int n = start_ix; n <= stop_ix; n++ ) { @@ -761,7 +761,7 @@ squeryarr (const ParmParse::Table& table, << "\" type which can't be parsed from the string \"" << valname << "\"\n" << *def << '\n'; - BoxLib::Abort(); + amrex::Abort(); } } return true; @@ -788,7 +788,7 @@ sgetarr (const ParmParse::Table& table, << " not found in table" << '\n'; ParmParse::dumpTable(std::cerr); - BoxLib::Abort(); + amrex::Abort(); } } @@ -864,7 +864,7 @@ ParmParse::prefixedName (const std::string& str) const { if ( str.empty() ) { - BoxLib::Error("ParmParse::prefixedName: has empty name"); + amrex::Error("ParmParse::prefixedName: has empty name"); } if ( !m_pstack.top().empty()) { @@ -892,7 +892,7 @@ ParmParse::popPrefix () { if ( m_pstack.size() <= 1 ) { - BoxLib::Error("ParmParse::popPrefix: stack underflow"); + amrex::Error("ParmParse::popPrefix: stack underflow"); } m_pstack.pop(); } @@ -1018,11 +1018,11 @@ ParmParse::Initialize (int argc, { if ( initialized ) { - BoxLib::Error("ParmParse::Initialize(): already initialized!"); + amrex::Error("ParmParse::Initialize(): already initialized!"); } ppinit(argc, argv, parfile, g_table); - BoxLib::ExecOnFinalize(ParmParse::Finalize); + amrex::ExecOnFinalize(ParmParse::Finalize); } void @@ -1794,7 +1794,7 @@ ParmParse::getRecord (const std::string& name, int n) const if ( pe == 0 ) { std::cerr << "ParmParse::getRecord: record " << name << " not found" << std::endl; - BoxLib::Abort(); + amrex::Abort(); } return Record(ParmParse(*pe->m_table)); } @@ -1878,7 +1878,7 @@ require_valid_parmparse(const std::string& str, int pp) if ( it == parsers.end() ) { std::cerr << "In routine: " << str << ": "; - BoxLib::Error("require_valid_parser::not a valid parsers"); + amrex::Error("require_valid_parser::not a valid parsers"); } } @@ -1888,7 +1888,7 @@ require_valid_size(const std::string& str, int asize, int nsize) if (asize > nsize) { std::cerr << "In routine: " << str << ": "; - BoxLib::Error("require_valid_size::not large enough input array"); + amrex::Error("require_valid_size::not large enough input array"); } } } diff --git a/Src/Base/AMReX_PhysBCFunct.cpp b/Src/Base/AMReX_PhysBCFunct.cpp index 0106ceceb23..cfdfc8908f6 100644 --- a/Src/Base/AMReX_PhysBCFunct.cpp +++ b/Src/Base/AMReX_PhysBCFunct.cpp @@ -72,7 +72,7 @@ PhysBCFunct::FillBoundary (MultiFab& mf, int, int, Real time) const RealBox& prob_domain = m_geom.ProbDomain(); const Real* problo = prob_domain.lo(); - Box gdomain = BoxLib::convert(domain, mf.boxArray().ixType()); + Box gdomain = amrex::convert(domain, mf.boxArray().ixType()); for (int i = 0; i < BL_SPACEDIM; ++i) { if (m_geom.isPeriodic(i)) { gdomain.grow(i, mf.nGrow()); diff --git a/Src/Base/AMReX_PlotFileUtil.cpp b/Src/Base/AMReX_PlotFileUtil.cpp index 30e6a860c34..c2e083cccc2 100644 --- a/Src/Base/AMReX_PlotFileUtil.cpp +++ b/Src/Base/AMReX_PlotFileUtil.cpp @@ -5,19 +5,19 @@ #include #include -std::string BoxLib::LevelPath (int level, const std::string &levelPrefix) +std::string amrex::LevelPath (int level, const std::string &levelPrefix) { - return BoxLib::Concatenate(levelPrefix, level, 1); // e.g., Level_5 + return amrex::Concatenate(levelPrefix, level, 1); // e.g., Level_5 } -std::string BoxLib::MultiFabHeaderPath (int level, +std::string amrex::MultiFabHeaderPath (int level, const std::string &levelPrefix, const std::string &mfPrefix) { - return BoxLib::LevelPath(level, levelPrefix) + '/' + mfPrefix; // e.g., Level_4/Cell + return amrex::LevelPath(level, levelPrefix) + '/' + mfPrefix; // e.g., Level_4/Cell } -std::string BoxLib::LevelFullPath (int level, +std::string amrex::LevelFullPath (int level, const std::string &plotfilename, const std::string &levelPrefix) { @@ -25,11 +25,11 @@ std::string BoxLib::LevelFullPath (int level, if ( ! r.empty() && r.back() != '/') { r += '/'; } - r += BoxLib::LevelPath(level, levelPrefix); // e.g., plt00005/Level_5 + r += amrex::LevelPath(level, levelPrefix); // e.g., plt00005/Level_5 return r; } -std::string BoxLib::MultiFabFileFullPrefix (int level, +std::string amrex::MultiFabFileFullPrefix (int level, const std::string& plotfilename, const std::string &levelPrefix, const std::string &mfPrefix) @@ -44,14 +44,14 @@ std::string BoxLib::MultiFabFileFullPrefix (int level, void -BoxLib::PreBuildDirectorHierarchy (const std::string &dirName, +amrex::PreBuildDirectorHierarchy (const std::string &dirName, const std::string &subDirPrefix, int nSubDirs, bool callBarrier) { - BoxLib::UtilCreateCleanDirectory(dirName, false); // ---- dont call barrier + amrex::UtilCreateCleanDirectory(dirName, false); // ---- dont call barrier for(int i(0); i < nSubDirs; ++i) { const std::string &fullpath = LevelFullPath(i, dirName); - BoxLib::UtilCreateCleanDirectory(fullpath, false); // ---- dont call barrier + amrex::UtilCreateCleanDirectory(fullpath, false); // ---- dont call barrier } if(callBarrier) { @@ -61,7 +61,7 @@ BoxLib::PreBuildDirectorHierarchy (const std::string &dirName, void -BoxLib::WriteGenericPlotfileHeader (std::ostream &HeaderFile, +amrex::WriteGenericPlotfileHeader (std::ostream &HeaderFile, int nlevels, const Array &bArray, const Array &varnames, @@ -146,7 +146,7 @@ BoxLib::WriteGenericPlotfileHeader (std::ostream &HeaderFile, void -BoxLib::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, +amrex::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, const Array& mf, const Array& varnames, const Array& geom, Real time, const Array& level_steps, @@ -173,7 +173,7 @@ BoxLib::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, const std::string mfPrefix("Cell"); bool callBarrier(true); - BoxLib::PreBuildDirectorHierarchy(plotfilename, levelPrefix, nlevels, callBarrier); + amrex::PreBuildDirectorHierarchy(plotfilename, levelPrefix, nlevels, callBarrier); if (ParallelDescriptor::IOProcessor()) { std::string HeaderFileName(plotfilename + "/Header"); @@ -181,7 +181,7 @@ BoxLib::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, std::ofstream::trunc | std::ofstream::binary); if( ! HeaderFile.good()) { - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); } Array boxArrays(nlevels); @@ -189,7 +189,7 @@ BoxLib::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, boxArrays[level] = mf[level]->boxArray(); } - BoxLib::WriteGenericPlotfileHeader(HeaderFile, nlevels, boxArrays, varnames, + amrex::WriteGenericPlotfileHeader(HeaderFile, nlevels, boxArrays, varnames, geom, time, level_steps, ref_ratio); } @@ -203,7 +203,7 @@ BoxLib::WriteMultiLevelPlotfile (const std::string& plotfilename, int nlevels, } void -BoxLib::WriteSingleLevelPlotfile (const std::string& plotfilename, +amrex::WriteSingleLevelPlotfile (const std::string& plotfilename, const MultiFab& mf, const Array& varnames, const Geometry& geom, Real time, int level_step) { @@ -212,7 +212,7 @@ BoxLib::WriteSingleLevelPlotfile (const std::string& plotfilename, Array level_steps(1,level_step); Array ref_ratio; - BoxLib::WriteMultiLevelPlotfile(plotfilename, 1, mfarr, varnames, geomarr, time, + amrex::WriteMultiLevelPlotfile(plotfilename, 1, mfarr, varnames, geomarr, time, level_steps, ref_ratio); } diff --git a/Src/Base/AMReX_RealBox.cpp b/Src/Base/AMReX_RealBox.cpp index b0c03fe20b8..f1895b9591b 100644 --- a/Src/Base/AMReX_RealBox.cpp +++ b/Src/Base/AMReX_RealBox.cpp @@ -96,7 +96,7 @@ operator >> (std::istream &is, RealBox& b) if (s != "RealBox") { std::cerr << "unexpected token in RealBox: " << s << '\n'; - BoxLib::Abort(); + amrex::Abort(); } Real lo[BL_SPACEDIM]; diff --git a/Src/Base/AMReX_TinyProfiler.cpp b/Src/Base/AMReX_TinyProfiler.cpp index 26417c30a58..b28252764d9 100644 --- a/Src/Base/AMReX_TinyProfiler.cpp +++ b/Src/Base/AMReX_TinyProfiler.cpp @@ -132,7 +132,7 @@ TinyProfiler::Finalize () local_imp.push_back(*it); } - BoxLib::SyncStrings(local_imp, sync_imp, synced); + amrex::SyncStrings(local_imp, sync_imp, synced); if (ParallelDescriptor::IOProcessor()) { std::cout << "\nWARNING: TinyProfilers not properly nested!!!\n"; @@ -156,7 +156,7 @@ TinyProfiler::Finalize () localStrings.push_back(it->first); } - BoxLib::SyncStrings(localStrings, syncedStrings, alreadySynced); + amrex::SyncStrings(localStrings, syncedStrings, alreadySynced); if( ! alreadySynced) { // add the new name for(int i(0); i < syncedStrings.size(); ++i) { diff --git a/Src/Base/AMReX_Utility.H b/Src/Base/AMReX_Utility.H index d555a092118..6a528568a44 100644 --- a/Src/Base/AMReX_Utility.H +++ b/Src/Base/AMReX_Utility.H @@ -157,7 +157,7 @@ namespace BoxLib Internally, the Fortran entry point calls a static Mersenne Twister object (the same one called by blutilrand()) to get a random number in the open interval (0,1), and then sets "val" to the result of calling - BoxLib::InvNormDist() with that random number. + amrex::InvNormDist() with that random number. */ double InvNormDist (double p); /* @@ -190,7 +190,7 @@ namespace BoxLib Internally, the Fortran entry point calls a static Mersenne Twister object (the same one called by blutilrand()) to get a random number in the open interval (0,1), and then sets "val" to the result of calling - BoxLib::InvNormDist() with that random number. + amrex::InvNormDist() with that random number. */ double InvNormDistBest (double p); /* @@ -211,7 +211,7 @@ namespace BoxLib call blutilrand(rn) Internally, blutilrand() calls a static Mersenne Twister oject (the - same one used by BoxLib::Random()) to get a value in [0,1] and then + same one used by amrex::Random()) to get a value in [0,1] and then sets "rn" to that value. */ double Random (); // [0,1] @@ -286,8 +286,8 @@ namespace BoxLib template class base_Timer; template std::ostream& operator<<(std::ostream&, const base_Timer&); - typedef base_Timer WallTimer; - typedef base_Timer CPUTimer; + typedef base_Timer WallTimer; + typedef base_Timer CPUTimer; template class base_Timer @@ -414,7 +414,7 @@ namespace BoxLib } -template void BoxLib::BroadcastArray(Array &aT, int myLocalId, int rootId, const MPI_Comm &localComm) +template void amrex::BroadcastArray(Array &aT, int myLocalId, int rootId, const MPI_Comm &localComm) { int aT_Size(-2); if(myLocalId == rootId) { @@ -498,20 +498,20 @@ template void BoxLib::BroadcastArray(Array &aT, int myLocalId, int r // Implementation of the Timer template -BoxLib::base_Timer::base_Timer() +amrex::base_Timer::base_Timer() : running(false), val(0.0), accum_val(0.0), cnt(0) { } template -BoxLib::base_Timer::~base_Timer() +amrex::base_Timer::~base_Timer() { BL_ASSERT( !running ); } template bool -BoxLib::base_Timer::is_running() const +amrex::base_Timer::is_running() const { return running; } @@ -519,7 +519,7 @@ BoxLib::base_Timer::is_running() const template inline void -BoxLib::base_Timer::start() +amrex::base_Timer::start() { BL_ASSERT( !running ); held = FCN(0); @@ -529,7 +529,7 @@ BoxLib::base_Timer::start() template inline void -BoxLib::base_Timer::stop() +amrex::base_Timer::stop() { BL_ASSERT( running ); val = (FCN(0) - held); @@ -546,7 +546,7 @@ BoxLib::base_Timer::stop() template void -BoxLib::base_Timer::reset() +amrex::base_Timer::reset() { BL_ASSERT( !running ); accum_val = 0; @@ -555,7 +555,7 @@ BoxLib::base_Timer::reset() template double -BoxLib::base_Timer::accum_time() const +amrex::base_Timer::accum_time() const { BL_ASSERT( !running ); return accum_val; @@ -563,7 +563,7 @@ BoxLib::base_Timer::accum_time() const template double -BoxLib::base_Timer::time() const +amrex::base_Timer::time() const { BL_ASSERT( !running ); return val; @@ -571,7 +571,7 @@ BoxLib::base_Timer::time() const template int -BoxLib::base_Timer::count() const +amrex::base_Timer::count() const { BL_ASSERT( !running ); return cnt; @@ -580,7 +580,7 @@ BoxLib::base_Timer::count() const // I stole this code from someplace, but I don't know where. template double -BoxLib::base_Timer::tick() +amrex::base_Timer::tick() { const int M = 100; double timesfound[M]; @@ -606,7 +606,7 @@ BoxLib::base_Timer::tick() } template -std::ostream& operator<<(std::ostream& os, const BoxLib::base_Timer& bt) +std::ostream& operator<<(std::ostream& os, const amrex::base_Timer& bt) { return os << "[" << bt.accum_time() << "/" @@ -616,14 +616,14 @@ std::ostream& operator<<(std::ostream& os, const BoxLib::base_Timer& bt) template long -BoxLib::bytesOf (const std::vector& v) +amrex::bytesOf (const std::vector& v) { return sizeof(v) + v.capacity()*sizeof(T); } template long -BoxLib::bytesOf (const std::map& m) +amrex::bytesOf (const std::map& m) { return sizeof(m) + m.size()*(sizeof(Key)+sizeof(T)+gcc_map_node_extra_bytes); } diff --git a/Src/Base/AMReX_Utility.cpp b/Src/Base/AMReX_Utility.cpp index f873738bc33..5df08ae4279 100644 --- a/Src/Base/AMReX_Utility.cpp +++ b/Src/Base/AMReX_Utility.cpp @@ -59,7 +59,7 @@ extern "C" int gettimeofday (struct timeval*, struct timezone*); #endif double -BoxLib::second (double* t) +amrex::second (double* t) { struct tms buffer; @@ -72,12 +72,12 @@ BoxLib::second (double* t) #if defined(_SC_CLK_TCK) CyclesPerSecond = sysconf(_SC_CLK_TCK); if (CyclesPerSecond == -1) - BoxLib::Error("second(double*): sysconf() failed"); + amrex::Error("second(double*): sysconf() failed"); #elif defined(HZ) CyclesPerSecond = HZ; #else CyclesPerSecond = 100; - BoxLib::Warning("second(): sysconf(): default value of 100 for hz, worry about timings"); + amrex::Warning("second(): sysconf(): default value of 100 for hz, worry about timings"); #endif } @@ -96,7 +96,7 @@ get_initial_wall_clock_time () struct timeval tp; if (gettimeofday(&tp, 0) != 0) - BoxLib::Abort("get_time_of_day(): gettimeofday() failed"); + amrex::Abort("get_time_of_day(): gettimeofday() failed"); return tp.tv_sec + tp.tv_usec/1000000.0; } @@ -107,7 +107,7 @@ get_initial_wall_clock_time () double BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); double -BoxLib::wsecond (double* t) +amrex::wsecond (double* t) { struct timeval tp; @@ -143,7 +143,7 @@ get_initial_wall_clock_time() LONGLONG BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); } double -BoxLib::wsecond(double* rslt) +amrex::wsecond(double* rslt) { BL_ASSERT( inited ); LARGE_INTEGER li; @@ -155,7 +155,7 @@ BoxLib::wsecond(double* rslt) #include double -BoxLib::second (double* r) +amrex::second (double* r) { static clock_t start = -1; @@ -177,7 +177,7 @@ BoxLib::second (double* r) #include double -BoxLib::second (double* r) +amrex::second (double* r) { static clock_t start = -1; @@ -207,7 +207,7 @@ get_initial_wall_clock_time () time_t BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); double -BoxLib::wsecond (double* r) +amrex::wsecond (double* r) { time_t finish; @@ -224,7 +224,7 @@ BoxLib::wsecond (double* r) #endif void -BoxLib::ResetWallClockTime () +amrex::ResetWallClockTime () { BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); } @@ -234,7 +234,7 @@ BoxLib::ResetWallClockTime () // bool -BoxLib::is_integer (const char* str) +amrex::is_integer (const char* str) { int len = 0; @@ -258,11 +258,11 @@ namespace { } const std::vector& -BoxLib::Tokenize (const std::string& instr, +amrex::Tokenize (const std::string& instr, const std::string& separators) { if (!tokenize_initialized) { - BoxLib::ExecOnFinalize(CleanupTokenizeStatics); + amrex::ExecOnFinalize(CleanupTokenizeStatics); tokenize_initialized = true; } @@ -310,7 +310,7 @@ BoxLib::Tokenize (const std::string& instr, } std::string -BoxLib::Concatenate (const std::string& root, +amrex::Concatenate (const std::string& root, int num, int mindigits) { @@ -323,10 +323,10 @@ BoxLib::Concatenate (const std::string& root, bool #ifdef WIN32 -BoxLib::UtilCreateDirectory (const std::string& path, +amrex::UtilCreateDirectory (const std::string& path, int mode, bool verbose) #else -BoxLib::UtilCreateDirectory (const std::string& path, +amrex::UtilCreateDirectory (const std::string& path, mode_t mode, bool verbose) #endif { @@ -407,7 +407,7 @@ BoxLib::UtilCreateDirectory (const std::string& path, if(retVal == false || verbose == true) { for(int i(0); i < pathError.size(); ++i) { - std::cout << "BoxLib::UtilCreateDirectory:: path errno: " + std::cout << "amrex::UtilCreateDirectory:: path errno: " << pathError[i].first << " :: " << strerror(pathError[i].second) << std::endl; @@ -418,36 +418,36 @@ BoxLib::UtilCreateDirectory (const std::string& path, } void -BoxLib::CreateDirectoryFailed (const std::string& dir) +amrex::CreateDirectoryFailed (const std::string& dir) { std::string msg("Couldn't create directory: "); msg += dir; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } void -BoxLib::FileOpenFailed (const std::string& file) +amrex::FileOpenFailed (const std::string& file) { std::string msg("Couldn't open file: "); msg += file; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } void -BoxLib::UnlinkFile (const std::string& file) +amrex::UnlinkFile (const std::string& file) { unlink(file.c_str()); } bool -BoxLib::FileExists(const std::string &filename) +amrex::FileExists(const std::string &filename) { struct stat statbuff; return(::lstat(filename.c_str(), &statbuff) != -1); } std::string -BoxLib::UniqueString() +amrex::UniqueString() { std::stringstream tempstring; tempstring << std::setprecision(11) << std::fixed << ParallelDescriptor::second(); @@ -456,46 +456,46 @@ BoxLib::UniqueString() } void -BoxLib::UtilCreateCleanDirectory (const std::string &path, bool callbarrier) +amrex::UtilCreateCleanDirectory (const std::string &path, bool callbarrier) { if(ParallelDescriptor::IOProcessor()) { - if(BoxLib::FileExists(path)) { - std::string newoldname(path + ".old." + BoxLib::UniqueString()); - std::cout << "BoxLib::UtilCreateCleanDirectory(): " << path + if(amrex::FileExists(path)) { + std::string newoldname(path + ".old." + amrex::UniqueString()); + std::cout << "amrex::UtilCreateCleanDirectory(): " << path << " exists. Renaming to: " << newoldname << std::endl; std::rename(path.c_str(), newoldname.c_str()); } - if( ! BoxLib::UtilCreateDirectory(path, 0755)) { - BoxLib::CreateDirectoryFailed(path); + if( ! amrex::UtilCreateDirectory(path, 0755)) { + amrex::CreateDirectoryFailed(path); } } if(callbarrier) { // Force other processors to wait until directory is built. - ParallelDescriptor::Barrier("BoxLib::UtilCreateCleanDirectory"); + ParallelDescriptor::Barrier("amrex::UtilCreateCleanDirectory"); } } void -BoxLib::UtilRenameDirectoryToOld (const std::string &path, bool callbarrier) +amrex::UtilRenameDirectoryToOld (const std::string &path, bool callbarrier) { if(ParallelDescriptor::IOProcessor()) { - if(BoxLib::FileExists(path)) { - std::string newoldname(path + ".old." + BoxLib::UniqueString()); - std::cout << "BoxLib::UtilRenameDirectoryToOld(): " << path + if(amrex::FileExists(path)) { + std::string newoldname(path + ".old." + amrex::UniqueString()); + std::cout << "amrex::UtilRenameDirectoryToOld(): " << path << " exists. Renaming to: " << newoldname << std::endl; std::rename(path.c_str(), newoldname.c_str()); } } if(callbarrier) { // Force other processors to wait until directory is renamed. - ParallelDescriptor::Barrier("BoxLib::UtilRenameDirectoryToOld"); + ParallelDescriptor::Barrier("amrex::UtilRenameDirectoryToOld"); } } void -BoxLib::OutOfMemory () +amrex::OutOfMemory () { - BoxLib::Error("Sorry, out of memory, bye ..."); + amrex::Error("Sorry, out of memory, bye ..."); } // @@ -507,13 +507,13 @@ namespace const long billion = 1000000000L; } -BoxLib::Time::Time() +amrex::Time::Time() { tv_sec = 0; tv_nsec = 0; } -BoxLib::Time::Time(long s, long n) +amrex::Time::Time(long s, long n) { BL_ASSERT(s >= 0); BL_ASSERT(n >= 0); @@ -523,7 +523,7 @@ BoxLib::Time::Time(long s, long n) normalize(); } -BoxLib::Time::Time(double d) +amrex::Time::Time(double d) { tv_sec = long(d); tv_nsec = long((d-tv_sec)*billion); @@ -531,19 +531,19 @@ BoxLib::Time::Time(double d) } double -BoxLib::Time::as_double() const +amrex::Time::as_double() const { return tv_sec + tv_nsec/double(billion); } long -BoxLib::Time::as_long() const +amrex::Time::as_long() const { return tv_sec + tv_nsec/billion; } -BoxLib::Time& -BoxLib::Time::operator+=(const Time& r) +amrex::Time& +amrex::Time::operator+=(const Time& r) { tv_sec += r.tv_sec; tv_nsec += r.tv_nsec; @@ -551,15 +551,15 @@ BoxLib::Time::operator+=(const Time& r) return *this; } -BoxLib::Time -BoxLib::Time::operator+(const Time& r) const +amrex::Time +amrex::Time::operator+(const Time& r) const { Time result(*this); return result+=r; } void -BoxLib::Time::normalize() +amrex::Time::normalize() { if ( tv_nsec > billion ) { @@ -568,10 +568,10 @@ BoxLib::Time::normalize() } } -BoxLib::Time -BoxLib::Time::get_time() +amrex::Time +amrex::Time::get_time() { - return Time(BoxLib::wsecond()); + return Time(amrex::wsecond()); } @@ -606,15 +606,15 @@ BoxLib::Time::get_time() /* ACM Transactions on Modeling and Computer Simulation, */ /* Vol. 8, No. 1, January 1998, pp 3--30. */ -unsigned long BoxLib::mt19937::init_seed; -unsigned long BoxLib::mt19937::mt[BoxLib::mt19937::N]; -int BoxLib::mt19937::mti; +unsigned long amrex::mt19937::init_seed; +unsigned long amrex::mt19937::mt[amrex::mt19937::N]; +int amrex::mt19937::mti; // // initializing with a NONZERO seed. // void -BoxLib::mt19937::sgenrand(unsigned long seed) +amrex::mt19937::sgenrand(unsigned long seed) { mt[0]= seed & 0xffffffffUL; for ( mti=1; mti>1); } unsigned long -BoxLib::mt19937::u_value() +amrex::mt19937::u_value() { return igenrand(); } void -BoxLib::mt19937::save (Array& state) const +amrex::mt19937::save (Array& state) const { state.resize(N+2); state[0] = init_seed; @@ -801,16 +801,16 @@ BoxLib::mt19937::save (Array& state) const } int -BoxLib::mt19937::RNGstatesize () const +amrex::mt19937::RNGstatesize () const { return N+2; } void -BoxLib::mt19937::restore (const Array& state) +amrex::mt19937::restore (const Array& state) { if (state.size() != N+2) - BoxLib::Error("mt19937::restore(): incorrectly sized state vector"); + amrex::Error("mt19937::restore(): incorrectly sized state vector"); init_seed = state[0]; for (int i = 0; i < N; i++) @@ -818,51 +818,51 @@ BoxLib::mt19937::restore (const Array& state) mti = state[N+1]; if (mti < 0 || mti > N) - BoxLib::Error("mt19937::restore(): mti out-of-bounds"); + amrex::Error("mt19937::restore(): mti out-of-bounds"); } namespace { - BoxLib::mt19937 the_generator; + amrex::mt19937 the_generator; } void -BoxLib::InitRandom (unsigned long seed) +amrex::InitRandom (unsigned long seed) { the_generator = mt19937(seed); } void -BoxLib::InitRandom (unsigned long seed, int numprocs) +amrex::InitRandom (unsigned long seed, int numprocs) { the_generator = mt19937(seed, numprocs); } -void BoxLib::ResetRandomSeed(unsigned long seed) +void amrex::ResetRandomSeed(unsigned long seed) { the_generator.reset(seed); } double -BoxLib::Random () +amrex::Random () { return the_generator.d_value(); } double -BoxLib::Random1 () +amrex::Random1 () { return the_generator.d1_value(); } double -BoxLib::Random2 () +amrex::Random2 () { return the_generator.d2_value(); } unsigned long -BoxLib::Random_int(unsigned long n) +amrex::Random_int(unsigned long n) { const unsigned long umax = 4294967295UL; // 2^32-1 BL_ASSERT( n > 0 && n <= umax ); @@ -875,34 +875,34 @@ BoxLib::Random_int(unsigned long n) } void -BoxLib::SaveRandomState (Array& state) +amrex::SaveRandomState (Array& state) { the_generator.save(state); } int -BoxLib::sizeofRandomState () +amrex::sizeofRandomState () { return the_generator.RNGstatesize(); } void -BoxLib::RestoreRandomState (const Array& state) +amrex::RestoreRandomState (const Array& state) { the_generator.restore(state); } void -BoxLib::UniqueRandomSubset (Array &uSet, int setSize, int poolSize, +amrex::UniqueRandomSubset (Array &uSet, int setSize, int poolSize, bool printSet) { if(setSize > poolSize) { - BoxLib::Abort("**** Error in UniqueRandomSubset: setSize > poolSize."); + amrex::Abort("**** Error in UniqueRandomSubset: setSize > poolSize."); } std::set copySet; Array uSetTemp; while(copySet.size() < setSize) { - int r(BoxLib::Random_int(poolSize)); + int r(amrex::Random_int(poolSize)); if(copySet.find(r) == copySet.end()) { copySet.insert(r); uSetTemp.push_back(r); @@ -917,7 +917,7 @@ BoxLib::UniqueRandomSubset (Array &uSet, int setSize, int poolSize, } void -BoxLib::NItemsPerBin (int totalItems, Array &binCounts) +amrex::NItemsPerBin (int totalItems, Array &binCounts) { if(binCounts.size() == 0) { return; @@ -926,7 +926,7 @@ BoxLib::NItemsPerBin (int totalItems, Array &binCounts) int countForAll(totalItems / binCounts.size()); int remainder(totalItems % binCounts.size()); if(ParallelDescriptor::IOProcessor() && verbose) { - std::cout << "BoxLib::NItemsPerBin: countForAll remainder = " << countForAll + std::cout << "amrex::NItemsPerBin: countForAll remainder = " << countForAll << " " << remainder << std::endl; } for(int i(0); i < binCounts.size(); ++i) { @@ -937,31 +937,31 @@ BoxLib::NItemsPerBin (int totalItems, Array &binCounts) } for(int i(0); i < binCounts.size(); ++i) { if(ParallelDescriptor::IOProcessor() && verbose) { - std::cout << "BoxLib::NItemsPerBin:: binCounts[" << i << "] = " << binCounts[i] << std::endl; + std::cout << "amrex::NItemsPerBin:: binCounts[" << i << "] = " << binCounts[i] << std::endl; } } } // -// Fortran entry points for BoxLib::Random(). +// Fortran entry points for amrex::Random(). // BL_FORT_PROC_DECL(BLUTILINITRAND,blutilinitrand)(const int* sd) { unsigned long seed = *sd; - BoxLib::InitRandom(seed); + amrex::InitRandom(seed); } BL_FORT_PROC_DECL(BLINITRAND,blinitrand)(const int* sd) { unsigned long seed = *sd; - BoxLib::InitRandom(seed); + amrex::InitRandom(seed); } BL_FORT_PROC_DECL(BLUTILRAND,blutilrand)(Real* rn) { - *rn = BoxLib::Random(); + *rn = amrex::Random(); } // @@ -985,10 +985,10 @@ BL_FORT_PROC_DECL(BLUTILRAND,blutilrand)(Real* rn) // double -BoxLib::InvNormDist (double p) +amrex::InvNormDist (double p) { if (p <= 0 || p >= 1) - BoxLib::Error("BoxLib::InvNormDist(): p MUST be in (0,1)"); + amrex::Error("amrex::InvNormDist(): p MUST be in (0,1)"); // // Coefficients in rational approximations. // @@ -1073,7 +1073,7 @@ BL_FORT_PROC_DECL(BLINVNORMDIST,blinvnormdist)(Real* result) // double val = the_generator.d2_value(); - *result = BoxLib::InvNormDist(val); + *result = amrex::InvNormDist(val); } // @@ -1115,7 +1115,7 @@ BL_FORT_PROC_DECL(BLINVNORMDIST,blinvnormdist)(Real* result) // double -BoxLib::InvNormDistBest (double p) +amrex::InvNormDistBest (double p) { static const double a[8] = @@ -1170,7 +1170,7 @@ BoxLib::InvNormDistBest (double p) double r, value; if (p <= 0 || p >= 1) - BoxLib::Error("InvNormDistBest(): p MUST be in (0,1)"); + amrex::Error("InvNormDistBest(): p MUST be in (0,1)"); double q = p - 0.5; @@ -1236,7 +1236,7 @@ BL_FORT_PROC_DECL(BLINVNORMDISTBEST,blinvnormdistbest)(Real* result) // double val = the_generator.d2_value(); - *result = BoxLib::InvNormDistBest(val); + *result = amrex::InvNormDistBest(val); } @@ -1245,7 +1245,7 @@ BL_FORT_PROC_DECL(BLINVNORMDISTBEST,blinvnormdistbest)(Real* result) // std::istream& -BoxLib::operator>>(std::istream& is, const expect& exp) +amrex::operator>>(std::istream& is, const expect& exp) { int len = exp.istr.size(); int n = 0; @@ -1264,28 +1264,28 @@ BoxLib::operator>>(std::istream& is, const expect& exp) { is.clear(std::ios::badbit|is.rdstate()); std::string msg = "expect fails to find \"" + exp.the_string() + "\""; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } return is; } -BoxLib::expect::expect(const char* istr_) +amrex::expect::expect(const char* istr_) : istr(istr_) { } -BoxLib::expect::expect(const std::string& str_) +amrex::expect::expect(const std::string& str_) : istr(str_) { } -BoxLib::expect::expect(char c) +amrex::expect::expect(char c) { istr += c; } const std::string& -BoxLib::expect::the_string() const +amrex::expect::the_string() const { return istr; } @@ -1295,15 +1295,15 @@ BoxLib::expect::the_string() const // StreamRetry // -int BoxLib::StreamRetry::nStreamErrors = 0; +int amrex::StreamRetry::nStreamErrors = 0; -BoxLib::StreamRetry::StreamRetry(std::ostream &os, const std::string &suffix, +amrex::StreamRetry::StreamRetry(std::ostream &os, const std::string &suffix, const int maxtries) : tries(0), maxTries(maxtries), sros(os), spos(os.tellp()), suffix(suffix) { } -BoxLib::StreamRetry::StreamRetry(const std::string &filename, +amrex::StreamRetry::StreamRetry(const std::string &filename, const bool abortonretryfailure, const int maxtries) : tries(0), maxTries(maxtries), @@ -1314,7 +1314,7 @@ BoxLib::StreamRetry::StreamRetry(const std::string &filename, nStreamErrors = 0; } -bool BoxLib::StreamRetry::TryOutput() +bool amrex::StreamRetry::TryOutput() { if(tries == 0) { ++tries; @@ -1357,7 +1357,7 @@ bool BoxLib::StreamRetry::TryOutput() } -bool BoxLib::StreamRetry::TryFileOutput() +bool amrex::StreamRetry::TryFileOutput() { bool bTryOutput(false); @@ -1372,7 +1372,7 @@ bool BoxLib::StreamRetry::TryFileOutput() bTryOutput = false; } else { // wrote a bad file, rename it if(ParallelDescriptor::IOProcessor()) { - const std::string& badFileName = BoxLib::Concatenate(fileName + ".bad", + const std::string& badFileName = amrex::Concatenate(fileName + ".bad", tries - 1, 2); std::cout << nWriteErrors << " STREAMERRORS : Renaming file from " << fileName << " to " << badFileName << std::endl; @@ -1385,7 +1385,7 @@ bool BoxLib::StreamRetry::TryFileOutput() bTryOutput = true; } else { if(abortOnRetryFailure) { - BoxLib::Abort("STREAMERROR : StreamRetry::maxTries exceeded."); + amrex::Abort("STREAMERROR : StreamRetry::maxTries exceeded."); } bTryOutput = false; } @@ -1398,7 +1398,7 @@ bool BoxLib::StreamRetry::TryFileOutput() } -void BoxLib::SyncStrings(const Array &localStrings, +void amrex::SyncStrings(const Array &localStrings, Array &syncedStrings, bool &alreadySynced) { #ifdef BL_USE_MPI @@ -1562,7 +1562,7 @@ void BoxLib::SyncStrings(const Array &localStrings, -Array BoxLib::SerializeStringArray(const Array &stringArray) +Array amrex::SerializeStringArray(const Array &stringArray) { std::ostringstream stringStream; for(int i(0); i < stringArray.size(); ++i) { @@ -1579,7 +1579,7 @@ Array BoxLib::SerializeStringArray(const Array &stringArray) -Array BoxLib::UnSerializeStringArray(const Array &charArray) +Array amrex::UnSerializeStringArray(const Array &charArray) { Array stringArray; std::istringstream stringStream(charArray.dataPtr()); @@ -1595,36 +1595,36 @@ Array BoxLib::UnSerializeStringArray(const Array &charArray) } -void BoxLib::BroadcastBox(Box &bB, int myLocalId, int rootId, const MPI_Comm &localComm) +void amrex::BroadcastBox(Box &bB, int myLocalId, int rootId, const MPI_Comm &localComm) { Array baseBoxAI; if(myLocalId == rootId) { - baseBoxAI = BoxLib::SerializeBox(bB); + baseBoxAI = amrex::SerializeBox(bB); } - BoxLib::BroadcastArray(baseBoxAI, myLocalId, rootId, localComm); + amrex::BroadcastArray(baseBoxAI, myLocalId, rootId, localComm); if(myLocalId != rootId) { - bB = BoxLib::UnSerializeBox(baseBoxAI); + bB = amrex::UnSerializeBox(baseBoxAI); } } -void BoxLib::BroadcastBoxArray(BoxArray &bBA, int myLocalId, int rootId, const MPI_Comm &localComm) +void amrex::BroadcastBoxArray(BoxArray &bBA, int myLocalId, int rootId, const MPI_Comm &localComm) { Array sbaG; if(myLocalId == rootId) { - sbaG = BoxLib::SerializeBoxArray(bBA); + sbaG = amrex::SerializeBoxArray(bBA); } - BoxLib::BroadcastArray(sbaG, myLocalId, rootId, localComm); + amrex::BroadcastArray(sbaG, myLocalId, rootId, localComm); if(myLocalId != rootId) { if(sbaG.size() > 0) { - bBA = BoxLib::UnSerializeBoxArray(sbaG); + bBA = amrex::UnSerializeBoxArray(sbaG); } } } -void BoxLib::BroadcastDistributionMapping(DistributionMapping &dM, int sentinelProc, +void amrex::BroadcastDistributionMapping(DistributionMapping &dM, int sentinelProc, int myLocalId, int rootId, const MPI_Comm &localComm, bool addToCache) { @@ -1639,7 +1639,7 @@ void BoxLib::BroadcastDistributionMapping(DistributionMapping &dM, int sentinelP if(myLocalId == rootId) { dmapA = dM.ProcessorMap(); } - BoxLib::BroadcastArray(dmapA, myLocalId, rootId, localComm); + amrex::BroadcastArray(dmapA, myLocalId, rootId, localComm); if(dmapA.size() > 0) { if(myLocalId != rootId) { dmapA[dmapA.size() - 1] = sentinelProc; // ---- set the sentinel @@ -1656,7 +1656,7 @@ void BoxLib::BroadcastDistributionMapping(DistributionMapping &dM, int sentinelP } -void BoxLib::USleep(double sleepsec) { +void amrex::USleep(double sleepsec) { //usleep(sleepsec * msps); usleep(sleepsec * msps / 10.0); } diff --git a/Src/Base/AMReX_VisMF.cpp b/Src/Base/AMReX_VisMF.cpp index 162598098a2..34277379339 100644 --- a/Src/Base/AMReX_VisMF.cpp +++ b/Src/Base/AMReX_VisMF.cpp @@ -67,7 +67,7 @@ VisMF::Initialize () VisMF::SetMFFileInStreams(nMFFileInStreams); - BoxLib::ExecOnFinalize(VisMF::Finalize); + amrex::ExecOnFinalize(VisMF::Finalize); ParmParse pp("vismf"); pp.query("v",verbose); @@ -122,7 +122,7 @@ operator<< (std::ostream& os, os << TheFabOnDiskPrefix << ' ' << fod.m_name << ' ' << fod.m_head; if( ! os.good()) { - BoxLib::Error("Write of VisMF::FabOnDisk failed"); + amrex::Error("Write of VisMF::FabOnDisk failed"); } return os; @@ -141,7 +141,7 @@ operator>> (std::istream& is, is >> fod.m_head; if( ! is.good()) { - BoxLib::Error("Read of VisMF::FabOnDisk failed"); + amrex::Error("Read of VisMF::FabOnDisk failed"); } return is; @@ -160,7 +160,7 @@ operator<< (std::ostream& os, } if( ! os.good()) { - BoxLib::Error("Write of Array failed"); + amrex::Error("Write of Array failed"); } return os; @@ -182,7 +182,7 @@ operator>> (std::istream& is, } if( ! is.good()) { - BoxLib::Error("Read of Array failed"); + amrex::Error("Read of Array failed"); } return is; @@ -207,7 +207,7 @@ operator<< (std::ostream& os, } if( ! os.good()) { - BoxLib::Error("Write of Array> failed"); + amrex::Error("Write of Array> failed"); } return os; @@ -227,13 +227,13 @@ operator>> (std::istream& is, is >> N >> ch >> M; if( N < 0 ) { - BoxLib::Error("Expected a positive integer, N, got something else"); + amrex::Error("Expected a positive integer, N, got something else"); } if( M < 0 ) { - BoxLib::Error("Expected a positive integer, M, got something else"); + amrex::Error("Expected a positive integer, M, got something else"); } if( ch != ',' ) { - BoxLib::Error("Expected a ',' got something else"); + amrex::Error("Expected a ',' got something else"); } ar.resize(N); @@ -249,13 +249,13 @@ operator>> (std::istream& is, is >> ar[i][j] >> ch; #endif if( ch != ',' ) { - BoxLib::Error("Expected a ',' got something else"); + amrex::Error("Expected a ',' got something else"); } } } if( ! is.good()) { - BoxLib::Error("Read of Array> failed"); + amrex::Error("Read of Array> failed"); } return is; @@ -319,7 +319,7 @@ operator<< (std::ostream &os, os.precision(oldPrec); if( ! os.good()) { - BoxLib::Error("Write of VisMF::Header failed"); + amrex::Error("Write of VisMF::Header failed"); } return os; @@ -342,7 +342,7 @@ operator>> (std::istream &is, hd.m_how = VisMF::NFiles; break; default: - BoxLib::Error("Bad case in VisMF::Header.m_how switch"); + amrex::Error("Bad case in VisMF::Header.m_how switch"); } is >> hd.m_ncomp; @@ -372,13 +372,13 @@ operator>> (std::istream &is, for(int i(0); i < hd.m_famin.size(); ++i) { is >> hd.m_famin[i] >> ch; if( ch != ',' ) { - BoxLib::Error("Expected a ',' when reading hd.m_famin"); + amrex::Error("Expected a ',' when reading hd.m_famin"); } } for(int i(0); i < hd.m_famax.size(); ++i) { is >> hd.m_famax[i] >> ch; if( ch != ',' ) { - BoxLib::Error("Expected a ',' when reading hd.m_famax"); + amrex::Error("Expected a ',' when reading hd.m_famax"); } } } @@ -391,7 +391,7 @@ operator>> (std::istream &is, if( ! is.good()) { - BoxLib::Error("Read of VisMF::Header failed"); + amrex::Error("Read of VisMF::Header failed"); } return is; @@ -861,7 +861,7 @@ VisMF::WriteHeader (const std::string &mf_name, MFHdrFile.open(MFHdrFileName.c_str(), std::ios::out | std::ios::trunc); if( ! MFHdrFile.good()) { - BoxLib::FileOpenFailed(MFHdrFileName); + amrex::FileOpenFailed(MFHdrFileName); } MFHdrFile << hdr; @@ -1428,7 +1428,7 @@ VisMF::Read (FabArray &mf, ranksFileOrder[ranksFileOrder.size() - 1] = ParallelDescriptor::MyProc(); Array nRanksPerFile(FileReadChains.size()); - BoxLib::NItemsPerBin(nProcs, nRanksPerFile); + amrex::NItemsPerBin(nProcs, nRanksPerFile); int currentFileIndex(0); for(frcIter = FileReadChains.begin(); frcIter != FileReadChains.end(); ++frcIter) { @@ -1439,7 +1439,7 @@ VisMF::Read (FabArray &mf, { return a.fileOffset < b.fileOffset; } ); Array nBoxesPerRank(nRanksPerFile[currentFileIndex]); - BoxLib::NItemsPerBin(frc.size(), nBoxesPerRank); + amrex::NItemsPerBin(frc.size(), nBoxesPerRank); int frcIndex(0); for(int nbpr(0); nbpr < nBoxesPerRank.size(); ++nbpr) { @@ -1655,7 +1655,7 @@ VisMF::Read (FabArray &mf, allReads[findex][whichProc].insert(std::pair(iSeekPos, i)); } else { std::cout << "**** Error: filename not found = " << fname << std::endl; - BoxLib::Abort("**** Error in VisMF::Read"); + amrex::Abort("**** Error in VisMF::Read"); } } } @@ -1945,7 +1945,7 @@ std::ifstream *VisMF::OpenStream(const std::string &fileName) { pifs.pstr->open(fileName.c_str(), std::ios::in | std::ios::binary); if( ! pifs.pstr->good()) { delete pifs.pstr; - BoxLib::FileOpenFailed(fileName); + amrex::FileOpenFailed(fileName); } pifs.isOpen = true; pifs.currentPosition = 0; diff --git a/Src/Base/AMReX_iMultiFab.cpp b/Src/Base/AMReX_iMultiFab.cpp index 81de028f3c7..8acaace243c 100644 --- a/Src/Base/AMReX_iMultiFab.cpp +++ b/Src/Base/AMReX_iMultiFab.cpp @@ -186,7 +186,7 @@ iMultiFab::Initialize () { if (initialized) return; - BoxLib::ExecOnFinalize(iMultiFab::Finalize); + amrex::ExecOnFinalize(iMultiFab::Finalize); initialized = true; } @@ -385,7 +385,7 @@ iMultiFab::minIndex (int comp, for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - const Box& box = BoxLib::grow(mfi.validbox(),nghost); + const Box& box = amrex::grow(mfi.validbox(),nghost); const int lmn = get(mfi).min(box,comp); if (lmn < priv_mn) @@ -471,7 +471,7 @@ iMultiFab::maxIndex (int comp, for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - const Box& box = BoxLib::grow(mfi.validbox(),nghost); + const Box& box = amrex::grow(mfi.validbox(),nghost); const int lmx = get(mfi).max(box,comp); if (lmx > priv_mx) @@ -550,7 +550,7 @@ iMultiFab::norm0 (int comp, const BoxArray& ba, int nghost, bool local) const for (MFIter mfi(*this); mfi.isValid(); ++mfi) { - ba.intersections(BoxLib::grow(mfi.validbox(),nghost),isects); + ba.intersections(amrex::grow(mfi.validbox(),nghost),isects); for (int i = 0, N = isects.size(); i < N; i++) { diff --git a/Src/Boundary/AMReX_BndryData.cpp b/Src/Boundary/AMReX_BndryData.cpp index f36a3b08037..8a46fef1faa 100644 --- a/Src/Boundary/AMReX_BndryData.cpp +++ b/Src/Boundary/AMReX_BndryData.cpp @@ -123,7 +123,7 @@ BndryData::define (const BoxArray& _grids, // // Otherwise we'll just abort. We could make this work but it's just as easy to start with a fresh Bndrydata object. // - BoxLib::Abort("BndryData::define(): object already built"); + amrex::Abort("BndryData::define(): object already built"); } geom = _geom; m_ncomp = _ncomp; diff --git a/Src/Boundary/AMReX_BndryRegister.cpp b/Src/Boundary/AMReX_BndryRegister.cpp index 17bb22e9791..a4e279f932a 100644 --- a/Src/Boundary/AMReX_BndryRegister.cpp +++ b/Src/Boundary/AMReX_BndryRegister.cpp @@ -308,7 +308,7 @@ BndryRegister::write (const std::string& name, std::ostream& os) const const int i = face(); BL_ASSERT(i >= 0 && i <= 7); - std::string facename = BoxLib::Concatenate(name + '_', i, 1); + std::string facename = amrex::Concatenate(name + '_', i, 1); bndry[face()].write(facename); } @@ -329,7 +329,7 @@ BndryRegister::read (const std::string& name, std::istream& is) const int i = face(); BL_ASSERT(i >= 0 && i <= 7); - std::string facename = BoxLib::Concatenate(name + '_', i, 1); + std::string facename = amrex::Concatenate(name + '_', i, 1); bndry[face()].read(facename); } @@ -350,7 +350,7 @@ BndryRegister::AddProcsToComp(int ioProcNumSCS, int ioProcNumAll, int scsMyId, MPI_Comm scsComm) { // ---- BoxArrays - BoxLib::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); + amrex::BroadcastBoxArray(grids, scsMyId, ioProcNumSCS, scsComm); // ---- FabSet for(int i(0); i < (2 * BL_SPACEDIM); ++i) { diff --git a/Src/Boundary/AMReX_FabSet.H b/Src/Boundary/AMReX_FabSet.H index ae2ebb86023..7cea9aa732c 100644 --- a/Src/Boundary/AMReX_FabSet.H +++ b/Src/Boundary/AMReX_FabSet.H @@ -123,7 +123,7 @@ public: void AddProcsToComp (int ioProcNumSCS, int ioProcNumAll, int scsMyId, MPI_Comm scsComm) - { BoxLib::Abort("FabSet::AddProcsToComp not implemented"); } + { amrex::Abort("FabSet::AddProcsToComp not implemented"); } private: MultiFab m_mf; diff --git a/Src/Boundary/AMReX_FabSet.cpp b/Src/Boundary/AMReX_FabSet.cpp index 5c9df4cc57d..333a72af90b 100644 --- a/Src/Boundary/AMReX_FabSet.cpp +++ b/Src/Boundary/AMReX_FabSet.cpp @@ -64,7 +64,7 @@ FabSet::plusFrom (const FabSet& src, int scomp, int dcomp, int ncomp) (*this)[fsi].plus(src[fsi], scomp, dcomp, ncomp); } } else { - BoxLib::Abort("FabSet::plusFrom: parallel plusFrom not supported"); + amrex::Abort("FabSet::plusFrom: parallel plusFrom not supported"); } return *this; } @@ -188,7 +188,7 @@ FabSet::read(const std::string& name) void FabSet::Copy (FabSet& dst, const FabSet& src) { - BL_ASSERT(BoxLib::match(dst.boxArray(), src.boxArray())); + BL_ASSERT(amrex::match(dst.boxArray(), src.boxArray())); BL_ASSERT(dst.DistributionMap() == src.DistributionMap()); int ncomp = dst.nComp(); #ifdef _OPENMP diff --git a/Src/Boundary/AMReX_InterpBndryData.cpp b/Src/Boundary/AMReX_InterpBndryData.cpp index b16da6f85b6..5f1d5a22079 100644 --- a/Src/Boundary/AMReX_InterpBndryData.cpp +++ b/Src/Boundary/AMReX_InterpBndryData.cpp @@ -196,7 +196,7 @@ InterpBndryData::setBndryValues (::BndryRegister& crse, BL_ASSERT(grids[fine_mfi.index()] == fine_mfi.validbox()); const Box& fine_bx = fine_mfi.validbox(); - const Box& crse_bx = BoxLib::coarsen(fine_bx,ratio); + const Box& crse_bx = amrex::coarsen(fine_bx,ratio); const int* cblo = crse_bx.loVect(); const int* cbhi = crse_bx.hiVect(); const int mxlen = crse_bx.longside() + 2; @@ -235,7 +235,7 @@ InterpBndryData::setBndryValues (::BndryRegister& crse, // The quadratic interp needs crse data in 2 grow cells tangential // to face. This checks to be sure the source data is large enough. // - Box crsebnd = BoxLib::adjCell(crse_bx,face,1); + Box crsebnd = amrex::adjCell(crse_bx,face,1); if (max_order == 3) { @@ -264,7 +264,7 @@ InterpBndryData::setBndryValues (::BndryRegister& crse, } else { - BoxLib::Abort("InterpBndryData::setBndryValues supports only max_order=1 or 3"); + amrex::Abort("InterpBndryData::setBndryValues supports only max_order=1 or 3"); } } diff --git a/Src/Boundary/AMReX_MacBndry.cpp b/Src/Boundary/AMReX_MacBndry.cpp index 5748ee8a5f3..7b8e974a83e 100644 --- a/Src/Boundary/AMReX_MacBndry.cpp +++ b/Src/Boundary/AMReX_MacBndry.cpp @@ -7,7 +7,7 @@ MacBndry::MacBndry () : InterpBndryData() { - BoxLib::Abort("*** Calling default constructor for MacBndry()"); + amrex::Abort("*** Calling default constructor for MacBndry()"); } MacBndry::MacBndry (const BoxArray& _grids, diff --git a/Src/Extern/amrdata/AMReX_AmrData.cpp b/Src/Extern/amrdata/AMReX_AmrData.cpp index bfd9de024b8..21b2e55cbaf 100644 --- a/Src/Extern/amrdata/AMReX_AmrData.cpp +++ b/Src/Extern/amrdata/AMReX_AmrData.cpp @@ -515,7 +515,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { bool bRestrictDomain(maxDomain[0].ok()); if(bRestrictDomain) { for(lev = 1; lev <= finestLevel; ++lev) { - maxDomain[lev] = BoxLib::refine(maxDomain[lev-1],refRatio[lev-1]); + maxDomain[lev] = amrex::refine(maxDomain[lev-1],refRatio[lev-1]); } } Array restrictDomain(finestLevel + 1); @@ -526,8 +526,8 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { if(bRestrictDomain) { restrictDomain[lev] = maxDomain[lev]; } - extendRestrictDomain[lev] = BoxLib::grow(restrictDomain[lev],boundaryWidth); - BoxList bndry_boxes = BoxLib::boxDiff(extendRestrictDomain[lev], + extendRestrictDomain[lev] = amrex::grow(restrictDomain[lev],boundaryWidth); + BoxList bndry_boxes = amrex::boxDiff(extendRestrictDomain[lev], restrictDomain[lev]); nRegions = bndry_boxes.size(); @@ -654,15 +654,15 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { // get better data from interior or input bndry regions for(lev = 0; lev <= finestLevel; ++lev) { Box inbox(restrictDomain[lev]); - Box reg1(BoxLib::grow(restrictDomain[lev],boundaryWidth)); - Box reg2(BoxLib::grow(probDomain[lev],width)); - BoxList outside = BoxLib::boxDiff(reg1, reg2); + Box reg1(amrex::grow(restrictDomain[lev],boundaryWidth)); + Box reg2(amrex::grow(probDomain[lev],width)); + BoxList outside = amrex::boxDiff(reg1, reg2); if(outside.size() > 0) { // parts of the bndry have not been filled from the input // data, must extending from interior regions for(int idir(0); idir < BL_SPACEDIM; ++idir) { - Box bx(BoxLib::adjCellLo(inbox,idir,boundaryWidth)); + Box bx(amrex::adjCellLo(inbox,idir,boundaryWidth)); Box br(bx); for(k = 0; k < BL_SPACEDIM; ++k) { if(k != idir) { @@ -680,7 +680,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { tmpreg_lo.copy(tmpreg,tmpreg.box(),0,tmpreg_lo.box(),0,nComp); // now fill out tmp region along idir direction - Box b_lo(BoxLib::adjCellLo(inbox,idir,1)); + Box b_lo(amrex::adjCellLo(inbox,idir,1)); for(k = 1; k < boundaryWidth; ++k) { Box btmp(b_lo); btmp.shift(idir, -k); @@ -692,7 +692,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { int n; for(k = 1; k < BL_SPACEDIM; ++k) { int kdir = (idir + k) % BL_SPACEDIM; - b_dest = BoxLib::adjCellLo(bx, kdir, 1); + b_dest = amrex::adjCellLo(bx, kdir, 1); b_src = b_dest; b_src = b_src.shift(kdir, 1); for(n = 1; n <= boundaryWidth; ++n) { @@ -700,7 +700,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { b_dest.shift(kdir, -1); } - b_dest = BoxLib::adjCellHi(bx,kdir,1); + b_dest = amrex::adjCellHi(bx,kdir,1); b_src = b_dest; b_src.shift(kdir,-1); for(n = 1; n <= boundaryWidth; ++n) { @@ -727,7 +727,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { } // end for j // now work on the high side of the bndry region - bx = BoxLib::adjCellHi(inbox,idir,boundaryWidth); + bx = amrex::adjCellHi(inbox,idir,boundaryWidth); br = bx; for(k = 0; k < BL_SPACEDIM; ++k) { if(k != idir) br.grow(k, boundaryWidth); @@ -743,7 +743,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { tmpreg_hi.copy(tmpreg2,tmpreg2.box(),0,tmpreg_hi.box(),0,nComp); // now fill out tmp region along idir direction - Box b_hi(BoxLib::adjCellHi(inbox,idir,1)); + Box b_hi(amrex::adjCellHi(inbox,idir,1)); for(k = 1; k < boundaryWidth; ++k) { Box btmp(b_hi); btmp.shift(idir,k); @@ -753,7 +753,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { // now fill out temp bndry region for(k = 1; k < BL_SPACEDIM; ++k) { int kdir = (idir + k) % BL_SPACEDIM; - b_dest = BoxLib::adjCellLo(bx, kdir, 1); + b_dest = amrex::adjCellLo(bx, kdir, 1); b_src = b_dest; b_src.shift(kdir, 1); for(n = 1; n <= boundaryWidth; ++n) { @@ -761,7 +761,7 @@ bool AmrData::ReadData(const string &filename, Amrvis::FileType filetype) { b_dest.shift(kdir,-1); } - b_dest = BoxLib::adjCellHi(bx, kdir, 1); + b_dest = amrex::adjCellHi(bx, kdir, 1); b_src = b_dest; b_src.shift(kdir, -1); for(n = 1; n <= boundaryWidth; ++n) { @@ -926,7 +926,7 @@ bool AmrData::ReadNonPlotfileData(const string &filename, Amrvis::FileType filet plotVars.resize(nComp); for(i = 0; i < nComp; ++i) { if(snprintf(fabname, N, "%s%d", "Fab_", i) >= N) { - BoxLib::Abort("AmrData::ReadNonPlotfileData: fabname buffer too small"); + amrex::Abort("AmrData::ReadNonPlotfileData: fabname buffer too small"); } plotVars[i] = fabname; } @@ -964,7 +964,7 @@ bool AmrData::ReadNonPlotfileData(const string &filename, Amrvis::FileType filet for(int iComp(0); iComp < nComp; ++iComp) { if(snprintf(fabname, N, "%s%d", "MultiFab_", iComp) >= N) { - BoxLib::Abort("AmrData::ReadNonPlotfileData: fabname buffer too small"); + amrex::Abort("AmrData::ReadNonPlotfileData: fabname buffer too small"); } plotVars[iComp] = fabname; @@ -1145,7 +1145,7 @@ void AmrData::FillVar(MultiFab &destMultiFab, int finestFillLevel, cerr << " Domain is " << probDomain[finestFillLevel] << std::endl; cerr << " ith box is " << destBoxes[iIndex] << std::endl; } - BoxLib::Abort("Error: AmrData::FillVar"); + amrex::Abort("Error: AmrData::FillVar"); } } @@ -1263,7 +1263,7 @@ void AmrData::FillVar(MultiFab &destMultiFab, int finestFillLevel, srcComp, 0, 1); fillBoxIdBAs[ibox][currentLevel][currentBLI][0] = - BoxArray(BoxLib::complementIn(tempCoarseBox, + BoxArray(amrex::complementIn(tempCoarseBox, tempUnfillableBoxes)); unfillableBoxesOnThisLevel.catenate(tempUnfillableBoxes); @@ -1488,7 +1488,7 @@ void AmrData::FillVar(Array &destFabs, const Array &destBoxes, srcComp, destComp, numFillComps); fillBoxIdBAs[ibox][currentLevel][currentBLI][0] = - BoxArray(BoxLib::complementIn(tempCoarseBox, + BoxArray(amrex::complementIn(tempCoarseBox, tempUnfillableBoxes)); unfillableBoxesOnThisLevel.catenate(tempUnfillableBoxes); @@ -1592,7 +1592,7 @@ void AmrData::FillVar(Array &destFabs, const Array &destBoxes, // --------------------------------------------------------------- void AmrData::FillInterior(FArrayBox &dest, int level, const Box &subbox) { - BoxLib::Abort("Error: should not be in AmrData::FillInterior"); + amrex::Abort("Error: should not be in AmrData::FillInterior"); } @@ -1807,7 +1807,7 @@ bool AmrData::MinMax(const Box &onBox, const string &derived, int level, } else if(bCartGrid && (compIndex != StateNumber("vfrac"))) { #if (BL_SPACEDIM == 1) - BoxLib::Abort("AmrData::MinMax: should not be here for 1d."); + amrex::Abort("AmrData::MinMax: should not be here for 1d."); #else int iCount(0), iCountAllBody(0); int iCountMixedSkipped(0), iCountMixedFort(0); @@ -1984,7 +1984,7 @@ int AmrData::StateNumber(const string &statename) const { if(ParallelDescriptor::IOProcessor()) { cerr << "Error: bad state name: " << statename << std::endl; } - BoxLib::Abort("bad state name in AmrData::StateNumber()"); + amrex::Abort("bad state name in AmrData::StateNumber()"); return(-1); } @@ -1994,11 +1994,11 @@ void AmrData::Interp(FArrayBox &fine, FArrayBox &crse, const Box &fine_box, int lrat) { #if (BL_SPACEDIM == 1) - BoxLib::Abort("AmrData::MinMax: should not be here for 1d."); + amrex::Abort("AmrData::MinMax: should not be here for 1d."); #else BL_ASSERT(fine.box().contains(fine_box)); - Box crse_bx(BoxLib::coarsen(fine_box,lrat)); - Box fslope_bx(BoxLib::refine(crse_bx,lrat)); + Box crse_bx(amrex::coarsen(fine_box,lrat)); + Box fslope_bx(amrex::refine(crse_bx,lrat)); Box cslope_bx(crse_bx); cslope_bx.grow(1); BL_ASSERT(crse.box() == cslope_bx); diff --git a/Src/Extern/amrdata/AMReX_DataServices.cpp b/Src/Extern/amrdata/AMReX_DataServices.cpp index 1b1c390837a..36e8dd18057 100644 --- a/Src/Extern/amrdata/AMReX_DataServices.cpp +++ b/Src/Extern/amrdata/AMReX_DataServices.cpp @@ -295,13 +295,13 @@ void DataServices::Dispatch(DSRequestType requestType, DataServices *ds, ...) { case FillVarArrayOfFabs: { - BoxLib::Abort("FillVarArrayOfFabs not implemented yet."); + amrex::Abort("FillVarArrayOfFabs not implemented yet."); } break; case FillVarMultiFab: { - BoxLib::Abort("FillVarMultiFab not implemented yet."); + amrex::Abort("FillVarMultiFab not implemented yet."); } break; @@ -743,7 +743,7 @@ bool DataServices::DumpSlice(int slicedir, int slicenum, const int N = 64; char slicechar[N]; if (snprintf(slicechar, N, "%d.Level_%d", slicenum, iWTL) >= N) - BoxLib::Abort("DataServices::DumpSlice(1): slicechar buffer too small"); + amrex::Abort("DataServices::DumpSlice(1): slicechar buffer too small"); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; @@ -801,7 +801,7 @@ bool DataServices::DumpSlice(int slicedir, int slicenum) { // dump all vars const int N = 64; char slicechar[N]; if (snprintf(slicechar, N, "%d.Level_%d", slicenum, iWTL) >= N) - BoxLib::Abort("DataServices::DumpSlice(2): slicechar buffer too small"); + amrex::Abort("DataServices::DumpSlice(2): slicechar buffer too small"); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; @@ -859,7 +859,7 @@ bool DataServices::DumpSlice(const Box &b, const string &varname) { b.bigEnd(Amrvis::XDIR), b.bigEnd(Amrvis::YDIR), b.bigEnd(Amrvis::ZDIR), iWTL); #endif if (count >= N) - BoxLib::Abort("DataServices::DumpSlice(3): slicechar buffer too small"); + amrex::Abort("DataServices::DumpSlice(3): slicechar buffer too small"); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; @@ -905,7 +905,7 @@ bool DataServices::DumpSlice(const Box &b) { // dump all vars b.bigEnd(Amrvis::XDIR), b.bigEnd(Amrvis::YDIR), b.bigEnd(Amrvis::ZDIR), iWTL); #endif if (count >= N) - BoxLib::Abort("DataServices::DumpSlice(4): slicechar buffer too small"); + amrex::Abort("DataServices::DumpSlice(4): slicechar buffer too small"); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; diff --git a/Src/Extern/hpgmg/BL_HPGMG.cpp b/Src/Extern/hpgmg/BL_HPGMG.cpp index 1945037dde1..05425469f97 100644 --- a/Src/Extern/hpgmg/BL_HPGMG.cpp +++ b/Src/Extern/hpgmg/BL_HPGMG.cpp @@ -23,7 +23,7 @@ void CreateHPGMGLevel (level_type* level, { const Box& bx = mfi.validbox(); if (!bx.isSquare()) { - BoxLib::Error("All boxes must be square in HPGMG"); + amrex::Error("All boxes must be square in HPGMG"); } } @@ -37,7 +37,7 @@ void CreateHPGMGLevel (level_type* level, const Box& bx2 = mfi2.validbox(); if (!(bx1.sameSize(bx2))) { - BoxLib::Error("All boxes must be identical in HPGMG!"); + amrex::Error("All boxes must be identical in HPGMG!"); } } } @@ -51,7 +51,7 @@ void CreateHPGMGLevel (level_type* level, const int box_dim = bx.length(0); /* Since we've already checked that all boxes are the same size, we can just use the size from one of them here. */ if (TotalBoxes / num_ranks == 0) - BoxLib::Error("Must have at least one box per MPI task when using HPGMG"); + amrex::Error("Must have at least one box per MPI task when using HPGMG"); if (ParallelDescriptor::IOProcessor()) { @@ -66,7 +66,7 @@ void CreateHPGMGLevel (level_type* level, } else { - BoxLib::Error("Unknown boundary condition supplied"); + amrex::Error("Unknown boundary condition supplied"); } } @@ -111,7 +111,7 @@ void CreateHPGMGLevel (level_type* level, // allocate 3D array of integers to hold the MPI rank of the corresponding box and initialize to -1 (unassigned) level->rank_of_box = (int*)malloc(level->boxes_in.i*level->boxes_in.j*level->boxes_in.k*sizeof(int)); if(level->rank_of_box==NULL) - BoxLib::Error("malloc of level->rank_of_box failed"); + amrex::Error("malloc of level->rank_of_box failed"); for(box=0;boxboxes_in.i*level->boxes_in.j*level->boxes_in.k;box++){level->rank_of_box[box]=-1;} // -1 denotes that there is no actual box assigned to this region @@ -186,7 +186,7 @@ void CreateHPGMGLevel (level_type* level, for(box=0;boxboxes_in.i*level->boxes_in.j*level->boxes_in.k;box++){if(level->rank_of_box[box]==level->my_rank)level->num_my_boxes++;} level->my_boxes = (box_type*)malloc(level->num_my_boxes*sizeof(box_type)); if((level->num_my_boxes>0)&&(level->my_boxes==NULL)) - BoxLib::Error("malloc failed - create_level/level->my_boxes"); + amrex::Error("malloc failed - create_level/level->my_boxes"); // allocate flattened vector FP data and create pointers... if (ParallelDescriptor::IOProcessor()) @@ -312,7 +312,7 @@ void SetupHPGMGCoefficients(const double a, } if (!found) { - BoxLib::Error("Could not find matching boxes between HPGMG and BoxLib"); + amrex::Error("Could not find matching boxes between HPGMG and BoxLib"); } const Box &fabbox = mfi.fabbox(); @@ -361,7 +361,7 @@ void SetupHPGMGCoefficients(const double a, } if (!found) { - BoxLib::Error("Could not find matching boxes between HPGMG and BoxLib"); + amrex::Error("Could not find matching boxes between HPGMG and BoxLib"); } const Box &fabbox = mfi.fabbox(); @@ -428,7 +428,7 @@ void ConvertToHPGMGLevel (const MultiFab& mf, if (!found) { - BoxLib::Error("Could not find matching boxes between HPGMG and BoxLib"); + amrex::Error("Could not find matching boxes between HPGMG and BoxLib"); } const Box &fabbox = mfi.fabbox(); diff --git a/Src/F_BaseLib/MultiFab_C_F.cpp b/Src/F_BaseLib/MultiFab_C_F.cpp index f35cdfa615e..0bc0cd27cb9 100644 --- a/Src/F_BaseLib/MultiFab_C_F.cpp +++ b/Src/F_BaseLib/MultiFab_C_F.cpp @@ -17,7 +17,7 @@ MultiFab_C_to_F::MultiFab_C_to_F (const Geometry& geom, std::vector hi(nb*dm); for ( int i = 0; i < nb; ++i ) { - const Box& bx = BoxLib::enclosedCells(ba[i]); + const Box& bx = amrex::enclosedCells(ba[i]); for ( int j = 0; j < dm; ++j ) { lo[j + i*dm] = bx.smallEnd(j); hi[j + i*dm] = bx.bigEnd(j); diff --git a/Src/F_Interfaces/BaseLib/main.cpp b/Src/F_Interfaces/BaseLib/main.cpp index af3f1cc9762..9261118ae07 100644 --- a/Src/F_Interfaces/BaseLib/main.cpp +++ b/Src/F_Interfaces/BaseLib/main.cpp @@ -6,7 +6,7 @@ extern "C" { void fmain(); } int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -14,5 +14,5 @@ int main (int argc, char* argv[]) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Src/LinearSolvers/C_CellMG/AMReX_CGSolver.cpp b/Src/LinearSolvers/C_CellMG/AMReX_CGSolver.cpp index 16eceae64cb..c74f61d2990 100644 --- a/Src/LinearSolvers/C_CellMG/AMReX_CGSolver.cpp +++ b/Src/LinearSolvers/C_CellMG/AMReX_CGSolver.cpp @@ -70,8 +70,8 @@ CGSolver::Initialize () pp.query("use_jacobi_precond", use_jacobi_precond); pp.query("unstable_criterion", def_unstable_criterion); - if (SSS < 1 ) BoxLib::Abort("SSS must be >= 1"); - if (SSS > SSS_MAX) BoxLib::Abort("SSS must be <= SSS_MAX"); + if (SSS < 1 ) amrex::Abort("SSS must be >= 1"); + if (SSS > SSS_MAX) amrex::Abort("SSS must be <= SSS_MAX"); int ii; if (pp.query("cg_solver", ii)) @@ -82,7 +82,7 @@ CGSolver::Initialize () case 1: def_cg_solver = BiCGStab; break; case 2: def_cg_solver = CABiCGStab; break; default: - BoxLib::Error("CGSolver::Initialize(): bad cg_solver"); + amrex::Error("CGSolver::Initialize(): bad cg_solver"); } } @@ -97,7 +97,7 @@ CGSolver::Initialize () std::cout << " SSS = " << SSS << '\n'; } - BoxLib::ExecOnFinalize(CGSolver::Finalize); + amrex::ExecOnFinalize(CGSolver::Finalize); initialized = true; } @@ -171,7 +171,7 @@ CGSolver::solve (MultiFab& sol, case CABiCGStab: return solve_cabicgstab(sol, rhs, eps_rel, eps_abs, bc_mode); default: - BoxLib::Error("CGSolver::solve(): unknown solver"); + amrex::Error("CGSolver::solve(): unknown solver"); } return -1; @@ -725,7 +725,7 @@ CGSolver::solve_cabicgstab (MultiFab& sol, if ( L2_norm_of_resid > L2_norm_of_rt ) { if ( ParallelDescriptor::IOProcessor(color()) ) - BoxLib::Warning("CGSolver_CABiCGStab: failed to converge!"); + amrex::Warning("CGSolver_CABiCGStab: failed to converge!"); // // Return code 8 tells the MultiGrid driver to zero out the solution! // @@ -1033,7 +1033,7 @@ CGSolver::solve_bicgstab (MultiFab& sol, #endif { if ( ParallelDescriptor::IOProcessor(color()) ) - BoxLib::Warning("CGSolver_BiCGStab:: failed to converge!"); + amrex::Warning("CGSolver_BiCGStab:: failed to converge!"); ret = 8; } @@ -1207,7 +1207,7 @@ CGSolver::solve_cg (MultiFab& sol, #endif { if ( ParallelDescriptor::IOProcessor(color()) ) - BoxLib::Warning("CGSolver_cg: failed to converge!"); + amrex::Warning("CGSolver_cg: failed to converge!"); ret = 8; } @@ -1365,7 +1365,7 @@ CGSolver::jbb_precond (MultiFab& sol, { if ( ParallelDescriptor::IOProcessor(color()) ) { - BoxLib::Warning("jbb_precond:: failed to converge!"); + amrex::Warning("jbb_precond:: failed to converge!"); } ret = 8; } diff --git a/Src/LinearSolvers/C_CellMG/AMReX_Laplacian.cpp b/Src/LinearSolvers/C_CellMG/AMReX_Laplacian.cpp index c62c96305aa..629b510b5f5 100644 --- a/Src/LinearSolvers/C_CellMG/AMReX_Laplacian.cpp +++ b/Src/LinearSolvers/C_CellMG/AMReX_Laplacian.cpp @@ -18,7 +18,7 @@ Laplacian::norm (int nm, int level, const bool local) case 0: return 8.0/(h[level][0]*h[level][0]); } - BoxLib::Error("Bad Laplacian::norm"); + amrex::Error("Bad Laplacian::norm"); return -1.0; } diff --git a/Src/LinearSolvers/C_CellMG/AMReX_LinOp.cpp b/Src/LinearSolvers/C_CellMG/AMReX_LinOp.cpp index c9be467fe00..bd1649d8d74 100644 --- a/Src/LinearSolvers/C_CellMG/AMReX_LinOp.cpp +++ b/Src/LinearSolvers/C_CellMG/AMReX_LinOp.cpp @@ -50,7 +50,7 @@ LinOp::Initialize () std::cout << "def_maxorder = " << def_maxorder << '\n'; } - BoxLib::ExecOnFinalize(LinOp::Finalize); + amrex::ExecOnFinalize(LinOp::Finalize); initialized = true; } @@ -296,7 +296,7 @@ LinOp::jacobi_smooth (MultiFab& solnL, Real LinOp::norm (int nm, int level, const bool local) { - BoxLib::Error("LinOp::norm: Placeholder for pure virtual function"); + amrex::Error("LinOp::norm: Placeholder for pure virtual function"); return 0; } @@ -320,7 +320,7 @@ LinOp::prepareForLevel (int level) h[level][i] = h[level-1][i]*2.0; } geomarray.resize(level+1); - geomarray[level].define(BoxLib::coarsen(geomarray[level-1].Domain(),2)); + geomarray[level].define(amrex::coarsen(geomarray[level-1].Domain(),2)); // // Add a box to the new coarser level (assign removes old BoxArray). // @@ -402,7 +402,7 @@ LinOp::makeCoefficients (MultiFab& cs, } else { - BoxLib::Error("LinOp::makeCoeffients: Bad index type"); + amrex::Error("LinOp::makeCoeffients: Bad index type"); } BoxArray d(gbox[level]); @@ -479,7 +479,7 @@ LinOp::makeCoefficients (MultiFab& cs, } break; default: - BoxLib::Error("LinOp:: bad coefficient coarsening direction!"); + amrex::Error("LinOp:: bad coefficient coarsening direction!"); } } @@ -556,14 +556,14 @@ LinOp::getDx (int level) Real LinOp::get_alpha () const { - BoxLib::Abort("LinOp::get_alpha"); + amrex::Abort("LinOp::get_alpha"); return 0; } Real LinOp::get_beta () const { - BoxLib::Abort("LinOp::get_beta"); + amrex::Abort("LinOp::get_beta"); return 0; } @@ -571,7 +571,7 @@ const MultiFab& LinOp::aCoefficients (int level) { static MultiFab junk; - BoxLib::Abort("LinOp::aCoefficients"); + amrex::Abort("LinOp::aCoefficients"); return junk; } @@ -579,7 +579,7 @@ const MultiFab& LinOp::bCoefficients (int dir,int level) { static MultiFab junk; - BoxLib::Abort("LinOp::bCoefficients"); + amrex::Abort("LinOp::bCoefficients"); return junk; } diff --git a/Src/LinearSolvers/C_CellMG/AMReX_MultiGrid.cpp b/Src/LinearSolvers/C_CellMG/AMReX_MultiGrid.cpp index 494eb07f9fb..9ce6ac15074 100644 --- a/Src/LinearSolvers/C_CellMG/AMReX_MultiGrid.cpp +++ b/Src/LinearSolvers/C_CellMG/AMReX_MultiGrid.cpp @@ -105,7 +105,7 @@ MultiGrid::Initialize () std::cout << " use_Anorm_for_convergence = " << use_Anorm_for_convergence << '\n'; } - BoxLib::ExecOnFinalize(MultiGrid::Finalize); + amrex::ExecOnFinalize(MultiGrid::Finalize); initialized = true; } @@ -298,7 +298,7 @@ MultiGrid::solve (MultiFab& _sol, // We can now use homogeneous bc's because we have put the problem into residual-correction form. // if ( !solve_(_sol, _eps_rel, _eps_abs, LinOp::Homogeneous_BC, tmp[0], tmp[1]) ) - BoxLib::Error("MultiGrid:: failed to converge!"); + amrex::Error("MultiGrid:: failed to converge!"); } int diff --git a/Src/LinearSolvers/C_CellMG4/AMReX_ABec2.cpp b/Src/LinearSolvers/C_CellMG4/AMReX_ABec2.cpp index 6c7af8afcde..9727e8394b6 100644 --- a/Src/LinearSolvers/C_CellMG4/AMReX_ABec2.cpp +++ b/Src/LinearSolvers/C_CellMG4/AMReX_ABec2.cpp @@ -271,7 +271,7 @@ ABec2::smooth (MultiFab& solnL, } else { - BoxLib::Abort("Shouldnt be here"); + amrex::Abort("Shouldnt be here"); } } @@ -301,7 +301,7 @@ ABec2::jacobi_smooth (MultiFab& solnL, } else { - BoxLib::Abort("Shouldnt be here"); + amrex::Abort("Shouldnt be here"); } } diff --git a/Src/LinearSolvers/C_CellMG4/AMReX_ABec4.cpp b/Src/LinearSolvers/C_CellMG4/AMReX_ABec4.cpp index 45ba6df417f..81a0fd7030b 100644 --- a/Src/LinearSolvers/C_CellMG4/AMReX_ABec4.cpp +++ b/Src/LinearSolvers/C_CellMG4/AMReX_ABec4.cpp @@ -196,7 +196,7 @@ ABec4::ca2cc(const MultiFab& ca, MultiFab& cc, const FArrayBox& caf = ca[mfi]; FArrayBox& ccf = cc[mfi]; const Box& box = mfi.tilebox(); - BL_ASSERT(caf.box().contains(BoxLib::grow(box,1))); + BL_ASSERT(caf.box().contains(amrex::grow(box,1))); FORT_CA2CC(box.loVect(), box.hiVect(), caf.dataPtr(sComp), ARLIM(caf.box().loVect()), ARLIM(caf.box().hiVect()), ccf.dataPtr(dComp), ARLIM(ccf.box().loVect()), ARLIM(ccf.box().hiVect()), @@ -215,7 +215,7 @@ ABec4::cc2ca(const MultiFab& cc, MultiFab& ca, const FArrayBox& ccf = cc[mfi]; FArrayBox& caf = ca[mfi]; const Box& box = mfi.growntilebox(); - BL_ASSERT(ccf.box().contains(BoxLib::grow(box,1))); + BL_ASSERT(ccf.box().contains(amrex::grow(box,1))); FORT_CC2CA(box.loVect(), box.hiVect(), ccf.dataPtr(sComp), ARLIM(ccf.box().loVect()), ARLIM(ccf.box().hiVect()), caf.dataPtr(dComp), ARLIM(caf.box().loVect()), ARLIM(caf.box().hiVect()), @@ -465,7 +465,7 @@ ABec4::Fsmooth (MultiFab& solnL, int level, int redBlackFlag) { - BoxLib::Abort("ABec4 does not surrport Fsmooth at level = 0"); + amrex::Abort("ABec4 does not surrport Fsmooth at level = 0"); } void @@ -473,7 +473,7 @@ ABec4::Fsmooth_jacobi (MultiFab& solnL, const MultiFab& rhsL, int level) { - BoxLib::Abort("ABec4 does not surrport Fsmooth_jacobi"); + amrex::Abort("ABec4 does not surrport Fsmooth_jacobi"); } void @@ -567,7 +567,7 @@ ABec4::Fapply (MultiFab& y, } } else { - BoxLib::Abort("ABec4 cannot do Fapply on level != 0"); + amrex::Abort("ABec4 cannot do Fapply on level != 0"); } } diff --git a/Src/LinearSolvers/C_TensorMG/AMReX_MCCGSolver.cpp b/Src/LinearSolvers/C_TensorMG/AMReX_MCCGSolver.cpp index 01e65dabfe2..7f0825fd9ab 100644 --- a/Src/LinearSolvers/C_TensorMG/AMReX_MCCGSolver.cpp +++ b/Src/LinearSolvers/C_TensorMG/AMReX_MCCGSolver.cpp @@ -43,7 +43,7 @@ MCCGSolver::Initialize () std::cout << "def_isExpert = " << def_isExpert << '\n'; } - BoxLib::ExecOnFinalize(MCCGSolver::Finalize); + amrex::ExecOnFinalize(MCCGSolver::Finalize); initialized = true; } @@ -296,11 +296,11 @@ MCCGSolver::solve (MultiFab& sol, if (ret != 0 && isExpert == false) { - BoxLib::Error("MCCGSolver:: apparent accuracy problem; try expert setting or change unstable_criterion"); + amrex::Error("MCCGSolver:: apparent accuracy problem; try expert setting or change unstable_criterion"); } if (ret==0 && rnorm > eps_rel*rnorm0 && rnorm > eps_abs) { - BoxLib::Error("MCCGSolver:: failed to converge!"); + amrex::Error("MCCGSolver:: failed to converge!"); } // // Omit ghost update since maybe not initialized in calling routine. diff --git a/Src/LinearSolvers/C_TensorMG/AMReX_MCInterpBndryData.cpp b/Src/LinearSolvers/C_TensorMG/AMReX_MCInterpBndryData.cpp index 5823260fcf0..1dcaf725f02 100644 --- a/Src/LinearSolvers/C_TensorMG/AMReX_MCInterpBndryData.cpp +++ b/Src/LinearSolvers/C_TensorMG/AMReX_MCInterpBndryData.cpp @@ -180,7 +180,7 @@ MCInterpBndryData::setBndryValues (const ::BndryRegister& crse, BL_ASSERT(grids[finemfi.index()] == finemfi.validbox()); const Box& fine_bx = finemfi.validbox(); - Box crse_bx = BoxLib::coarsen(fine_bx,ratio); + Box crse_bx = amrex::coarsen(fine_bx,ratio); const int* cblo = crse_bx.loVect(); const int* cbhi = crse_bx.hiVect(); int mxlen = crse_bx.longside() + 2; diff --git a/Src/LinearSolvers/C_TensorMG/AMReX_MCLinOp.cpp b/Src/LinearSolvers/C_TensorMG/AMReX_MCLinOp.cpp index 773ad6a5542..25fb4e00d26 100644 --- a/Src/LinearSolvers/C_TensorMG/AMReX_MCLinOp.cpp +++ b/Src/LinearSolvers/C_TensorMG/AMReX_MCLinOp.cpp @@ -51,7 +51,7 @@ MCLinOp::Initialize () if (ParallelDescriptor::IOProcessor() && def_verbose) std::cout << "def_harmavg = " << def_harmavg << '\n'; - BoxLib::ExecOnFinalize(MCLinOp::Finalize); + amrex::ExecOnFinalize(MCLinOp::Finalize); initialized = true; } @@ -230,7 +230,7 @@ MCLinOp::applyBC (MultiFab& inout, else if (cdir == 1) perpdir = 0; else - BoxLib::Abort("MCLinOp::applyBC(): bad logic"); + amrex::Abort("MCLinOp::applyBC(): bad logic"); const Mask& m = (*maskvals[level][face])[mfi]; const Mask& mphi = (*maskvals[level][Orientation(perpdir,Orientation::high)])[mfi]; @@ -423,7 +423,7 @@ MCLinOp::makeCoefficients (MultiFab& cs, } #endif else - BoxLib::Abort("MCLinOp::makeCoeffients(): Bad index type"); + amrex::Abort("MCLinOp::makeCoeffients(): Bad index type"); BoxArray d(gbox[level]); if (cdir >= 0) @@ -478,7 +478,7 @@ MCLinOp::makeCoefficients (MultiFab& cs, } break; default: - BoxLib::Error("MCLinOp::makeCoeffients(): bad coefficient coarsening direction!"); + amrex::Error("MCLinOp::makeCoeffients(): bad coefficient coarsening direction!"); } } } diff --git a/Src/LinearSolvers/C_TensorMG/AMReX_MCMultiGrid.cpp b/Src/LinearSolvers/C_TensorMG/AMReX_MCMultiGrid.cpp index 483ebbaf1d1..66fee46f171 100644 --- a/Src/LinearSolvers/C_TensorMG/AMReX_MCMultiGrid.cpp +++ b/Src/LinearSolvers/C_TensorMG/AMReX_MCMultiGrid.cpp @@ -84,7 +84,7 @@ MCMultiGrid::Initialize () std::cout << "def_verbose = " << def_verbose << '\n'; } - BoxLib::ExecOnFinalize(MCMultiGrid::Finalize); + amrex::ExecOnFinalize(MCMultiGrid::Finalize); initialized = true; } @@ -262,7 +262,7 @@ MCMultiGrid::solve (MultiFab& _sol, prepareForLevel(level); residualCorrectionForm(*rhs[level],_rhs,*cor[level],_sol,bc_mode,level); if (!solve_(_sol, _eps_rel, _eps_abs, MCHomogeneous_BC, level)) - BoxLib::Error("MCMultiGrid::solve(): failed to converge!"); + amrex::Error("MCMultiGrid::solve(): failed to converge!"); } int @@ -412,7 +412,7 @@ MCMultiGrid::numLevels () const Box tmp = bs[i]; if (tmp.shortside() <= 3 ) - BoxLib::Error("MCMultiGrid::numLevels(): fine grid too small"); + amrex::Error("MCMultiGrid::numLevels(): fine grid too small"); for (;;) { diff --git a/Src/LinearSolvers/C_to_F_MG/AMReX_FMultiGrid.cpp b/Src/LinearSolvers/C_to_F_MG/AMReX_FMultiGrid.cpp index 9d6ed121e77..46577dddf88 100644 --- a/Src/LinearSolvers/C_to_F_MG/AMReX_FMultiGrid.cpp +++ b/Src/LinearSolvers/C_to_F_MG/AMReX_FMultiGrid.cpp @@ -14,7 +14,7 @@ FMultiGrid::FMultiGrid (const Geometry & geom, m_bndry(nullptr) { if (m_baselevel > 0 && m_crse_ratio == IntVect::TheZeroVector()) - BoxLib::Abort("FMultiGrid: must set crse_ratio if baselevel > 0"); + amrex::Abort("FMultiGrid: must set crse_ratio if baselevel > 0"); } FMultiGrid::FMultiGrid (const Array & geom, @@ -31,7 +31,7 @@ FMultiGrid::FMultiGrid (const Array & geom, m_bndry(nullptr) { if (m_baselevel > 0 && m_crse_ratio == IntVect::TheZeroVector()) - BoxLib::Abort("FMultiGrid: must set crse_ratio if baselevel > 0"); + amrex::Abort("FMultiGrid: must set crse_ratio if baselevel > 0"); } void @@ -331,7 +331,7 @@ FMultiGrid::Boundary::set_bndry_values (MacBndry& bndry, IntVect crse_ratio) } else { - BoxLib::Abort("FMultiGrid::Boundary::build_bndry: How did we get here?"); + amrex::Abort("FMultiGrid::Boundary::build_bndry: How did we get here?"); } } @@ -394,7 +394,7 @@ FMultiGrid::ABecCoeff::set_coeffs (MGT_Solver & mgt_solver, FMultiGrid& fmg) } default: { - BoxLib::Abort("FMultiGrid::ABecCoeff::set_coeffs: How did we get here?"); + amrex::Abort("FMultiGrid::ABecCoeff::set_coeffs: How did we get here?"); } } } diff --git a/Src/LinearSolvers/C_to_F_MG/AMReX_MGT_Solver.cpp b/Src/LinearSolvers/C_to_F_MG/AMReX_MGT_Solver.cpp index 08622a47379..1cf8abe0313 100644 --- a/Src/LinearSolvers/C_to_F_MG/AMReX_MGT_Solver.cpp +++ b/Src/LinearSolvers/C_to_F_MG/AMReX_MGT_Solver.cpp @@ -270,7 +270,7 @@ MGT_Solver::FlushFortranOutput() void MGT_Solver::initialize(bool nodal) { - BoxLib::ExecOnFinalize(MGT_Solver::Finalize); + amrex::ExecOnFinalize(MGT_Solver::Finalize); initialized = true; @@ -622,7 +622,7 @@ MGT_Solver::solve(const Array& uu, const Array& rh, const mgt_solve(tol,abs_tol,&need_grad_phi,&final_resnorm,&status,&always_use_bnorm); if (status != 0) - BoxLib::Error("Multigrid did not converge!"); + amrex::Error("Multigrid did not converge!"); int ng = (need_grad_phi == 1) ? 1 : 0; diff --git a/Src/Particle/AMReX_ParticleInit.H b/Src/Particle/AMReX_ParticleInit.H index d8110ab78d9..6edee169c54 100644 --- a/Src/Particle/AMReX_ParticleInit.H +++ b/Src/Particle/AMReX_ParticleInit.H @@ -68,7 +68,7 @@ ParticleContainer::InitFromAsciiFile (const std::string& file, int extr ifs.open(file.c_str(), std::ios::in); if (!ifs.good()) - BoxLib::FileOpenFailed(file); + amrex::FileOpenFailed(file); int cnt = 0; @@ -89,7 +89,7 @@ ParticleContainer::InitFromAsciiFile (const std::string& file, int extr std::string msg("ParticleContainer::InitFromAsciiFile("); msg += file; msg += ") failed @ 1"; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } int MyCnt = Chunk; @@ -134,7 +134,7 @@ ParticleContainer::InitFromAsciiFile (const std::string& file, int extr { std::string msg("ParticleContainer::InitFromAsciiFile("); msg += file; msg += ") failed @ 2"; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } if (!ParticleBase::Where(p,m_gdb)) @@ -150,7 +150,7 @@ ParticleContainer::InitFromAsciiFile (const std::string& file, int extr std::cout << "BAD PARTICLE POS(" << d << ") " << p.m_pos[d] << std::endl; } - BoxLib::Abort("ParticleContainer::InitFromAsciiFile(): invalid particle"); + amrex::Abort("ParticleContainer::InitFromAsciiFile(): invalid particle"); } } @@ -196,7 +196,7 @@ ParticleContainer::InitFromAsciiFile (const std::string& file, int extr if (!ParticleBase::Where(p_rep,m_gdb)) { std::cout << "BAD REPLICATED PARTICLE ID WOULD BE " << ParticleBase::NextID() << std::endl; - BoxLib::Abort("ParticleContainer::InitFromAsciiFile(): invalid replicated particle"); + amrex::Abort("ParticleContainer::InitFromAsciiFile(): invalid replicated particle"); } } // @@ -421,7 +421,7 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, { do { - int n = int(BoxLib::Random() * (NProcs-1)); + int n = int(amrex::Random() * (NProcs-1)); BL_ASSERT(n >= 0); BL_ASSERT(n < NProcs); @@ -468,7 +468,7 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, ifs.open(file.c_str(), std::ios::in|std::ios::binary); if (!ifs.good()) - BoxLib::FileOpenFailed(file); + amrex::FileOpenFailed(file); ifs.read((char*)&NP, sizeof(NP)); ifs.read((char*)&DM, sizeof(DM)); @@ -477,22 +477,22 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, // NP MUST be positive! // if (NP <= 0) - BoxLib::Abort("ParticleContainer::InitFromBinaryFile(): NP <= 0"); + amrex::Abort("ParticleContainer::InitFromBinaryFile(): NP <= 0"); // // DM must equal BL_SPACEDIM. // if (DM != BL_SPACEDIM) - BoxLib::Abort("ParticleContainer::InitFromBinaryFile(): DM != BL_SPACEDIM"); + amrex::Abort("ParticleContainer::InitFromBinaryFile(): DM != BL_SPACEDIM"); // // NX MUST be in [0,N]. // if (NX < 0 || NX > NR) - BoxLib::Abort("ParticleContainer::InitFromBinaryFile(): NX < 0 || NX > N"); + amrex::Abort("ParticleContainer::InitFromBinaryFile(): NX < 0 || NX > N"); // // Can't ask for more data than exists in the file! // if (extradata > NX) - BoxLib::Abort("ParticleContainer::InitFromBinaryFile(): extradata > NX"); + amrex::Abort("ParticleContainer::InitFromBinaryFile(): extradata > NX"); // // Figure out whether we're dealing with floats or doubles. // @@ -537,7 +537,7 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, std::string msg("ParticleContainer::InitFromBinaryFile("); msg += file; msg += ") failed @ 1"; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } } // @@ -667,7 +667,7 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, std::string msg("ParticleContainer::InitFromBinaryFile("); msg += file; msg += ") failed @ 2"; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } if (!ParticleBase::Where(p,m_gdb)) @@ -683,7 +683,7 @@ ParticleContainer::InitFromBinaryFile (const std::string& file, std::cout << "BAD PARTICLE POS(" << d << ") " << p.m_pos[d] << std::endl; } - BoxLib::Abort("ParticleContainer::InitFromBinaryFile(): invalid particle"); + amrex::Abort("ParticleContainer::InitFromBinaryFile(): invalid particle"); } } @@ -833,7 +833,7 @@ ParticleContainer::InitRandom (long icount, const Real* xlo = containing_bx.lo(); const Real* xhi = containing_bx.hi(); - BoxLib::InitRandom(iseed+MyProc); + amrex::InitRandom(iseed+MyProc); m_particles.resize(m_gdb->finestLevel()+1); @@ -861,7 +861,7 @@ ParticleContainer::InitRandom (long icount, { do { - r = BoxLib::Random(); + r = amrex::Random(); x = geom.ProbLo(i) + (r * len[i]); } while (x < xlo[i] || x > xhi[i]); @@ -897,7 +897,7 @@ ParticleContainer::InitRandom (long icount, if (!ParticleBase::Where(p,m_gdb)) { - BoxLib::Abort("ParticleContainer::InitRandom(): invalid particle"); + amrex::Abort("ParticleContainer::InitRandom(): invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); @@ -944,7 +944,7 @@ ParticleContainer::InitRandom (long icount, { do { - r = BoxLib::Random(); + r = amrex::Random(); x = geom.ProbLo(i) + (r * len[i]); } while (x < xlo[i] || x > xhi[i]); @@ -970,7 +970,7 @@ ParticleContainer::InitRandom (long icount, if (!ParticleBase::Where(p,m_gdb)) { - BoxLib::Abort("ParticleContainer::InitRandom(): invalid particle"); + amrex::Abort("ParticleContainer::InitRandom(): invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); @@ -1071,7 +1071,7 @@ ParticleContainer::InitOnePerCell (Real x_off, Real y_off, Real z_off, if (!ParticleBase::Where(p,m_gdb)) { - BoxLib::Abort("ParticleContainer::InitOnePerCell(): invalid particle"); + amrex::Abort("ParticleContainer::InitOnePerCell(): invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); @@ -1145,11 +1145,11 @@ ParticleContainer::InitNRandomPerCell (int n_per_cell, Real mass, Multi for (int n = 0; n < n_per_cell; n++) { - r = BoxLib::Random(); + r = amrex::Random(); p.m_pos[0] = grid_box.lo(0) + (r + i)*dx[0]; - r = BoxLib::Random(); + r = amrex::Random(); p.m_pos[1] = grid_box.lo(1) + (r + j)*dx[1]; - r = BoxLib::Random(); + r = amrex::Random(); p.m_pos[2] = grid_box.lo(2) + (r + k)*dx[2]; for (int i = 0; i < BL_SPACEDIM; i++) @@ -1170,7 +1170,7 @@ ParticleContainer::InitNRandomPerCell (int n_per_cell, Real mass, Multi p.m_cpu = ParallelDescriptor::MyProc(); if (!ParticleBase::Where(p,m_gdb)) - BoxLib::Abort("ParticleContainer::InitNRandomPerCell(): invalid particle"); + amrex::Abort("ParticleContainer::InitNRandomPerCell(): invalid particle"); BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); // diff --git a/Src/Particle/AMReX_Particles.H b/Src/Particle/AMReX_Particles.H index 29ac7a9465f..82641f7c396 100644 --- a/Src/Particle/AMReX_Particles.H +++ b/Src/Particle/AMReX_Particles.H @@ -616,10 +616,10 @@ ParticleContainer::addOneParticle (int id_in, p.m_cpu = cpu_in; if (p.m_id <= 0) - BoxLib::Abort("Particle ID's must be > 0 in addOneParticle"); + amrex::Abort("Particle ID's must be > 0 in addOneParticle"); if (ParallelDescriptor::MyProc() != p.m_cpu) - BoxLib::Abort("cpu_in must equal MyProc() in addOneParticle"); + amrex::Abort("cpu_in must equal MyProc() in addOneParticle"); for (int i = 0; i < BL_SPACEDIM; i++) p.m_pos[i] = xloc[i]; @@ -655,7 +655,7 @@ ParticleContainer::addOneParticle (int id_in, { std::cout << "BAD PARTICLE POS(" << d << ") " << p.m_pos[d] << std::endl; } - BoxLib::Abort("ParticleContainer::addOneParticle(): invalid particle"); + amrex::Abort("ParticleContainer::addOneParticle(): invalid particle"); } } @@ -706,7 +706,7 @@ ParticleContainer::addNParticles(int n_part, Array& x, Array::addNParticles(): invalid particle location"); + amrex::Abort("ParticleContainer::addNParticles(): invalid particle location"); for (int i = 0; i < n_attr; i++) p.m_data[BL_SPACEDIM+i] = attributes[n_attr*j + i]; @@ -752,7 +752,7 @@ ParticleContainer::MoveRandom (int lev) static bool first = true; - static Array rn; + static Array rn; if (first) { @@ -774,7 +774,7 @@ ParticleContainer::MoveRandom (int lev) // const unsigned long seedbase = 1+tnum*ParallelDescriptor::MyProc(); - rn[i] = BoxLib::mt19937(seedbase+i); + rn[i] = amrex::mt19937(seedbase+i); } } @@ -1134,7 +1134,7 @@ ParticleContainer::GetParticleData (Array& part_data, int start_c // Make sure we don't try to get more than we have // if (start_comp + num_comp > NR) - BoxLib::Error("Tried to grab too many components in GetParticleData!!"); + amrex::Error("Tried to grab too many components in GetParticleData!!"); #if BL_USE_MPI Array cnts(ParallelDescriptor::NProcs()); @@ -1237,7 +1237,7 @@ ParticleContainer::SetParticleLocations (Array& part_data) // Mass + locations if (part_data.size() != npart*BL_SPACEDIM) - BoxLib::Abort("Sending in wrong size part_data to SetParticleLocations"); + amrex::Abort("Sending in wrong size part_data to SetParticleLocations"); for (int lev = 0; lev <= m_gdb->finestLevel(); lev++) { @@ -1307,7 +1307,7 @@ ParticleContainer::AddParticlesAtLevel (int level, // // Virtuals shouldn't be in Ghost cells. // - BoxLib::Abort("ParticleContainer::AddParticlesAtLevel(): Can't add outside of domain\n"); + amrex::Abort("ParticleContainer::AddParticlesAtLevel(): Can't add outside of domain\n"); } else { @@ -1440,7 +1440,7 @@ ParticleContainer::CreateVirtualParticles (int level, // // Create a buffer so that particles near the cf border are not aggregated. // - BoxArray buffer = BoxLib::complementIn(m_gdb->Geom(level).Domain(), m_gdb->ParticleBoxArray(level)); + BoxArray buffer = amrex::complementIn(m_gdb->Geom(level).Domain(), m_gdb->ParticleBoxArray(level)); buffer.grow(aggregation_buffer); @@ -1529,11 +1529,11 @@ ParticleContainer::CreateVirtualParticles (int level, } else if (aggregation_type == "Flow") { - BoxLib::Abort("Flow aggregation not implemented"); + amrex::Abort("Flow aggregation not implemented"); } else { - BoxLib::Abort("Unknown Particle Aggregation mode"); + amrex::Abort("Unknown Particle Aggregation mode"); } } } @@ -1684,7 +1684,7 @@ ParticleContainer::Redistribute (bool where_already_called, if (lev_min != 0) // RestrictedWhere should be unnecessary at top level. { if (!ParticleBase::RestrictedWhere(p, m_gdb, nGrow)) - BoxLib::Abort("ParticleContainer::Redistribute(): invalid particle at non-coarse step"); + amrex::Abort("ParticleContainer::Redistribute(): invalid particle at non-coarse step"); } else { @@ -1699,7 +1699,7 @@ ParticleContainer::Redistribute (bool where_already_called, else { std::cout << "Bad Particle: " << p << '\n'; - BoxLib::Abort("ParticleContainer::Redistribute(): invalid particle in basic check"); + amrex::Abort("ParticleContainer::Redistribute(): invalid particle in basic check"); } } } @@ -2219,8 +2219,8 @@ ParticleContainer::Checkpoint (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(pdir, 0755)) - BoxLib::CreateDirectoryFailed(pdir); + if (!amrex::UtilCreateDirectory(pdir, 0755)) + amrex::CreateDirectoryFailed(pdir); // // Force other processors to wait till directory is built. // @@ -2271,7 +2271,7 @@ ParticleContainer::Checkpoint (const std::string& dir, HdrFile.open(HdrFileName.c_str(), std::ios::out|std::ios::trunc); if (!HdrFile.good()) - BoxLib::FileOpenFailed(HdrFileName); + amrex::FileOpenFailed(HdrFileName); // // First thing written is our Checkpoint/Restart version string. // @@ -2339,11 +2339,11 @@ ParticleContainer::Checkpoint (const std::string& dir, if (!LevelDir.empty() && LevelDir[LevelDir.size()-1] != '/') LevelDir += '/'; - LevelDir = BoxLib::Concatenate(LevelDir + "Level_", lev, 1); + LevelDir = amrex::Concatenate(LevelDir + "Level_", lev, 1); if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(LevelDir, 0755)) - BoxLib::CreateDirectoryFailed(LevelDir); + if (!amrex::UtilCreateDirectory(LevelDir, 0755)) + amrex::CreateDirectoryFailed(LevelDir); // // Force other processors to wait till directory is built. // @@ -2366,7 +2366,7 @@ ParticleContainer::Checkpoint (const std::string& dir, FullFileName += '/'; FullFileName += ParticleBase::DataPrefix(); - FullFileName += BoxLib::Concatenate("", FileNumber, 4); + FullFileName += amrex::Concatenate("", FileNumber, 4); std::ofstream ParticleFile; @@ -2401,7 +2401,7 @@ ParticleContainer::Checkpoint (const std::string& dir, } if (!ParticleFile.good()) - BoxLib::FileOpenFailed(FullFileName); + amrex::FileOpenFailed(FullFileName); // // Write out all the valid particles we own at the specified level. // Do it grid block by grid block remembering the seek offset @@ -2414,7 +2414,7 @@ ParticleContainer::Checkpoint (const std::string& dir, ParticleFile.close(); if (!ParticleFile.good()) - BoxLib::Abort("ParticleContainer::Checkpoint(): problem writing ParticleFile"); + amrex::Abort("ParticleContainer::Checkpoint(): problem writing ParticleFile"); int iBuff = 0, wakeUpPID = (MyProc + nOutFiles), tag = (MyProc % nOutFiles); @@ -2470,9 +2470,9 @@ ParticleContainer::Checkpoint (const std::string& dir, FullFileName += '/'; FullFileName += ParticleBase::DataPrefix(); - FullFileName += BoxLib::Concatenate("", i, 4); + FullFileName += amrex::Concatenate("", i, 4); - BoxLib::UnlinkFile(FullFileName.c_str()); + amrex::UnlinkFile(FullFileName.c_str()); } } } @@ -2492,7 +2492,7 @@ ParticleContainer::Checkpoint (const std::string& dir, HdrFile.close(); if (!HdrFile.good()) - BoxLib::Abort("ParticleContainer::Checkpoint(): problem writing HdrFile"); + amrex::Abort("ParticleContainer::Checkpoint(): problem writing HdrFile"); std::cout << "ParticleContainer::Checkpoint() time: " << stoptime << '\n'; } @@ -2723,7 +2723,7 @@ ParticleContainer::Restart (const std::string& dir, HdrFile.open(HdrFileName.c_str(), std::ios::in); if (!HdrFile.good()) - BoxLib::FileOpenFailed(HdrFileName); + amrex::FileOpenFailed(HdrFileName); // // First value should be the version string. // @@ -2775,14 +2775,14 @@ ParticleContainer::Restart (const std::string& dir, { std::string msg("ParticleContainer::Restart(): bad version string: "); msg += version; - BoxLib::Error(version.c_str()); + amrex::Error(version.c_str()); } } else { std::string msg("ParticleContainer::Restart(): unknown version string: "); msg += version; - BoxLib::Abort(msg.c_str()); + amrex::Abort(msg.c_str()); } if (m_verbose > 1) @@ -2819,7 +2819,7 @@ ParticleContainer::Restart_Doit (const std::string& fullname, HdrFile >> dm; if (dm != BL_SPACEDIM) - BoxLib::Abort("ParticleContainer::Restart(): dm != BL_SPACEDIM"); + amrex::Abort("ParticleContainer::Restart(): dm != BL_SPACEDIM"); } ParallelDescriptor::Bcast(&dm, 1, IOProc); // @@ -2832,7 +2832,7 @@ ParticleContainer::Restart_Doit (const std::string& fullname, HdrFile >> n; if (n != NR) - BoxLib::Abort("ParticleContainer::Restart(): n != N"); + amrex::Abort("ParticleContainer::Restart(): n != N"); } ParallelDescriptor::Bcast(&n, 1, IOProc); @@ -2942,17 +2942,17 @@ ParticleContainer::Restart_Doit (const std::string& fullname, name += '/'; name += "Level_"; - name += BoxLib::Concatenate("", lev, 1); + name += amrex::Concatenate("", lev, 1); name += '/'; name += ParticleBase::DataPrefix(); - name += BoxLib::Concatenate("", which[grid], 4); + name += amrex::Concatenate("", which[grid], 4); std::ifstream ParticleFile; ParticleFile.open(name.c_str(), std::ios::in); if (!ParticleFile.good()) - BoxLib::FileOpenFailed(name); + amrex::FileOpenFailed(name); ParticleFile.seekg(where[grid], std::ios::beg); @@ -2968,13 +2968,13 @@ ParticleContainer::Restart_Doit (const std::string& fullname, { std::string msg("ParticleContainer::Restart_Doit(): bad parameter: "); msg += how; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } ParticleFile.close(); if (!ParticleFile.good()) - BoxLib::Abort("ParticleContainer::Restart_Doit(): problem reading particles"); + amrex::Abort("ParticleContainer::Restart_Doit(): problem reading particles"); } } @@ -3062,7 +3062,7 @@ ParticleContainer::ReadParticles_DoublePrecision (int cnt, std::cout << "RESTART:BAD PARTICLE POS(" << d << ") " << p.m_pos[d] << std::endl; } - BoxLib::Abort("ParticleContainer::ReadParticles_DoublePrecision(): invalid particle"); + amrex::Abort("ParticleContainer::ReadParticles_DoublePrecision(): invalid particle"); } } @@ -3183,7 +3183,7 @@ ParticleContainer::ReadParticles_SinglePrecision (int cnt, std::cout << "RESTART:BAD PARTICLE POS(" << d << ") " << p.m_pos[d] << std::endl; } - BoxLib::Abort("ParticleContainer::ReadParticles_SinglePrecision(): invalid particle"); + amrex::Abort("ParticleContainer::ReadParticles_SinglePrecision(): invalid particle"); } } @@ -3262,7 +3262,7 @@ ParticleContainer::WriteAsciiFile (const std::string& filename) File.open(filename.c_str(), std::ios::out|std::ios::trunc); if (!File.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); File << nparticles << '\n'; @@ -3271,7 +3271,7 @@ ParticleContainer::WriteAsciiFile (const std::string& filename) File.close(); if (!File.good()) - BoxLib::Abort("ParticleContainer::WriteAsciiFile(): problem writing file"); + amrex::Abort("ParticleContainer::WriteAsciiFile(): problem writing file"); } ParallelDescriptor::Barrier(); @@ -3296,7 +3296,7 @@ ParticleContainer::WriteAsciiFile (const std::string& filename) File.precision(15); if (!File.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); for (const auto& pmap : m_particles) { @@ -3328,7 +3328,7 @@ ParticleContainer::WriteAsciiFile (const std::string& filename) File.close(); if (!File.good()) - BoxLib::Abort("ParticleContainer::WriteAsciiFile(): problem writing file"); + amrex::Abort("ParticleContainer::WriteAsciiFile(): problem writing file"); } @@ -3394,7 +3394,7 @@ ParticleContainer::WriteCoarsenedAsciiFile (const std::string& filename File.open(filename.c_str(), std::ios::out|std::ios::trunc); if (!File.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); File << nparticles << '\n'; @@ -3403,7 +3403,7 @@ ParticleContainer::WriteCoarsenedAsciiFile (const std::string& filename File.close(); if (!File.good()) - BoxLib::Abort("ParticleContainer::WriteCoarsenedAsciiFile(): problem writing file"); + amrex::Abort("ParticleContainer::WriteCoarsenedAsciiFile(): problem writing file"); } ParallelDescriptor::Barrier(); @@ -3428,7 +3428,7 @@ ParticleContainer::WriteCoarsenedAsciiFile (const std::string& filename File.precision(15); if (!File.good()) - BoxLib::FileOpenFailed(filename); + amrex::FileOpenFailed(filename); for (const auto& pmap : m_particles) { @@ -3466,7 +3466,7 @@ ParticleContainer::WriteCoarsenedAsciiFile (const std::string& filename File.close(); if (!File.good()) - BoxLib::Abort("ParticleContainer::WriteCoarsenedAsciiFile(): problem writing file"); + amrex::Abort("ParticleContainer::WriteCoarsenedAsciiFile(): problem writing file"); } @@ -3635,7 +3635,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, Array >& mf_to_be_filled, int lev_min, int ncomp, int finest_level) const { - if (rho_index != 0) BoxLib::Abort("AssignDensity only works if rho_index = 0"); + if (rho_index != 0) amrex::Abort("AssignDensity only works if rho_index = 0"); BL_PROFILE("ParticleContainer::AssignDensity()"); BL_ASSERT(NR >= 1); @@ -3767,7 +3767,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, { if (gm.isAnyPeriodic()) { - const Box& dest = BoxLib::grow(grids[i],dgrow); + const Box& dest = amrex::grow(grids[i],dgrow); if ( ! dm.contains(dest)) { @@ -3835,7 +3835,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, { if (gm.isAnyPeriodic()) { - const Box& dest = BoxLib::grow(cfba[i],mf[lev_index]->nGrow()); + const Box& dest = amrex::grow(cfba[i],mf[lev_index]->nGrow()); if ( ! dm.contains(dest)) { @@ -3872,7 +3872,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, // The "+1" is so we enclose the valid region together with any // ghost cells that can be periodically shifted into valid. // - compfvalid = BoxLib::complementIn(BoxLib::grow(dm,dgrow+1), fvalid); + compfvalid = amrex::complementIn(amrex::grow(dm,dgrow+1), fvalid); compfvalid_grown = compfvalid; compfvalid_grown.grow(1); @@ -3880,7 +3880,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, if (gm.isAnyPeriodic() && ! gm.isAllPeriodic()) { - BoxLib::Error("AssignDensity: problem must be periodic in no or all directions"); + amrex::Error("AssignDensity: problem must be periodic in no or all directions"); } // // If we're at a lev > 0, this is the coarsened BoxArray. @@ -3919,7 +3919,7 @@ ParticleContainer::AssignDensity (int rho_index, bool sub_cycle, // if ( ! gm.isAllPeriodic() && ! allow_particles_near_boundary) { if ( ! gm.Domain().contains(cells[0]) || ! gm.Domain().contains(cells[M-1])) { - BoxLib::Error("AssignDensity: if not periodic, all particles must stay away from the domain boundary"); + amrex::Error("AssignDensity: if not periodic, all particles must stay away from the domain boundary"); } } // @@ -4502,7 +4502,7 @@ ParticleContainer::AssignDensityDoit (int rho_index, int ncomp, int lev_min) const { - if (rho_index != 0) BoxLib::Abort("AssignDensityDoit only works if rho_index = 0"); + if (rho_index != 0) amrex::Abort("AssignDensityDoit only works if rho_index = 0"); BL_PROFILE("ParticleContainer::AssignDensityDoit()"); BL_ASSERT(NR >= ncomp); @@ -4734,7 +4734,7 @@ ParticleContainer::AssignDensitySingleLevel (int rho_index, } else { - BoxLib::Abort("AssignCellDensitySingleLevel: mixed type not supported"); + amrex::Abort("AssignCellDensitySingleLevel: mixed type not supported"); } } @@ -4749,7 +4749,7 @@ ParticleContainer::AssignCellDensitySingleLevel (int rho_index, int ncomp, int particle_lvl_offset) const { - if (rho_index != 0) BoxLib::Abort("AssignCellDensitySingleLevel only works if rho_index = 0"); + if (rho_index != 0) amrex::Abort("AssignCellDensitySingleLevel only works if rho_index = 0"); MultiFab* mf_pointer; @@ -4771,7 +4771,7 @@ ParticleContainer::AssignCellDensitySingleLevel (int rho_index, // adjacent grid by first putting the value into ghost cells of its own grid. The mf->sumBoundary call then // adds the value from one grid's ghost cell to another grid's valid region. if (mf_pointer->nGrow() < 1) - BoxLib::Error("Must have at least one ghost cell when in AssignDensitySingleLevel"); + amrex::Error("Must have at least one ghost cell when in AssignDensitySingleLevel"); const Real strttime = ParallelDescriptor::second(); const Geometry& gm = m_gdb->Geom(lev); @@ -4782,7 +4782,7 @@ ParticleContainer::AssignCellDensitySingleLevel (int rho_index, const int ngrids = pmap.size(); if (gm.isAnyPeriodic() && ! gm.isAllPeriodic()) { - BoxLib::Error("AssignDensity: problem must be periodic in no or all directions"); + amrex::Error("AssignDensity: problem must be periodic in no or all directions"); } for (MFIter mfi(*mf_pointer); mfi.isValid(); ++mfi) { @@ -4835,7 +4835,7 @@ ParticleContainer::AssignCellDensitySingleLevel (int rho_index, // if ( ! gm.isAllPeriodic() && ! allow_particles_near_boundary) { if ( ! gm.Domain().contains(cells[0]) || ! gm.Domain().contains(cells[M-1])) { - BoxLib::Error("AssignDensity: if not periodic, all particles must stay away from the domain boundary"); + amrex::Error("AssignDensity: if not periodic, all particles must stay away from the domain boundary"); } } @@ -4939,7 +4939,7 @@ ParticleContainer::NodalDepositionSingleLevel (int rho_index, { // If mf_to_be_filled is not defined on the particle_box_array, then we need // to make a temporary here and copy into mf_to_be_filled at the end. - mf_pointer = new MultiFab(BoxLib::convert(m_gdb->ParticleBoxArray(lev), + mf_pointer = new MultiFab(amrex::convert(m_gdb->ParticleBoxArray(lev), mf_to_be_filled.boxArray().ixType()), ncomp, mf_to_be_filled.nGrow(), m_gdb->ParticleDistributionMap(lev), Fab_allocate); @@ -4952,7 +4952,7 @@ ParticleContainer::NodalDepositionSingleLevel (int rho_index, const int ngrids = pmap.size(); if (gm.isAnyPeriodic() && ! gm.isAllPeriodic()) - BoxLib::Error("AssignDensity: problem must be periodic in no or all directions"); + amrex::Error("AssignDensity: problem must be periodic in no or all directions"); mf_pointer->setVal(0.0); diff --git a/Src/Particle/AMReX_Particles.cpp b/Src/Particle/AMReX_Particles.cpp index b2bdc26af49..f4f2284ae03 100644 --- a/Src/Particle/AMReX_Particles.cpp +++ b/Src/Particle/AMReX_Particles.cpp @@ -215,7 +215,7 @@ ParticleBase::FineToCrse (const ParticleBase& p, which[i] = 0; } - const Box& ibx = BoxLib::grow(gdb->ParticleBoxArray(flev)[p.m_grid],-1); + const Box& ibx = amrex::grow(gdb->ParticleBoxArray(flev)[p.m_grid],-1); BL_ASSERT(ibx.ok()); @@ -309,7 +309,7 @@ ParticleBase::FineCellsToUpdateFromCrse (const ParticleBase& p, BL_ASSERT(lev >= 0); BL_ASSERT(lev < gdb->finestLevel()); - const Box& fbx = BoxLib::refine(Box(ccell,ccell),gdb->refRatio(lev)); + const Box& fbx = amrex::refine(Box(ccell,ccell),gdb->refRatio(lev)); const BoxArray& fba = gdb->ParticleBoxArray(lev+1); const Real* plo = gdb->Geom(lev).ProbLo(); const Real* dx = gdb->Geom(lev).CellSize(); @@ -437,7 +437,7 @@ ParticleBase::MaxReaders () Max_Readers = std::min(ParallelDescriptor::NProcs(),Max_Readers); if (Max_Readers <= 0) - BoxLib::Abort("particles.nreaders must be positive"); + amrex::Abort("particles.nreaders must be positive"); } return Max_Readers; @@ -467,7 +467,7 @@ ParticleBase::MaxParticlesPerRead () pp.query("nparts_per_read", Max_Particles_Per_Read); if (Max_Particles_Per_Read <= 0) - BoxLib::Abort("particles.nparts_per_read must be positive"); + amrex::Abort("particles.nparts_per_read must be positive"); } return Max_Particles_Per_Read; @@ -512,7 +512,7 @@ ParticleBase::NextID () next = the_next_id++; if (next == std::numeric_limits::max()) - BoxLib::Abort("ParticleBase::NextID() -- too many particles"); + amrex::Abort("ParticleBase::NextID() -- too many particles"); return next; } @@ -522,7 +522,7 @@ ParticleBase::UnprotectedNextID () { int next = the_next_id++; if (next == std::numeric_limits::max()) - BoxLib::Abort("ParticleBase::NextID() -- too many particles"); + amrex::Abort("ParticleBase::NextID() -- too many particles"); return next; } @@ -646,7 +646,7 @@ ParticleBase::RestrictedWhere (ParticleBase& p, const IntVect& iv = ParticleBase::Index(p,gdb->Geom(p.m_lev)); - if (BoxLib::grow(gdb->ParticleBoxArray(p.m_lev)[p.m_grid], ngrow).contains(iv)) + if (amrex::grow(gdb->ParticleBoxArray(p.m_lev)[p.m_grid], ngrow).contains(iv)) { p.m_cell = iv; @@ -887,7 +887,7 @@ operator<< (std::ostream& os, const ParticleBase& p) os << p.m_pos[i] << ' '; if (!os.good()) - BoxLib::Error("operator<<(ostream&,ParticleBase&) failed"); + amrex::Error("operator<<(ostream&,ParticleBase&) failed"); return os; } diff --git a/Src/Particle/AMReX_TracerParticles.cpp b/Src/Particle/AMReX_TracerParticles.cpp index b84a9cea306..1278e31f67b 100644 --- a/Src/Particle/AMReX_TracerParticles.cpp +++ b/Src/Particle/AMReX_TracerParticles.cpp @@ -291,7 +291,7 @@ TracerParticleContainer::Timestamp (const std::string& basename, if (gotwork) { - std::string FileName = BoxLib::Concatenate(basename + '_', MyProc % nOutFiles, 2); + std::string FileName = amrex::Concatenate(basename + '_', MyProc % nOutFiles, 2); std::ofstream TimeStampFile; @@ -308,7 +308,7 @@ TracerParticleContainer::Timestamp (const std::string& basename, TimeStampFile.seekp(0, std::ios::end); if (!TimeStampFile.good()) - BoxLib::FileOpenFailed(FileName); + amrex::FileOpenFailed(FileName); const int M = indices.size(); const BoxArray& ba = mf.boxArray(); diff --git a/Tests/BBIOBenchmark/BBIOTest.cpp b/Tests/BBIOBenchmark/BBIOTest.cpp index fbfd0a1243f..992a6a64de6 100644 --- a/Tests/BBIOBenchmark/BBIOTest.cpp +++ b/Tests/BBIOBenchmark/BBIOTest.cpp @@ -66,7 +66,7 @@ void TestWriteNFiles(int nfiles, int nMB, bool raninit, bool mb2) long npts(dataArray.size()), nItemsToWrite(0); long totalNBytes(npts * sizeof(long) * nProcs); std::string fileName(dirName + "/TestArray_"); - fileName = BoxLib::Concatenate(fileName, myProc, 4); + fileName = amrex::Concatenate(fileName, myProc, 4); cout << myProc << "::fileName = " << fileName << endl << endl; ParallelDescriptor::Barrier(); @@ -167,7 +167,7 @@ void TestReadNFiles(int nfiles, int nMB, bool raninit, bool mb2) long npts(dataArray.size()), nItemsToRead(0); long totalNBytes(npts * sizeof(long) * nProcs); std::string fileName(dirName + "/TestArray_"); - fileName = BoxLib::Concatenate(fileName, myProc, 4); + fileName = amrex::Concatenate(fileName, myProc, 4); cout << myProc << "::fileName = " << fileName << endl << endl; ParallelDescriptor::Barrier(); diff --git a/Tests/BBIOBenchmark/BBIOTestDriver.cpp b/Tests/BBIOBenchmark/BBIOTestDriver.cpp index 12e0a580bd5..5960c6ceec2 100644 --- a/Tests/BBIOBenchmark/BBIOTestDriver.cpp +++ b/Tests/BBIOBenchmark/BBIOTestDriver.cpp @@ -49,7 +49,7 @@ static void PrintUsage(const char *progName) { // ------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); VisMF::Initialize(); if(argc == 1) { @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { } - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // ------------------------------------------------------------- diff --git a/Tests/C_BaseLib/AMRProfTestBL.cpp b/Tests/C_BaseLib/AMRProfTestBL.cpp index a06b0e047f0..590074c4b73 100644 --- a/Tests/C_BaseLib/AMRProfTestBL.cpp +++ b/Tests/C_BaseLib/AMRProfTestBL.cpp @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) { MPI_Init(&argc, &argv); #endif - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); BL_PROFILE_INIT_PARAMS(3.0, true, true); BL_PROFILE_REGION_START("R::main"); BL_PROFILE_VAR("main()", pmain); @@ -274,7 +274,7 @@ int main(int argc, char *argv[]) { usleep(0.1 * msps); bool finalizeMPI(false); - BoxLib::Finalize(finalizeMPI); + amrex::Finalize(finalizeMPI); #ifdef BL_USE_MPI MPI_Finalize(); diff --git a/Tests/C_BaseLib/BcastClasses/BcastClasses.cpp b/Tests/C_BaseLib/BcastClasses/BcastClasses.cpp index 195a5e3151c..5bda50df86a 100644 --- a/Tests/C_BaseLib/BcastClasses/BcastClasses.cpp +++ b/Tests/C_BaseLib/BcastClasses/BcastClasses.cpp @@ -14,7 +14,7 @@ using std::endl; // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); bool bIOP(ParallelDescriptor::IOProcessor()); int myProc(ParallelDescriptor::MyProc()); @@ -25,20 +25,20 @@ int main(int argc, char *argv[]) { Array aSB; if(bIOP) { - aSB = BoxLib::SerializeBox(bControl); + aSB = amrex::SerializeBox(bControl); } - BoxLib::BroadcastArray(aSB, myProc, ioProcNum, ParallelDescriptor::CommunicatorAll()); + amrex::BroadcastArray(aSB, myProc, ioProcNum, ParallelDescriptor::CommunicatorAll()); ParallelDescriptor::Barrier(); - BoxLib::USleep(myProc/10.0); + amrex::USleep(myProc/10.0); for(int i(0); i < aSB.size(); ++i) { cout << myProc << ":: aSB[" << i << "] = " << aSB[i] << endl; } - Box uSB = BoxLib::UnSerializeBox(aSB); + Box uSB = amrex::UnSerializeBox(aSB); ParallelDescriptor::Barrier(); - BoxLib::USleep(myProc/10.0); + amrex::USleep(myProc/10.0); cout << myProc << ":: uSB = " << uSB << endl; ParallelDescriptor::Barrier(); @@ -52,18 +52,18 @@ int main(int argc, char *argv[]) { Array aBASerial; if(bIOP) { - aBASerial = BoxLib::SerializeBoxArray(baControl); + aBASerial = amrex::SerializeBoxArray(baControl); for(int i(0); i < aSB.size(); ++i) { cout << myProc << ":: aBASerial[" << i << "] = " << aBASerial[i] << endl; } } ParallelDescriptor::Barrier(); - BoxLib::BroadcastBoxArray(baBcast, myProc, ioProcNum, + amrex::BroadcastBoxArray(baBcast, myProc, ioProcNum, ParallelDescriptor::CommunicatorAll()); ParallelDescriptor::Barrier(); - BoxLib::USleep(myProc/10.0); + amrex::USleep(myProc/10.0); cout << myProc << ":: baBcast = " << baBcast << endl; if(baBcast != baControl) { cout << myProc << ":: **** Error: bad BoxArrayBroadcast: baBcast baControl = " @@ -72,11 +72,11 @@ int main(int argc, char *argv[]) { /* if( ! fba.ok()) { - BoxLib::Error("BoxArray is not OK"); + amrex::Error("BoxArray is not OK"); } if( ! fba.isDisjoint()) { - BoxLib::Error("BoxArray is not disjoint"); + amrex::Error("BoxArray is not disjoint"); } fba.maxSize(32); @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) { - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tBA.cpp b/Tests/C_BaseLib/tBA.cpp index d8a74b1be5a..28e5ef36b00 100644 --- a/Tests/C_BaseLib/tBA.cpp +++ b/Tests/C_BaseLib/tBA.cpp @@ -20,10 +20,10 @@ GetBndryCells_old (const BoxArray& ba, BoxDomain bd; for (int i = 0; i < ba.size(); ++i) { - BoxList gCells = BoxLib::boxDiff(BoxLib::grow(ba[i],ngrow),ba[i]); + BoxList gCells = amrex::boxDiff(amrex::grow(ba[i],ngrow),ba[i]); for (BoxList::iterator bli = gCells.begin(); bli != gCells.end(); ++bli) - bd.add(BoxLib::complementIn(*bli,blgrids)); + bd.add(amrex::complementIn(*bli,blgrids)); } BoxList bl; @@ -56,7 +56,7 @@ GetBndryCells_new (const BoxArray& ba, BoxList gcells; for (int i = 0; i < ba.size(); ++i) { - gcells.join(BoxLib::boxDiff(BoxLib::grow(ba[i],ngrow),ba[i])); + gcells.join(amrex::boxDiff(amrex::grow(ba[i],ngrow),ba[i])); } std::cout << " size of ghostcell list: " << gcells.size() << std::endl; // @@ -79,7 +79,7 @@ GetBndryCells_new (const BoxArray& ba, BoxList pieces; for (int i = 0; i < isects.size(); i++) pieces.push_back(isects[i].second); - BoxList leftover = BoxLib::complementIn(*it,pieces); + BoxList leftover = amrex::complementIn(*it,pieces); bcells.catenate(leftover); } } @@ -90,7 +90,7 @@ GetBndryCells_new (const BoxArray& ba, // gcells.clear(); - gcells = BoxLib::removeOverlap(bcells); + gcells = amrex::removeOverlap(bcells); std::cout << " size before simplify(): " << gcells.size() << std::endl; @@ -198,7 +198,7 @@ intersections_old (const BoxArray& ba) for (int j = 0; j < ba.size(); j++) { - const Box& bx = BoxLib::grow(ba[j], ngrow); + const Box& bx = amrex::grow(ba[j], ngrow); for (int i = 0; i < ba.size(); i++) { @@ -226,7 +226,7 @@ intersections_new (const BoxArray& ba) for (int j = 0; j < ba.size(); j++) { - std::vector< std::pair > v = ba.intersections(BoxLib::grow(ba[j], ngrow)); + std::vector< std::pair > v = ba.intersections(amrex::grow(ba[j], ngrow)); cnt += v.size(); } @@ -249,7 +249,7 @@ newComplementIn_old (const Box& b, { if (newbli->intersects(*bli)) { - BoxList tm = BoxLib::boxDiff(*newbli, *bli); + BoxList tm = amrex::boxDiff(*newbli, *bli); newb.catenate(tm); newb.remove(newbli++); } @@ -332,7 +332,7 @@ main () { const Real beg = ParallelDescriptor::second(); - bl1 = BoxLib::complementIn(bb, bl); + bl1 = amrex::complementIn(bb, bl); const Real end = ParallelDescriptor::second() - beg; std::cout << "complementIn(), size = " << bl1.size() << " time = " << end << std::endl; bl1.simplify(); diff --git a/Tests/C_BaseLib/tCArena.cpp b/Tests/C_BaseLib/tCArena.cpp index ea1e5f125e6..7908812fbc5 100644 --- a/Tests/C_BaseLib/tCArena.cpp +++ b/Tests/C_BaseLib/tCArena.cpp @@ -41,7 +41,7 @@ CArena FB::m_CArena(100*CHUNKSIZE); FB::FB () { - m_size = size_t(CHUNKSIZE*BoxLib::Random()); + m_size = size_t(CHUNKSIZE*amrex::Random()); m_data = (double*) m_CArena.alloc(m_size*sizeof(double)); // // Set specific values in the data. diff --git a/Tests/C_BaseLib/tDM.cpp b/Tests/C_BaseLib/tDM.cpp index 6b9c7b15a50..8b13a49304c 100644 --- a/Tests/C_BaseLib/tDM.cpp +++ b/Tests/C_BaseLib/tDM.cpp @@ -20,7 +20,7 @@ Print (const BoxList& bl, const char* str) int main (int argc, char* argv[]) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); // std::ifstream ifs("ba.60", std::ios::in); // std::ifstream ifs("ba.213", std::ios::in); @@ -52,5 +52,5 @@ main (int argc, char* argv[]) DistributionMapping::FlushCache(); } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tDir.cpp b/Tests/C_BaseLib/tDir.cpp index 11c1b541246..c26faae60f0 100644 --- a/Tests/C_BaseLib/tDir.cpp +++ b/Tests/C_BaseLib/tDir.cpp @@ -6,7 +6,7 @@ main (int argc, char** argv) { if (argc == 2) { - if (!BoxLib::UtilCreateDirectory(argv[1], 0755)) + if (!amrex::UtilCreateDirectory(argv[1], 0755)) { std::cout << "Utility::UtilCreateDirectory() failed!!!\n"; } diff --git a/Tests/C_BaseLib/tFAC.cpp b/Tests/C_BaseLib/tFAC.cpp index a7471e7395a..eff8ad87ed1 100644 --- a/Tests/C_BaseLib/tFAC.cpp +++ b/Tests/C_BaseLib/tFAC.cpp @@ -12,7 +12,7 @@ int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); BL_ASSERT(ParallelDescriptor::NProcs() == 2); @@ -53,5 +53,5 @@ main (int argc, char** argv) std::cout << mf_1[0] << std::endl; } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tFB.cpp b/Tests/C_BaseLib/tFB.cpp index 92ab8b2c907..e8588ec522a 100644 --- a/Tests/C_BaseLib/tFB.cpp +++ b/Tests/C_BaseLib/tFB.cpp @@ -12,7 +12,7 @@ const int nStrategies(4); int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); BL_PROFILE_VAR("main()", pmain); @@ -149,7 +149,7 @@ main (int argc, char** argv) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tFillFab.cpp b/Tests/C_BaseLib/tFillFab.cpp index d213102f01e..3bf4295c5ac 100644 --- a/Tests/C_BaseLib/tFillFab.cpp +++ b/Tests/C_BaseLib/tFillFab.cpp @@ -12,7 +12,7 @@ BL_FORT_PROC_DECL(FILLFAB,fillfab)(Real* d, const int* nx, const int* ny); int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); // // This in only for 2D. // @@ -32,7 +32,7 @@ main (int argc, char** argv) ofs.open("out.fab", std::ios::out|std::ios::trunc); if (!ofs.good()) - BoxLib::FileOpenFailed("out.fab"); + amrex::FileOpenFailed("out.fab"); BL_FORT_PROC_CALL(FILLFAB,fillfab)(fab.dataPtr(), &NX, &NY); @@ -41,11 +41,11 @@ main (int argc, char** argv) ofs.close(); if (!ofs.good()) - BoxLib::Error("Write failed"); + amrex::Error("Write failed"); #endif - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tMF.cpp b/Tests/C_BaseLib/tMF.cpp index dfb72f51b75..de09f5eb0aa 100644 --- a/Tests/C_BaseLib/tMF.cpp +++ b/Tests/C_BaseLib/tMF.cpp @@ -12,7 +12,7 @@ int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); typedef std::map,Array > OurBinMap; @@ -204,7 +204,7 @@ main (int argc, char** argv) } #endif - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tMFcopy.cpp b/Tests/C_BaseLib/tMFcopy.cpp index e30dad1066b..f79695eea9f 100644 --- a/Tests/C_BaseLib/tMFcopy.cpp +++ b/Tests/C_BaseLib/tMFcopy.cpp @@ -7,7 +7,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); // // Use Space Filling Curve algorithm for distributing grids. // @@ -24,20 +24,20 @@ main (int argc, char* argv[]) std::ifstream ifs(file, std::ios::in); if (!ifs.good()) - BoxLib::Error("Unable to open file"); + amrex::Error("Unable to open file"); BoxArray fba; fba.readFrom(ifs); if (!ifs.good()) - BoxLib::Error("Read of BoxArray failed"); + amrex::Error("Read of BoxArray failed"); if (!fba.ok()) - BoxLib::Error("BoxArray is not OK"); + amrex::Error("BoxArray is not OK"); if (!fba.isDisjoint()) - BoxLib::Error("BoxArray is not disjoint"); + amrex::Error("BoxArray is not disjoint"); fba.maxSize(32); @@ -77,7 +77,7 @@ main (int argc, char* argv[]) if (cmf.DistributionMap()[0] == ParallelDescriptor::MyProc()) std::cout << cmf[0] << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tParmParse.cpp b/Tests/C_BaseLib/tParmParse.cpp index cb5bbdf6cf7..b2ef1d6b408 100644 --- a/Tests/C_BaseLib/tParmParse.cpp +++ b/Tests/C_BaseLib/tParmParse.cpp @@ -7,7 +7,7 @@ int main (int argc, char** argv) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; @@ -20,5 +20,5 @@ main (int argc, char** argv) std::cout << arr[i] << std::endl; } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tProfiler.cpp b/Tests/C_BaseLib/tProfiler.cpp index 627b42b5996..bbf6887bd35 100644 --- a/Tests/C_BaseLib/tProfiler.cpp +++ b/Tests/C_BaseLib/tProfiler.cpp @@ -46,8 +46,8 @@ void nap(unsigned int sleeptime) { void napabort(unsigned int sleeptime) { BL_PROFILE("napabort()"); Sleep(sleeptime); - BoxLib::Finalize(); - BoxLib::Abort("From napabort"); + amrex::Finalize(); + amrex::Abort("From napabort"); } @@ -90,7 +90,7 @@ void nonap() { // -------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); // sleep(1); BL_PROFILE_INIT_PARAMS(3.0, true, true); @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) { ParallelDescriptor::Barrier(); - BoxLib::SyncStrings(localStrings, syncedStrings, alreadySynced); + amrex::SyncStrings(localStrings, syncedStrings, alreadySynced); if( ! alreadySynced) { if(ParallelDescriptor::IOProcessor()) { @@ -154,7 +154,7 @@ int main(int argc, char *argv[]) { localStrings.push_back("allString zzz"); ParallelDescriptor::Barrier(); - BoxLib::SyncStrings(localStrings, syncedStrings, alreadySynced); + amrex::SyncStrings(localStrings, syncedStrings, alreadySynced); if( ! alreadySynced) { if(ParallelDescriptor::IOProcessor()) { @@ -275,7 +275,7 @@ int main(int argc, char *argv[]) { cout << "rint = " << rint << endl; for(int i(0); i < nPts; ++i) { - int ri(BoxLib::Random_int(rint)); + int ri(amrex::Random_int(rint)); nativeVals[i] = ri; if(i == 0) { nativeVals[i] = 1.234e+123; @@ -376,7 +376,7 @@ int main(int argc, char *argv[]) { BL_PROFILE_REGION_STOP("R::main"); BL_PROFILE_FINALIZE(); - BoxLib::Finalize(); + amrex::Finalize(); } // -------------------------------------------------------------- diff --git a/Tests/C_BaseLib/tRABcast.cpp b/Tests/C_BaseLib/tRABcast.cpp index b79660ae178..467f832117b 100644 --- a/Tests/C_BaseLib/tRABcast.cpp +++ b/Tests/C_BaseLib/tRABcast.cpp @@ -6,7 +6,7 @@ // ------------------------------------------------------------ int main(int argc, char **argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); BL_PROFILE_VAR("main()", pmain); @@ -45,7 +45,7 @@ int main(int argc, char **argv) { BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/C_BaseLib/tRan.cpp b/Tests/C_BaseLib/tRan.cpp index d21d63e92ce..f55487738c4 100644 --- a/Tests/C_BaseLib/tRan.cpp +++ b/Tests/C_BaseLib/tRan.cpp @@ -7,8 +7,8 @@ int main(int argc, char** argv) { - BoxLib::Initialize(argc,argv); - BoxLib::mt19937 rr(4357UL); + amrex::Initialize(argc,argv); + amrex::mt19937 rr(4357UL); std::ios::fmtflags ofmtflags = std::cout.setf(std::ios::fixed, std::ios::floatfield); std::cout << std::setprecision(8); for ( int j=0; j<1000; j++ ) @@ -17,5 +17,5 @@ main(int argc, char** argv) if ( j%5==4 ) std::cout << std::endl; } std::cout << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tVisMF.cpp b/Tests/C_BaseLib/tVisMF.cpp index b2d966b1904..a5f58125883 100644 --- a/Tests/C_BaseLib/tVisMF.cpp +++ b/Tests/C_BaseLib/tVisMF.cpp @@ -72,14 +72,14 @@ Write_N_Read (const MultiFab& mf, if (ParallelDescriptor::IOProcessor()) { - start = BoxLib::wsecond(); + start = amrex::wsecond(); } ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { - end = BoxLib::wsecond(); + end = amrex::wsecond(); std::cout << "\nWallclock time for MF write: " << (end-start) << '\n'; @@ -117,7 +117,7 @@ Write_N_Read (const MultiFab& mf, int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); the_prog_name = argv[0]; parse_args(argv); @@ -127,7 +127,7 @@ main (int argc, char** argv) for (int i = 1; i < nBoxs; i++) { - ba.set(i,BoxLib::grow(ba[i-1],2)); + ba.set(i,amrex::grow(ba[i-1],2)); } MultiFab mf(ba, 2, 1); @@ -146,5 +146,5 @@ main (int argc, char** argv) Write_N_Read (mf, mf_name); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tVisMF2.cpp b/Tests/C_BaseLib/tVisMF2.cpp index 505250c6c17..f9b55678960 100644 --- a/Tests/C_BaseLib/tVisMF2.cpp +++ b/Tests/C_BaseLib/tVisMF2.cpp @@ -8,7 +8,7 @@ int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); if (ParallelDescriptor::IOProcessor()) std::cout << "Successfully initialized BoxLib" << std::endl; @@ -39,5 +39,5 @@ main (int argc, char** argv) if (ParallelDescriptor::IOProcessor()) std::cout << "Successfully wrote Rho ..." << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/C_BaseLib/tread.cpp b/Tests/C_BaseLib/tread.cpp index 50755961f79..e279b194da9 100644 --- a/Tests/C_BaseLib/tread.cpp +++ b/Tests/C_BaseLib/tread.cpp @@ -13,7 +13,7 @@ int main (int argc, char** argv) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); if (argc < 2) { @@ -30,7 +30,7 @@ main (int argc, char** argv) ifs.open(argv[idx], std::ios::in); if (!ifs.good()) - BoxLib::FileOpenFailed(argv[idx]); + amrex::FileOpenFailed(argv[idx]); std::cout << "Reading " << argv[idx] << " ..." << std::endl; @@ -49,7 +49,7 @@ main (int argc, char** argv) ifs.open(argv[idx], std::ios::in); if (!ifs.good()) - BoxLib::FileOpenFailed(argv[idx]); + amrex::FileOpenFailed(argv[idx]); std::cout << "Reading " << argv[idx] << " ..." << std::endl; @@ -62,11 +62,11 @@ main (int argc, char** argv) ofs.open("SUM",std::ios::out|std::ios::trunc); - if (!ofs.good()) BoxLib::FileOpenFailed("SUM"); + if (!ofs.good()) amrex::FileOpenFailed("SUM"); sum.writeOn(ofs); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tests/FillBoundaryComparison/main.cpp b/Tests/FillBoundaryComparison/main.cpp index 4a35ce055ad..f340f3f7a40 100644 --- a/Tests/FillBoundaryComparison/main.cpp +++ b/Tests/FillBoundaryComparison/main.cpp @@ -13,7 +13,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BoxArray ba; @@ -169,10 +169,10 @@ main (int argc, char* argv[]) // // When MPI3 shared memory is used, the dtor of MultiFab calls MPI // functions. Because the scope of mfs is beyond the call to - // BoxLib::Finalize(), which in turn calls MPI_Finalize(), we + // amrex::Finalize(), which in turn calls MPI_Finalize(), we // destroy these MultiFabs by hand now. // mfs.clear(); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/IOBenchmark/IOTest.cpp b/Tests/IOBenchmark/IOTest.cpp index 2c62e937dd5..6dbb0ae3524 100644 --- a/Tests/IOBenchmark/IOTest.cpp +++ b/Tests/IOBenchmark/IOTest.cpp @@ -60,14 +60,14 @@ void DirectoryTests() { std::stringstream dirname; dirname << "dir" << i; if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(dirname.str(), 0755, verboseDir)) { - BoxLib::CreateDirectoryFailed(dirname.str()); + if( ! amrex::UtilCreateDirectory(dirname.str(), 0755, verboseDir)) { + amrex::CreateDirectoryFailed(dirname.str()); } for(int level(0); level < nlevels; ++level) { std::stringstream dirname; dirname << "dir" << i << "/Level_" << level; - if( ! BoxLib::UtilCreateDirectory(dirname.str(), 0755, verboseDir)) { - BoxLib::CreateDirectoryFailed(dirname.str()); + if( ! amrex::UtilCreateDirectory(dirname.str(), 0755, verboseDir)) { + amrex::CreateDirectoryFailed(dirname.str()); } } } @@ -136,20 +136,20 @@ void FileTests() { std::string dirname("/home/vince/Development/BoxLib/Tests/IOBenchmark/a/b/c/d"); if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(dirname, 0755, verboseDir)) { - BoxLib::CreateDirectoryFailed(dirname); + if( ! amrex::UtilCreateDirectory(dirname, 0755, verboseDir)) { + amrex::CreateDirectoryFailed(dirname); } } std::string rdirname("relative/e/f/g"); if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(rdirname, 0755, verboseDir)) { - BoxLib::CreateDirectoryFailed(rdirname); + if( ! amrex::UtilCreateDirectory(rdirname, 0755, verboseDir)) { + amrex::CreateDirectoryFailed(rdirname); } } std::string nsdirname("noslash"); if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(nsdirname, 0755, verboseDir)) { - BoxLib::CreateDirectoryFailed(nsdirname); + if( ! amrex::UtilCreateDirectory(nsdirname, 0755, verboseDir)) { + amrex::CreateDirectoryFailed(nsdirname); } } @@ -228,7 +228,7 @@ void TestWriteNFiles(int nfiles, int maxgrid, int ncomps, int nboxes, mfName = "TestMFNoFabHeaderFAMinMax"; break; default: - BoxLib::Abort("**** Error in TestWriteNFiles: bad version."); + amrex::Abort("**** Error in TestWriteNFiles: bad version."); } // ---- make the MultiFabs @@ -247,7 +247,7 @@ void TestWriteNFiles(int nfiles, int maxgrid, int ncomps, int nboxes, if(raninit) { Real *dp = (*multifabs[nmf])[mfiset].dataPtr(invar); for(int i(0); i < (*multifabs[nmf])[mfiset].box().numPts(); ++i) { - dp[i] = BoxLib::Random() + (1.0 + static_cast (invar)); + dp[i] = amrex::Random() + (1.0 + static_cast (invar)); } } else { (*multifabs[nmf])[mfiset].setVal((100.0 * mfiset.index()) + invar + @@ -465,9 +465,9 @@ void DSSNFileTests(int noutfiles, const std::string &filePrefixIn, if(mySetPosition == 0) { // ---- write data int fileNumber(NFilesIter::FileNumber(nOutFiles, myProc, groupSets)); std::ofstream csFile; - std::string FullName(BoxLib::Concatenate(filePrefix, fileNumber, 5)); + std::string FullName(amrex::Concatenate(filePrefix, fileNumber, 5)); csFile.open(FullName.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); - if( ! csFile.good()) { BoxLib::FileOpenFailed(FullName); } + if( ! csFile.good()) { amrex::FileOpenFailed(FullName); } // ----------------------------- write to file here csFile.write((const char *) data.dataPtr(), data.size() * sizeof(int)); // ----------------------------- end write to file here @@ -549,12 +549,12 @@ void DSSNFileTests(int noutfiles, const std::string &filePrefixIn, // ---- wait for signal to start writing rmess = ParallelDescriptor::Recv(&fileNumber, 1, MPI_ANY_SOURCE, writeTag); coordinatorProc = rmess.pid(); - std::string FullName(BoxLib::Concatenate(filePrefix, fileNumber, 5)); + std::string FullName(amrex::Concatenate(filePrefix, fileNumber, 5)); std::ofstream csFile; csFile.open(FullName.c_str(), std::ios::out | std::ios::app | std::ios::binary); csFile.seekp(0, std::ios::end); // set to eof - if( ! csFile.good()) { BoxLib::FileOpenFailed(FullName); } + if( ! csFile.good()) { amrex::FileOpenFailed(FullName); } // ----------------------------- write to file here csFile.write((const char *) data.dataPtr(), data.size() * sizeof(int)); // ----------------------------- end write to file here diff --git a/Tests/IOBenchmark/IOTestDriver.cpp b/Tests/IOBenchmark/IOTestDriver.cpp index 1fc2fc7f406..1b50064e460 100644 --- a/Tests/IOBenchmark/IOTestDriver.cpp +++ b/Tests/IOBenchmark/IOTestDriver.cpp @@ -80,7 +80,7 @@ static void PrintUsage(const char *progName) { // ------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); //VisMF::Initialize(); if(argc == 1) { @@ -326,12 +326,12 @@ int main(int argc, char *argv[]) { hVersion = VisMF::Header::NoFabHeaderFAMinMax_v1; break; default: - BoxLib::Abort("**** Error: bad hVersion."); + amrex::Abort("**** Error: bad hVersion."); } for(int itimes(0); itimes < ntimes; ++itimes) { ParallelDescriptor::Barrier("TestWriteNFiles::BeforeSleep4"); - BoxLib::USleep(4); + amrex::USleep(4); ParallelDescriptor::Barrier("TestWriteNFiles::AfterSleep4"); if(ParallelDescriptor::IOProcessor()) { @@ -358,7 +358,7 @@ int main(int argc, char *argv[]) { VisMF::SetMFFileInStreams(nReadStreams); for(int itimes(0); itimes < ntimes; ++itimes) { ParallelDescriptor::Barrier("TestReadMF::BeforeSleep4"); - BoxLib::USleep(4); + amrex::USleep(4); ParallelDescriptor::Barrier("TestReadMF::AfterSleep4"); if(ParallelDescriptor::IOProcessor()) { @@ -381,7 +381,7 @@ int main(int argc, char *argv[]) { - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // ------------------------------------------------------------- diff --git a/Tests/LinearSolvers/C_CellMG/MacOperator.cpp b/Tests/LinearSolvers/C_CellMG/MacOperator.cpp index dde826ad464..698baa9812d 100644 --- a/Tests/LinearSolvers/C_CellMG/MacOperator.cpp +++ b/Tests/LinearSolvers/C_CellMG/MacOperator.cpp @@ -57,7 +57,7 @@ MacOperator::Initialize () pp.query("max_order", max_order); - BoxLib::ExecOnFinalize(MacOperator::Finalize); + amrex::ExecOnFinalize(MacOperator::Finalize); initialized = true; } @@ -378,7 +378,7 @@ mac_level_driver (AmrCore* parent, if (the_solver == 1 && mac_op.maxOrder() != 2) { - BoxLib::Error("Can't use CGSolver with maxorder > 2"); + amrex::Error("Can't use CGSolver with maxorder > 2"); } // // Construct MultiGrid or CGSolver object and solve system. @@ -403,7 +403,7 @@ mac_level_driver (AmrCore* parent, hp.solve(*mac_phi, Rhs, true); hp.clear_solver(); #else - BoxLib::Error("mac_level_driver::HypreABec not in this build"); + amrex::Error("mac_level_driver::HypreABec not in this build"); #endif } else if (the_solver == 3 ) @@ -511,7 +511,7 @@ mac_sync_driver (AmrCore* parent, if (the_solver == 1 && mac_op.maxOrder() != 2) { - BoxLib::Error("Can't use CGSolver with maxorder > 2"); + amrex::Error("Can't use CGSolver with maxorder > 2"); } // // Now construct MultiGrid or CGSolver object to solve system. @@ -536,7 +536,7 @@ mac_sync_driver (AmrCore* parent, hp.solve(*mac_sync_phi, Rhs, true); hp.clear_solver(); #else - BoxLib::Error("mac_sync_driver: HypreABec not in this build"); + amrex::Error("mac_sync_driver: HypreABec not in this build"); #endif } else if (the_solver == 3 ) diff --git a/Tests/LinearSolvers/C_CellMG/macprojTest.cpp b/Tests/LinearSolvers/C_CellMG/macprojTest.cpp index 7ea996b248d..6a713856618 100644 --- a/Tests/LinearSolvers/C_CellMG/macprojTest.cpp +++ b/Tests/LinearSolvers/C_CellMG/macprojTest.cpp @@ -89,7 +89,7 @@ void mac_driver (const MacBndry& mac_bndry, int main (int argc, char* argv[]) { - BoxLib::Initialize(argc, argv); + amrex::Initialize(argc, argv); // // Instantiate after we're running in Parallel. @@ -122,27 +122,27 @@ main (int argc, char* argv[]) int use_cg_solve; if (!pp.query("use_cg_solve", use_cg_solve)) - BoxLib::Abort("Must specify use_cg_solve"); + amrex::Abort("Must specify use_cg_solve"); int Density; if (!pp.query("Density", Density)) - BoxLib::Abort("Must specify Density"); + amrex::Abort("Must specify Density"); Real dt; if (!pp.query("dt", dt)) - BoxLib::Abort("Must specify dt"); + amrex::Abort("Must specify dt"); Real mac_tol; if (!pp.query("mac_tol", mac_tol)) - BoxLib::Abort("Must specify mac_tol"); + amrex::Abort("Must specify mac_tol"); Real mac_abs_tol; if (!pp.query("mac_abs_tol", mac_abs_tol)) - BoxLib::Abort("Must specify mac_abs_tol"); + amrex::Abort("Must specify mac_abs_tol"); Real rhs_scale; if (!pp.query("rhs_scale", rhs_scale)) - BoxLib::Abort("Must specify rhs_scale"); + amrex::Abort("Must specify rhs_scale"); bool dump_norm = false; pp.query("dump_norm", dump_norm); @@ -191,7 +191,7 @@ main (int argc, char* argv[]) } } - BoxLib::Finalize(); + amrex::Finalize(); } BoxList @@ -201,7 +201,7 @@ readBoxList(const aString file, BOX& domain) ifstream boxspec(file.c_str()); if( !boxspec ) { - BoxLib::Error("readBoxList: unable to open " + *file.c_str()); + amrex::Error("readBoxList: unable to open " + *file.c_str()); } boxspec >> domain; @@ -253,7 +253,7 @@ mac_driver (const MacBndry& mac_bndry, if (use_cg_solve && mac_op.maxOrder() != 2) { - BoxLib::Error("Can't use CGSolver with maxorder > 2"); + amrex::Error("Can't use CGSolver with maxorder > 2"); } // // Construct MultiGrid or CGSolver object and solve system. diff --git a/Tests/LinearSolvers/C_CellMG/main.cpp b/Tests/LinearSolvers/C_CellMG/main.cpp index 9c50ae487dd..c1d327a6bb4 100644 --- a/Tests/LinearSolvers/C_CellMG/main.cpp +++ b/Tests/LinearSolvers/C_CellMG/main.cpp @@ -56,7 +56,7 @@ readBoxList (const std::string file, Box& domain) { std::string msg = "readBoxList: unable to open "; msg += file; - BoxLib::Error(msg.c_str()); + amrex::Error(msg.c_str()); } boxspec >> domain; @@ -93,8 +93,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -115,7 +115,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << 2 << '\n'; HeaderFile << "soln\nrhs\n"; @@ -144,7 +144,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -156,8 +156,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // @@ -190,7 +190,7 @@ writePlotFile (const std::string& dir, int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); std::cout << std::setprecision(15); @@ -214,7 +214,7 @@ main (int argc, char* argv[]) int maxgrid = -1 ; pp.query("max_grid_size", maxgrid); if (maxgrid < 0) - BoxLib::Abort("max_grid_size must be positive"); + amrex::Abort("max_grid_size must be positive"); bs = BoxArray(dmn); @@ -600,7 +600,7 @@ main (int argc, char* argv[]) } } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tests/LinearSolvers/C_TensorMG/testVI.cpp b/Tests/LinearSolvers/C_TensorMG/testVI.cpp index 3e274f5b183..6b472611447 100644 --- a/Tests/LinearSolvers/C_TensorMG/testVI.cpp +++ b/Tests/LinearSolvers/C_TensorMG/testVI.cpp @@ -34,7 +34,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); std::cout << std::setprecision(10); @@ -65,7 +65,7 @@ main (int argc, { std::string msg = "problem opening grids file: "; msg += boxfile.c_str(); - BoxLib::Abort(msg.c_str()); + amrex::Abort(msg.c_str()); } ifs >> domain; diff --git a/Tests/LinearSolvers/ComparisonTest/HypreABecLap/HypreABecLap.cpp b/Tests/LinearSolvers/ComparisonTest/HypreABecLap/HypreABecLap.cpp index ec143ae14ed..c092637ea06 100644 --- a/Tests/LinearSolvers/ComparisonTest/HypreABecLap/HypreABecLap.cpp +++ b/Tests/LinearSolvers/ComparisonTest/HypreABecLap/HypreABecLap.cpp @@ -162,7 +162,7 @@ BndryAuxVar::BndryAuxVar(const BoxArray& _grids, Location loc) aux[ori].resize(grids.size(), PArrayManage); int ishift = ori.isLow() ? 1-inormal : inormal-1; for (int i = firstLocal(); isValid(i); i = nextLocal(i)) { - Box b = BoxLib::adjCell(grids[i], ori); + Box b = amrex::adjCell(grids[i], ori); aux[ori].set(i, new AuxVarBox(b.shift(ori.coordDir(), ishift))); } } @@ -249,7 +249,7 @@ CrseBndryAuxVar::CrseBndryAuxVar(const BoxArray& _cgrids, list bl; list fi; for (int j = 0; j < fgrids.size(); j++) { - Box face = BoxLib::adjCell(fgrids[j], ori); + Box face = amrex::adjCell(fgrids[j], ori); if (cgrids[i].intersects(face)) { bl.push_back(face & cgrids[i]); fi.push_back(j); @@ -378,7 +378,7 @@ CrseBndryAuxVar::CrseBndryAuxVar(const BoxArray& _cgrids, for (int j = 0; j < n; j++) { fine_index[ori][i][j] = other.fine_index[ori][i][j]; - Box face = BoxLib::adjCell(fgrids[fine_index[ori][i][j]], ori); + Box face = amrex::adjCell(fgrids[fine_index[ori][i][j]], ori); aux[ori][i].set(j, new AuxVarBox(face & cgrids[i])); Box mask_box = aux[ori][i][j].box(); @@ -570,7 +570,7 @@ HypreABecLap::HypreABecLap(int _crse_level, int _fine_level, ObjectType = HYPRE_PARCSR; } else { - BoxLib::Error("No such solver in HypreABecLap"); + amrex::Error("No such solver in HypreABecLap"); } int nparts = fine_level - crse_level + 1; @@ -740,7 +740,7 @@ TransverseInterpolant(AuxVarBox& cintrp, const Mask& msk, for (IntVect v = vf; v <= face.bigEnd(); face.next(v)) { cintrp(v).push(clevel, vc, 1.0); } - //BoxLib::Error("Case not implemented"); + //amrex::Error("Case not implemented"); } #elif (BL_SPACEDIM == 3) @@ -946,26 +946,26 @@ void HypreABecLap::buildMatrixStructure() for (OrientationIter oitr; oitr; ++oitr) { Orientation ori = oitr(); int idir = ori.coordDir(); - IntVect vin = BoxLib::BASISV(idir); + IntVect vin = amrex::BASISV(idir); vin = (ori.isLow() ? -vin : vin); // outward normal unit vector Real h = geom[level].CellSize(idir); // normal fine grid spacing IntVect ve; // default constructor initializes to zero #if (BL_SPACEDIM >= 2) int jdir = (idir + 1) % BL_SPACEDIM; - IntVect vj1 = BoxLib::BASISV(jdir); // tangential unit vector + IntVect vj1 = amrex::BASISV(jdir); // tangential unit vector IntVect vjr = rat * vj1; ve += (vjr - vj1); #endif #if (BL_SPACEDIM == 3) int kdir = (idir + 2) % 3; - IntVect vk1 = BoxLib::BASISV(kdir); + IntVect vk1 = amrex::BASISV(kdir); IntVect vkr = rat * vk1; ve += (vkr - vk1); #endif for (int i = cintrp[level].firstLocal(); cintrp[level].isValid(i); i = cintrp[level].nextLocal(i)) { - Box reg = BoxLib::adjCell(grids[level][i], ori); - Box creg = BoxLib::coarsen(reg, rat); // coarse adjacent cells + Box reg = amrex::adjCell(grids[level][i], ori); + Box creg = amrex::coarsen(reg, rat); // coarse adjacent cells const Mask &msk = *(bd[level].bndryMasks(i)[ori]); TransverseInterpolant(cintrp[level](ori)[i], msk, reg, creg, @@ -995,11 +995,11 @@ void HypreABecLap::buildMatrixStructure() for (OrientationIter oitr; oitr; ++oitr) { Orientation ori = oitr(); int idir = ori.coordDir(); - IntVect vin = BoxLib::BASISV(idir); + IntVect vin = amrex::BASISV(idir); vin = (ori.isLow() ? -vin : vin); // outward normal unit vector for (int i = entry.firstLocal(); entry.isValid(i); i = entry.nextLocal(i)) { - Box reg = BoxLib::adjCell(grids[level][i], ori); + Box reg = amrex::adjCell(grids[level][i], ori); reg.shift(-vin); // fine interior cells for (IntVect v = reg.smallEnd(); v <= reg.bigEnd(); reg.next(v)) { #if (0 && !defined(NDEBUG)) @@ -1071,19 +1071,19 @@ void HypreABecLap::buildMatrixStructure() for (OrientationIter oitr; oitr; ++oitr) { Orientation ori = oitr(); int idir = ori.coordDir(); - IntVect vin = BoxLib::BASISV(idir); + IntVect vin = amrex::BASISV(idir); vin = (ori.isLow() ? -vin : vin); // outward normal unit vector Real h = geom[level].CellSize(idir); // normal fine grid spacing IntVect ve; // default constructor initializes to zero #if (BL_SPACEDIM >= 2) int jdir = (idir + 1) % BL_SPACEDIM; - IntVect vj1 = BoxLib::BASISV(jdir); // tangential unit vector + IntVect vj1 = amrex::BASISV(jdir); // tangential unit vector IntVect vjr = rat * vj1; ve += (vjr - vj1); #endif #if (BL_SPACEDIM == 3) int kdir = (idir + 2) % 3; - IntVect vk1 = BoxLib::BASISV(kdir); + IntVect vk1 = amrex::BASISV(kdir); IntVect vkr = rat * vk1; ve += (vkr - vk1); #endif @@ -1318,7 +1318,7 @@ void HypreABecLap::setInitGuess(int level, const MultiFab& guess) void HypreABecLap::solve(PArray& soln, Real _reltol, Real _abstol, int _maxiter) { if (!x_loaded || !b_loaded) { - BoxLib::Error("Must setRhs and setInitGuess before calling solve"); + amrex::Error("Must setRhs and setInitGuess before calling solve"); } HYPRE_SStructVectorAssemble(b); @@ -1470,14 +1470,14 @@ void HypreABecLap::loadMatrix() for (OrientationIter oitr; oitr; ++oitr) { Orientation ori = oitr(); int idir = ori.coordDir(); - IntVect vin = BoxLib::BASISV(idir), ves; + IntVect vin = amrex::BASISV(idir), ves; vin = (ori.isLow() ? -vin : vin); // outward normal unit vector ves = (ori.isLow() ? ves : vin); // edge shift vector Real h = geom[level].CellSize(idir); // normal fine grid spacing Real ffac = (-scalar_b / h); // divergence factor for (int i = cintrp[level].firstLocal(); cintrp[level].isValid(i); i = cintrp[level].nextLocal(i)) { - Box reg = BoxLib::adjCell(grids[level][i], ori); + Box reg = amrex::adjCell(grids[level][i], ori); reg.shift(-vin); // fine interior cells const Mask &msk = *(bd[level].bndryMasks(i)[ori]); for (IntVect v = reg.smallEnd(); v <= reg.bigEnd(); reg.next(v)) { @@ -1492,11 +1492,11 @@ void HypreABecLap::loadMatrix() for (OrientationIter oitr; oitr; ++oitr) { Orientation ori = oitr(); int idir = ori.coordDir(); - IntVect vin = BoxLib::BASISV(idir); + IntVect vin = amrex::BASISV(idir); vin = (ori.isLow() ? -vin : vin); // outward normal unit vector for (int i = cintrp[level].firstLocal(); cintrp[level].isValid(i); i = cintrp[level].nextLocal(i)) { - Box reg = BoxLib::adjCell(grids[level][i], ori); + Box reg = amrex::adjCell(grids[level][i], ori); reg.shift(-vin); // fine interior cells for (IntVect v = reg.smallEnd(); v <= reg.bigEnd(); reg.next(v)) { if (!entry(ori)[i](v).empty() && @@ -1555,7 +1555,7 @@ void HypreABecLap::loadMatrix() Orientation ori = oitr(); int idir = ori.coordDir(); c_entry[level].loadFaceData(ori, bcoefs[level][idir], 0, 0, 1); - IntVect vin = BoxLib::BASISV(idir), ves; + IntVect vin = amrex::BASISV(idir), ves; vin = (ori.isLow() ? -vin : vin); // outward normal unit vector ves = (ori.isLow() ? -vin : ves); // edge shift vector (diff from above) Real hc = geom[level-1].CellSize(idir); // normal coarse grid spacing @@ -1566,12 +1566,12 @@ void HypreABecLap::loadMatrix() IntVect ve; // default constructor initializes to zero #if (BL_SPACEDIM >= 2) int jdir = (idir + 1) % BL_SPACEDIM; - ve += (rat[jdir] - 1) * BoxLib::BASISV(jdir); + ve += (rat[jdir] - 1) * amrex::BASISV(jdir); cfac /= rat[jdir]; // will average over fine cells in tangential dir #endif #if (BL_SPACEDIM == 3) int kdir = (idir + 2) % 3; - ve += (rat[kdir] - 1) * BoxLib::BASISV(kdir); + ve += (rat[kdir] - 1) * amrex::BASISV(kdir); cfac /= rat[kdir]; // will average over fine cells in tangential dir #endif for (int i = c_entry[level].firstLocal(); c_entry[level].isValid(i); @@ -1731,7 +1731,7 @@ void HypreABecLap::setupSolver() } } else { - BoxLib::Error("No such solver in HypreABecLap"); + amrex::Error("No such solver in HypreABecLap"); } } @@ -1743,7 +1743,7 @@ void HypreABecLap::clearSolver() HYPRE_BoomerAMGDestroy(precond); } else { - BoxLib::Error("No such solver in HypreABecLap"); + amrex::Error("No such solver in HypreABecLap"); } } @@ -1773,7 +1773,7 @@ void HypreABecLap::doIt() HYPRE_BoomerAMGSetTol(precond, reltol_new); } else { - BoxLib::Error("No such solver in HypreABecLap"); + amrex::Error("No such solver in HypreABecLap"); } } } @@ -1792,7 +1792,7 @@ void HypreABecLap::doIt() HYPRE_ParCSRGMRESSolve(solver, par_A, par_b, par_x); } else { - BoxLib::Error("No such solver in HypreABecLap"); + amrex::Error("No such solver in HypreABecLap"); } HYPRE_SStructVectorGather(x); diff --git a/Tests/LinearSolvers/ComparisonTest/main.cpp b/Tests/LinearSolvers/ComparisonTest/main.cpp index 9c3a4d1131c..5350dc1af30 100644 --- a/Tests/LinearSolvers/ComparisonTest/main.cpp +++ b/Tests/LinearSolvers/ComparisonTest/main.cpp @@ -53,7 +53,7 @@ void compute_norm(const Array& soln, int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) #ifdef USEHYPRE solver_type = Hypre; #else - BoxLib::Error("Set USE_HYPRE=TRUE in GNUmakefile"); + amrex::Error("Set USE_HYPRE=TRUE in GNUmakefile"); #endif } else if (solver_type_s == "All") { @@ -80,7 +80,7 @@ int main(int argc, char* argv[]) if (ParallelDescriptor::IOProcessor()) { std::cout << "Don't know this solver type: " << solver_type << std::endl; } - BoxLib::Error(""); + amrex::Error(""); } } @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) if (ParallelDescriptor::IOProcessor()) { std::cout << "Don't know this boundary type: " << bc_type << std::endl; } - BoxLib::Error(""); + amrex::Error(""); } } @@ -225,7 +225,7 @@ int main(int argc, char* argv[]) compute_norm(psoln, pexac, geom, grids, nsoln, iCpp, iF90, iHyp); } - BoxLib::Finalize(); + amrex::Finalize(); } void build_grids(Array& geom, Array& grids) diff --git a/Tests/LinearSolvers/ComparisonTest/solve_with_F90.cpp b/Tests/LinearSolvers/ComparisonTest/solve_with_F90.cpp index aca03b08765..69c3c8ec74b 100644 --- a/Tests/LinearSolvers/ComparisonTest/solve_with_F90.cpp +++ b/Tests/LinearSolvers/ComparisonTest/solve_with_F90.cpp @@ -68,7 +68,7 @@ void solve_with_F90(const Array& soln, Real a, Real b, bcoeffs[ilev][n].reset(new MultiFab(edge_boxes,1,0,Fab_allocate)); } - BoxLib::average_cellcenter_to_face(amrex::GetArrOfPtrs(bcoeffs[ilev]), + amrex::average_cellcenter_to_face(amrex::GetArrOfPtrs(bcoeffs[ilev]), *beta[ilev], geom[ilev]); } diff --git a/Tests/LinearSolvers/ComparisonTest/solve_with_hypre.cpp b/Tests/LinearSolvers/ComparisonTest/solve_with_hypre.cpp index 79290206128..727cb835ac4 100644 --- a/Tests/LinearSolvers/ComparisonTest/solve_with_hypre.cpp +++ b/Tests/LinearSolvers/ComparisonTest/solve_with_hypre.cpp @@ -76,7 +76,7 @@ void solve_with_hypre(const Array& soln, Real a, Real b, bcoeffs[n].reset(new MultiFab(edge_boxes, 1, 0)); } - BoxLib::average_cellcenter_to_face(amrex::GetArrOfPtrs(bcoeffs), *beta[level], geom[level]); + amrex::average_cellcenter_to_face(amrex::GetArrOfPtrs(bcoeffs), *beta[level], geom[level]); for (int n = 0; n < BL_SPACEDIM ; n++) { diff --git a/Tests/LinearSolvers/ComparisonTest/writePlotFile.cpp b/Tests/LinearSolvers/ComparisonTest/writePlotFile.cpp index 4c7d4d443a2..97c62320e69 100644 --- a/Tests/LinearSolvers/ComparisonTest/writePlotFile.cpp +++ b/Tests/LinearSolvers/ComparisonTest/writePlotFile.cpp @@ -33,8 +33,8 @@ void writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -55,7 +55,7 @@ void writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "HyperCLaw-V1.1\n"; HeaderFile << n_data_items << '\n'; @@ -112,7 +112,7 @@ void writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", ilev, 1); + std::string Level = amrex::Concatenate("Level_", ilev, 1); // // Now for the full pathname of that directory. // @@ -124,8 +124,8 @@ void writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tests/MKDir/MKDir.cpp b/Tests/MKDir/MKDir.cpp index 0a0c1f8f787..00b0d5a3a3d 100644 --- a/Tests/MKDir/MKDir.cpp +++ b/Tests/MKDir/MKDir.cpp @@ -18,7 +18,7 @@ // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); const Real tStart(ParallelDescriptor::second()); int nprocs(ParallelDescriptor::NProcs()); @@ -43,14 +43,14 @@ int main(int argc, char *argv[]) { std::stringstream dirname; dirname << "dir" << i; if(ParallelDescriptor::IOProcessor()) { - if( ! BoxLib::UtilCreateDirectory(dirname.str(), 0755)) { - BoxLib::CreateDirectoryFailed(dirname.str()); + if( ! amrex::UtilCreateDirectory(dirname.str(), 0755)) { + amrex::CreateDirectoryFailed(dirname.str()); } for(int level(0); level < nlevels; ++level) { std::stringstream dirname; dirname << "dir" << i << "/Level_" << level; - if( ! BoxLib::UtilCreateDirectory(dirname.str(), 0755)) { - BoxLib::CreateDirectoryFailed(dirname.str()); + if( ! amrex::UtilCreateDirectory(dirname.str(), 0755)) { + amrex::CreateDirectoryFailed(dirname.str()); } } } @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) { } BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tools/C_util/AmrDeriveTecplot/AmrDeriveTecplot.cpp b/Tools/C_util/AmrDeriveTecplot/AmrDeriveTecplot.cpp index 5da59a32192..e30132cb8c6 100644 --- a/Tools/C_util/AmrDeriveTecplot/AmrDeriveTecplot.cpp +++ b/Tools/C_util/AmrDeriveTecplot/AmrDeriveTecplot.cpp @@ -61,7 +61,7 @@ std::ostream& operator<< (std::ostream& os, const Node& node) else os << "VALID"; if (os.fail()) - BoxLib::Error("operator<<(std::ostream&,Node&) failed"); + amrex::Error("operator<<(std::ostream&,Node&) failed"); return os; } @@ -123,7 +123,7 @@ print_usage (int, << " geometry.prob_lo = " << endl << " geometry.prob_hi = " << endl << endl; - BoxLib::Finalize(); + amrex::Finalize(); exit(1); } @@ -139,7 +139,7 @@ GetBndryCells (const BoxArray& ba, BoxList gcells, bcells; for (int i = 0; i < ba.size(); ++i) - gcells.join(BoxLib::boxDiff(BoxLib::grow(ba[i],ngrow),ba[i])); + gcells.join(amrex::boxDiff(amrex::grow(ba[i],ngrow),ba[i])); // // Now strip out intersections with original BoxArray. // @@ -157,7 +157,7 @@ GetBndryCells (const BoxArray& ba, BoxList pieces; for (int i = 0; i < isects.size(); i++) pieces.push_back(isects[i].second); - BoxList leftover = BoxLib::complementIn(*it,pieces); + BoxList leftover = amrex::complementIn(*it,pieces); bcells.catenate(leftover); } } @@ -165,7 +165,7 @@ GetBndryCells (const BoxArray& ba, // Now strip out overlaps. // gcells.clear(); - gcells = BoxLib::removeOverlap(bcells); + gcells = amrex::removeOverlap(bcells); bcells.clear(); if (geom.isAnyPeriodic()) @@ -188,7 +188,7 @@ GetBndryCells (const BoxArray& ba, const Box& shftbox = *it + pshifts[i]; const Box& ovlp = domain & shftbox; - BoxList bl = BoxLib::complementIn(ovlp,BoxList(ba)); + BoxList bl = amrex::complementIn(ovlp,BoxList(ba)); bcells.catenate(bl); } } @@ -309,7 +309,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); @@ -422,7 +422,7 @@ main (int argc, } } - gridArray[lev] = BoxLib::intersect(amrData.boxArray(lev), subboxArray[lev]); + gridArray[lev] = amrex::intersect(amrData.boxArray(lev), subboxArray[lev]); if (nGrowPer>0 && geom[lev].isAnyPeriodic() && gridArray[lev].size()>0) { @@ -488,7 +488,7 @@ main (int argc, for (MFIter fai(nodes[lev]); fai.isValid(); ++fai) { - const Box& box = BoxLib::grow(fai.validbox(),ref) & subboxArray[lev]; + const Box& box = amrex::grow(fai.validbox(),ref) & subboxArray[lev]; NodeFab& ifab = nodes[lev][fai]; std::vector< std::pair > isects = bndryCells.intersections(box); for (int i = 0; i < isects.size(); i++) @@ -498,7 +498,7 @@ main (int argc, std::cout << "BAD ISECTS: " << co << std::endl; const Box& dstBox = isects[i].second; - const Box& srcBox = BoxLib::coarsen(dstBox,ref); + const Box& srcBox = amrex::coarsen(dstBox,ref); NodeFab dst(dstBox,1); for (IntVect iv(srcBox.smallEnd()); @@ -578,22 +578,22 @@ main (int argc, { #if (BL_SPACEDIM == 2) const Node& n1 = ifab(iv,0); - const Node& n2 = ifab(IntVect(iv).shift(BoxLib::BASISV(0)),0); + const Node& n2 = ifab(IntVect(iv).shift(amrex::BASISV(0)),0); const Node& n3 = ifab(IntVect(iv).shift(IntVect::TheUnitVector()),0); - const Node& n4 = ifab(IntVect(iv).shift(BoxLib::BASISV(1)),0); + const Node& n4 = ifab(IntVect(iv).shift(amrex::BASISV(1)),0); if (n1.type==Node::VALID && n2.type==Node::VALID && n3.type==Node::VALID && n4.type==Node::VALID ) elements.insert(Element(n1,n2,n3,n4)); #else - const IntVect& ivu = IntVect(iv).shift(BoxLib::BASISV(2)); + const IntVect& ivu = IntVect(iv).shift(amrex::BASISV(2)); const Node& n1 = ifab(iv ,0); - const Node& n2 = ifab(IntVect(iv ).shift(BoxLib::BASISV(0)),0); - const Node& n3 = ifab(IntVect(iv ).shift(BoxLib::BASISV(0)).shift(BoxLib::BASISV(1)),0); - const Node& n4 = ifab(IntVect(iv ).shift(BoxLib::BASISV(1)),0); + const Node& n2 = ifab(IntVect(iv ).shift(amrex::BASISV(0)),0); + const Node& n3 = ifab(IntVect(iv ).shift(amrex::BASISV(0)).shift(amrex::BASISV(1)),0); + const Node& n4 = ifab(IntVect(iv ).shift(amrex::BASISV(1)),0); const Node& n5 = ifab(ivu,0); - const Node& n6 = ifab(IntVect(ivu).shift(BoxLib::BASISV(0)),0); - const Node& n7 = ifab(IntVect(ivu).shift(BoxLib::BASISV(0)).shift(BoxLib::BASISV(1)),0); - const Node& n8 = ifab(IntVect(ivu).shift(BoxLib::BASISV(1)),0); + const Node& n6 = ifab(IntVect(ivu).shift(amrex::BASISV(0)),0); + const Node& n7 = ifab(IntVect(ivu).shift(amrex::BASISV(0)).shift(amrex::BASISV(1)),0); + const Node& n8 = ifab(IntVect(ivu).shift(amrex::BASISV(1)),0); if (n1.type==Node::VALID && n2.type==Node::VALID && n3.type==Node::VALID && n4.type==Node::VALID && n5.type==Node::VALID && n6.type==Node::VALID && @@ -677,14 +677,14 @@ main (int argc, if (geom[lev].isPeriodic(i)) shrunkenDomain.grow(i,-ng); - const BoxArray edgeVBoxes = BoxLib::boxComplement(pd,shrunkenDomain); + const BoxArray edgeVBoxes = amrex::boxComplement(pd,shrunkenDomain); pData.define(edgeVBoxes,1,ng,Fab_allocate); pDataNG.define(BoxArray(edgeVBoxes).grow(ng),1,0,Fab_allocate); } for (int i=0; i norm0, norm1, norm2; @@ -90,7 +90,7 @@ main (int argc, for (int i=0; i norm0c, norm1c, norm2c; Array norm0f, norm1f, norm2f; @@ -94,7 +94,7 @@ main (int argc, for (int i=0; i bbll,bbur; @@ -1447,7 +1447,7 @@ TakeDifferenceFine(AmrData& amrDataf, for (int i=0;i bbll,bbur; @@ -1541,7 +1541,7 @@ TakeDifferenceCrse(AmrData& amrDataf, for (int i=0;i bbll,bbur; @@ -1640,7 +1640,7 @@ TakeDifferenceSum(AmrData& amrDataf, for (int i=0;i xold; for (int i = nstart; i < nmax; i++) { - File = BoxLib::Concatenate(iFile, i*nfac, 5); + File = amrex::Concatenate(iFile, i*nfac, 5); DataServices dataServices(File, fileType); @@ -270,9 +270,9 @@ main (int argc, } } else - BoxLib::Abort("Analysis type not defined"); + amrex::Abort("Analysis type not defined"); - BoxLib::Finalize(); + amrex::Finalize(); } @@ -300,7 +300,7 @@ compute_flux_all(int nstart, for (int i = nstart; i < nmax; i++) { - std::string File = BoxLib::Concatenate(iFile, i*nfac, 5); + std::string File = amrex::Concatenate(iFile, i*nfac, 5); DataServices dataServices(File, fileType); @@ -448,7 +448,7 @@ compute_flux_all(int nstart, for (int i = nstart; i < nmax; i++) { - std::string File = BoxLib::Concatenate(iFile, i*nfac, 5); + std::string File = amrex::Concatenate(iFile, i*nfac, 5); DataServices dataServices(File, fileType); @@ -643,7 +643,7 @@ compute_flux(AmrData& amrData, //for (int i=1; i<=finestLevel; i++) // domain.refine(amrData.RefRatio()[i]); - ba = BoxLib::intersect(amrData.boxArray(0),domain); + ba = amrex::intersect(amrData.boxArray(0),domain); } tmpmean.define(ba,nComp,0,Fab_allocate); diff --git a/Tools/C_util/Statistics/PltFileList.cpp b/Tools/C_util/Statistics/PltFileList.cpp index e14b11c1ee9..8b0624c6d86 100644 --- a/Tools/C_util/Statistics/PltFileList.cpp +++ b/Tools/C_util/Statistics/PltFileList.cpp @@ -43,7 +43,7 @@ main (int argc, if (argc == 1) PrintUsage(argv[0]); - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; if (pp.contains("help")) @@ -67,11 +67,11 @@ main (int argc, pp.query("infile", iFile); if (iFile.empty()) - BoxLib::Abort("You must specify `infile'"); + amrex::Abort("You must specify `infile'"); pp.query("outfile", outfile); if (outfile.empty()) - BoxLib::Abort("You must specify `outfile'"); + amrex::Abort("You must specify `outfile'"); int iFile_type = 0; pp.query("infile_type", iFile_type); @@ -97,7 +97,7 @@ main (int argc, { for (int i = 1; i <= nmax; i++) { - File = BoxLib::Concatenate(hdrFile, i, 1); + File = amrex::Concatenate(hdrFile, i, 1); File += '/'; File += iFile; @@ -149,7 +149,7 @@ main (int argc, { for (int i = 1; i <= nmax; i++) { - File = BoxLib::Concatenate(hdrFile, i, 1); + File = amrex::Concatenate(hdrFile, i, 1); File += '/'; File += iFile; @@ -194,8 +194,8 @@ main (int argc, // The I/O processor makes the directory if it doesn't already exist. if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(outfile, 0755)) - BoxLib::CreateDirectoryFailed(outfile); + if (!amrex::UtilCreateDirectory(outfile, 0755)) + amrex::CreateDirectoryFailed(outfile); ParallelDescriptor::Barrier(); std::string mfile = outfile + "/" + iFile + "_mean"; std::string vfile = outfile + "/" + iFile + "_var"; @@ -203,7 +203,7 @@ main (int argc, VisMF::Write(mean,mfile); VisMF::Write(variance,vfile); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tools/C_util/Statistics/PltFileStat.cpp b/Tools/C_util/Statistics/PltFileStat.cpp index 288d91df9c0..37edfcc7007 100644 --- a/Tools/C_util/Statistics/PltFileStat.cpp +++ b/Tools/C_util/Statistics/PltFileStat.cpp @@ -42,7 +42,7 @@ main (int argc, if (argc == 1) PrintUsage(argv[0]); - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; if (pp.contains("help")) @@ -63,21 +63,21 @@ main (int argc, std::string tmpFile; pp.query("infile", iFile); if (iFile.empty()) - BoxLib::Abort("You must specify `infile'"); + amrex::Abort("You must specify `infile'"); else tmpFile = iFile; int analysis_type = 0; pp.query("analysis", analysis_type); if (analysis_type == 0) - BoxLib::Abort("Analysis type is not specified."); + amrex::Abort("Analysis type is not specified."); if (analysis_type == 4) { int nstart = 10; pp.query("nstart",nstart); - tmpFile = BoxLib::Concatenate(iFile, nstart, 5); + tmpFile = amrex::Concatenate(iFile, nstart, 5); } int iFile_type = 0; @@ -120,7 +120,7 @@ main (int argc, } if (var_match[ic] == 0) { std::cout << "Component " << cNames[ic] << " is not defined!\n"; - BoxLib::Abort("Please check that the specified component is defined."); + amrex::Abort("Please check that the specified component is defined."); } } } @@ -176,7 +176,7 @@ main (int argc, bas.resize(Nlev); for (int iLevel=0; (iLevel<=finestLevel)&&(bas.size()==Nlev); ++iLevel) { - BoxArray baThisLev = BoxLib::intersect(amrData.boxArray(iLevel),levelDomain); + BoxArray baThisLev = amrex::intersect(amrData.boxArray(iLevel),levelDomain); if (baThisLev.size() > 0) { bas.set(iLevel,baThisLev); @@ -255,7 +255,7 @@ main (int argc, for (int i = nstart; i > ivoption(nvarg); for (int i=0; i > ivoption(nvarg); for (int i=0; i > ivoption(nvarg); for (int i=0; i xold; for (int i = nstart; i < nmax; i++) { - File = BoxLib::Concatenate(iFile, i*nfac, 5); + File = amrex::Concatenate(iFile, i*nfac, 5); DataServices dataServices(File, fileType); @@ -259,9 +259,9 @@ main (int argc, } } else - BoxLib::Abort("Analysis type not defined"); + amrex::Abort("Analysis type not defined"); - BoxLib::Finalize(); + amrex::Finalize(); } @@ -288,7 +288,7 @@ compute_flux_all(int nstart, for (int i = nstart; i < nmax; i++) { - std::string File = BoxLib::Concatenate(iFile, i*nfac, 5); + std::string File = amrex::Concatenate(iFile, i*nfac, 5); //File = hdrFile + idxs + iFile; @@ -434,7 +434,7 @@ compute_flux_all(int nstart, for (int i = nstart; i < nmax; i++) { - std::string File = BoxLib::Concatenate(iFile, i*nfac, 5); + std::string File = amrex::Concatenate(iFile, i*nfac, 5); DataServices dataServices(File, fileType); @@ -613,7 +613,7 @@ compute_flux(AmrData& amrData, //for (int i=1; i<=finestLevel; i++) // domain.refine(amrData.RefRatio()[i]); - ba = BoxLib::intersect(amrData.boxArray(0),domain); + ba = amrex::intersect(amrData.boxArray(0),domain); } tmpmean.define(ba,nComp,0,Fab_allocate); diff --git a/Tools/C_util/TV_TempWrite.H b/Tools/C_util/TV_TempWrite.H index 95ecd36e39c..fed8dbc0399 100644 --- a/Tools/C_util/TV_TempWrite.H +++ b/Tools/C_util/TV_TempWrite.H @@ -18,8 +18,8 @@ extern "C" { FullPath += '/'; if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); static const std::string MultiFabBaseName("MultiFab"); FullPath += MultiFabBaseName; diff --git a/Tools/C_util/ViewMF/MFNorm.cpp b/Tools/C_util/ViewMF/MFNorm.cpp index a12c33b3dc1..7e3abbe2284 100644 --- a/Tools/C_util/ViewMF/MFNorm.cpp +++ b/Tools/C_util/ViewMF/MFNorm.cpp @@ -61,7 +61,7 @@ MFNorm (const MultiFab& mfab, } else { - BoxLib::Error("Invalid exponent to norm function"); + amrex::Error("Invalid exponent to norm function"); } return myNorm; diff --git a/Tools/C_util/ViewMF/checkMFghostcells.cpp b/Tools/C_util/ViewMF/checkMFghostcells.cpp index 53dacc88342..68f4e74e9ed 100644 --- a/Tools/C_util/ViewMF/checkMFghostcells.cpp +++ b/Tools/C_util/ViewMF/checkMFghostcells.cpp @@ -31,7 +31,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(&argc, &argv); + amrex::Initialize(&argc, &argv); // // Parse the command line diff --git a/Tools/C_util/ViewMF/main.cpp b/Tools/C_util/ViewMF/main.cpp index 80b5c4fe7a2..4968acd01ed 100644 --- a/Tools/C_util/ViewMF/main.cpp +++ b/Tools/C_util/ViewMF/main.cpp @@ -335,7 +335,7 @@ norm ( const MultiFab& mfab, } else { - BoxLib::Error("Invalid exponent to norm function"); + amrex::Error("Invalid exponent to norm function"); } return myNorm; diff --git a/Tools/C_util/ViewMF/mfMinMax.cpp b/Tools/C_util/ViewMF/mfMinMax.cpp index da1af045ef9..51ef8716cea 100644 --- a/Tools/C_util/ViewMF/mfMinMax.cpp +++ b/Tools/C_util/ViewMF/mfMinMax.cpp @@ -31,7 +31,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // // Parse the command line // @@ -76,5 +76,5 @@ main (int argc, cout << "Comp: " << comps[n] << ", (min,max): " << mf.min(comps[n]) << ", " << mf.max(comps[n]) << endl; } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tools/C_util/ViewMF/viewMF.cpp b/Tools/C_util/ViewMF/viewMF.cpp index 275ab490b6b..2becad969f2 100644 --- a/Tools/C_util/ViewMF/viewMF.cpp +++ b/Tools/C_util/ViewMF/viewMF.cpp @@ -34,7 +34,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // // Parse the command line // @@ -68,7 +68,7 @@ main (int argc, return true; } - BoxLib::Finalize(); + amrex::Finalize(); return ArrayViewMultiFab(&tmp); } diff --git a/Tools/C_util/ViewMF/viewMFcol.cpp b/Tools/C_util/ViewMF/viewMFcol.cpp index 281106109d2..e0fca882354 100644 --- a/Tools/C_util/ViewMF/viewMFcol.cpp +++ b/Tools/C_util/ViewMF/viewMFcol.cpp @@ -33,7 +33,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // // Parse the command line // @@ -73,7 +73,7 @@ main (int argc, cout << "Components: " << sComp << " : " << sComp + nComp - 1 << endl; cout << fab << endl; - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tools/C_util/ViewMF/viewMFdiff.cpp b/Tools/C_util/ViewMF/viewMFdiff.cpp index e9de7b3040d..848fe546db1 100644 --- a/Tools/C_util/ViewMF/viewMFdiff.cpp +++ b/Tools/C_util/ViewMF/viewMFdiff.cpp @@ -30,7 +30,7 @@ PrintUsage(int argc, char *argv[]) int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; @@ -78,25 +78,25 @@ int main (int argc, // BoxList common_bl; for (int i=0; i domain(finestLevel+1); const IndexType& ixType = mf.boxArray().ixType(); if (ixType != IndexType::TheCellType()) - BoxLib::Error("writePlotfile unable to handle non cell-centered data for now"); + amrex::Error("writePlotfile unable to handle non cell-centered data for now"); Box tmpb = Box(geom.Domain()).convert(ixType); Array corr(BL_SPACEDIM); for (int d = 0; d < BL_SPACEDIM; d++) @@ -112,7 +112,7 @@ writePlotFile (const std::string& dir, // Build the directory to hold the MultiFabs at this level. // The name is relative to the directory containing the Header file. // - std::string Level = BoxLib::Concatenate("Level_", level, 1); + std::string Level = amrex::Concatenate("Level_", level, 1); // // Now for the full pathname of that directory. // @@ -124,8 +124,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // @@ -146,7 +146,7 @@ writePlotFile (const std::string& dir, { if (names.size()==0) { - std::string name = BoxLib::Concatenate("state_", n, 1); + std::string name = amrex::Concatenate("state_", n, 1); os << name << '\n'; } @@ -241,8 +241,8 @@ writePlotFile (const char* name, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(pltfile, 0755)) - BoxLib::CreateDirectoryFailed(pltfile); + if (!amrex::UtilCreateDirectory(pltfile, 0755)) + amrex::CreateDirectoryFailed(pltfile); // // Force other processors to wait till directory is built. // @@ -266,7 +266,7 @@ writePlotFile (const char* name, HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(30); } @@ -282,7 +282,7 @@ writePlotFile (const char* name, HeaderFile.precision(old_prec); if (!HeaderFile.good()) - BoxLib::Error("Amr::writePlotFile() failed"); + amrex::Error("Amr::writePlotFile() failed"); } double dPlotFileTime1(ParallelDescriptor::second()); @@ -304,8 +304,8 @@ void WritePlotFile(const Array mfa, int finestLevel = amrdToMimic.FinestLevel(); if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(oFile,0755)) - BoxLib::CreateDirectoryFailed(oFile); + if (!amrex::UtilCreateDirectory(oFile,0755)) + amrex::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // @@ -326,7 +326,7 @@ void WritePlotFile(const Array mfa, os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); if (os.fail()) - BoxLib::FileOpenFailed(oFileHeader); + amrex::FileOpenFailed(oFileHeader); // // Start writing plotfile. // @@ -366,7 +366,7 @@ void WritePlotFile(const Array mfa, // int nGrids = amrdToMimic.boxArray(iLevel).size(); - std::string LevelStr = BoxLib::Concatenate("Level_", iLevel, 1); + std::string LevelStr = amrex::Concatenate("Level_", iLevel, 1); if (ParallelDescriptor::IOProcessor()) { @@ -390,8 +390,8 @@ void WritePlotFile(const Array mfa, Level += '/'; Level += LevelStr; - if (!BoxLib::UtilCreateDirectory(Level, 0755)) - BoxLib::CreateDirectoryFailed(Level); + if (!amrex::UtilCreateDirectory(Level, 0755)) + amrex::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. diff --git a/Tools/C_util/dbgTools/crsGrids.cpp b/Tools/C_util/dbgTools/crsGrids.cpp index aabf4b28b5d..76bf910b39e 100644 --- a/Tools/C_util/dbgTools/crsGrids.cpp +++ b/Tools/C_util/dbgTools/crsGrids.cpp @@ -49,7 +49,7 @@ main (int argc, if (argc == 1) PrintUsage(argv[0]); - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); ParmParse pp; @@ -60,11 +60,11 @@ main (int argc, pp.query("infile", iFile); // Input File if (iFile.empty() && ParallelDescriptor::IOProcessor()) - BoxLib::Abort("You must specify `infile'"); + amrex::Abort("You must specify `infile'"); int nCrsRatio = pp.countval("crsratio"); if (nCrsRatio == 0) - BoxLib::Abort("You must specify `crsratio'"); + amrex::Abort("You must specify `crsratio'"); Array crsRatio(nCrsRatio); for (int n = 0; n < nCrsRatio; n++) @@ -80,13 +80,13 @@ main (int argc, is.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); is.open(iFile.c_str(), std::ios::in); if (is.fail()) - BoxLib::FileOpenFailed(iFile); + amrex::FileOpenFailed(iFile); int nRefLevels; is >> nRefLevels; if (nCrsRatio != nRefLevels) - BoxLib::Abort("nCrsRatio != nRefLevels"); + amrex::Abort("nCrsRatio != nRefLevels"); std::cout << nRefLevels << std::endl; @@ -110,7 +110,7 @@ main (int argc, } } - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tools/C_util/dbgTools/intersectGrids.cpp b/Tools/C_util/dbgTools/intersectGrids.cpp index d51c00c664c..dc1d5f9fac3 100644 --- a/Tools/C_util/dbgTools/intersectGrids.cpp +++ b/Tools/C_util/dbgTools/intersectGrids.cpp @@ -102,17 +102,17 @@ main (int argc, pp.query("infile", iFile); // Input File if (iFile.isNull() && ParallelDescriptor::IOProcessor()) - BoxLib::Abort("You must specify `infile'"); + amrex::Abort("You must specify `infile'"); Array loDims(BL_SPACEDIM); if (pp.countval("lodims") != BL_SPACEDIM) - BoxLib::Abort("You must specify BL_SPACEDIM `lodims'"); + amrex::Abort("You must specify BL_SPACEDIM `lodims'"); for (int n = 0; n < BL_SPACEDIM; n++) pp.get("lodims", loDims[n], n); Array hiDims(BL_SPACEDIM); if (pp.countval("hidims") != BL_SPACEDIM) - BoxLib::Abort("You must specify BL_SPACEDIM `hidims'"); + amrex::Abort("You must specify BL_SPACEDIM `hidims'"); for (int n = 0; n < BL_SPACEDIM; n++) pp.get("hidims", hiDims[n], n); @@ -122,7 +122,7 @@ main (int argc, int nCrsRatio = pp.countval("refratio"); if (nCrsRatio == 0) - BoxLib::Abort("You must specify `refratio'"); + amrex::Abort("You must specify `refratio'"); Array refRatio(nCrsRatio); for (int n = 0; n < nCrsRatio; n++) @@ -144,7 +144,7 @@ main (int argc, is >> nRefLevels; if (nCrsRatio != nRefLevels) - BoxLib::Abort("nCrsRatio != nRefLevels"); + amrex::Abort("nCrsRatio != nRefLevels"); cout << nRefLevels << endl; diff --git a/Tutorials/AMR_Adv_C/Source/Adv.cpp b/Tutorials/AMR_Adv_C/Source/Adv.cpp index 990e1270ed7..1328c468a31 100644 --- a/Tutorials/AMR_Adv_C/Source/Adv.cpp +++ b/Tutorials/AMR_Adv_C/Source/Adv.cpp @@ -29,12 +29,12 @@ Adv::read_params () // This tutorial code only supports Cartesian coordinates. if (! Geometry::IsCartesian()) { - BoxLib::Abort("Please set geom.coord_sys = 0"); + amrex::Abort("Please set geom.coord_sys = 0"); } // This tutorial code only supports periodic boundaries. if (! Geometry::isAllPeriodic()) { - BoxLib::Abort("Please set geom.is_periodic = 1 1 1"); + amrex::Abort("Please set geom.is_periodic = 1 1 1"); } @@ -196,7 +196,7 @@ Adv::avgDown (int state_indx) MultiFab& S_fine = fine_lev.get_new_data(state_indx); MultiFab& S_crse = get_new_data(state_indx); - BoxLib::average_down(S_fine,S_crse, + amrex::average_down(S_fine,S_crse, fine_lev.geom,geom, 0,S_fine.nComp(),parent->refRatio(level)); } diff --git a/Tutorials/AMR_Adv_C/Source/Adv_advance.cpp b/Tutorials/AMR_Adv_C/Source/Adv_advance.cpp index dbf6b7a819e..c0df793d317 100644 --- a/Tutorials/AMR_Adv_C/Source/Adv_advance.cpp +++ b/Tutorials/AMR_Adv_C/Source/Adv_advance.cpp @@ -70,9 +70,9 @@ Adv::advance (Real time, // Allocate fabs for fluxes and Godunov velocities. for (int i = 0; i < BL_SPACEDIM ; i++) { - const Box& bxtmp = BoxLib::surroundingNodes(bx,i); + const Box& bxtmp = amrex::surroundingNodes(bx,i); flux[i].resize(bxtmp,NUM_STATE); - uface[i].resize(BoxLib::grow(bxtmp,1),1); + uface[i].resize(amrex::grow(bxtmp,1),1); } get_face_velocity(level, ctr_time, diff --git a/Tutorials/AMR_Adv_C/Source/Adv_io.cpp b/Tutorials/AMR_Adv_C/Source/Adv_io.cpp index d75e53af35d..c18ec5ffce1 100644 --- a/Tutorials/AMR_Adv_C/Source/Adv_io.cpp +++ b/Tutorials/AMR_Adv_C/Source/Adv_io.cpp @@ -50,7 +50,7 @@ Adv::writePlotFile (const std::string& dir, os << thePlotFileType() << '\n'; if (n_data_items == 0) - BoxLib::Error("Must specify at least one valid data item to plot"); + amrex::Error("Must specify at least one valid data item to plot"); os << n_data_items << '\n'; @@ -111,8 +111,8 @@ Adv::writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/AMR_Adv_C/Source/main.cpp b/Tutorials/AMR_Adv_C/Source/main.cpp index 9c892d63c78..ab7c1eb1840 100644 --- a/Tutorials/AMR_Adv_C/Source/main.cpp +++ b/Tutorials/AMR_Adv_C/Source/main.cpp @@ -12,7 +12,7 @@ int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); Real dRunTime1 = ParallelDescriptor::second(); std::cout << std::setprecision(10); @@ -31,11 +31,11 @@ main (int argc, pp.query("stop_time",stop_time); if (strt_time < 0.0) { - BoxLib::Abort("MUST SPECIFY a non-negative strt_time"); + amrex::Abort("MUST SPECIFY a non-negative strt_time"); } if (max_step < 0 && stop_time < 0.0) { - BoxLib::Abort("Exiting because neither max_step nor stop_time is non-negative."); + amrex::Abort("Exiting because neither max_step nor stop_time is non-negative."); } Amr* amrptr = new Amr; @@ -85,7 +85,7 @@ main (int argc, std::cout << "Run time = " << dRunTime2 << std::endl; } - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/AMR_Adv_C_v2/Source/AmrAdv.cpp b/Tutorials/AMR_Adv_C_v2/Source/AmrAdv.cpp index b0b07211ce5..3014f506611 100644 --- a/Tutorials/AMR_Adv_C_v2/Source/AmrAdv.cpp +++ b/Tutorials/AMR_Adv_C_v2/Source/AmrAdv.cpp @@ -169,7 +169,7 @@ AmrAdv::AverageDown () { for (int lev = finest_level-1; lev >= 0; --lev) { - BoxLib::average_down(*phi_new[lev+1], *phi_new[lev], + amrex::average_down(*phi_new[lev+1], *phi_new[lev], geom[lev+1], geom[lev], 0, phi_new[lev]->nComp(), refRatio(lev)); } @@ -178,7 +178,7 @@ AmrAdv::AverageDown () void AmrAdv::AverageDownTo (int crse_lev) { - BoxLib::average_down(*phi_new[crse_lev+1], *phi_new[crse_lev], + amrex::average_down(*phi_new[crse_lev+1], *phi_new[crse_lev], geom[crse_lev+1], geom[crse_lev], 0, phi_new[crse_lev]->nComp(), refRatio(crse_lev)); } @@ -211,7 +211,7 @@ AmrAdv::FillPatch (int lev, Real time, MultiFab& mf, int icomp, int ncomp) GetData(0, time, smf, stime); AmrAdvPhysBC physbc; - BoxLib::FillPatchSingleLevel(mf, time, smf, stime, 0, icomp, ncomp, + amrex::FillPatchSingleLevel(mf, time, smf, stime, 0, icomp, ncomp, geom[lev], physbc); } else @@ -228,7 +228,7 @@ AmrAdv::FillPatch (int lev, Real time, MultiFab& mf, int icomp, int ncomp) int hi_bc[] = {INT_DIR, INT_DIR, INT_DIR}; Array bcs(1, BCRec(lo_bc, hi_bc)); - BoxLib::FillPatchTwoLevels(mf, time, cmf, ctime, fmf, ftime, + amrex::FillPatchTwoLevels(mf, time, cmf, ctime, fmf, ftime, 0, icomp, ncomp, geom[lev-1], geom[lev], cphysbc, fphysbc, refRatio(lev-1), mapper, bcs); diff --git a/Tutorials/AMR_Adv_C_v2/Source/AmrAdvEvolve.cpp b/Tutorials/AMR_Adv_C_v2/Source/AmrAdvEvolve.cpp index 87ab959163d..a30217eb78f 100644 --- a/Tutorials/AMR_Adv_C_v2/Source/AmrAdvEvolve.cpp +++ b/Tutorials/AMR_Adv_C_v2/Source/AmrAdvEvolve.cpp @@ -159,9 +159,9 @@ AmrAdv::Advance (int lev, Real time, Real dt, int iteration, int ncycle) // Allocate fabs for fluxes and Godunov velocities. for (int i = 0; i < BL_SPACEDIM ; i++) { - const Box& bxtmp = BoxLib::surroundingNodes(bx,i); + const Box& bxtmp = amrex::surroundingNodes(bx,i); flux[i].resize(bxtmp,S_new.nComp()); - uface[i].resize(BoxLib::grow(bxtmp,1),1); + uface[i].resize(amrex::grow(bxtmp,1),1); } get_face_velocity(lev, ctr_time, diff --git a/Tutorials/AMR_Adv_C_v2/Source/AmrAdvIO.cpp b/Tutorials/AMR_Adv_C_v2/Source/AmrAdvIO.cpp index 8d121384c7f..3414079a64d 100644 --- a/Tutorials/AMR_Adv_C_v2/Source/AmrAdvIO.cpp +++ b/Tutorials/AMR_Adv_C_v2/Source/AmrAdvIO.cpp @@ -6,7 +6,7 @@ std::string AmrAdv::PlotFileName (int lev) const { - return BoxLib::Concatenate(plot_file, lev, 5); + return amrex::Concatenate(plot_file, lev, 5); } Array @@ -32,13 +32,13 @@ AmrAdv::WritePlotFile () const const auto& mf = PlotFileMF(); const auto& varnames = PlotFileVarNames(); - BoxLib::WriteMultiLevelPlotfile(plotfilename, finest_level+1, mf, varnames, + amrex::WriteMultiLevelPlotfile(plotfilename, finest_level+1, mf, varnames, Geom(), t_new[0], istep, refRatio()); } void AmrAdv::InitFromCheckpoint () { - BoxLib::Abort("AmrAdv::InitFromCheckpoint: todo"); + amrex::Abort("AmrAdv::InitFromCheckpoint: todo"); } diff --git a/Tutorials/AMR_Adv_C_v2/Source/main.cpp b/Tutorials/AMR_Adv_C_v2/Source/main.cpp index 6697a26bb0a..c1999342b36 100644 --- a/Tutorials/AMR_Adv_C_v2/Source/main.cpp +++ b/Tutorials/AMR_Adv_C_v2/Source/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -32,5 +32,5 @@ int main(int argc, char* argv[]) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/DataServicesTest0/DataServicesTest0.cpp b/Tutorials/DataServicesTest0/DataServicesTest0.cpp index c719588e5d8..a8982f0dc53 100644 --- a/Tutorials/DataServicesTest0/DataServicesTest0.cpp +++ b/Tutorials/DataServicesTest0/DataServicesTest0.cpp @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) { } bool bInitParmParse(false); - BoxLib::Initialize(argc, argv, bInitParmParse); + amrex::Initialize(argc, argv, bInitParmParse); int myProc(ParallelDescriptor::MyProc()); @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { bool bFinalizeMPI(true); - BoxLib::Finalize(bFinalizeMPI); + amrex::Finalize(bFinalizeMPI); return 0; } diff --git a/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_F/HyptermOnly.cpp b/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_F/HyptermOnly.cpp index 62ceaf896ec..820c2590451 100644 --- a/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_F/HyptermOnly.cpp +++ b/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_F/HyptermOnly.cpp @@ -38,7 +38,7 @@ using std::endl; // -------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); int maxgrid(64), nComps(5), nGhost(4); int ioProc(ParallelDescriptor::IOProcessorNumber()); @@ -89,9 +89,9 @@ int main(int argc, char *argv[]) { VisMF::Write(mfU, "mfUInit"); - double tsleepstart = BoxLib::wsecond(); + double tsleepstart = amrex::wsecond(); sleep(1); - double tsleepend = BoxLib::wsecond(); + double tsleepend = amrex::wsecond(); if(ParallelDescriptor::IOProcessor()) { cout << "sleep(1) time = " << tsleepend - tsleepstart << endl; } @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) { } } - double tstart = BoxLib::wsecond(); + double tstart = amrex::wsecond(); int nSteps(1); for(int iStep(0); iStep < nSteps; ++iStep) { @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { } } - double tend = BoxLib::wsecond(); + double tend = amrex::wsecond(); if(ParallelDescriptor::IOProcessor()) { cout << "-----------------" << endl; cout << "Hypterm time = " << tend - tstart << endl; @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) { VisMF::Write(mfFlux, "mfFluxFinal"); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------- diff --git a/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_c/HyptermOnly.cpp b/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_c/HyptermOnly.cpp index 9dd3deb0a1b..b06ea1a158c 100644 --- a/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_c/HyptermOnly.cpp +++ b/Tutorials/Exp_CNS_NoSpec_F/HyptermKernels/HyptermKernel_cpp_c/HyptermOnly.cpp @@ -46,7 +46,7 @@ extern "C" { // -------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); int maxgrid(64), nComps(5), nGhost(4); int ioProc(ParallelDescriptor::IOProcessorNumber()); @@ -102,9 +102,9 @@ int main(int argc, char *argv[]) { VisMF::Write(mfU, "mfUInit"); - double tsleepstart = BoxLib::wsecond(); + double tsleepstart = amrex::wsecond(); sleep(1); - double tsleepend = BoxLib::wsecond(); + double tsleepend = amrex::wsecond(); if(ParallelDescriptor::IOProcessor()) { cout << "sleep(1) time = " << tsleepend - tsleepstart << endl; } @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) { init_timer(); - double tstart = BoxLib::wsecond(); + double tstart = amrex::wsecond(); int nSteps(1); for(int iStep(0); iStep < nSteps; ++iStep) { @@ -149,11 +149,11 @@ int main(int argc, char *argv[]) { cout << "-----------------" << endl; } - double tstart = BoxLib::wsecond(); + double tstart = amrex::wsecond(); hypterm_naive(lo,hi,NG,dx,U,Q,F); - double tend = BoxLib::wsecond(); + double tend = amrex::wsecond(); if(ParallelDescriptor::IOProcessor()) { cout << "-----------------" << endl; cout << "hypterm = " << tend - tstart << endl; @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) { } } - double tend = BoxLib::wsecond(); + double tend = amrex::wsecond(); if(ParallelDescriptor::IOProcessor()) { cout << "-----------------" << endl; cout << "runtime tot = " << tend - tstart << endl; @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) { VisMF::Write(mfFlux, "mfFluxFinal"); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------- diff --git a/Tutorials/GettingStarted_C/main.cpp b/Tutorials/GettingStarted_C/main.cpp index f8b9a68c84a..95f6c1d421f 100644 --- a/Tutorials/GettingStarted_C/main.cpp +++ b/Tutorials/GettingStarted_C/main.cpp @@ -77,10 +77,10 @@ void main_main () int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); main_main(); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/HeatEquation_EX1_C/main.cpp b/Tutorials/HeatEquation_EX1_C/main.cpp index 71cd0c58254..1fccdef8c4f 100644 --- a/Tutorials/HeatEquation_EX1_C/main.cpp +++ b/Tutorials/HeatEquation_EX1_C/main.cpp @@ -165,7 +165,7 @@ void main_main () if (plot_int > 0) { int n = 0; - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *phi[init_index], geom, time); } @@ -195,7 +195,7 @@ void main_main () // Write a plotfile of the current data (plot_int was defined in the inputs file) if (plot_int > 0 && n%plot_int == 0) { - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *phi[new_index], geom, time); } } @@ -214,10 +214,10 @@ void main_main () int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); main_main(); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/HeatEquation_EX1_C/writePlotFile.cpp b/Tutorials/HeatEquation_EX1_C/writePlotFile.cpp index f7a53e3a8bf..5016d974644 100644 --- a/Tutorials/HeatEquation_EX1_C/writePlotFile.cpp +++ b/Tutorials/HeatEquation_EX1_C/writePlotFile.cpp @@ -14,8 +14,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -36,7 +36,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -73,7 +73,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -85,8 +85,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/HeatEquation_EX2_C/main.cpp b/Tutorials/HeatEquation_EX2_C/main.cpp index 24acfe5b84c..acd1642730e 100644 --- a/Tutorials/HeatEquation_EX2_C/main.cpp +++ b/Tutorials/HeatEquation_EX2_C/main.cpp @@ -193,7 +193,7 @@ void main_main () if (plot_int > 0) { int n = 0; - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *phi[init_index], geom, time); } @@ -223,7 +223,7 @@ void main_main () // Write a plotfile of the current data (plot_int was defined in the inputs file) if (plot_int > 0 && n%plot_int == 0) { - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *phi[new_index], geom, time); } } @@ -242,10 +242,10 @@ void main_main () int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); main_main(); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/HeatEquation_EX2_C/writePlotFile.cpp b/Tutorials/HeatEquation_EX2_C/writePlotFile.cpp index f7a53e3a8bf..5016d974644 100644 --- a/Tutorials/HeatEquation_EX2_C/writePlotFile.cpp +++ b/Tutorials/HeatEquation_EX2_C/writePlotFile.cpp @@ -14,8 +14,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -36,7 +36,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -73,7 +73,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -85,8 +85,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/HelloWorld_C/main.cpp b/Tutorials/HelloWorld_C/main.cpp index 1088a8177ec..f76d9f55c51 100644 --- a/Tutorials/HelloWorld_C/main.cpp +++ b/Tutorials/HelloWorld_C/main.cpp @@ -12,7 +12,7 @@ extern "C" int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // define the lower and upper corner of a 3D domain IntVect domain_lo(0 , 0, 0); @@ -53,6 +53,6 @@ int main(int argc, char* argv[]) std::cout << "L1 norm = " << data.norm1() << std::endl; std::cout << "L2 norm = " << data.norm2() << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/MultiColor_C/main.cpp b/Tutorials/MultiColor_C/main.cpp index bbe4eb6a852..a8e68a7e26d 100644 --- a/Tutorials/MultiColor_C/main.cpp +++ b/Tutorials/MultiColor_C/main.cpp @@ -43,7 +43,7 @@ void single_component_solve(MultiFab& soln, const MultiFab& rhs, int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BoxArray ba; Geometry geom; @@ -89,7 +89,7 @@ int main(int argc, char* argv[]) VisMF::Write(soln, "soln"); - BoxLib::Finalize(); + amrex::Finalize(); } void setup_rhs(MultiFab& rhs, const Geometry& geom) @@ -113,7 +113,7 @@ void setup_coeffs(MultiFab& alpha, const Array& beta, const Geometry& alpha.setVal(1.0); #if (BL_SPACEDIM == 3) - BoxLib::Abort("2D only"); + amrex::Abort("2D only"); #endif for ( MFIter mfi(alpha); mfi.isValid(); ++mfi ) diff --git a/Tutorials/MultiFabTests_C/GridMoveTest.cpp b/Tutorials/MultiFabTests_C/GridMoveTest.cpp index 6c4893ca190..d5661afe298 100644 --- a/Tutorials/MultiFabTests_C/GridMoveTest.cpp +++ b/Tutorials/MultiFabTests_C/GridMoveTest.cpp @@ -54,7 +54,7 @@ void SetFabValsToPMap(MultiFab &mf) { // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); BL_PROFILE_REGION_START("main"); @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) { Array copyArray; if(ParallelDescriptor::IOProcessor()) { - BoxLib::UniqueRandomSubset(copyArray, nRanksInSet, nProcs); + amrex::UniqueRandomSubset(copyArray, nRanksInSet, nProcs); } else { copyArray.resize(nRanksInSet); } @@ -187,10 +187,10 @@ int main(int argc, char *argv[]) { Array copyArray; int nRanksInSet(8); if(nRanksInSet % 2 != 0) { - BoxLib::Abort("**** Bad nRanksInSet"); + amrex::Abort("**** Bad nRanksInSet"); } if(ParallelDescriptor::IOProcessor()) { - BoxLib::UniqueRandomSubset(copyArray, nRanksInSet, nProcs); + amrex::UniqueRandomSubset(copyArray, nRanksInSet, nProcs); } else { copyArray.resize(nRanksInSet); } @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) { Array randomMap(ba16.size()); if(ParallelDescriptor::IOProcessor()) { for(int ir(0); ir < ba16.size(); ++ ir) { - randomMap[ir] = BoxLib::Random_int(nProcs); + randomMap[ir] = amrex::Random_int(nProcs); } } ParallelDescriptor::Bcast(randomMap.dataPtr(), randomMap.size()); @@ -245,7 +245,7 @@ int main(int argc, char *argv[]) { BL_PROFILE_REGION_STOP("main"); BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tutorials/MultiFabTests_C/MultiFabFillBoundary.cpp b/Tutorials/MultiFabTests_C/MultiFabFillBoundary.cpp index 9373a1658f4..e532dea098c 100644 --- a/Tutorials/MultiFabTests_C/MultiFabFillBoundary.cpp +++ b/Tutorials/MultiFabTests_C/MultiFabFillBoundary.cpp @@ -63,7 +63,7 @@ void PrintL0Grdlog(std::ostream &os, const BoxArray &ba, const Array &map) // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); VisMF::SetNOutFiles(nFiles); // ---- this will enforce the range [1, nprocs] @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) { for(MFIter mfi(mf); mfi.isValid(); ++mfi) { const int index(mfi.index()); FArrayBox &fab = mf[index]; - std::string fname = BoxLib::Concatenate("FAB_", index, 4); + std::string fname = amrex::Concatenate("FAB_", index, 4); std::ofstream fabs(fname.c_str()); fab.writeOn(fabs); fabs.close(); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) { PrintL0Grdlog(std::cout, mf.boxArray(), dmap.ProcessorMap()); } - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tutorials/MultiFabTests_C/MultiFabReadWrite.cpp b/Tutorials/MultiFabTests_C/MultiFabReadWrite.cpp index 856908d9578..6645698bb98 100644 --- a/Tutorials/MultiFabTests_C/MultiFabReadWrite.cpp +++ b/Tutorials/MultiFabTests_C/MultiFabReadWrite.cpp @@ -36,7 +36,7 @@ const int nFiles(64); // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); BL_PROFILE_REGION_START("main"); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { for(MFIter mfi(mf); mfi.isValid(); ++mfi) { const int index(mfi.index()); FArrayBox &fab = mf[mfi]; - std::string fname = BoxLib::Concatenate("FAB_", index, 4); + std::string fname = amrex::Concatenate("FAB_", index, 4); std::ofstream fabs(fname.c_str()); fab.writeOn(fabs); fabs.close(); @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { BL_PROFILE_REGION_STOP("main"); BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tutorials/MultiGrid_C/main.cpp b/Tutorials/MultiGrid_C/main.cpp index eff5df7ec32..e1089669b62 100644 --- a/Tutorials/MultiGrid_C/main.cpp +++ b/Tutorials/MultiGrid_C/main.cpp @@ -94,7 +94,7 @@ void solve_with_HPGMG(MultiFab& soln, MultiFab& gphi, Real a, Real b, MultiFab& int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); BL_PROFILE_VAR("main()", pmain); @@ -121,14 +121,14 @@ int main(int argc, char* argv[]) #ifdef USE_F90_SOLVERS solver_type = BoxLib_F; #else - BoxLib::Error("Set USE_FORTRAN=TRUE in GNUmakefile"); + amrex::Error("Set USE_FORTRAN=TRUE in GNUmakefile"); #endif } else if (solver_type_s == "Hypre") { #ifdef USEHYPRE solver_type = Hypre; #else - BoxLib::Error("Set USE_HYPRE=TRUE in GNUmakefile"); + amrex::Error("Set USE_HYPRE=TRUE in GNUmakefile"); #endif } else if (solver_type_s == "All") { @@ -138,7 +138,7 @@ int main(int argc, char* argv[]) if (ParallelDescriptor::IOProcessor()) { std::cout << "Don't know this solver type: " << solver_type << std::endl; } - BoxLib::Error(""); + amrex::Error(""); } } @@ -154,7 +154,7 @@ int main(int argc, char* argv[]) else if (bc_type_s == "Neumann") { bc_type = Neumann; #ifdef USEHPGMG - BoxLib::Error("HPGMG does not support Neumann boundary conditions"); + amrex::Error("HPGMG does not support Neumann boundary conditions"); #endif } else if (bc_type_s == "Periodic") { @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) if (ParallelDescriptor::IOProcessor()) { std::cout << "Don't know this boundary type: " << bc_type << std::endl; } - BoxLib::Error(""); + amrex::Error(""); } } @@ -353,7 +353,7 @@ int main(int argc, char* argv[]) BL_PROFILE_VAR_STOP(pmain); - BoxLib::Finalize(); + amrex::Finalize(); } void compute_analyticSolution(MultiFab& anaSoln, const Array& offset) @@ -398,7 +398,7 @@ void setup_coeffs(BoxArray& bs, MultiFab& alpha, const Array& beta, bx.loVect(),bx.hiVect(),dx, sigma, w); } - BoxLib::average_cellcenter_to_face(beta, cc_coef, geom); + amrex::average_cellcenter_to_face(beta, cc_coef, geom); if (plot_beta == 1) { writePlotFile("BETA", cc_coef, geom); @@ -650,7 +650,7 @@ void solve(MultiFab& soln, const MultiFab& anaSoln, MultiFab& gphi, } #endif else { - BoxLib::Error("Invalid solver"); + amrex::Error("Invalid solver"); } Real run_time = ParallelDescriptor::second() - run_strt; @@ -723,7 +723,7 @@ void solve_with_Cpp(MultiFab& soln, MultiFab& gphi, Real a, Real b, MultiFab& al #endif // Average edge-centered gradients to cell centers. - BoxLib::average_face_to_cellcenter(gphi, amrex::GetArrOfConstPtrs(grad_phi), geom); + amrex::average_face_to_cellcenter(gphi, amrex::GetArrOfConstPtrs(grad_phi), geom); } #ifdef USE_F90_SOLVERS @@ -775,7 +775,7 @@ void solve_with_F90(MultiFab& soln, MultiFab& gphi, Real a, Real b, MultiFab& al fmg.get_fluxes(amrex::GetArrOfPtrs(grad_phi)); // Average edge-centered gradients to cell centers. - BoxLib::average_face_to_cellcenter(gphi, amrex::GetArrOfConstPtrs(grad_phi), geom); + amrex::average_face_to_cellcenter(gphi, amrex::GetArrOfConstPtrs(grad_phi), geom); } #endif @@ -936,6 +936,6 @@ void solve_with_HPGMG(MultiFab& soln, MultiFab& gphi, Real a, Real b, MultiFab& #endif // Average edge-centered gradients to cell centers. - BoxLib::average_face_to_cellcenter(gphi, grad_phi, geom); + amrex::average_face_to_cellcenter(gphi, grad_phi, geom); } #endif diff --git a/Tutorials/MultiGrid_C/writePlotFile.cpp b/Tutorials/MultiGrid_C/writePlotFile.cpp index 9cf72f74541..cda43c1d470 100644 --- a/Tutorials/MultiGrid_C/writePlotFile.cpp +++ b/Tutorials/MultiGrid_C/writePlotFile.cpp @@ -23,8 +23,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -45,7 +45,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -79,7 +79,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -91,8 +91,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/PGAS_HEAT/main.cpp b/Tutorials/PGAS_HEAT/main.cpp index 75a23b6a5b9..44cf1c87022 100644 --- a/Tutorials/PGAS_HEAT/main.cpp +++ b/Tutorials/PGAS_HEAT/main.cpp @@ -87,7 +87,7 @@ Real compute_dt (Real dx) int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // What time is it now? We'll use this to compute total run time. Real strt_time = ParallelDescriptor::second(); @@ -195,7 +195,7 @@ main (int argc, char* argv[]) // Write a plotfile of the initial data if plot_int > 0 (plot_int was defined in the inputs file) if (plot_int > 0) { int n = 0; - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_phi, geom); } @@ -215,7 +215,7 @@ main (int argc, char* argv[]) // Write a plotfile of the current data (plot_int was defined in the inputs file) if (plot_int > 0 && n%plot_int == 0) { - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_phi, geom); } } @@ -265,10 +265,10 @@ main (int argc, char* argv[]) // // When MPI3 shared memory is used, the dtor of MultiFab calls MPI functions. // Because the scope of phis is beyond the call to - // BoxLib::Finalize(), which in turn calls MPI_Finalize(), we destroy these + // amrex::Finalize(), which in turn calls MPI_Finalize(), we destroy these // MultiFabs by hand now. phis.clear(); // Say goodbye to MPI, etc... - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/PGAS_HEAT/writePlotFile.cpp b/Tutorials/PGAS_HEAT/writePlotFile.cpp index ed37f22d703..685a4946033 100644 --- a/Tutorials/PGAS_HEAT/writePlotFile.cpp +++ b/Tutorials/PGAS_HEAT/writePlotFile.cpp @@ -23,8 +23,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -45,7 +45,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -79,7 +79,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -91,8 +91,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/PIC_C/main.cpp b/Tutorials/PIC_C/main.cpp index f35cc687ff9..1ed3fe9e8bd 100644 --- a/Tutorials/PIC_C/main.cpp +++ b/Tutorials/PIC_C/main.cpp @@ -18,7 +18,7 @@ void two_level(int nlevs, int nx, int ny, int nz, int max_grid_size, int nppc int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); const Real strt_total = ParallelDescriptor::second(); @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) pp.get("nppc", nppc); if (nppc < 1 && ParallelDescriptor::IOProcessor()) - BoxLib::Abort("Must specify at least one particle per cell"); + amrex::Abort("Must specify at least one particle per cell"); bool verbose = false; pp.query("verbose", verbose); @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) } else if (nlevs == 2) { two_level(nlevs,nx,ny,nz,max_grid_size,nppc,verbose); } else { - BoxLib::Abort("Right now we only take max_level = 0 or 1"); + amrex::Abort("Right now we only take max_level = 0 or 1"); } Real end_total = ParallelDescriptor::second() - strt_total; @@ -73,5 +73,5 @@ int main(int argc, char* argv[]) std::cout << "Total Time : " << end_total << '\n' << '\n'; ; - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/PIC_C/solve_for_accel.cpp b/Tutorials/PIC_C/solve_for_accel.cpp index 4198609ae03..abb9aad2ffe 100644 --- a/Tutorials/PIC_C/solve_for_accel.cpp +++ b/Tutorials/PIC_C/solve_for_accel.cpp @@ -69,7 +69,7 @@ solve_for_accel(const Array& rhs, // Average edge-centered gradients to cell centers and fill the values in ghost cells. for (int lev = base_level; lev <= finest_level; lev++) { - BoxLib::average_face_to_cellcenter(*grad_phi[lev], + amrex::average_face_to_cellcenter(*grad_phi[lev], amrex::GetArrOfConstPtrs(grad_phi_edge[lev]), geom[lev]); grad_phi[lev]->FillBoundary(0,BL_SPACEDIM,geom[lev].periodicity()); diff --git a/Tutorials/PIC_C/solve_with_f90.cpp b/Tutorials/PIC_C/solve_with_f90.cpp index 6e13ef60663..4627642a803 100644 --- a/Tutorials/PIC_C/solve_with_f90.cpp +++ b/Tutorials/PIC_C/solve_with_f90.cpp @@ -27,7 +27,7 @@ solve_with_f90(const Array& rhs, mg_bc[2*dir + 1] = 0; } } else { - BoxLib::Abort("non periodic boundaries not supported here"); + amrex::Abort("non periodic boundaries not supported here"); } // Have to do some packing because these arrays does not always start with base_level diff --git a/Tutorials/PIC_C/two_level.cpp b/Tutorials/PIC_C/two_level.cpp index 8538e46d711..9e1611a9966 100644 --- a/Tutorials/PIC_C/two_level.cpp +++ b/Tutorials/PIC_C/two_level.cpp @@ -83,7 +83,7 @@ two_level(int nlevs, int nx, int ny, int nz, int max_grid_size, int nppc, bool v geom[0].define(domain, &real_box, coord, is_per); for (int lev = 1; lev < nlevs; lev++) { - geom[lev].define(BoxLib::refine(geom[lev-1].Domain(), rr[lev-1]), + geom[lev].define(amrex::refine(geom[lev-1].Domain(), rr[lev-1]), &real_box, coord, is_per); } @@ -208,7 +208,7 @@ two_level(int nlevs, int nx, int ny, int nz, int max_grid_size, int nppc, bool v MyPC->AssignDensitySingleLevel(0, *PartMF[0],0,1,0); for (int lev = finest_level - 1 - base_level; lev >= 0; lev--) - BoxLib::average_down(*PartMF[lev+1],*PartMF[lev],0,1,rr[lev]); + amrex::average_down(*PartMF[lev+1],*PartMF[lev],0,1,rr[lev]); for (int lev = 0; lev < nlevs; lev++) MultiFab::Add(*rhs[base_level+lev], *PartMF[lev], 0, 0, 1, 0); diff --git a/Tutorials/Sidecar_EX1/DestMFTest.cpp b/Tutorials/Sidecar_EX1/DestMFTest.cpp index 1bc274f3325..ea065a61872 100644 --- a/Tutorials/Sidecar_EX1/DestMFTest.cpp +++ b/Tutorials/Sidecar_EX1/DestMFTest.cpp @@ -101,7 +101,7 @@ namespace MPI_Group group_sidecar(MPI_GROUP_NULL), group_all(MPI_GROUP_NULL); ParallelDescriptor::Barrier(ParallelDescriptor::CommunicatorAll()); - BoxLib::USleep(myProcAll / 10.0); + amrex::USleep(myProcAll / 10.0); std::cout << ":::: _in CFATests: myProcAll myProcComp myProcSidecar = " << myProcAll << " " << myProcComp << " " << myProcSidecar << std::endl; @@ -124,7 +124,7 @@ namespace } dm_comp_all.define(pm_comp_all, addToCache); - BoxLib::USleep(myProcAll / 10.0); + amrex::USleep(myProcAll / 10.0); if(myProcAll == 0) { std::cout << myProcAll << ":::: _in CFATests: dm_comp = " << dm << std::endl; } @@ -167,7 +167,7 @@ namespace DistributionMapping dm_all(pm_all); if (ParallelDescriptor::IOProcessor()) { - BoxLib::USleep(1); + amrex::USleep(1); std::cout << "SIDECAR DM = " << dm_sidecar << std::endl << std::flush; std::cout << "WORLD DM = " << dm_all << std::endl << std::flush; } @@ -257,7 +257,7 @@ namespace // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // A flag you need for broadcasting across MPI groups. We always broadcast // the data to the sidecar group from the IOProcessor on the compute group. @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) { if(ParallelDescriptor::InSidecarGroup()) { - BoxLib::USleep(myProcAll / 10.0); + amrex::USleep(myProcAll / 10.0); std::cout << myProcAll << ":: Calling SidecarEventLoop()." << std::endl; SidecarEventLoop(); @@ -409,7 +409,7 @@ int main(int argc, char *argv[]) { } ParallelDescriptor::Barrier(); - BoxLib::USleep(myProcAll / 10.0); + amrex::USleep(myProcAll / 10.0); if(ParallelDescriptor::IOProcessor()) { std::cout << myProcAll << ":: Finished timesteps" << std::endl; } @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) { nSidecarProcs = 0; ParallelDescriptor::SetNProcsSidecars(nSidecarProcs); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/Sidecar_EX1/GridMoveTest.cpp b/Tutorials/Sidecar_EX1/GridMoveTest.cpp index e13a39157b7..9338bbdecdb 100644 --- a/Tutorials/Sidecar_EX1/GridMoveTest.cpp +++ b/Tutorials/Sidecar_EX1/GridMoveTest.cpp @@ -63,7 +63,7 @@ namespace { std::ostringstream ss_error_msg; ss_error_msg << "Unknown signal sent to sidecars: -----> " << in_signal << " <-----" << std::endl; - BoxLib::Error(const_cast(ss_error_msg.str().c_str())); + amrex::Error(const_cast(ss_error_msg.str().c_str())); } return out_signal; @@ -83,8 +83,8 @@ namespace } static void RunAtStatic () { - BoxLib::ExecOnInitialize(STATIC_INIT); - BoxLib::ExecOnFinalize(STATIC_CLEAN); + amrex::ExecOnInitialize(STATIC_INIT); + amrex::ExecOnFinalize(STATIC_CLEAN); }; #endif } @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { //ParallelDescriptor::SetNProcsSidecar(nSidecarProcs); #endif - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); int myProcAll(ParallelDescriptor::MyProcAll()); @@ -119,8 +119,8 @@ std::cout << myProcAll << "::_here 0." << std::endl; #endif std::cout << myProcAll << "::_here 1." << std::endl; - // The sidecar group has already called BoxLib::Finalize() by the time we - // are out of BoxLib::Initialize(), so make them quit immediately. + // The sidecar group has already called amrex::Finalize() by the time we + // are out of amrex::Initialize(), so make them quit immediately. // Everything below this point is done on the compute group only. #ifdef IN_TRANSIT if (ParallelDescriptor::InSidecarGroup()) { @@ -216,6 +216,6 @@ ParallelDescriptor::Barrier(); #endif std::cout << "_calling Finalize()" << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/Sidecar_EX1/NSidecarsTest.cpp b/Tutorials/Sidecar_EX1/NSidecarsTest.cpp index 4644f891731..ddcd6dd145a 100644 --- a/Tutorials/Sidecar_EX1/NSidecarsTest.cpp +++ b/Tutorials/Sidecar_EX1/NSidecarsTest.cpp @@ -129,7 +129,7 @@ namespace DistributionMapping dm_all(pm_all); if (ParallelDescriptor::IOProcessor()) { - BoxLib::USleep(1); + amrex::USleep(1); std::cout << "SIDECAR " << whichSidecar << " DM = " << dm_sidecar << std::endl << std::flush; std::cout << "WORLD DM = " << dm_all << std::endl << std::flush; } @@ -294,7 +294,7 @@ namespace // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // A flag you need for broadcasting across MPI groups. We always broadcast // the data to the sidecar group from the IOProcessor on the compute group. @@ -309,7 +309,7 @@ int main(int argc, char *argv[]) { ParmParse pp; if(nProcs < 8) { - BoxLib::Abort("**** Error: this test must be run with at least 8 processes."); + amrex::Abort("**** Error: this test must be run with at least 8 processes."); } pp.query("maxGrid", maxGrid); @@ -332,7 +332,7 @@ int main(int argc, char *argv[]) { Array randomRanks; if(ParallelDescriptor::IOProcessor()) { bool printSet(true); - BoxLib::UniqueRandomSubset(randomRanks, nProcs, nProcs, printSet); + amrex::UniqueRandomSubset(randomRanks, nProcs, nProcs, printSet); for(int i(0); i < randomRanks.size(); ++i) { if(randomRanks[i] == 0) { // ---- comprank[0] must be 0 randomRanks[i] = randomRanks[0]; @@ -340,7 +340,7 @@ int main(int argc, char *argv[]) { } } } - BoxLib::BroadcastArray(randomRanks, myProcAll, ioProcNum, ParallelDescriptor::Communicator()); + amrex::BroadcastArray(randomRanks, myProcAll, ioProcNum, ParallelDescriptor::Communicator()); if(useSequential) { for(int i(0); i < randomRanks.size(); ++i) { @@ -507,7 +507,7 @@ int main(int argc, char *argv[]) { } ParallelDescriptor::Barrier(); - BoxLib::USleep(myProcAll); + amrex::USleep(myProcAll); if(ParallelDescriptor::IOProcessor()) { std::cout << myProcAll << ":: Finished timesteps" << std::endl; } @@ -517,7 +517,7 @@ int main(int argc, char *argv[]) { ParallelDescriptor::SetNProcsSidecars(nSidecars); - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tutorials/Sidecar_EX1/SidecarResizeTest.cpp b/Tutorials/Sidecar_EX1/SidecarResizeTest.cpp index 1fead66429f..28c6c2f5c7f 100644 --- a/Tutorials/Sidecar_EX1/SidecarResizeTest.cpp +++ b/Tutorials/Sidecar_EX1/SidecarResizeTest.cpp @@ -71,7 +71,7 @@ namespace // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // A flag you need for broadcasting across MPI groups. We always broadcast // the data to the sidecar group from the IOProcessor on the compute group. @@ -137,6 +137,6 @@ int main(int argc, char *argv[]) { ParallelDescriptor::Barrier(); std::cout << "_calling Finalize()" << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); return 0; } diff --git a/Tutorials/Sidecar_EX1/TestRankSets.cpp b/Tutorials/Sidecar_EX1/TestRankSets.cpp index 45937a0283d..a8c20210612 100644 --- a/Tutorials/Sidecar_EX1/TestRankSets.cpp +++ b/Tutorials/Sidecar_EX1/TestRankSets.cpp @@ -12,7 +12,7 @@ // -------------------------------------------------------------------------- int main(int argc, char *argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); int myProcAll(ParallelDescriptor::MyProcAll()); int nProcs(ParallelDescriptor::NProcs()); @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { bool printRanks(true); if(nProcs < 8) { - BoxLib::Abort("**** Error: must use at least 8 processes."); + amrex::Abort("**** Error: must use at least 8 processes."); } Array compProcsInAll; @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) { std::cout << myProcAll << ":: Set initial sidecar sizes." << std::endl; std::cout << std::endl; } - BoxLib::USleep(myProcAll); + amrex::USleep(myProcAll); ParallelDescriptor::SetNProcsSidecars(compProcsInAll, sidecarProcsInAll, printRanks); @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) { std::cout << myProcAll << ":: Move elements from comp to sidecar." << std::endl; std::cout << std::endl; } - BoxLib::USleep(myProcAll); + amrex::USleep(myProcAll); ParallelDescriptor::SetNProcsSidecars(compProcsInAll, sidecarProcsInAll, printRanks); @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { std::cout << myProcAll << ":: Move elements both from and to comp. This test should fail." << std::endl; std::cout << std::endl; } - BoxLib::USleep(myProcAll); + amrex::USleep(myProcAll); ParallelDescriptor::SetNProcsSidecars(compProcsInAll, sidecarProcsInAll, printRanks); @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) { std::cout << myProcAll << ":: Finished." << std::endl; } - BoxLib::Finalize(); + amrex::Finalize(); return 0; } // -------------------------------------------------------------------------- diff --git a/Tutorials/Tiling_C/main.cpp b/Tutorials/Tiling_C/main.cpp index 47510630b9c..65808db0e99 100644 --- a/Tutorials/Tiling_C/main.cpp +++ b/Tutorials/Tiling_C/main.cpp @@ -12,7 +12,7 @@ extern "C" int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // define the lower and upper corner of a 3D domain IntVect domain_lo(0 , 0, 0); @@ -107,6 +107,6 @@ int main(int argc, char* argv[]) std::cout << "L1 norm = " << data2.norm1() << std::endl; std::cout << "L2 norm = " << data2.norm2() << std::endl; - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/Tiling_Heat_C/main.cpp b/Tutorials/Tiling_Heat_C/main.cpp index bd44cf18c71..7f0b6a7e950 100644 --- a/Tutorials/Tiling_Heat_C/main.cpp +++ b/Tutorials/Tiling_Heat_C/main.cpp @@ -83,7 +83,7 @@ Real compute_dt (Real dx) int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // What time is it now? We'll use this to compute total run time. Real strt_time = ParallelDescriptor::second(); @@ -186,7 +186,7 @@ main (int argc, char* argv[]) // Write a plotfile of the initial data if plot_int > 0 (plot_int was defined in the inputs file) if (plot_int > 0) { int n = 0; - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_phi, geom); } @@ -206,7 +206,7 @@ main (int argc, char* argv[]) // Write a plotfile of the current data (plot_int was defined in the inputs file) if (plot_int > 0 && n%plot_int == 0) { - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_phi, geom); } } @@ -230,5 +230,5 @@ main (int argc, char* argv[]) } // Say goodbye to MPI, etc... - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/Tiling_Heat_C/writePlotFile.cpp b/Tutorials/Tiling_Heat_C/writePlotFile.cpp index ed37f22d703..685a4946033 100644 --- a/Tutorials/Tiling_Heat_C/writePlotFile.cpp +++ b/Tutorials/Tiling_Heat_C/writePlotFile.cpp @@ -23,8 +23,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -45,7 +45,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -79,7 +79,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -91,8 +91,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // diff --git a/Tutorials/TwoGrid_PIC_C/main.cpp b/Tutorials/TwoGrid_PIC_C/main.cpp index d8a1d057007..4703837f034 100644 --- a/Tutorials/TwoGrid_PIC_C/main.cpp +++ b/Tutorials/TwoGrid_PIC_C/main.cpp @@ -24,7 +24,7 @@ void splitBoxes (BoxArray& ba, Array& newcost, const Ar int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); int max_grid_size = 32; int min_grid_size = 4; @@ -94,7 +94,7 @@ int main(int argc, char* argv[]) geom[0].define(domain, &real_box, coord, is_per); for (int lev = 1; lev < nlevs; lev++) { - geom[lev].define(BoxLib::refine(geom[lev-1].Domain(), rr[lev-1]), + geom[lev].define(amrex::refine(geom[lev-1].Domain(), rr[lev-1]), &real_box, coord, is_per); } @@ -292,7 +292,7 @@ int main(int argc, char* argv[]) MyPC->AssignDensitySingleLevel(0, *PartMF[0], 0, 1, 0); for (int lev = finest_level - 1 - base_level; lev >= 0; lev--) - BoxLib::average_down(*PartMF[lev+1],*PartMF[lev],0,1,rr[lev]); + amrex::average_down(*PartMF[lev+1],*PartMF[lev],0,1,rr[lev]); for (int lev = 0; lev < nlevs; lev++) MultiFab::Add(*rhs[base_level+lev], *PartMF[lev], 0, 0, 1, 0); @@ -387,7 +387,7 @@ int main(int argc, char* argv[]) } // end if (nlevs > 1) - BoxLib::Finalize(); + amrex::Finalize(); } Real diff --git a/Tutorials/TwoGrid_PIC_C/solve_for_accel.cpp b/Tutorials/TwoGrid_PIC_C/solve_for_accel.cpp index 2e0ad363d0d..b18435c6d6d 100644 --- a/Tutorials/TwoGrid_PIC_C/solve_for_accel.cpp +++ b/Tutorials/TwoGrid_PIC_C/solve_for_accel.cpp @@ -63,7 +63,7 @@ solve_for_accel(const Array& rhs, // Average edge-centered gradients to cell centers and fill the values in ghost cells. for (int lev = base_level; lev <= finest_level; lev++) { - BoxLib::average_face_to_cellcenter(*grad_phi[lev], + amrex::average_face_to_cellcenter(*grad_phi[lev], amrex::GetArrOfConstPtrs(grad_phi_edge[lev]), geom[lev]); grad_phi[lev]->FillBoundary(0,BL_SPACEDIM,geom[lev].periodicity()); diff --git a/Tutorials/TwoGrid_PIC_C/solve_with_f90.cpp b/Tutorials/TwoGrid_PIC_C/solve_with_f90.cpp index ab33be03db9..042f71b071a 100644 --- a/Tutorials/TwoGrid_PIC_C/solve_with_f90.cpp +++ b/Tutorials/TwoGrid_PIC_C/solve_with_f90.cpp @@ -25,7 +25,7 @@ solve_with_f90(const Array& rhs, mg_bc[2*dir + 1] = 0; } } else { - BoxLib::Abort("non periodic boundraies not supported here"); + amrex::Abort("non periodic boundraies not supported here"); } // Have to do some packing because these arrays does not always start with base_level diff --git a/Tutorials/WaveEquation_C/main.cpp b/Tutorials/WaveEquation_C/main.cpp index b9862d3cc25..88f2b61640c 100644 --- a/Tutorials/WaveEquation_C/main.cpp +++ b/Tutorials/WaveEquation_C/main.cpp @@ -52,7 +52,7 @@ Real compute_dt(Real dx) int main (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); // What time is it now? We'll use this to compute total run time. Real strt_time = ParallelDescriptor::second(); @@ -160,7 +160,7 @@ main (int argc, char* argv[]) if (plot_int > 0) { int n = 0; - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_data, geom); } @@ -179,7 +179,7 @@ main (int argc, char* argv[]) // Write a plotfile of the current data (plot_int was defined in the inputs file) if (plot_int > 0 && n%plot_int == 0) { - const std::string& pltfile = BoxLib::Concatenate("plt",n,5); + const std::string& pltfile = amrex::Concatenate("plt",n,5); writePlotFile(pltfile, *new_data, geom); } } @@ -195,6 +195,6 @@ main (int argc, char* argv[]) std::cout << "Run time = " << stop_time << std::endl; // Say goodbye to MPI, etc... - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/Tutorials/WaveEquation_C/writePlotFile.cpp b/Tutorials/WaveEquation_C/writePlotFile.cpp index 9cf72f74541..cda43c1d470 100644 --- a/Tutorials/WaveEquation_C/writePlotFile.cpp +++ b/Tutorials/WaveEquation_C/writePlotFile.cpp @@ -23,8 +23,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(dir, 0755)) - BoxLib::CreateDirectoryFailed(dir); + if (!amrex::UtilCreateDirectory(dir, 0755)) + amrex::CreateDirectoryFailed(dir); // // Force other processors to wait till directory is built. // @@ -45,7 +45,7 @@ writePlotFile (const std::string& dir, // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!HeaderFile.good()) - BoxLib::FileOpenFailed(HeaderFileName); + amrex::FileOpenFailed(HeaderFileName); HeaderFile << "NavierStokes-V1.1\n"; HeaderFile << mf.nComp() << '\n'; @@ -79,7 +79,7 @@ writePlotFile (const std::string& dir, // static const std::string BaseName = "/Cell"; - std::string Level = BoxLib::Concatenate("Level_", 0, 1); + std::string Level = amrex::Concatenate("Level_", 0, 1); // // Now for the full pathname of that directory. // @@ -91,8 +91,8 @@ writePlotFile (const std::string& dir, // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) - if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) - BoxLib::CreateDirectoryFailed(FullPath); + if (!amrex::UtilCreateDirectory(FullPath, 0755)) + amrex::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. //