Write more than three fields in PlotfileToTurb #3775
Replies: 3 comments 3 replies
-
The code shown above extends the original data by assuming the domain is periodic in x and y directions. It does one component at a time with a loop |
Beta Was this translation helpful? Give feedback.
-
Thanks @WeiqunZhang for looking into this. I want to map the scalar along with the velocities at the inlet. I modified I have difficultly in understanding what Extend(xfab, TMP[0], domain) does and whether this should be modified as we increase the number of variables to map. this is the code for extend tbx.setBig(0, domain.bigEnd(0) + 3); const int ygrow = BL_SPACEDIM==3 ? 3 : 1; tbx.setBig(1, domain.bigEnd(1) + ygrow); xfab.resize(tbx,1); xfab.copy(vfab); I am not sure how do we decide the arguments of shift and what is this shift doing? Additionally, I was under the assumption that this utilitiy assumes the flow to be periodic in z. Do we also need the flow to be periodic in x and y? |
Beta Was this translation helpful? Give feedback.
-
Thank you @drummerdoc and @WeiqunZhang for explaining this. |
Beta Was this translation helpful? Give feedback.
-
Currently PlotfileToTurb.cpp writes three fields, I am looking to extend it to write more fields. I have difficulty in understanding the following code snippet. How do we decide the shift in vfab and what the index in vfab correspond to?
`static
void
Extend (FArrayBox& xfab,
FArrayBox& vfab,
const Box& domain)
{
Box tbx = vfab.box();
tbx.setBig(0, domain.bigEnd(0) + 3);
const int ygrow = BL_SPACEDIM==3 ? 3 : 1;
tbx.setBig(1, domain.bigEnd(1) + ygrow);
xfab.resize(tbx,1);
xfab.copy(vfab);
vfab.shift(0, domain.length(0));
xfab.copy(vfab);
vfab.shift(1, domain.length(1));
xfab.copy(vfab);
vfab.shift(0, -domain.length(0));
xfab.copy(vfab);
}`
My understanding is that the codes reads field names[d] from the pltfile and copies that to xfab. I can add more fields in names[d] and adjust the loop counter to loop over the new fields. But looks like that is not sufficient. Could you please suggest what other changes will be needed to accomplish this? I also note that the code fails when using more than one mpi rank? Is this meant to run in serial only?
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions