aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2022-06-24 00:20:19 -0700
committerGravatar GitHub <noreply@github.com> 2022-06-24 00:20:19 -0700
commitf8cf3bc6276aab1d66b32a383c2021592676d69d (patch)
tree923cac9f50a5d227785dfa7e2547159571b905bf /Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
parent6be401a3c7322e64efc91a89bf9644bca83f2db9 (diff)
downloadWarpX-f8cf3bc6276aab1d66b32a383c2021592676d69d.tar.gz
WarpX-f8cf3bc6276aab1d66b32a383c2021592676d69d.tar.zst
WarpX-f8cf3bc6276aab1d66b32a383c2021592676d69d.zip
Added `none` as an option for fields_to_plot (#2419)
* Added `none` as an option for fields_to_plot * Added CI test case * Further updates, for picmi and CI tests * Skip the call to amrex::WriteMultiLevelPlotfile when writing no fields * Now clears m_varnames_fields * Don't allocate m_mf_output if no varnames * Updated WarpX-tests.ini
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
index 4655128d5..513d97f3a 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
@@ -71,15 +71,17 @@ FlushFormatPlotfile::WriteToFile (
VisMF::Header::Version current_version = VisMF::GetHeaderVersion();
VisMF::SetHeaderVersion(amrex::VisMF::Header::Version_v1);
if (plot_raw_fields) rfs.emplace_back("raw_fields");
- amrex::WriteMultiLevelPlotfile(filename, nlev,
- amrex::GetVecOfConstPtrs(mf),
- varnames, geom,
- static_cast<Real>(time), iteration, warpx.refRatio(),
- "HyperCLaw-V1.1",
- "Level_",
- "Cell",
- rfs
- );
+ if (varnames.size() > 0) {
+ amrex::WriteMultiLevelPlotfile(filename, nlev,
+ amrex::GetVecOfConstPtrs(mf),
+ varnames, geom,
+ static_cast<Real>(time), iteration, warpx.refRatio(),
+ "HyperCLaw-V1.1",
+ "Level_",
+ "Cell",
+ rfs
+ );
+ }
WriteAllRawFields(plot_raw_fields, nlev, filename, plot_raw_fields_guards);