diff options
author | 2022-06-24 00:20:19 -0700 | |
---|---|---|
committer | 2022-06-24 00:20:19 -0700 | |
commit | f8cf3bc6276aab1d66b32a383c2021592676d69d (patch) | |
tree | 923cac9f50a5d227785dfa7e2547159571b905bf /Source/Diagnostics/FullDiagnostics.cpp | |
parent | 6be401a3c7322e64efc91a89bf9644bca83f2db9 (diff) | |
download | WarpX-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/FullDiagnostics.cpp')
-rw-r--r-- | Source/Diagnostics/FullDiagnostics.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Diagnostics/FullDiagnostics.cpp b/Source/Diagnostics/FullDiagnostics.cpp index cb51301ee..5fb9abbcb 100644 --- a/Source/Diagnostics/FullDiagnostics.cpp +++ b/Source/Diagnostics/FullDiagnostics.cpp @@ -541,7 +541,10 @@ FullDiagnostics::InitializeBufferData (int i_buffer, int lev ) { // Allocate output MultiFab for diagnostics. The data will be stored at cell-centers. int ngrow = (m_format == "sensei" || m_format == "ascent") ? 1 : 0; // The zero is hard-coded since the number of output buffers = 1 for FullDiagnostics - m_mf_output[i_buffer][lev] = amrex::MultiFab(ba, dmap, static_cast<int>(m_varnames.size()), ngrow); + int const ncomp = static_cast<int>(m_varnames.size()); + if (ncomp > 0) { + m_mf_output[i_buffer][lev] = amrex::MultiFab(ba, dmap, ncomp, ngrow); + } if (lev == 0) { |