aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpXEvolve.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2017-11-27 14:59:22 -0800
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2017-11-27 14:59:22 -0800
commitc30adf106534acd25562e69f217161e1b1acfff3 (patch)
tree040aaaf8d38cd9c6974c356b882ec1b328111c62 /Source/WarpXEvolve.cpp
parentb956e9fb7c94ba6ff89d19fd5c7f1ae5f91d29c2 (diff)
downloadWarpX-c30adf106534acd25562e69f217161e1b1acfff3.tar.gz
WarpX-c30adf106534acd25562e69f217161e1b1acfff3.tar.zst
WarpX-c30adf106534acd25562e69f217161e1b1acfff3.zip
Remove white lines and trailing spaces
Diffstat (limited to 'Source/WarpXEvolve.cpp')
-rw-r--r--Source/WarpXEvolve.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp
index df6822962..be9792634 100644
--- a/Source/WarpXEvolve.cpp
+++ b/Source/WarpXEvolve.cpp
@@ -42,12 +42,12 @@ WarpX::EvolveES(int numsteps) {
// nodal storage for the electrostatic case
const int num_levels = max_level + 1;
Vector<std::unique_ptr<MultiFab> > rhoNodal(num_levels);
- Vector<std::unique_ptr<MultiFab> > phiNodal(num_levels);
- Vector<std::array<std::unique_ptr<MultiFab>, 3> > eFieldNodal(num_levels);
+ Vector<std::unique_ptr<MultiFab> > phiNodal(num_levels);
+ Vector<std::array<std::unique_ptr<MultiFab>, 3> > eFieldNodal(num_levels);
const int ng = 1;
for (int lev = 0; lev <= max_level; lev++) {
BoxArray nba = boxArray(lev);
- nba.surroundingNodes();
+ nba.surroundingNodes();
rhoNodal[lev].reset(new MultiFab(nba, dmap[lev], 1, ng));
phiNodal[lev].reset(new MultiFab(nba, dmap[lev], 1, 2));
@@ -59,12 +59,12 @@ WarpX::EvolveES(int numsteps) {
const int lev = 0;
for (int step = istep[0]; step < numsteps_max && cur_time < stop_time; ++step)
{
-
+
// Start loop on time steps
amrex::Print() << "\nSTEP " << step+1 << " starts ...\n";
-
- // At initialization, particles have p^{n-1/2} and x^{n-1/2}.
- // Beyond one step, particles have p^{n-1/2} and x^{n}.
+
+ // At initialization, particles have p^{n-1/2} and x^{n-1/2}.
+ // Beyond one step, particles have p^{n-1/2} and x^{n}.
if (is_synchronized) {
// on first step, push X by 0.5*dt
mypc->PushXES(0.5*dt[lev]);
@@ -88,17 +88,17 @@ WarpX::EvolveES(int numsteps) {
computePhi(rhoNodal, phiNodal);
computeE(eFieldNodal, phiNodal);
-
+
if (cur_time + dt[0] >= stop_time - 1.e-3*dt[0] || step == numsteps_max-1) {
// on last step, push by only 0.5*dt to synchronize all at n+1/2
mypc->PushXES(-0.5*dt[lev]);
is_synchronized = true;
- }
+ }
mypc->Redistribute();
-
+
++istep[0];
-
+
cur_time += dt[0];
bool to_make_plot = (plot_int > 0) && ((step+1) % plot_int == 0);
@@ -152,7 +152,7 @@ WarpX::EvolveEM (int numsteps)
Real cur_time = t_new[0];
static int last_plot_file_step = 0;
static int last_check_file_step = 0;
-
+
int numsteps_max;
if (numsteps < 0) { // Note that the default argument is numsteps = -1
numsteps_max = max_step;
@@ -160,7 +160,7 @@ WarpX::EvolveEM (int numsteps)
numsteps_max = std::min(istep[0]+numsteps, max_step);
}
- bool max_time_reached = false;
+ bool max_time_reached = false;
for (int step = istep[0]; step < numsteps_max && cur_time < stop_time; ++step)
{
if (warpx_py_print_step) {
@@ -230,7 +230,7 @@ WarpX::EvolveEM (int numsteps)
} else {
EvolveE(dt[0], DtType::Full); // We now have E^{n+1}
}
-
+
for (int lev = 0; lev <= max_level; ++lev) {
++istep[lev];
}
@@ -293,13 +293,13 @@ WarpX::EvolveEM (int numsteps)
FillBoundaryE();
FillBoundaryB();
UpdateAuxilaryData();
-
+
for (int lev = 0; lev <= finest_level; ++lev) {
mypc->FieldGather(lev,
*Efield_aux[lev][0],*Efield_aux[lev][1],*Efield_aux[lev][2],
*Bfield_aux[lev][0],*Bfield_aux[lev][1],*Bfield_aux[lev][2]);
}
-
+
WritePlotFile();
}
@@ -331,7 +331,7 @@ WarpX::EvolveB (int lev, Real dt, DtType typ)
int patch_level = (ipatch == 0) ? lev : lev-1;
const std::array<Real,3>& dx = WarpX::CellSize(patch_level);
const std::array<Real,3> dtsdx {dt/dx[0], dt/dx[1], dt/dx[2]};
-
+
MultiFab *Ex, *Ey, *Ez, *Bx, *By, *Bz;
if (ipatch == 0)
{
@@ -366,7 +366,7 @@ WarpX::EvolveB (int lev, Real dt, DtType typ)
const Box& tbx = mfi.tilebox(Bx_nodal_flag);
const Box& tby = mfi.tilebox(By_nodal_flag);
const Box& tbz = mfi.tilebox(Bz_nodal_flag);
-
+
// Call picsar routine for each tile
WRPX_PXR_PUSH_BVEC(
tbx.loVect(), tbx.hiVect(),
@@ -409,7 +409,7 @@ WarpX::EvolveB (int lev, Real dt, DtType typ)
const Box& tbx = mfi.tilebox(Bx_nodal_flag);
const Box& tby = mfi.tilebox(By_nodal_flag);
const Box& tbz = mfi.tilebox(Bz_nodal_flag);
-
+
WRPX_PUSH_PML_BVEC(
tbx.loVect(), tbx.hiVect(),
tby.loVect(), tby.hiVect(),
@@ -483,7 +483,7 @@ WarpX::EvolveE (int lev, Real dt, DtType typ)
MultiFab* cost = costs[lev].get();
const IntVect& rr = (lev < finestLevel()) ? refRatio(lev) : IntVect::TheUnitVector();
-
+
// Loop through the grids, and over the tiles within each grid
#ifdef _OPENMP
#pragma omp parallel
@@ -556,7 +556,7 @@ WarpX::EvolveE (int lev, Real dt, DtType typ)
const Box& tex = mfi.tilebox(Ex_nodal_flag);
const Box& tey = mfi.tilebox(Ey_nodal_flag);
const Box& tez = mfi.tilebox(Ez_nodal_flag);
-
+
WRPX_PUSH_PML_EVEC(
tex.loVect(), tex.hiVect(),
tey.loVect(), tey.hiVect(),
@@ -722,4 +722,3 @@ WarpX::InjectPlasma (int num_shift, int dir)
}
}
}
-