In case an interpolated cell, which should be positive, is zero or negative,
and the sum of derivatives is zero as well, the correction of
derivatives can enter into an infinite loop. It shouldn't normally
happen, since such a situation is unphysical.
Avoid the infinite loop and print a warning about encountered problems.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Unphysical cells can appear due to various reasons, e.g conservative to
primitive variable conversion in recently created block after mesh
refinements. Such unphysical cells can be immediately propagated to
neighbor blocks through boundary update, blocks which have not been
marked as recently updated. In such situation, the unphysical cells are
not corrected in these neighbors.
This change fixes this by marking all neighbors of blocks created in the
mesh update to be verified for unphysical cells too.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
File 'makedeps' is now generated automatically if it does not exist or
any of source files has been modified.
Improve the cleaning of compilation files. Only files created during the
compilation are removed. Also if the OBJDIR is empty, it is removed as
well.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Get rid of 'grep' and use only 'awk', 'sort' and 'uniq'. All should be
available in any linux system.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we increase the number of MPI processes during the restart, the seed
values are read from the last available restart file. Therefore, if we
have completely random seed numbers, the extra processes will have the
same seed value.
Detect this case and generate new random seeds if necessary.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The array of seed numbers makes sense only when OpenMP is used. With
MPI on, the length of seed vector on each MPI process is equal to the
number of OpenMP threads. For no OpenMP, only one seed number per MPI
process is used.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The shrink parameter is an integer factor which is the power of 2 in the
range from 1 to the minimum dimension of the block size. For example, if
shrink = 2 than the output array will be halfed in each direction.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The condition for taking the surrounding region was supposed to be based
on the number of physical cells available. Unfortunately, the counter
for unphysical cell was checked instead. Fix it.
Also increase the maximum region to four cells away.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>