Replies: 3 comments 2 replies
-
I have several remarks. When discussing boundaries, please refer to Xmin, Xmax, Ymin, Ymax and so on for clarity because high and low i s ambiguous. There are the same number of ghost cells in each direction and for all patches. That number is the When dealing with field exchange you can not just give a cell number because it is ambiguous as well. You need to consider grid points because, as you noticed, quantities are either primal or dual and are not treated equally. You also have to remember that ghost cells overlap the real cells of the neighbour and not each other. Meaning that with |
Beta Was this translation helpful? Give feedback.
-
Very nice illustration. This would indeed be much easier if I could draw on a blackboard. First I should start by saying that communications are usually minimized in the sense that only necessary information is exchanged. Anything that can be retrieved by mere computation is not exchanged. That explains why less points are exchanged for fields but one more has to be exchanged for currents. Have a look at which grid points can be influenced by a particle of a another patch (currents) and which grid points can not be updated by the local patch solver (fields). These are the points that need information from outside.
|
Beta Was this translation helpful? Give feedback.
-
Anyone else who could chime in on this? |
Beta Was this translation helpful? Give feedback.
-
This discussion was initiated on the chat by psalz:
I have a bit of a technical question regarding the implementation of the stencil: It is my understanding that each patch has some ghost cells in each dimension that contain data from the neighboring patches. On the "low" side in each dimension there's 2 ghost cells, and on the "high" side there's 2 + 1 + isDual(D). However, when looking at the code for exchanging those values (https://github.com/SmileiPIC/Smilei/blob/d8e1d8595693c1633ab737bb8e0c5364d8f0a1a8/src/Patch/SyncVectorPatch.cpp#L1551-L1564), only oversize (=2) cells are exchanged in each dimension. For the "low" side that is fine, but on the "high" side, only the last two cells are exchanged, i.e., in a field of size N, cells N-1 and N-2. This means that cells N-3 (and if isDual(D), N-4) are NOT exchanged. I looked at the values in a couple of patches and it seems like this works out fine between inner boundaries (N-3 and N-4 still contain the correct values of the neighboring patch), but it doesn't for wrapping around to the other side of the domain when using periodic boundary conditions. In other words, when using periodic boundary conditions, cells 2 and 3 in the first patch do NOT contain the same values as cells N-4 and N-3 of the last patch on the other side of the domain. I tried changing this to do the full oversize + 1 + isDual(D) exchange, which then results in a point-wise error in field values in the order of ~10^-6 and an error in the order of ~10^-4 for Utot, Uelm and Ukin. Could you maybe shed some light on what is going on here?
Beta Was this translation helpful? Give feedback.
All reactions