|
7 | 7 | #include "FlushFormats/FlushFormatPlotfile.H" |
8 | 8 | #include "FlushFormats/FlushFormatCheckpoint.H" |
9 | 9 | #include "FlushFormats/FlushFormatAscent.H" |
| 10 | +#include "FlushFormats/FlushFormatSensei.H" |
10 | 11 | #ifdef WARPX_USE_OPENPMD |
11 | 12 | # include "FlushFormats/FlushFormatOpenPMD.H" |
12 | 13 | #endif |
@@ -39,8 +40,10 @@ Diagnostics::ReadParameters () |
39 | 40 | m_intervals = IntervalsParser(period_string); |
40 | 41 | pp.query("format", m_format); |
41 | 42 | AMREX_ALWAYS_ASSERT_WITH_MESSAGE( |
42 | | - m_format == "plotfile" || m_format == "openpmd" || m_format == "checkpoint" || m_format == "ascent", |
43 | | - "<diag>.format must be plotfile or openpmd or checkpoint or ascent"); |
| 43 | + m_format == "plotfile" || m_format == "openpmd" || |
| 44 | + m_format == "checkpoint" || m_format == "ascent" || |
| 45 | + m_format == "sensei", |
| 46 | + "<diag>.format must be plotfile or openpmd or checkpoint or ascent or sensei"); |
44 | 47 | bool raw_specified = pp.query("plot_raw_fields", m_plot_raw_fields); |
45 | 48 | raw_specified += pp.query("plot_raw_fields_guards", m_plot_raw_fields_guards); |
46 | 49 | bool varnames_specified = pp.queryarr("fields_to_plot", m_varnames); |
@@ -148,6 +151,14 @@ Diagnostics::InitData () |
148 | 151 | m_flush_format = new FlushFormatCheckpoint; |
149 | 152 | } else if (m_format == "ascent"){ |
150 | 153 | m_flush_format = new FlushFormatAscent; |
| 154 | + } else if (m_format == "sensei"){ |
| 155 | +#ifdef BL_USE_SENSEI_INSITU |
| 156 | + m_flush_format = new FlushFormatSensei( |
| 157 | + dynamic_cast<amrex::AmrMesh*>(const_cast<WarpX*>(&warpx)), |
| 158 | + m_diag_name); |
| 159 | +#else |
| 160 | + amrex::Abort("To use SENSEI in situ, compile with USE_SENSEI=TRUE"); |
| 161 | +#endif |
151 | 162 | } else if (m_format == "openpmd"){ |
152 | 163 | #ifdef WARPX_USE_OPENPMD |
153 | 164 | m_flush_format = new FlushFormatOpenPMD(m_diag_name); |
@@ -195,7 +206,7 @@ Diagnostics::Flush () |
195 | 206 | { |
196 | 207 | auto & warpx = WarpX::GetInstance(); |
197 | 208 | m_flush_format->WriteToFile( |
198 | | - m_varnames, GetVecOfConstPtrs(m_mf_output), warpx.Geom(), warpx.getistep(), |
| 209 | + m_varnames, m_mf_output, warpx.Geom(), warpx.getistep(), |
199 | 210 | warpx.gett_new(0), m_all_species, nlev, m_file_prefix, |
200 | 211 | m_plot_raw_fields, m_plot_raw_fields_guards, m_plot_raw_rho, m_plot_raw_F); |
201 | 212 | } |
@@ -401,7 +412,8 @@ Diagnostics::DefineDiagMultiFab ( int lev ) { |
401 | 412 | // is different from the lo and hi physical co-ordinates of the simulation domain. |
402 | 413 | if (use_warpxba == false) dmap = DistributionMapping{ba}; |
403 | 414 | // Allocate output MultiFab for diagnostics. The data will be stored at cell-centers. |
404 | | - m_mf_output[lev] = MultiFab(ba, dmap, m_varnames.size(), 0); |
| 415 | + int ngrow = (m_format == "sensei") ? 1 : 0; |
| 416 | + m_mf_output[lev] = MultiFab(ba, dmap, m_varnames.size(), ngrow); |
405 | 417 | } |
406 | 418 |
|
407 | 419 |
|
|
0 commit comments