diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Diagnostics/WarpXIO.cpp | 34 | ||||
-rw-r--r-- | Source/Make.WarpX | 9 |
2 files changed, 41 insertions, 2 deletions
diff --git a/Source/Diagnostics/WarpXIO.cpp b/Source/Diagnostics/WarpXIO.cpp index ee9059f24..7f2769114 100644 --- a/Source/Diagnostics/WarpXIO.cpp +++ b/Source/Diagnostics/WarpXIO.cpp @@ -11,6 +11,11 @@ #include <AMReX_AmrMeshInSituBridge.H> #endif +#ifdef AMREX_USE_ASCENT +#include <ascent.hpp> +#include <AMReX_Conduit_Blueprint.H> +#endif + using namespace amrex; namespace @@ -439,7 +444,7 @@ WarpX::GetCellCenteredData() { void WarpX::UpdateInSitu () const { -#ifdef BL_USE_SENSEI_INSITU +#if defined(BL_USE_SENSEI_INSITU) || defined(AMREX_USE_ASCENT) BL_PROFILE("WarpX::UpdateInSitu()"); // Average the fields from the simulation to the cell centers @@ -449,9 +454,10 @@ WarpX::UpdateInSitu () const 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}, {varnames})) + {&mf_avg}, {varnames})) { amrex::ErrorStream() << "WarpXIO::UpdateInSitu : Failed to update the in situ bridge." @@ -460,6 +466,30 @@ WarpX::UpdateInSitu () const amrex::Abort(); } #endif + +#ifdef AMREX_USE_ASCENT + conduit::Node bp_mesh; + MultiLevelToBlueprint(finest_level+1, + amrex::GetVecOfConstPtrs(mf_avg), + varnames, + Geom(), + t_new[0], + istep, + refRatio(), + bp_mesh); + + ascent::Ascent ascent; + conduit::Node opts; + opts["exceptions"] = "catch"; + opts["mpi_comm"] = MPI_Comm_c2f(ParallelDescriptor::Communicator()); + ascent.open(opts); + ascent.publish(bp_mesh); + conduit::Node actions; + ascent.execute(actions); + ascent.close(); +#endif + +#endif } void diff --git a/Source/Make.WarpX b/Source/Make.WarpX index ff6916548..eb5725221 100644 --- a/Source/Make.WarpX +++ b/Source/Make.WarpX @@ -12,6 +12,15 @@ ifeq ($(USE_GPU),TRUE) NVCC_HOST_COMP = gcc endif +ifeq ($(USE_ASCENT_INSITU),TRUE) + ASCENT_HOME ?= NOT_SET + ifneq ($(ASCENT_HOME),NOT_SET) + include $(ASCENT_HOME)/share/ascent/ascent_config.mk + endif + USE_CONDUIT = TRUE + USE_ASCENT = TRUE +endif + include $(AMREX_HOME)/Tools/GNUMake/Make.defs ifndef USE_PYTHON_MAIN |