diff --git a/src_common/ComputeAverages.cpp b/src_common/ComputeAverages.cpp index 34791dcc..2b474cc5 100644 --- a/src_common/ComputeAverages.cpp +++ b/src_common/ComputeAverages.cpp @@ -95,8 +95,12 @@ void WriteHorizontalAverage(const MultiFab& mf_in, const int& dir, const int& in void WriteHorizontalAverageToMF(const MultiFab& mf_in, MultiFab& mf_out, const int& dir, const int& incomp, - const int& ncomp) + const int& ncomp, int outcomp) { + if (outcomp == -1) { + outcomp = incomp; // default outcomp is incomp unless specified + } + // number of points in the averaging direction int npts = n_cells[dir]; @@ -166,7 +170,7 @@ void WriteHorizontalAverageToMF(const MultiFab& mf_in, MultiFab& mf_out, const Array4 mf = mf_out.array(mfi); for (auto n=0; n0) nplot += nspec_surfcov*6; } - + + if (plot_deltaY_dir != -1) { + nplot += nspecies; + } + amrex::BoxArray ba = cuMeans.boxArray(); amrex::DistributionMapping dmap = cuMeans.DistributionMap(); @@ -257,6 +261,16 @@ void WritePlotFileStag(int step, } } + if (plot_deltaY_dir != -1) { + MultiFab Ybar(ba, dmap, nspecies, 0); + // Yk is component 6: in prim + WriteHorizontalAverageToMF(prim,Ybar,plot_deltaY_dir,6,nspecies,0); + Ybar.mult(-1.); + amrex::MultiFab::Add(Ybar,prim,6,0,nspecies,0); + amrex::MultiFab::Copy(plotfile,Ybar,0,cnt,nspecies,0); + cnt+= nspecies; + } + // Set variable names cnt = 0; @@ -445,6 +459,14 @@ void WritePlotFileStag(int step, } + if (plot_deltaY_dir != 1) { + x = "deltaYk_"; + for (i=0; i