From 8726ae0dcf7a084e35444d8cf207f48847c6a42b Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 3 Jan 2017 13:26:04 -0800 Subject: migration step 3 --- Python/ParticleProb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/ParticleProb.cpp') diff --git a/Python/ParticleProb.cpp b/Python/ParticleProb.cpp index fc8cd0f71..7cda4d99f 100644 --- a/Python/ParticleProb.cpp +++ b/Python/ParticleProb.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include #include -- cgit v1.2.3 From 638b5b4f8fe79817afa724558c8b02771206fd45 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 3 Jan 2017 13:31:29 -0800 Subject: migration step 5 --- Exec/Langmuir/ParticleProb.cpp | 2 +- Exec/charged_beam/ParticleProb.cpp | 2 +- Exec/uniform_plasma/ParticleProb.cpp | 2 +- Python/ParticleProb.cpp | 2 +- Source/ParticleContainer.cpp | 4 ++-- Source/ParticleIterator.H | 2 +- Source/ParticleIterator.cpp | 4 ++-- Source/WarpX.cpp | 6 +++--- Source/WarpXEvolve.cpp | 4 ++-- Source/WarpXIO.cpp | 10 +++++----- Source/WarpXWrappers.cpp | 6 +++--- Source/main.cpp | 4 ++-- tests/CurrentDeposition/main.cpp | 12 ++++++------ tests/FieldGather/main.cpp | 12 ++++++------ tests/FieldSolver/main.cpp | 14 +++++++------- tests/ParticlePusher/main.cpp | 6 +++--- 16 files changed, 46 insertions(+), 46 deletions(-) (limited to 'Python/ParticleProb.cpp') diff --git a/Exec/Langmuir/ParticleProb.cpp b/Exec/Langmuir/ParticleProb.cpp index 7bc61389a..fde18091c 100644 --- a/Exec/Langmuir/ParticleProb.cpp +++ b/Exec/Langmuir/ParticleProb.cpp @@ -131,7 +131,7 @@ MyParticleContainer::InitData() if (!ParticleBase::Where(p,m_gdb)) // this will set m_cell { - BoxLib::Abort("invalid particle"); + amrex::Abort("invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); diff --git a/Exec/charged_beam/ParticleProb.cpp b/Exec/charged_beam/ParticleProb.cpp index c4795f70d..ac690272e 100644 --- a/Exec/charged_beam/ParticleProb.cpp +++ b/Exec/charged_beam/ParticleProb.cpp @@ -131,7 +131,7 @@ MyParticleContainer::InitData() if (!ParticleBase::Where(p,m_gdb)) // this will set m_cell { - BoxLib::Abort("invalid particle"); + amrex::Abort("invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); diff --git a/Exec/uniform_plasma/ParticleProb.cpp b/Exec/uniform_plasma/ParticleProb.cpp index 6724f8a61..cf08963e7 100644 --- a/Exec/uniform_plasma/ParticleProb.cpp +++ b/Exec/uniform_plasma/ParticleProb.cpp @@ -125,7 +125,7 @@ MyParticleContainer::InitData() if (!ParticleBase::Where(p,m_gdb)) // this will set m_cell { - BoxLib::Abort("invalid particle"); + amrex::Abort("invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); diff --git a/Python/ParticleProb.cpp b/Python/ParticleProb.cpp index 7cda4d99f..daf320f1c 100644 --- a/Python/ParticleProb.cpp +++ b/Python/ParticleProb.cpp @@ -110,7 +110,7 @@ MyParticleContainer::InitData() if (!ParticleBase::Where(p,m_gdb)) // this will set m_cell { - BoxLib::Abort("invalid particle"); + amrex::Abort("invalid particle"); } BL_ASSERT(p.m_lev >= 0 && p.m_lev <= m_gdb->finestLevel()); diff --git a/Source/ParticleContainer.cpp b/Source/ParticleContainer.cpp index d29569ec8..1d1fd136b 100644 --- a/Source/ParticleContainer.cpp +++ b/Source/ParticleContainer.cpp @@ -173,7 +173,7 @@ MyParticleContainer::Evolve (int lev, BL_PROFILE_VAR_STOP(blp_copy); - const Box& box = BoxLib::enclosedCells(ba[gid]); + const Box& box = amrex::enclosedCells(ba[gid]); BL_ASSERT(box == vbx); #if (BL_SPACEDIM == 3) long nx = box.length(0); @@ -317,7 +317,7 @@ MyParticleContainer::GetChargeDensity (int lev, bool local) wp[i] = p.m_data[PIdx::w]; }); - const Box& box = BoxLib::enclosedCells(ba[gid]); + const Box& box = amrex::enclosedCells(ba[gid]); BL_ASSERT(box == vbx); #if (BL_SPACEDIM == 3) long nx = box.length(0); diff --git a/Source/ParticleIterator.H b/Source/ParticleIterator.H index 3015aa951..5d55bb2b5 100644 --- a/Source/ParticleIterator.H +++ b/Source/ParticleIterator.H @@ -45,7 +45,7 @@ public: auto& pbox = pmap[index_map[currentIndex]]; if (info.tiling) { - BoxLib::Abort("PartIter wip"); + amrex::Abort("PartIter wip"); } else { diff --git a/Source/ParticleIterator.cpp b/Source/ParticleIterator.cpp index addc0d70f..0424bd30b 100644 --- a/Source/ParticleIterator.cpp +++ b/Source/ParticleIterator.cpp @@ -22,7 +22,7 @@ PartIter::Initialize () { if (info.tiling) { - BoxLib::Abort("PartIter wip"); + amrex::Abort("PartIter wip"); #if 0 for (auto& pbox : pmap) { @@ -70,7 +70,7 @@ PartIter::numParticles () const const auto& pbox = pmap[idx]; if (info.tiling) { - BoxLib::Abort("PartIter wip"); + amrex::Abort("PartIter wip"); return 0; } else diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 7592333b9..a176ec3c3 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -65,7 +65,7 @@ WarpX::WarpX () ReadParameters(); if (max_level != 0) { - BoxLib::Abort("WaprX: max_level must be zero"); + amrex::Abort("WaprX: max_level must be zero"); } // Geometry on all levels has been defined already. @@ -131,10 +131,10 @@ WarpX::ReadParameters () pp.query("noy", noy); pp.query("noz", noz); if (nox != noy || nox != noz) { - BoxLib::Abort("warpx.nox, noy and noz must be equal"); + amrex::Abort("warpx.nox, noy and noz must be equal"); } if (nox < 1) { - BoxLib::Abort("warpx.nox must >= 1"); + amrex::Abort("warpx.nox must >= 1"); } } diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp index 21ecb73ec..3eb04bdfb 100644 --- a/Source/WarpXEvolve.cpp +++ b/Source/WarpXEvolve.cpp @@ -133,7 +133,7 @@ WarpX::EvolveB (int lev, Real dt) for ( MFIter mfi(*Bfield[lev][0]); mfi.isValid(); ++mfi ) { - const Box& bx = BoxLib::enclosedCells(mfi.validbox()); + const Box& bx = amrex::enclosedCells(mfi.validbox()); #if (BL_SPACEDIM == 3) long nx = bx.length(0); long ny = bx.length(1); @@ -205,7 +205,7 @@ WarpX::EvolveE (int lev, Real dt) for ( MFIter mfi(*Efield[lev][0]); mfi.isValid(); ++mfi ) { - const Box & bx = BoxLib::enclosedCells(mfi.validbox()); + const Box & bx = amrex::enclosedCells(mfi.validbox()); #if (BL_SPACEDIM == 3) long nx = bx.length(0); long ny = bx.length(1); diff --git a/Source/WarpXIO.cpp b/Source/WarpXIO.cpp index 13f4fe53e..8b056f39c 100644 --- a/Source/WarpXIO.cpp +++ b/Source/WarpXIO.cpp @@ -11,7 +11,7 @@ WarpX::WritePlotFile () const { BL_PROFILE("WarpX::WritePlotFile()"); - const std::string& plotfilename = BoxLib::Concatenate(plot_file,istep[0]); + const std::string& plotfilename = amrex::Concatenate(plot_file,istep[0]); if (ParallelDescriptor::IOProcessor()) { std::cout << " Writing plotfile " << plotfilename << std::endl; @@ -31,7 +31,7 @@ WarpX::WritePlotFile () const Array srcmf(BL_SPACEDIM); PackPlotDataPtrs(srcmf, current[lev]); int dcomp = 0; - BoxLib::average_edge_to_cellcenter(*mf[lev], dcomp, srcmf); + amrex::average_edge_to_cellcenter(*mf[lev], dcomp, srcmf); #if (BL_SPACEDIM == 2) MultiFab::Copy(*mf[lev], *mf[lev], dcomp+1, dcomp+2, 1, ngrow); WarpX::Copy(*mf[lev], dcomp+1, 1, *current[lev][1], 0); @@ -39,7 +39,7 @@ WarpX::WritePlotFile () const PackPlotDataPtrs(srcmf, Efield[lev]); dcomp += 3; - BoxLib::average_edge_to_cellcenter(*mf[lev], dcomp, srcmf); + amrex::average_edge_to_cellcenter(*mf[lev], dcomp, srcmf); #if (BL_SPACEDIM == 2) MultiFab::Copy(*mf[lev], *mf[lev], dcomp+1, dcomp+2, 1, ngrow); WarpX::Copy(*mf[lev], dcomp+1, 1, *Efield[lev][1], 0); @@ -47,7 +47,7 @@ WarpX::WritePlotFile () const PackPlotDataPtrs(srcmf, Bfield[lev]); dcomp += 3; - BoxLib::average_face_to_cellcenter(*mf[lev], dcomp, srcmf); + amrex::average_face_to_cellcenter(*mf[lev], dcomp, srcmf); #if (BL_SPACEDIM == 2) MultiFab::Copy(*mf[lev], *mf[lev], dcomp+1, dcomp+2, 1, ngrow); WarpX::Copy(*mf[lev], dcomp+1, 1, *Bfield[lev][1], 0); @@ -59,7 +59,7 @@ WarpX::WritePlotFile () const mf2[lev] = mf[lev].get(); } - BoxLib::WriteMultiLevelPlotfile(plotfilename, finest_level+1, mf2, varnames, + amrex::WriteMultiLevelPlotfile(plotfilename, finest_level+1, mf2, varnames, Geom(), t_new[0], istep, refRatio()); } diff --git a/Source/WarpXWrappers.cpp b/Source/WarpXWrappers.cpp index 2bef71bfd..f8be7531b 100644 --- a/Source/WarpXWrappers.cpp +++ b/Source/WarpXWrappers.cpp @@ -9,17 +9,17 @@ extern "C" { void boxlib_init (int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); } void boxlib_init_with_inited_mpi (int argc, char* argv[], MPI_Comm mpicomm) { - BoxLib::Initialize(argc,argv,true,mpicomm); + amrex::Initialize(argc,argv,true,mpicomm); } void boxlib_finalize (int finalize_mpi) { - BoxLib::Finalize(finalize_mpi); + amrex::Finalize(finalize_mpi); } void warpx_init () diff --git a/Source/main.cpp b/Source/main.cpp index e3735f4df..5dc636a83 100644 --- a/Source/main.cpp +++ b/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/tests/CurrentDeposition/main.cpp b/tests/CurrentDeposition/main.cpp index 58b338523..d1bf980bc 100644 --- a/tests/CurrentDeposition/main.cpp +++ b/tests/CurrentDeposition/main.cpp @@ -12,7 +12,7 @@ int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); { long nox=1, noy=1, noz=1; @@ -22,10 +22,10 @@ int main(int argc, char* argv[]) pp.query("noy", noy); pp.query("noz", noz); if (nox != noy || nox != noz) { - BoxLib::Abort("warpx.nox, noy and noz must be equal"); + amrex::Abort("warpx.nox, noy and noz must be equal"); } if (nox < 1) { - BoxLib::Abort("warpx.nox must >= 1"); + amrex::Abort("warpx.nox must >= 1"); } } @@ -78,7 +78,7 @@ int main(int argc, char* argv[]) const int ng = nox; Box domain_box {IntVect{D_DECL(0,0,0)}, IntVect{D_DECL(nx,ny,nz)}}; - Box grown_box = BoxLib::grow(domain_box, ng); + Box grown_box = amrex::grow(domain_box, ng); long ngx = ng; long ngy = ng; @@ -113,8 +113,8 @@ int main(int argc, char* argv[]) Geometry geom{plotbox, &realbox, 0, is_per}; std::string plotname{"plt00000"}; Array varnames{"jx", "jy", "jz"}; - BoxLib::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); + amrex::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/tests/FieldGather/main.cpp b/tests/FieldGather/main.cpp index d688b0450..bf94877b7 100644 --- a/tests/FieldGather/main.cpp +++ b/tests/FieldGather/main.cpp @@ -11,7 +11,7 @@ int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); { long nox=1, noy=1, noz=1; @@ -21,10 +21,10 @@ int main(int argc, char* argv[]) pp.query("noy", noy); pp.query("noz", noz); if (nox != noy || nox != noz) { - BoxLib::Abort("warpx.nox, noy and noz must be equal"); + amrex::Abort("warpx.nox, noy and noz must be equal"); } if (nox < 1) { - BoxLib::Abort("warpx.nox must >= 1"); + amrex::Abort("warpx.nox must >= 1"); } } @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) const int ng = nox; Box domain_box {IntVect{D_DECL(0,0,0)}, IntVect{D_DECL(nx,ny,nz)}}; - Box grown_box = BoxLib::grow(domain_box, ng); + Box grown_box = amrex::grow(domain_box, ng); long ngx = ng; long ngy = ng; @@ -133,8 +133,8 @@ int main(int argc, char* argv[]) Geometry geom{plotbox, &realbox, 0, is_per}; std::string plotname{"plt00000"}; Array varnames{"Ex", "Ey", "Ez", "Bx", "By", "Bz"}; - BoxLib::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); + amrex::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/tests/FieldSolver/main.cpp b/tests/FieldSolver/main.cpp index 7589792a0..c7b7efde6 100644 --- a/tests/FieldSolver/main.cpp +++ b/tests/FieldSolver/main.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); { long nox=1, noy=1, noz=1; @@ -23,10 +23,10 @@ int main(int argc, char* argv[]) pp.query("noy", noy); pp.query("noz", noz); if (nox != noy || nox != noz) { - BoxLib::Abort("warpx.nox, noy and noz must be equal"); + amrex::Abort("warpx.nox, noy and noz must be equal"); } if (nox < 1) { - BoxLib::Abort("warpx.nox must >= 1"); + amrex::Abort("warpx.nox must >= 1"); } } @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) for ( MFIter mfi(*Bfield[0]); mfi.isValid(); ++mfi ) { - const Box& bx = BoxLib::enclosedCells(mfi.validbox()); + const Box& bx = amrex::enclosedCells(mfi.validbox()); #if (BL_SPACEDIM == 3) long nx = bx.length(0); long ny = bx.length(1); @@ -166,7 +166,7 @@ int main(int argc, char* argv[]) for ( MFIter mfi(*Efield[0]); mfi.isValid(); ++mfi ) { - const Box & bx = BoxLib::enclosedCells(mfi.validbox()); + const Box & bx = amrex::enclosedCells(mfi.validbox()); #if (BL_SPACEDIM == 3) long nx = bx.length(0); long ny = bx.length(1); @@ -217,8 +217,8 @@ int main(int argc, char* argv[]) Geometry geom{cc_domain, &realbox, 0, is_per}; std::string plotname{"plt00000"}; Array varnames{"Ex", "Ey", "Ez", "Bx", "By", "Bz"}; - BoxLib::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); + amrex::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); } - BoxLib::Finalize(); + amrex::Finalize(); } diff --git a/tests/ParticlePusher/main.cpp b/tests/ParticlePusher/main.cpp index 85b8c1ceb..2f4d4da4e 100644 --- a/tests/ParticlePusher/main.cpp +++ b/tests/ParticlePusher/main.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { - BoxLib::Initialize(argc,argv); + amrex::Initialize(argc,argv); { long particle_pusher_algo = 0; @@ -108,8 +108,8 @@ int main(int argc, char* argv[]) Geometry geom{plotbox, &realbox, 0, is_per}; std::string plotname{"plt00000"}; Array varnames{"x", "y", "z", "ux", "uy", "uz", "gamma"}; - BoxLib::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); + amrex::WriteSingleLevelPlotfile(plotname, plotmf, varnames, geom, 0.0, 0); } - BoxLib::Finalize(); + amrex::Finalize(); } -- cgit v1.2.3 From 0fe2476d00597e680ebd5734b976af7d551454e2 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 3 Jan 2017 14:10:30 -0800 Subject: migration step 5 --- Exec/Langmuir/ParticleProb.cpp | 2 ++ Exec/charged_beam/ParticleProb.cpp | 2 ++ Exec/uniform_plasma/ParticleProb.cpp | 2 ++ Python/ParticleProb.cpp | 2 ++ Source/ParticleContainer.H | 16 ++++++------ Source/ParticleContainer.cpp | 2 ++ Source/ParticleIterator.H | 10 ++++---- Source/ParticleIterator.cpp | 2 ++ Source/WarpX.H | 49 ++++++++++++++++++------------------ Source/WarpX.cpp | 2 ++ Source/WarpXConst.H | 2 ++ Source/WarpXEvolve.cpp | 2 ++ Source/WarpXIO.cpp | 2 ++ Source/WarpXInitData.cpp | 2 ++ Source/main.cpp | 2 ++ tests/CurrentDeposition/main.cpp | 2 ++ tests/FieldGather/main.cpp | 2 ++ tests/FieldSolver/main.cpp | 2 ++ tests/ParticlePusher/main.cpp | 2 ++ 19 files changed, 70 insertions(+), 37 deletions(-) (limited to 'Python/ParticleProb.cpp') diff --git a/Exec/Langmuir/ParticleProb.cpp b/Exec/Langmuir/ParticleProb.cpp index fde18091c..c3734de58 100644 --- a/Exec/Langmuir/ParticleProb.cpp +++ b/Exec/Langmuir/ParticleProb.cpp @@ -11,6 +11,8 @@ #include #include +using namespace amrex; + void MyParticleContainer::InitData() { diff --git a/Exec/charged_beam/ParticleProb.cpp b/Exec/charged_beam/ParticleProb.cpp index ac690272e..a20fb3765 100644 --- a/Exec/charged_beam/ParticleProb.cpp +++ b/Exec/charged_beam/ParticleProb.cpp @@ -11,6 +11,8 @@ #include #include +using namespace amrex; + void MyParticleContainer::InitData() { diff --git a/Exec/uniform_plasma/ParticleProb.cpp b/Exec/uniform_plasma/ParticleProb.cpp index cf08963e7..68669d1c7 100644 --- a/Exec/uniform_plasma/ParticleProb.cpp +++ b/Exec/uniform_plasma/ParticleProb.cpp @@ -12,6 +12,8 @@ #include #include +using namespace amrex; + void MyParticleContainer::InitData() { diff --git a/Python/ParticleProb.cpp b/Python/ParticleProb.cpp index daf320f1c..1f716a098 100644 --- a/Python/ParticleProb.cpp +++ b/Python/ParticleProb.cpp @@ -11,6 +11,8 @@ #include #include +using namespace amrex; + void MyParticleContainer::InitData() { diff --git a/Source/ParticleContainer.H b/Source/ParticleContainer.H index efa752de3..f59545063 100644 --- a/Source/ParticleContainer.H +++ b/Source/ParticleContainer.H @@ -23,12 +23,12 @@ struct PIdx }; class MyParticleContainer - : public ParticleContainer > > + : public amrex::ParticleContainer > > { public: - MyParticleContainer (AmrCore* amr_core); + MyParticleContainer (amrex::AmrCore* amr_core); virtual ~MyParticleContainer() {} @@ -37,11 +37,11 @@ public: void InitData (); void Evolve (int lev, - const MultiFab& Ex, const MultiFab& Ey, const MultiFab& Ez, - const MultiFab& Bx, const MultiFab& By, const MultiFab& Bz, - MultiFab& jx, MultiFab& jy, MultiFab& jz, Real dt); + const amrex::MultiFab& Ex, const amrex::MultiFab& Ey, const amrex::MultiFab& Ez, + const amrex::MultiFab& Bx, const amrex::MultiFab& By, const amrex::MultiFab& Bz, + amrex::MultiFab& jx, amrex::MultiFab& jy, amrex::MultiFab& jz, Real dt); - std::unique_ptr GetChargeDensity(int lev, bool local = false); + std::unique_ptr GetChargeDensity(int lev, bool local = false); private: @@ -51,7 +51,7 @@ private: // The size of the map value Array is npartdata. // The innermost Array holds a particular data (say Ex or gaminv) for particles on a grid. // The size of the innermost array is the number of particles. - Array > > > > m_partdata; + amrex::Array > > > > m_partdata; Real charge; Real mass; @@ -60,6 +60,6 @@ private: // runtime parameters static int do_tiling; - static IntVect tile_size; + static amrex::IntVect tile_size; }; #endif /*_ParticleContainer_H_*/ diff --git a/Source/ParticleContainer.cpp b/Source/ParticleContainer.cpp index 1d1fd136b..6d28f8c32 100644 --- a/Source/ParticleContainer.cpp +++ b/Source/ParticleContainer.cpp @@ -5,6 +5,8 @@ #include #include +using namespace amrex; + int MyParticleContainer::do_tiling = 0; IntVect MyParticleContainer::tile_size { D_DECL(1024000,8,8) }; diff --git a/Source/ParticleIterator.H b/Source/ParticleIterator.H index 5d55bb2b5..a71924e0f 100644 --- a/Source/ParticleIterator.H +++ b/Source/ParticleIterator.H @@ -7,14 +7,14 @@ struct PartIterInfo { - PartIterInfo (int _level, bool _tiling, const IntVect& _tilesize) + PartIterInfo (int _level, bool _tiling, const amrex::IntVect& _tilesize) : level(_level), tiling(_tiling), tilesize(_tilesize) { } PartIterInfo (const PartIterInfo&) = default; PartIterInfo (PartIterInfo&&) = default; int level; bool tiling; - IntVect tilesize; + amrex::IntVect tilesize; }; class PartIter @@ -34,9 +34,9 @@ public: int numParticles () const; - Box tilebox () const; + amrex::Box tilebox () const; - Box validbox () const; + amrex::Box validbox () const; // apply function to each particle in current tile template @@ -66,7 +66,7 @@ private: int currentIndex; int beginIndex; int endIndex; - Array index_map; + amrex::Array index_map; }; #endif diff --git a/Source/ParticleIterator.cpp b/Source/ParticleIterator.cpp index 0424bd30b..6c492cd56 100644 --- a/Source/ParticleIterator.cpp +++ b/Source/ParticleIterator.cpp @@ -1,6 +1,8 @@ #include +using namespace amrex; + PartIter::PartIter (MyParticleContainer& _mypc, const PartIterInfo& _info) : mypc(_mypc), pmap(_mypc.GetParticles(_info.level)), diff --git a/Source/WarpX.H b/Source/WarpX.H index e10fd2ce5..54791c5d5 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -14,7 +14,7 @@ #include class WarpX - : public AmrCore + : public amrex::AmrCore { public: @@ -30,7 +30,8 @@ public: void Evolve (int numsteps = -1); - static void FillBoundary (MultiFab& mf, const Geometry& geom, const IntVect& nodalflag); + static void FillBoundary (amrex::MultiFab& mf, const amrex::Geometry& geom, + const amrex::IntVect& nodalflag); // Algorithms static long current_deposition_algo; @@ -44,7 +45,7 @@ public: static long noz; protected: - virtual void ErrorEst (int lev, TagBoxArray& tags, Real time, int /*ngrow*/) override {} + virtual void ErrorEst (int lev, amrex::TagBoxArray& tags, Real time, int /*ngrow*/) override {} private: @@ -57,7 +58,7 @@ private: void ReadParameters (); void MakeNewLevel (int lev, Real time, - const BoxArray& new_grids, const DistributionMapping& new_dmap); + const amrex::BoxArray& new_grids, const amrex::DistributionMapping& new_dmap); void InitFromScratch (); void InitFromCheckpoint () {} @@ -68,23 +69,23 @@ private: void ComputeDt (); void WritePlotFile () const; - static void PackPlotDataPtrs (Array& pmf, - const Array >& data); - static void Copy (MultiFab& dstmf, int dcomp, int ncomp, const MultiFab& srcmf, int scomp); + static void PackPlotDataPtrs (amrex::Array& pmf, + const amrex::Array >& data); + static void Copy (amrex::MultiFab& dstmf, int dcomp, int ncomp, const amrex::MultiFab& srcmf, int scomp); - Array istep; // which step? - Array nsubsteps; // how many substeps on each level? + amrex::Array istep; // which step? + amrex::Array nsubsteps; // how many substeps on each level? - Array t_new; - Array t_old; - Array dt; + amrex::Array t_new; + amrex::Array t_old; + amrex::Array dt; // Particle container std::unique_ptr mypc; // Fields: First array for level, second for direction - Array > > current; - Array > > Efield; - Array > > Bfield; + amrex::Array > > current; + amrex::Array > > Efield; + amrex::Array > > Bfield; // runtime parameters @@ -102,17 +103,17 @@ private: int check_int = -1; int plot_int = -1; - static IntVect Bx_nodal_flag; - static IntVect By_nodal_flag; - static IntVect Bz_nodal_flag; + static amrex::IntVect Bx_nodal_flag; + static amrex::IntVect By_nodal_flag; + static amrex::IntVect Bz_nodal_flag; - static IntVect Ex_nodal_flag; - static IntVect Ey_nodal_flag; - static IntVect Ez_nodal_flag; + static amrex::IntVect Ex_nodal_flag; + static amrex::IntVect Ey_nodal_flag; + static amrex::IntVect Ez_nodal_flag; - static IntVect jx_nodal_flag; - static IntVect jy_nodal_flag; - static IntVect jz_nodal_flag; + static amrex::IntVect jx_nodal_flag; + static amrex::IntVect jy_nodal_flag; + static amrex::IntVect jz_nodal_flag; }; #endif diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index a176ec3c3..05bfdc18b 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -3,6 +3,8 @@ #include +using namespace amrex; + long WarpX::current_deposition_algo = 3; long WarpX::charge_deposition_algo = 0; long WarpX::field_gathering_algo = 1; diff --git a/Source/WarpXConst.H b/Source/WarpXConst.H index a8df77441..330bfe47a 100644 --- a/Source/WarpXConst.H +++ b/Source/WarpXConst.H @@ -1,6 +1,8 @@ #ifndef WARPX_CONST_H_ #define WARPX_CONST_H_ +#include + // Physical constants namespace PhysConst { diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp index 3eb04bdfb..db003312b 100644 --- a/Source/WarpXEvolve.cpp +++ b/Source/WarpXEvolve.cpp @@ -6,6 +6,8 @@ #include #include +using namespace amrex; + void WarpX::Evolve (int numsteps) { diff --git a/Source/WarpXIO.cpp b/Source/WarpXIO.cpp index 8b056f39c..b958d5ef4 100644 --- a/Source/WarpXIO.cpp +++ b/Source/WarpXIO.cpp @@ -6,6 +6,8 @@ #include "buildInfo.H" +using namespace amrex; + void WarpX::WritePlotFile () const { diff --git a/Source/WarpXInitData.cpp b/Source/WarpXInitData.cpp index c7020fb2a..9e0d7ac37 100644 --- a/Source/WarpXInitData.cpp +++ b/Source/WarpXInitData.cpp @@ -6,6 +6,8 @@ #include #include +using namespace amrex; + void WarpX::InitData () { diff --git a/Source/main.cpp b/Source/main.cpp index 5dc636a83..abf935aa9 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -7,6 +7,8 @@ #include +using namespace amrex; + int main(int argc, char* argv[]) { amrex::Initialize(argc,argv); diff --git a/tests/CurrentDeposition/main.cpp b/tests/CurrentDeposition/main.cpp index d1bf980bc..6eb1a5126 100644 --- a/tests/CurrentDeposition/main.cpp +++ b/tests/CurrentDeposition/main.cpp @@ -10,6 +10,8 @@ #include #include +using namespace amrex; + int main(int argc, char* argv[]) { amrex::Initialize(argc,argv); diff --git a/tests/FieldGather/main.cpp b/tests/FieldGather/main.cpp index bf94877b7..9ba07cfde 100644 --- a/tests/FieldGather/main.cpp +++ b/tests/FieldGather/main.cpp @@ -9,6 +9,8 @@ #include +using namespace amrex; + int main(int argc, char* argv[]) { amrex::Initialize(argc,argv); diff --git a/tests/FieldSolver/main.cpp b/tests/FieldSolver/main.cpp index c7b7efde6..505955148 100644 --- a/tests/FieldSolver/main.cpp +++ b/tests/FieldSolver/main.cpp @@ -11,6 +11,8 @@ #include #include +using namespace amrex; + int main(int argc, char* argv[]) { amrex::Initialize(argc,argv); diff --git a/tests/ParticlePusher/main.cpp b/tests/ParticlePusher/main.cpp index 2f4d4da4e..c1954e333 100644 --- a/tests/ParticlePusher/main.cpp +++ b/tests/ParticlePusher/main.cpp @@ -11,6 +11,8 @@ #include #include +using namespace amrex; + int main(int argc, char* argv[]) { amrex::Initialize(argc,argv); -- cgit v1.2.3 From 2dc09f9b296a2ededa2d028aa50c8acb0fa23cb3 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 3 Jan 2017 14:46:06 -0800 Subject: migration step 6 --- Exec/Langmuir/ParticleProb.cpp | 2 +- Exec/charged_beam/ParticleProb.cpp | 2 +- Exec/uniform_plasma/ParticleProb.cpp | 2 +- Python/ParticleProb.cpp | 2 +- Source/ParticleContainer.cpp | 5 +++-- Source/WarpX.cpp | 11 +++++++---- Source/WarpXIO.cpp | 2 +- Source/WarpXInitData.cpp | 8 ++++---- tests/CurrentDeposition/main.cpp | 4 +++- tests/FieldGather/main.cpp | 4 +++- tests/FieldSolver/main.cpp | 13 ++++++++----- tests/ParticlePusher/main.cpp | 4 +++- 12 files changed, 36 insertions(+), 23 deletions(-) (limited to 'Python/ParticleProb.cpp') diff --git a/Exec/Langmuir/ParticleProb.cpp b/Exec/Langmuir/ParticleProb.cpp index c3734de58..17a6b1fc6 100644 --- a/Exec/Langmuir/ParticleProb.cpp +++ b/Exec/Langmuir/ParticleProb.cpp @@ -68,7 +68,7 @@ MyParticleContainer::InitData() const BoxArray& ba = m_gdb->ParticleBoxArray(lev); const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); - MultiFab dummy_mf(ba, 1, 0, dm, Fab_noallocate); + MultiFab dummy_mf(ba, dm, 1, 0, MFInfo().SetAlloc(false)); for (MFIter mfi(dummy_mf,false); mfi.isValid(); ++mfi) { diff --git a/Exec/charged_beam/ParticleProb.cpp b/Exec/charged_beam/ParticleProb.cpp index a20fb3765..088d51a79 100644 --- a/Exec/charged_beam/ParticleProb.cpp +++ b/Exec/charged_beam/ParticleProb.cpp @@ -68,7 +68,7 @@ MyParticleContainer::InitData() const BoxArray& ba = m_gdb->ParticleBoxArray(lev); const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); - MultiFab dummy_mf(ba, 1, 0, dm, Fab_noallocate); + MultiFab dummy_mf(ba, dm, 1, 0, MFInfo().SetAlloc(false)); for (MFIter mfi(dummy_mf,false); mfi.isValid(); ++mfi) { diff --git a/Exec/uniform_plasma/ParticleProb.cpp b/Exec/uniform_plasma/ParticleProb.cpp index 68669d1c7..e997d8c0f 100644 --- a/Exec/uniform_plasma/ParticleProb.cpp +++ b/Exec/uniform_plasma/ParticleProb.cpp @@ -52,7 +52,7 @@ MyParticleContainer::InitData() const BoxArray& ba = m_gdb->ParticleBoxArray(lev); const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); - MultiFab dummy_mf(ba, 1, 0, dm, Fab_noallocate); + MultiFab dummy_mf(ba, dm, 1, 0, MFInfo().SetAlloc(false)); for (MFIter mfi(dummy_mf,false); mfi.isValid(); ++mfi) { diff --git a/Python/ParticleProb.cpp b/Python/ParticleProb.cpp index 1f716a098..16262646b 100644 --- a/Python/ParticleProb.cpp +++ b/Python/ParticleProb.cpp @@ -62,7 +62,7 @@ MyParticleContainer::InitData() const BoxArray& ba = m_gdb->ParticleBoxArray(lev); const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); - MultiFab dummy_mf(ba, 1, 0, dm, Fab_noallocate); + MultiFab dummy_mf(ba, dm, 1, 0, MFInfo().SetAlloc(false)); for (MFIter mfi(dummy_mf,false); mfi.isValid(); ++mfi) { diff --git a/Source/ParticleContainer.cpp b/Source/ParticleContainer.cpp index 6d28f8c32..5168d0165 100644 --- a/Source/ParticleContainer.cpp +++ b/Source/ParticleContainer.cpp @@ -56,7 +56,7 @@ MyParticleContainer::AllocData () const BoxArray& ba = m_gdb->ParticleBoxArray(lev); const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); - MultiFab foo(ba, 1, 0, dm, Fab_noallocate); + MultiFab foo(ba, dm, 1, 0, MFInfo().SetAlloc(false)); for (MFIter mfi(foo); mfi.isValid(); ++mfi) { int i = mfi.index(); @@ -274,6 +274,7 @@ std::unique_ptr MyParticleContainer::GetChargeDensity (int lev, bool local) { const Geometry& gm = m_gdb->Geom(lev); + const DistributionMapping& dm = m_gdb->ParticleDistributionMap(lev); const BoxArray& ba = m_gdb->ParticleBoxArray(lev); BoxArray nba = ba; nba.surroundingNodes(); @@ -286,7 +287,7 @@ MyParticleContainer::GetChargeDensity (int lev, bool local) const int ng = WarpX::nox; - auto rho = std::unique_ptr(new MultiFab(nba,1,ng)); + auto rho = std::unique_ptr(new MultiFab(nba,dm,1,ng)); rho->setVal(0.0); Array xp, yp, zp, wp; diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 05bfdc18b..b38c4520e 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -163,13 +163,16 @@ WarpX::MakeNewLevel (int lev, Real time, const IntVect& nodalflag = IntVect::TheUnitVector(); const int ng = WarpX::nox; // need to update this + MFInfo info; + info.SetNodal(nodalflag); + current[lev].resize(3); Efield [lev].resize(3); Bfield [lev].resize(3); for (int i = 0; i < 3; ++i) { - current[lev][i].reset(new MultiFab(grids[lev],1,ng,dmap[lev],Fab_allocate,nodalflag)); - Efield [lev][i].reset(new MultiFab(grids[lev],1,ng,dmap[lev],Fab_allocate,nodalflag)); - Bfield [lev][i].reset(new MultiFab(grids[lev],1,ng,dmap[lev],Fab_allocate,nodalflag)); + current[lev][i].reset(new MultiFab(grids[lev],dmap[lev],1,ng,info)); + Efield [lev][i].reset(new MultiFab(grids[lev],dmap[lev],1,ng,info)); + Bfield [lev][i].reset(new MultiFab(grids[lev],dmap[lev],1,ng,info)); } } @@ -180,7 +183,7 @@ WarpX::FillBoundary (MultiFab& mf, const Geometry& geom, const IntVect& nodalfla BoxArray ba = mf.boxArray(); ba.convert(correct_typ); - MultiFab tmpmf(ba, mf.nComp(), mf.nGrow(), mf.DistributionMap()); + MultiFab tmpmf(ba, mf.DistributionMap(), mf.nComp(), mf.nGrow()); const IndexType& mf_typ = mf.boxArray().ixType(); diff --git a/Source/WarpXIO.cpp b/Source/WarpXIO.cpp index b958d5ef4..82075ca95 100644 --- a/Source/WarpXIO.cpp +++ b/Source/WarpXIO.cpp @@ -28,7 +28,7 @@ WarpX::WritePlotFile () const { const int ncomp = 3*3; const int ngrow = 0; - mf[lev].reset(new MultiFab(grids[lev], ncomp, ngrow, dmap[lev])); + mf[lev].reset(new MultiFab(grids[lev], dmap[lev], ncomp, ngrow)); Array srcmf(BL_SPACEDIM); PackPlotDataPtrs(srcmf, current[lev]); diff --git a/Source/WarpXInitData.cpp b/Source/WarpXInitData.cpp index 9e0d7ac37..a623d3e7a 100644 --- a/Source/WarpXInitData.cpp +++ b/Source/WarpXInitData.cpp @@ -39,7 +39,7 @@ WarpX::InitFromScratch () finest_level = 0; const BoxArray& ba = MakeBaseGrids(); - DistributionMapping dm(ba, ParallelDescriptor::NProcs()); + DistributionMapping dm{ba}; MakeNewLevel(0, time, ba, dm); @@ -95,8 +95,8 @@ WarpX::InitOpenbc () DistributionMapping dm{iprocmap}; - MultiFab rho_openbc(ba, 1, 0, dm); - MultiFab phi_openbc(ba, 1, 0, dm); + MultiFab rho_openbc(ba, dm, 1, 0); + MultiFab phi_openbc(ba, dm, 1, 0); bool local = true; const std::unique_ptr& rho = mypc->GetChargeDensity(lev, local); @@ -110,7 +110,7 @@ WarpX::InitOpenbc () BoxArray nba = boxArray(lev); nba.surroundingNodes(); - MultiFab phi(nba, 1, 0); + MultiFab phi(nba, DistributionMap(lev), 1, 0); phi.copy(phi_openbc, gm.periodicity()); for (MFIter mfi(phi); mfi.isValid(); ++mfi) diff --git a/tests/CurrentDeposition/main.cpp b/tests/CurrentDeposition/main.cpp index 6eb1a5126..52b37447d 100644 --- a/tests/CurrentDeposition/main.cpp +++ b/tests/CurrentDeposition/main.cpp @@ -105,7 +105,9 @@ int main(int argc, char* argv[]) &lvect, ¤t_deposition_algo); Box plotbox{IntVect{D_DECL(0,0,0)},IntVect{D_DECL(nx-1,ny-1,nz-1)}}; - MultiFab plotmf(BoxArray{plotbox}, 3, 0); + BoxArray plotba {plotbox}; + DistributionMapping plotdm {plotba}; + MultiFab plotmf(plotba, plotdm, 3, 0); plotmf[0].copy(jxfab,0,0,1); plotmf[0].copy(jyfab,0,1,1); plotmf[0].copy(jzfab,0,2,1); diff --git a/tests/FieldGather/main.cpp b/tests/FieldGather/main.cpp index 9ba07cfde..b60450a03 100644 --- a/tests/FieldGather/main.cpp +++ b/tests/FieldGather/main.cpp @@ -112,7 +112,9 @@ int main(int argc, char* argv[]) &field_gathering_algo); Box plotbox{IntVect{D_DECL(0,0,0)},IntVect{D_DECL(nx-1,ny-1,nz-1)}}; - MultiFab plotmf(BoxArray{plotbox}, 6, 0); + BoxArray plotba {plotbox}; + DistributionMapping plotdm {plotba}; + MultiFab plotmf(plotba, plotdm, 6, 0); FArrayBox& plotfab = plotmf[0]; plotfab.setVal(0.0); for (int k = 0; k < nz; ++k) { diff --git a/tests/FieldSolver/main.cpp b/tests/FieldSolver/main.cpp index 505955148..556b57224 100644 --- a/tests/FieldSolver/main.cpp +++ b/tests/FieldSolver/main.cpp @@ -43,16 +43,19 @@ int main(int argc, char* argv[]) BoxArray grids{cc_domain}; grids.maxSize(32); + DistributionMapping dmap {grids}; + + MFInfo info; + info.SetNodal(IntVect::TheUnitVector()); const int ng = nox; Array > current(3); Array > Efield(3); Array > Bfield(3); for (int i = 0; i < 3; ++i) { - const IntVect& nodalflag = IntVect::TheUnitVector(); - current[i].reset(new MultiFab(grids,1,ng,Fab_allocate,nodalflag)); - Efield [i].reset(new MultiFab(grids,1,ng,Fab_allocate,nodalflag)); - Bfield [i].reset(new MultiFab(grids,1,ng,Fab_allocate,nodalflag)); + current[i].reset(new MultiFab(grids,dmap,1,ng,info)); + Efield [i].reset(new MultiFab(grids,dmap,1,ng,info)); + Bfield [i].reset(new MultiFab(grids,dmap,1,ng,info)); } for (MFIter mfi(*current[0]); mfi.isValid(); ++mfi) @@ -197,7 +200,7 @@ int main(int argc, char* argv[]) } } - MultiFab plotmf(grids, 6, 0); + MultiFab plotmf(grids, dmap, 6, 0); const auto& src_typ = (*Efield[0]).boxArray().ixType(); const auto& dst_typ = grids.ixType(); for (MFIter mfi(plotmf); mfi.isValid(); ++mfi) diff --git a/tests/ParticlePusher/main.cpp b/tests/ParticlePusher/main.cpp index c1954e333..bce5a230f 100644 --- a/tests/ParticlePusher/main.cpp +++ b/tests/ParticlePusher/main.cpp @@ -86,7 +86,9 @@ int main(int argc, char* argv[]) &particle_pusher_algo); Box plotbox{IntVect{D_DECL(0,0,0)},IntVect{D_DECL(nx-1,ny-1,nz-1)}}; - MultiFab plotmf(BoxArray{plotbox}, 7, 0); + BoxArray plotba {plotbox}; + DistributionMapping plotdm {plotba}; + MultiFab plotmf(plotba, plotdm, 7, 0); FArrayBox& plotfab = plotmf[0]; plotfab.setVal(0.0); for (int k = 0; k < nz; ++k) { -- cgit v1.2.3