aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Diagnostics/Diagnostics.cpp20
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormat.H2
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatAscent.H3
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatAscent.cpp4
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.H2
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp2
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.H2
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp9
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.H2
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp4
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatSensei.H70
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatSensei.cpp99
-rw-r--r--Source/Diagnostics/FlushFormats/Make.package1
-rw-r--r--Source/Diagnostics/WarpXIO.cpp29
-rw-r--r--Source/Evolve/WarpXEvolve.cpp61
-rw-r--r--Source/Initialization/WarpXInitData.cpp19
-rw-r--r--Source/WarpX.H16
-rw-r--r--Source/WarpX.cpp21
18 files changed, 199 insertions, 167 deletions
diff --git a/Source/Diagnostics/Diagnostics.cpp b/Source/Diagnostics/Diagnostics.cpp
index 0e13c256c..5a0f29113 100644
--- a/Source/Diagnostics/Diagnostics.cpp
+++ b/Source/Diagnostics/Diagnostics.cpp
@@ -7,6 +7,7 @@
#include "FlushFormats/FlushFormatPlotfile.H"
#include "FlushFormats/FlushFormatCheckpoint.H"
#include "FlushFormats/FlushFormatAscent.H"
+#include "FlushFormats/FlushFormatSensei.H"
#ifdef WARPX_USE_OPENPMD
# include "FlushFormats/FlushFormatOpenPMD.H"
#endif
@@ -39,8 +40,10 @@ Diagnostics::ReadParameters ()
m_intervals = IntervalsParser(period_string);
pp.query("format", m_format);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
- m_format == "plotfile" || m_format == "openpmd" || m_format == "checkpoint" || m_format == "ascent",
- "<diag>.format must be plotfile or openpmd or checkpoint or ascent");
+ m_format == "plotfile" || m_format == "openpmd" ||
+ m_format == "checkpoint" || m_format == "ascent" ||
+ m_format == "sensei",
+ "<diag>.format must be plotfile or openpmd or checkpoint or ascent or sensei");
bool raw_specified = pp.query("plot_raw_fields", m_plot_raw_fields);
raw_specified += pp.query("plot_raw_fields_guards", m_plot_raw_fields_guards);
bool varnames_specified = pp.queryarr("fields_to_plot", m_varnames);
@@ -148,6 +151,14 @@ Diagnostics::InitData ()
m_flush_format = new FlushFormatCheckpoint;
} else if (m_format == "ascent"){
m_flush_format = new FlushFormatAscent;
+ } else if (m_format == "sensei"){
+#ifdef BL_USE_SENSEI_INSITU
+ m_flush_format = new FlushFormatSensei(
+ dynamic_cast<amrex::AmrMesh*>(const_cast<WarpX*>(&warpx)),
+ m_diag_name);
+#else
+ amrex::Abort("To use SENSEI in situ, compile with USE_SENSEI=TRUE");
+#endif
} else if (m_format == "openpmd"){
#ifdef WARPX_USE_OPENPMD
m_flush_format = new FlushFormatOpenPMD(m_diag_name);
@@ -195,7 +206,7 @@ Diagnostics::Flush ()
{
auto & warpx = WarpX::GetInstance();
m_flush_format->WriteToFile(
- m_varnames, GetVecOfConstPtrs(m_mf_output), warpx.Geom(), warpx.getistep(),
+ m_varnames, m_mf_output, warpx.Geom(), warpx.getistep(),
warpx.gett_new(0), m_all_species, nlev, m_file_prefix,
m_plot_raw_fields, m_plot_raw_fields_guards, m_plot_raw_rho, m_plot_raw_F);
}
@@ -401,7 +412,8 @@ Diagnostics::DefineDiagMultiFab ( int lev ) {
// is different from the lo and hi physical co-ordinates of the simulation domain.
if (use_warpxba == false) dmap = DistributionMapping{ba};
// Allocate output MultiFab for diagnostics. The data will be stored at cell-centers.
- m_mf_output[lev] = MultiFab(ba, dmap, m_varnames.size(), 0);
+ int ngrow = (m_format == "sensei") ? 1 : 0;
+ m_mf_output[lev] = MultiFab(ba, dmap, m_varnames.size(), ngrow);
}
diff --git a/Source/Diagnostics/FlushFormats/FlushFormat.H b/Source/Diagnostics/FlushFormats/FlushFormat.H
index 4cd56a8de..d83355dd3 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormat.H
+++ b/Source/Diagnostics/FlushFormats/FlushFormat.H
@@ -10,7 +10,7 @@ public:
/** Flush fields and particles to file */
virtual void WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatAscent.H b/Source/Diagnostics/FlushFormats/FlushFormatAscent.H
index 68e0b4cbc..9aa670405 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatAscent.H
+++ b/Source/Diagnostics/FlushFormats/FlushFormatAscent.H
@@ -4,7 +4,6 @@
#include "FlushFormat.H"
#include "Diagnostics/ParticleDiag/ParticleDiag.H"
-
#ifdef AMREX_USE_ASCENT
# include <ascent.hpp>
# include <AMReX_Conduit_Blueprint.H>
@@ -21,7 +20,7 @@ public:
/** Do in-situ visualization for field and particle data */
virtual void WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatAscent.cpp b/Source/Diagnostics/FlushFormats/FlushFormatAscent.cpp
index 028cd2502..b0903b5a4 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatAscent.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatAscent.cpp
@@ -6,7 +6,7 @@ using namespace amrex;
void
FlushFormatAscent::WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev,
@@ -20,7 +20,7 @@ FlushFormatAscent::WriteToFile (
// wrap mesh data
conduit::Node bp_mesh;
amrex::MultiLevelToBlueprint(
- nlev, mf, varnames, geom, time, iteration, warpx.refRatio(), bp_mesh);
+ nlev, amrex::GetVecOfConstPtrs(mf), varnames, geom, time, iteration, warpx.refRatio(), bp_mesh);
WriteParticles(particle_diags, bp_mesh);
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.H b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.H
index af9372af9..9eeb3b7c8 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.H
+++ b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.H
@@ -8,7 +8,7 @@ class FlushFormatCheckpoint final : public FlushFormatPlotfile
/** Flush fields and particles to plotfile */
virtual void WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
index 015380441..d0bc9292c 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp
@@ -14,7 +14,7 @@ namespace
void
FlushFormatCheckpoint::WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.H b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.H
index 7d73d0b13..5d6197d66 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.H
+++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.H
@@ -19,7 +19,7 @@ public:
/** Flush fields and particles to plotfile */
virtual void WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
index 9f991b0af..9f9f2b96a 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp
@@ -6,11 +6,6 @@
using namespace amrex;
-namespace
-{
- const std::string level_prefix {"Level_"};
-}
-
FlushFormatOpenPMD::FlushFormatOpenPMD (const std::string& diag_name)
{
ParmParse pp(diag_name);
@@ -29,7 +24,7 @@ FlushFormatOpenPMD::FlushFormatOpenPMD (const std::string& diag_name)
void
FlushFormatOpenPMD::WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev,
@@ -47,7 +42,7 @@ FlushFormatOpenPMD::WriteToFile (
// fields: only dumped for coarse level
m_OpenPMDPlotWriter->WriteOpenPMDFields(
- varnames, *mf[0], geom[0], iteration[0], time);
+ varnames, mf[0], geom[0], iteration[0], time);
// particles: all (reside only on locally finest level)
m_OpenPMDPlotWriter->WriteOpenPMDParticles(particle_diags);
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.H b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.H
index 77bd2b384..f3eb671d9 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.H
+++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.H
@@ -15,7 +15,7 @@ public:
/** Flush fields and particles to plotfile */
virtual void WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
index 0da484fb2..fc685dc05 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
@@ -15,7 +15,7 @@ namespace
void
FlushFormatPlotfile::WriteToFile (
const amrex::Vector<std::string> varnames,
- const amrex::Vector<const amrex::MultiFab*> mf,
+ const amrex::Vector<amrex::MultiFab>& mf,
amrex::Vector<amrex::Geometry>& geom,
const amrex::Vector<int> iteration, const double time,
const amrex::Vector<ParticleDiag>& particle_diags, int nlev,
@@ -31,7 +31,7 @@ FlushFormatPlotfile::WriteToFile (
VisMF::SetHeaderVersion(amrex::VisMF::Header::Version_v1);
if (plot_raw_fields) rfs.emplace_back("raw_fields");
amrex::WriteMultiLevelPlotfile(filename, nlev,
- mf,
+ amrex::GetVecOfConstPtrs(mf),
varnames, geom,
time, iteration, warpx.refRatio(),
"HyperCLaw-V1.1",
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatSensei.H b/Source/Diagnostics/FlushFormats/FlushFormatSensei.H
new file mode 100644
index 000000000..35cbca46c
--- /dev/null
+++ b/Source/Diagnostics/FlushFormats/FlushFormatSensei.H
@@ -0,0 +1,70 @@
+#ifndef WARPX_FLUSHFORMATSENSEI_H_
+#define WARPX_FLUSHFORMATSENSEI_H_
+
+#include "FlushFormat.H"
+#include "AMReX_AmrMesh.H"
+
+#if defined(BL_USE_SENSEI_INSITU)
+#include "AMReX_AmrMeshInSituBridge.H"
+#else
+namespace amrex {
+using AmrMeshInSituBridge = void;
+}
+#endif
+
+/**
+ * \brief This class aims at dumping performing in-situ diagnostics with
+ * SENSEI. In particular, function WriteToFile takes fields and particles as
+ * input arguments, and calls amrex functions to do the in-situ visualization.
+ *
+ * To use the SENSEI flush format one must compile WarpX with the GNUMakefile
+ * setting: USE_SENSEI_INSITU=TRUE
+ *
+ * In addition to the standard controls, the following inputs file fields are
+ * supported:
+ *
+ * sensei_config - the path to a SENSEI XML configuration (required)
+ * sensei_pin_mesh - integer 0 or 1 forcing the moving mesh to be fixed
+ * at 0,0,0 (optional)
+ *
+ * Fri 29 May 2020 11:19:38 AM PDT : Tested with SENSEI version 3.2.0
+ */
+class FlushFormatSensei : public FlushFormat
+{
+public:
+ FlushFormatSensei();
+ ~FlushFormatSensei();
+
+ FlushFormatSensei(const FlushFormatSensei &) = delete;
+ void operator=(const FlushFormatSensei &) = delete;
+
+ /** \breif Construct.
+ * \parm[in] amr_mesh an AmrMesh instance
+ * \parm[in] diag_name ParmParse scope string.
+ */
+ FlushFormatSensei (amrex::AmrMesh *amr_mesh, std::string diag_name);
+
+ /** Do in-situ visualization for field and particle data */
+ virtual void WriteToFile (
+ const amrex::Vector<std::string> varnames,
+ const amrex::Vector<amrex::MultiFab>& mf,
+ amrex::Vector<amrex::Geometry>& geom,
+ const amrex::Vector<int> iteration, const double time,
+ const amrex::Vector<ParticleDiag>& particle_diags, int nlev, const std::string prefix,
+ bool plot_raw_fields,
+ bool plot_raw_fields_guards,
+ bool plot_raw_rho, bool plot_raw_F) const override;
+
+ /** \brief Do in-situ visualization for particle data.
+ * \param[in] particle_diags Each element of this vector handles output of 1 species.
+ */
+ void WriteParticles(const amrex::Vector<ParticleDiag>& particle_diags) const;
+
+private:
+ amrex::AmrMesh * m_amr_mesh;
+ amrex::AmrMeshInSituBridge * m_insitu_bridge;
+ std::string m_insitu_config;
+ int m_insitu_pin_mesh;
+};
+
+#endif // WARPX_FLUSHFORMATSENSEI_H_
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatSensei.cpp b/Source/Diagnostics/FlushFormats/FlushFormatSensei.cpp
new file mode 100644
index 000000000..0bd91c2f0
--- /dev/null
+++ b/Source/Diagnostics/FlushFormats/FlushFormatSensei.cpp
@@ -0,0 +1,99 @@
+#include "FlushFormatSensei.H"
+#include "WarpX.H"
+
+#ifdef BL_USE_SENSEI_INSITU
+# include <AMReX_AmrMeshInSituBridge.H>
+#endif
+
+FlushFormatSensei::FlushFormatSensei () :
+ m_insitu_config(), m_insitu_pin_mesh(0), m_insitu_bridge(nullptr),
+ m_amr_mesh(nullptr)
+{}
+
+FlushFormatSensei::FlushFormatSensei (amrex::AmrMesh *amr_mesh,
+ std::string diag_name) :
+ m_insitu_config(), m_insitu_pin_mesh(0), m_insitu_bridge(nullptr),
+ m_amr_mesh(amr_mesh)
+{
+#ifndef BL_USE_SENSEI_INSITU
+ (void)amr_mesh;
+ (void)diag_name;
+#else
+ amrex::ParmParse pp(diag_name);
+
+ pp.query("sensei_config", m_insitu_config);
+ pp.query("sensei_pin_mesh", m_insitu_pin_mesh);
+
+ m_insitu_bridge = new amrex::AmrMeshInSituBridge;
+ m_insitu_bridge->setEnabled(true);
+ m_insitu_bridge->setConfig(m_insitu_config);
+ m_insitu_bridge->setPinMesh(m_insitu_pin_mesh);
+ if (!m_amr_mesh || m_insitu_bridge->initialize())
+ {
+ amrex::ErrorStream() << "FlushFormtSensei::FlushFormatSensei : "
+ "Failed to initialize the in situ bridge." << std::endl;
+
+ amrex::Abort();
+ }
+ m_insitu_bridge->setFrequency(1);
+#endif
+}
+
+FlushFormatSensei::~FlushFormatSensei ()
+{
+#ifdef BL_USE_SENSEI_INSITU
+ delete m_insitu_bridge;
+#endif
+}
+
+void
+FlushFormatSensei::WriteToFile (
+ const amrex::Vector<std::string> varnames,
+ const amrex::Vector<amrex::MultiFab>& mf,
+ amrex::Vector<amrex::Geometry>& geom,
+ const amrex::Vector<int> iteration, const double time,
+ const amrex::Vector<ParticleDiag>& particle_diags, int nlev,
+ const std::string prefix, bool plot_raw_fields,
+ bool plot_raw_fields_guards, bool plot_raw_rho, bool plot_raw_F) const
+{
+#ifndef BL_USE_SENSEI_INSITU
+ (void)varnames;
+ (void)mf;
+ (void)geom;
+ (void)iteration;
+ (void)time;
+ (void)particle_diags;
+ (void)nlev;
+ (void)prefix;
+ (void)plot_raw_fields;
+ (void)plot_raw_fields_guards;
+ (void)plot_raw_rho;
+ (void)plot_raw_F;
+#else
+ amrex::Vector<amrex::MultiFab> *mf_ptr =
+ const_cast<amrex::Vector<amrex::MultiFab>*>(&mf);
+
+ if (m_insitu_bridge->update(iteration[0], time, m_amr_mesh,
+ {mf_ptr}, {varnames}))
+ {
+ amrex::ErrorStream() << "FlushFormatSensei::WriteToFile : "
+ "Failed to update the in situ bridge." << std::endl;
+
+ amrex::Abort();
+ }
+#endif
+}
+
+void
+FlushFormatSensei::WriteParticles (
+ const amrex::Vector<ParticleDiag>& particle_diags) const
+{
+#ifndef BL_USE_SENSEI_INSITU
+ (void)particle_diags;
+#else
+ amrex::ErrorStream() << "FlushFormatSensei::WriteParticles : "
+ "Not yet implemented." << std::endl;
+
+ amrex::Abort();
+#endif
+}
diff --git a/Source/Diagnostics/FlushFormats/Make.package b/Source/Diagnostics/FlushFormats/Make.package
index d665b655d..8b3a79600 100644
--- a/Source/Diagnostics/FlushFormats/Make.package
+++ b/Source/Diagnostics/FlushFormats/Make.package
@@ -1,6 +1,7 @@
CEXE_sources += FlushFormatPlotfile.cpp
CEXE_sources += FlushFormatCheckpoint.cpp
CEXE_sources += FlushFormatAscent.cpp
+CEXE_sources += FlushFormatSensei.cpp
ifeq ($(USE_OPENPMD), TRUE)
CEXE_sources += FlushFormatOpenPMD.cpp
endif
diff --git a/Source/Diagnostics/WarpXIO.cpp b/Source/Diagnostics/WarpXIO.cpp
index ef427f59f..402fd03ba 100644
--- a/Source/Diagnostics/WarpXIO.cpp
+++ b/Source/Diagnostics/WarpXIO.cpp
@@ -278,32 +278,3 @@ WarpX::GetCellCenteredData() {
return std::move(cc[0]);
}
-
-void
-WarpX::UpdateInSitu () const
-{
-#if defined(BL_USE_SENSEI_INSITU)
- WARPX_PROFILE("WarpX::UpdateInSitu()");
-
- // Average the fields from the simulation to the cell centers
- const int ngrow = 1;
- Vector<std::string> varnames; // Name of the written fields
- // mf_avg will contain the averaged, cell-centered fields
- Vector<MultiFab> mf_avg;
- WarpX::AverageAndPackFields( varnames, mf_avg, ngrow );
-
-# ifdef BL_USE_SENSEI_INSITU
- if (insitu_bridge->update(istep[0], t_new[0],
- dynamic_cast<amrex::AmrMesh*>(const_cast<WarpX*>(this)),
- {&mf_avg}, {varnames}))
- {
- amrex::ErrorStream()
- << "WarpXIO::UpdateInSitu : Failed to update the in situ bridge."
- << std::endl;
-
- amrex::Abort();
- }
-# endif
-
-#endif
-}
diff --git a/Source/Evolve/WarpXEvolve.cpp b/Source/Evolve/WarpXEvolve.cpp
index 066db9fe6..87d39ffc5 100644
--- a/Source/Evolve/WarpXEvolve.cpp
+++ b/Source/Evolve/WarpXEvolve.cpp
@@ -20,10 +20,6 @@
#include "FieldSolver/SpectralSolver/SpectralSolver.H"
#endif
-#ifdef BL_USE_SENSEI_INSITU
-# include <AMReX_AmrMeshInSituBridge.H>
-#endif
-
#include <cmath>
#include <limits>
@@ -37,7 +33,6 @@ WarpX::Evolve (int numsteps)
Real cur_time = t_new[0];
static int last_plot_file_step = 0;
- static int last_insitu_step = 0;
if (do_compute_max_step_from_zmax) {
computeMaxStepBoostAccelerator(geom[0]);
@@ -167,9 +162,6 @@ WarpX::Evolve (int numsteps)
cur_time += dt[0];
- bool do_insitu = ((step+1) >= insitu_start) &&
- (insitu_int > 0) && ((step+1) % insitu_int == 0);
-
if (do_back_transformed_diagnostics) {
std::unique_ptr<MultiFab> cell_centered_data = nullptr;
if (WarpX::do_back_transformed_fields) {
@@ -178,7 +170,7 @@ WarpX::Evolve (int numsteps)
myBFD->writeLabFrameData(cell_centered_data.get(), *mypc, geom[0], cur_time, dt[0]);
}
- bool move_j = is_synchronized || do_insitu;
+ bool move_j = is_synchronized;
// 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.
@@ -237,27 +229,6 @@ WarpX::Evolve (int numsteps)
multi_diags->FilterComputePackFlush( step );
- if (do_insitu)
- {
- // This is probably overkill, but it's not called often
- FillBoundaryE(guard_cells.ng_alloc_EB, guard_cells.ng_Extra);
- // This is probably overkill, but it's not called often
- FillBoundaryB(guard_cells.ng_alloc_EB, guard_cells.ng_Extra);
- // This is probably overkill, but it's not called often
-#ifndef WARPX_USE_PSATD
- FillBoundaryAux(guard_cells.ng_UpdateAux);
-#endif
- UpdateAuxilaryData();
-
- FieldGather();
-
- last_plot_file_step = step+1;
- //last_openPMD_step = step+1;
- last_insitu_step = step+1;
-
- UpdateInSitu();
- }
-
if (cur_time >= stop_time - 1.e-3*dt[0]) {
max_time_reached = true;
break;
@@ -269,41 +240,11 @@ WarpX::Evolve (int numsteps)
// End loop on time steps
}
- bool do_insitu = (insitu_start >= istep[0]) && (insitu_int > 0) &&
- (istep[0] > last_insitu_step) && (max_time_reached || istep[0] >= max_step);
-
multi_diags->FilterComputePackFlush( istep[0], true );
- if (do_insitu)
- {
- // This is probably overkill, but it's not called often
- FillBoundaryE(guard_cells.ng_alloc_EB, guard_cells.ng_Extra);
- // This is probably overkill, but it's not called often
- FillBoundaryB(guard_cells.ng_alloc_EB, guard_cells.ng_Extra);
- // This is probably overkill
-#ifndef WARPX_USE_PSATD
- FillBoundaryAux(guard_cells.ng_UpdateAux);
-#endif
- 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]);
- }
-
- UpdateInSitu();
- }
-
if (do_back_transformed_diagnostics) {
myBFD->Flush(geom[0]);
}
-
-#ifdef BL_USE_SENSEI_INSITU
- insitu_bridge->finalize();
-#endif
}
/* /brief Perform one PIC iteration, without subcycling
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp
index e97303d9d..7ee7e1902 100644
--- a/Source/Initialization/WarpXInitData.cpp
+++ b/Source/Initialization/WarpXInitData.cpp
@@ -63,29 +63,10 @@ WarpX::InitData ()
printGridSummary(std::cout, 0, finestLevel());
}
-#ifdef BL_USE_SENSEI_INSITU
- insitu_bridge = new amrex::AmrMeshInSituBridge;
- insitu_bridge->setEnabled(insitu_int > 0 ? 1 : 0);
- insitu_bridge->setConfig(insitu_config);
- insitu_bridge->setPinMesh(insitu_pin_mesh);
- if (insitu_bridge->initialize())
- {
- amrex::ErrorStream()
- << "WarpX::InitData : Failed to initialize the in situ bridge."
- << std::endl;
-
- amrex::Abort();
- }
- insitu_bridge->setFrequency(1);
-#endif
-
if (restart_chkfile.empty())
{
multi_diags->FilterComputePackFlush( 0, true );
- if ((insitu_int > 0) && (insitu_start == 0))
- UpdateInSitu();
-
// Write reduced diagnostics before the first iteration.
if (reduced_diags->m_plot_rd != 0)
{
diff --git a/Source/WarpX.H b/Source/WarpX.H
index e1f99fe4e..acc5f90e1 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -60,13 +60,6 @@
#include <memory>
#include <array>
-
-#if defined(BL_USE_SENSEI_INSITU)
-namespace amrex {
-class AmrMeshInSituBridge;
-}
-#endif
-
enum struct PatchType : int
{
fine,
@@ -401,7 +394,6 @@ public:
void AverageAndPackFields( amrex::Vector<std::string>& varnames,
amrex::Vector<amrex::MultiFab>& mf_avg, const int ngrow) const;
- void UpdateInSitu () const;
void prepareFields( int const step, amrex::Vector<std::string>& varnames,
amrex::Vector<amrex::MultiFab>& mf_avg,
amrex::Vector<const amrex::MultiFab*>& output_mf,
@@ -798,14 +790,6 @@ private:
#endif
amrex::Vector<std::unique_ptr<FiniteDifferenceSolver>> m_fdtd_solver_fp;
amrex::Vector<std::unique_ptr<FiniteDifferenceSolver>> m_fdtd_solver_cp;
-
-#if defined(BL_USE_SENSEI_INSITU)
- amrex::AmrMeshInSituBridge *insitu_bridge;
-#endif
- int insitu_int;
- int insitu_start;
- std::string insitu_config;
- int insitu_pin_mesh;
};
#endif
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 85dfe9333..38837ec54 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -275,10 +275,6 @@ WarpX::WarpX ()
m_fdtd_solver_fp.resize(nlevs_max);
m_fdtd_solver_cp.resize(nlevs_max);
-#ifdef BL_USE_SENSEI_INSITU
- insitu_bridge = nullptr;
-#endif
-
// NCI Godfrey filters can have different stencils
// at different levels (the stencil depends on c*dt/dz)
nci_godfrey_filter_exeybz.resize(nlevs_max);
@@ -301,10 +297,6 @@ WarpX::~WarpX ()
}
delete reduced_diags;
-
-#ifdef BL_USE_SENSEI_INSITU
- delete insitu_bridge;
-#endif
}
void
@@ -650,19 +642,6 @@ WarpX::ReadParameters ()
}
#endif
- {
- insitu_start = 0;
- insitu_int = 0;
- insitu_config = "";
- insitu_pin_mesh = 0;
-
- ParmParse pp("insitu");
- pp.query("int", insitu_int);
- pp.query("start", insitu_start);
- pp.query("config", insitu_config);
- pp.query("pin_mesh", insitu_pin_mesh);
- }
-
// for slice generation //
{
ParmParse pp("slice");