Closed nicolasaunai closed 4 years ago
Actually, the problem is only for moments...
it could be possible, since we have the field in the coarsening operator, to check with its name if it's a moment and then we'd have to look wether a fine ghost node appears in the fine indexes to coarsen and then skip the ghost and take only 1 fine node, as said above...
but this seems complicated. I'm investigating instead another method that consists in not placing a NaN on the first ghost node, but copying the first physical index there...
this way no NaNs anymore when coarsening...
This issue concerns the coarsening of moments only. Moments are defined on primal nodes.
At refinement ratio 2 a coarse grid node needs 3 fine nodes, the one on top, and the two next to it on the left and right side, with coefs 0.5, 0.25 0.25.
the problem is that for the coarse nod that falls on top of the fine patch border node, that node needs the first fine primal ghost... which is currently set to NaN.
as a result, many coarse node (all those falling on top of a fine border node) will have NaNs, which is bad.
Several options:
do not set nan on the first primal moment node. But that requires more ghost particles than we have now so that this node gets a complete deposit of moments. This could be costly (more particle communications, more deposits, more pushing...)
have a special condition for coarse nodes that fall onto fine patch borders when coarsening and make them use only the fine node on top.
second option seems easier even if introducing a special case...
second option variant could use the fine node on top AND the one inside, but the dissymmetry is weird.