From f8cf3bc6276aab1d66b32a383c2021592676d69d Mon Sep 17 00:00:00 2001 From: David Grote Date: Fri, 24 Jun 2022 00:20:19 -0700 Subject: 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 --- .../Diagnostics/FlushFormats/FlushFormatPlotfile.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp') 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(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(time), iteration, warpx.refRatio(), + "HyperCLaw-V1.1", + "Level_", + "Cell", + rfs + ); + } WriteAllRawFields(plot_raw_fields, nlev, filename, plot_raw_fields_guards); -- cgit v1.2.3