diff options
author | 2018-10-19 16:01:56 -0700 | |
---|---|---|
committer | 2018-10-22 16:38:19 -0700 | |
commit | bb78d332b75c2eb9a5d4c290163c3ed363b16d10 (patch) | |
tree | 535156cfa3df3a8541d9f786b6467ae85c09f5d8 /Source/WarpXInitData.cpp | |
parent | dc05f98bfa204bde279a5e64d4a932edd83e7f84 (diff) | |
download | WarpX-bb78d332b75c2eb9a5d4c290163c3ed363b16d10.tar.gz WarpX-bb78d332b75c2eb9a5d4c290163c3ed363b16d10.tar.zst WarpX-bb78d332b75c2eb9a5d4c290163c3ed363b16d10.zip |
Integrate SENSEI in situ
Diffstat (limited to 'Source/WarpXInitData.cpp')
-rw-r--r-- | Source/WarpXInitData.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/WarpXInitData.cpp b/Source/WarpXInitData.cpp index 769df87f5..a6b63a92d 100644 --- a/Source/WarpXInitData.cpp +++ b/Source/WarpXInitData.cpp @@ -7,6 +7,10 @@ #include <WarpX_f.H> #include <WarpXWrappers.h> +#ifdef BL_USE_SENSEI_INSITU +#include <AMReX_AmrMeshInSituBridge.H> +#endif + using namespace amrex; void @@ -43,14 +47,31 @@ 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); + 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()) { - if (plot_int > 0) { + if (plot_int > 0) WritePlotFile(); - } - if (check_int > 0) { - WriteCheckPointFile(); - } + + if (check_int > 0) + WriteCheckPointFile(); + + if ((insitu_int > 0) && (insitu_start == 0)) + UpdateInSitu(); } } |