diff options
author | 2019-03-26 12:40:47 -0700 | |
---|---|---|
committer | 2019-03-26 12:40:47 -0700 | |
commit | eb5db0ebb4cdf6bf0599263fe86374c7e55ac42a (patch) | |
tree | e75d2fa8f36fb20095e96a763b94d77ff24430c2 /Source/Diagnostics/FieldIO.cpp | |
parent | 10737921e9f07705d5e4cffe0f66ebc18b0bc7f2 (diff) | |
download | WarpX-eb5db0ebb4cdf6bf0599263fe86374c7e55ac42a.tar.gz WarpX-eb5db0ebb4cdf6bf0599263fe86374c7e55ac42a.tar.zst WarpX-eb5db0ebb4cdf6bf0599263fe86374c7e55ac42a.zip |
Implement component
Diffstat (limited to 'Source/Diagnostics/FieldIO.cpp')
-rw-r--r-- | Source/Diagnostics/FieldIO.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Diagnostics/FieldIO.cpp b/Source/Diagnostics/FieldIO.cpp index 607ec248f..03754404b 100644 --- a/Source/Diagnostics/FieldIO.cpp +++ b/Source/Diagnostics/FieldIO.cpp @@ -353,7 +353,7 @@ WriteCoarseScalar( const std::string field_name, const std::string& filename, const std::string& level_prefix, const int lev, const bool plot_guards, - const int r_ratio, const Real* dx ) + const int r_ratio, const Real* dx, const int icomp ) { int ng = 0; if (plot_guards) ng = F_fp->nGrow(); @@ -363,7 +363,9 @@ WriteCoarseScalar( const std::string field_name, // filled with 0, with the same number of cells as the _fp field WriteZeroRawField( *F_fp, dm, filename, level_prefix, field_name+"_cp", lev, ng ); } else { - auto F = getInterpolatedScalar( *F_cp, *F_fp, dm, r_ratio, dx, ng ); + // Create an alias to the component `icomp` of F_cp + MultiFab F_comp(*F_cp, amrex::make_alias, 1, icomp); + auto F = getInterpolatedScalar( F_comp, *F_fp, dm, r_ratio, dx, ng ); WriteRawField( *F, dm, filename, level_prefix, field_name+"_cp", lev, plot_guards ); } } |