Skip to content

Commit

Permalink
BoxLib:: --> amrex::
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Dec 16, 2016
1 parent 261d73f commit cec9885
Show file tree
Hide file tree
Showing 192 changed files with 1,591 additions and 1,577 deletions.
14 changes: 14 additions & 0 deletions Docs/Migration/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

4 changes: 2 additions & 2 deletions Docs/Readme.profiling
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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();
}


Expand Down
6 changes: 3 additions & 3 deletions MiniApps/FillBoundary/MultiFabFillBoundaryTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down Expand Up @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) {

BL_PROFILE_VAR_STOP(pmain);

BoxLib::Finalize();
amrex::Finalize();
return 0;
}
// --------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions MiniApps/MultiGrid_C/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -153,7 +153,7 @@ int main(int argc, char* argv[])

BL_PROFILE_VAR_STOP(pmain);

BoxLib::Finalize();
amrex::Finalize();
}

void compute_analyticSolution(MultiFab& anaSoln)
Expand Down
14 changes: 7 additions & 7 deletions MiniApps/PGAS_SMC/SMC_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
//
Expand All @@ -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';
Expand Down Expand Up @@ -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.
//
Expand All @@ -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.
//
Expand Down
4 changes: 2 additions & 2 deletions MiniApps/PGAS_SMC/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
int
main (int argc, char* argv[])
{
BoxLib::Initialize(argc,argv);
amrex::Initialize(argc,argv);

BL_PROFILE_VAR("main()", pmain);

Expand All @@ -16,5 +16,5 @@ main (int argc, char* argv[])

BL_PROFILE_VAR_STOP(pmain);

BoxLib::Finalize();
amrex::Finalize();
}
Loading

0 comments on commit cec9885

Please sign in to comment.