diff options
Diffstat (limited to 'Source/Evolve/WarpXEvolveEM.cpp')
-rw-r--r-- | Source/Evolve/WarpXEvolveEM.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp index 1cb17287b..bb1300562 100644 --- a/Source/Evolve/WarpXEvolveEM.cpp +++ b/Source/Evolve/WarpXEvolveEM.cpp @@ -1,3 +1,13 @@ +/* Copyright 2019-2020 Andrew Myers, Ann Almgren, Aurore Blelly + * Axel Huebl, Burlen Loring, David Grote + * Glenn Richardson, Jean-Luc Vay, Luca Fedeli + * Maxence Thevenet, Remi Lehe, Revathi Jambunathan + * Weiqun Zhang, Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #include <cmath> #include <limits> @@ -14,7 +24,6 @@ #include <AMReX_AmrMeshInSituBridge.H> #endif - using namespace amrex; void @@ -146,7 +155,8 @@ WarpX::EvolveEM (int numsteps) cur_time += dt[0]; - bool to_make_plot = (plot_int > 0) && ((step+1) % plot_int == 0); + bool to_make_plot = ( (plot_int > 0) && ((step+1) % plot_int == 0) ); + bool to_write_openPMD = ( (openpmd_int > 0) && ((step+1) % openpmd_int == 0) ); // slice generation // bool to_make_slice_plot = (slice_plot_int > 0) && ( (step+1)% slice_plot_int == 0); @@ -162,7 +172,7 @@ WarpX::EvolveEM (int numsteps) myBFD->writeLabFrameData(cell_centered_data.get(), *mypc, geom[0], cur_time, dt[0]); } - bool move_j = is_synchronized || to_make_plot || do_insitu; + bool move_j = is_synchronized || to_make_plot || to_write_openPMD || do_insitu; // If is_synchronized we need to shift j too so that next step we can evolve E by dt/2. // We might need to move j because we are going to make a plotfile. @@ -195,8 +205,15 @@ WarpX::EvolveEM (int numsteps) t_new[i] = cur_time; } + /// reduced diags + if (reduced_diags->m_plot_rd != 0) + { + reduced_diags->ComputeDiags(step); + reduced_diags->WriteToFile(step); + } + // slice gen // - if (to_make_plot || do_insitu || to_make_slice_plot) + if (to_make_plot || to_write_openPMD || do_insitu || to_make_slice_plot) { // This is probably overkill, but it's not called often FillBoundaryE(guard_cells.ng_alloc_EB, guard_cells.ng_Extra); @@ -219,6 +236,8 @@ WarpX::EvolveEM (int numsteps) if (to_make_plot) WritePlotFile(); + if (to_write_openPMD) + WriteOpenPMDFile(); if (to_make_slice_plot) { @@ -250,11 +269,12 @@ WarpX::EvolveEM (int numsteps) bool write_plot_file = plot_int > 0 && istep[0] > last_plot_file_step && (max_time_reached || istep[0] >= max_step); + bool write_openPMD = openpmd_int > 0 && (max_time_reached || istep[0] >= max_step); bool do_insitu = (insitu_start >= istep[0]) && (insitu_int > 0) && (istep[0] > last_insitu_step) && (max_time_reached || istep[0] >= max_step); - if (write_plot_file || do_insitu) + if (write_plot_file || write_openPMD || do_insitu) { // This is probably overkill, but it's not called often FillBoundaryE(guard_cells.ng_alloc_EB, guard_cells.ng_Extra); @@ -276,6 +296,8 @@ WarpX::EvolveEM (int numsteps) if (write_plot_file) WritePlotFile(); + if (write_openPMD) + WriteOpenPMDFile(); if (do_insitu) UpdateInSitu(); |