This PR drastically changes smear so that it only does one or two MPI reduction calls.
I added two lists of effective cells to keep track of things.
list_split: List of effective cell IDs that are split over multiple MPI ranks.
list_mydom(1,:): List of effective cell IDs that are partially covered by the domain.
list_mydom(2,:): ID within list_split if it is split over multiple MPI ranks. Set to 0 when it is not on list_split.
The first step sums up the conserved quantities (mass, momentum, energy, etc) over the effective cells. If only part of the effective cell is covered by the domain, the sum will only be a fraction of the total sum.
The second step reduces the summed up quantities over all MPI ranks.
The third step updates the local quantities by values averaged over the effective cell.
(For which=='hydro' only) Energy requires some amendments due to the change in density distribution, so is reduced and smeared at an additional step.
This PR drastically changes
smear
so that it only does one or two MPI reduction calls.I added two lists of effective cells to keep track of things.
list_split
: List of effective cell IDs that are split over multiple MPI ranks.list_mydom(1,:)
: List of effective cell IDs that are partially covered by the domain.list_mydom(2,:)
: ID withinlist_split
if it is split over multiple MPI ranks. Set to 0 when it is not onlist_split
.which=='hydro'
only) Energy requires some amendments due to the change in density distribution, so is reduced and smeared at an additional step.