123 BL_PROFILE(
"ERF::WriteBndryPlanes::write_planes");
130 const std::string chkname =
131 m_filename + Concatenate(
"/bndry_output", t_step);
135 const std::string level_prefix =
"Level_";
136 PreBuildDirectorHierarchy(chkname, level_prefix, 1,
true);
141 DistributionMapping dm{ba};
144 Box target_box_shifted(IntVect(0,0,0),new_hi);
145 BoxArray ba_shifted(target_box_shifted);
150 std::string filename = MultiFabFileFullPrefix(
bndry_lev, chkname, level_prefix, var_name);
153 if (var_name ==
"velocity") {
154 ncomp = AMREX_SPACEDIM;
163 if (var_name ==
"density")
167 }
else if (var_name ==
"temperature") {
169 MultiFab Temp(S.boxArray(),S.DistributionMap(),ncomp,0);
170 for (MFIter mfi(Temp, TilingIfNotGPU()); mfi.isValid(); ++mfi)
172 const Box& bx = mfi.tilebox();
179 bndry.copyFrom(Temp, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
180 }
else if (var_name ==
"scalar") {
182 MultiFab Temp(S.boxArray(),S.DistributionMap(),ncomp,0);
183 for (MFIter mfi(Temp, TilingIfNotGPU()); mfi.isValid(); ++mfi)
185 const Box& bx = mfi.tilebox();
188 bndry.copyFrom(Temp, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
190 }
else if (var_name ==
"ke") {
192 MultiFab Temp(S.boxArray(),S.DistributionMap(),ncomp,0);
193 for (MFIter mfi(Temp, TilingIfNotGPU()); mfi.isValid(); ++mfi)
195 const Box& bx = mfi.tilebox();
198 bndry.copyFrom(Temp, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
199 }
else if (var_name ==
"qv") {
201 MultiFab Temp(S.boxArray(),S.DistributionMap(),ncomp,0);
202 for (MFIter mfi(Temp, TilingIfNotGPU()); mfi.isValid(); ++mfi)
204 const Box& bx = mfi.tilebox();
207 bndry.copyFrom(Temp, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
209 }
else if (var_name ==
"qc") {
211 MultiFab Temp(S.boxArray(),S.DistributionMap(),ncomp,0);
212 for (MFIter mfi(Temp, TilingIfNotGPU()); mfi.isValid(); ++mfi)
214 const Box& bx = mfi.tilebox();
217 bndry.copyFrom(Temp, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
219 }
else if (var_name ==
"velocity") {
220 MultiFab Vel(S.boxArray(), S.DistributionMap(), 3,
m_out_rad);
221 average_face_to_cellcenter(Vel,0,Array<const MultiFab*,3>{&
xvel,&
yvel,&
zvel});
222 bndry.copyFrom(Vel, nghost, 0, 0, ncomp,
m_geom[
bndry_lev].periodicity());
225 Error(
"Don't know how to output this variable");
228 for (OrientationIter oit; oit !=
nullptr; ++oit) {
230 if (ori.coordDir() < 2) {
231 std::string facename = Concatenate(filename +
'_', ori, 1);
232 br_shift(oit, bndry, bndry_shifted);
233 bndry_shifted[ori].write(facename);
240 if (ParallelDescriptor::IOProcessor()) {
241 std::ofstream oftime(
m_time_file, std::ios::out | std::ios::app);
242 oftime << t_step <<
' ' << time <<
'\n';
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:43
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
void br_shift(OrientationIter oit, const BndryRegister &b1, BndryRegister &b2)
Definition: ERF_WriteBndryPlanes.cpp:18
const int m_out_rad
Definition: ERF_WriteBndryPlanes.H:51
const int m_extent_rad
Definition: ERF_WriteBndryPlanes.H:52
const int m_in_rad
controls extents on native bndry output
Definition: ERF_WriteBndryPlanes.H:50
@ xvel
Definition: ERF_IndexDefines.H:130
@ cons
Definition: ERF_IndexDefines.H:129
@ zvel
Definition: ERF_IndexDefines.H:132
@ yvel
Definition: ERF_IndexDefines.H:131
void erf_derrhodivide(const Box &bx, FArrayBox &derfab, const FArrayBox &datfab, const int scalar_index)
Definition: ERF_Derive.cpp:18
void erf_dertemp(const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const Geometry &, Real, const int *, const int)
Definition: ERF_Derive.cpp:91
void erf_dermoisttemp(const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const Geometry &, Real, const int *, const int)
Definition: ERF_Derive.cpp:113