Skip to content

Why a std::array of MultiFabs instead of a single MultiFab with ncomp=2 in Electrostatic PIC tutorial? #2488

Answered by atmyers
n8xm asked this question in Q&A
Discussion options

You must be logged in to vote

In that particular example, the electric field could be stored in a multi-component Multifab as you suggest, and the code would likely be a cleaner, because all the components of E have the same nodal centering. However, if you have a case where the different components might have different staggering, like on a Yee grid, then you need to store then as separate Multifabs. I think I was probably starting from a more general code that had (or could potentially have based on runtime options) staggered E fields.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by n8xm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants