diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/PhysicalParticleContainer.cpp | 10 | ||||
-rw-r--r-- | Source/WarpX.H | 3 | ||||
-rw-r--r-- | Source/WarpX.cpp | 2 | ||||
-rw-r--r-- | Source/WarpXComm.cpp | 6 |
4 files changed, 13 insertions, 8 deletions
diff --git a/Source/PhysicalParticleContainer.cpp b/Source/PhysicalParticleContainer.cpp index c221ddd84..b9ddd8ec4 100644 --- a/Source/PhysicalParticleContainer.cpp +++ b/Source/PhysicalParticleContainer.cpp @@ -103,16 +103,18 @@ PhysicalParticleContainer::AddParticles (int lev, Box part_box) #elif BL_SPACEDIM==2 scale_fac = dx[0]*dx[2]/num_ppc; #endif - + +#ifdef _OPENMP // First touch all tiles in the map in serial for (MFIter mfi = MakeMFIter(lev); mfi.isValid(); ++mfi) { const int grid_id = mfi.index(); const int tile_id = mfi.LocalTileIndex(); GetParticles(lev)[std::make_pair(grid_id, tile_id)]; } +#endif #ifdef _OPENMP -#pragma omp parallel +#pragma omp parallel if (not WarpX::serialize_ics) #endif { std::array<Real,PIdx::nattribs> attribs; @@ -474,8 +476,8 @@ PhysicalParticleContainer::Evolve (int lev, long ngRho = (rho) ? rho->nGrow() : 0; - long ngRhoDeposit = (WarpX::use_filter) ? ngRho : ngRho + 1; - long ngJDeposit = (WarpX::use_filter) ? ngJ : ngJ + 1; + long ngRhoDeposit = (WarpX::use_filter) ? ngRho +1 : ngRho; + long ngJDeposit = (WarpX::use_filter) ? ngJ +1 : ngJ; BL_ASSERT(OnSameGrids(lev,Ex)); diff --git a/Source/WarpX.H b/Source/WarpX.H index 6a16fed33..e036e0585 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -76,6 +76,7 @@ public: static bool use_laser; static bool use_filter; + static bool serialize_ics; const amrex::MultiFab& getcurrent (int lev, int direction) {return *current_fp[lev][direction];} const amrex::MultiFab& getEfield (int lev, int direction) {return *Efield_fp[lev][direction];} @@ -328,7 +329,7 @@ private: int do_electrostatic = 0; int n_buffer = 4; - Real const_dt = 0.5e-11; + amrex::Real const_dt = 0.5e-11; // Other runtime parameters int verbose = 1; diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 3fd47d51d..9f2a7eeab 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -35,6 +35,7 @@ long WarpX::noz = 1; bool WarpX::use_laser = false; bool WarpX::use_filter = false; +bool WarpX::serialize_ics = false; #if (BL_SPACEDIM == 3) IntVect WarpX::Bx_nodal_flag(1,0,0); @@ -209,6 +210,7 @@ WarpX::ReadParameters () pp.query("use_laser", use_laser); pp.query("use_filter", use_filter); + pp.query("serialize_ics", serialize_ics); pp.query("do_dive_cleaning", do_dive_cleaning); pp.query("do_pml", do_pml); diff --git a/Source/WarpXComm.cpp b/Source/WarpXComm.cpp index d5c0c81b4..934ef1b34 100644 --- a/Source/WarpXComm.cpp +++ b/Source/WarpXComm.cpp @@ -54,9 +54,9 @@ WarpX::UpdateAuxilaryData () dBx.setVal(0.0); dBy.setVal(0.0); dBz.setVal(0.0); - dBx.copy(*Bfield_aux[lev-1][0], 0, 0, 1, 0, ng, crse_period); - dBy.copy(*Bfield_aux[lev-1][1], 0, 0, 1, 0, ng, crse_period); - dBz.copy(*Bfield_aux[lev-1][2], 0, 0, 1, 0, ng, crse_period); + dBx.copy(*Bfield_aux[lev-1][0], 0, 0, 1, ng, ng, crse_period); + dBy.copy(*Bfield_aux[lev-1][1], 0, 0, 1, ng, ng, crse_period); + dBz.copy(*Bfield_aux[lev-1][2], 0, 0, 1, ng, ng, crse_period); MultiFab::Subtract(dBx, *Bfield_cp[lev][0], 0, 0, 1, ng); MultiFab::Subtract(dBy, *Bfield_cp[lev][1], 0, 0, 1, ng); MultiFab::Subtract(dBz, *Bfield_cp[lev][2], 0, 0, 1, ng); |