If the job was restart with different maxlev, then
initialize_coordinates() has to know about it, so it generate
appropriate coordinates.
Read maxlev from the restart snapshot, if the job was restarted, and set
toplev as the maximum value between the previous and current maxlev.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we run a job from a restart snapshot and modify some of the
parameters in the parameter file, this could lead to problems. Some
parameters, like the set of equations, equation of state, or block
dimensions, simply cannot be modified. Therefore, any such parameter,
modifies in the parameter file, should be overwritten with the value
from the restart snapshot. The purpose of these subroutines is to read
these parameters from restart snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
These factors aren't necessary, since the block coordinate is calculate
with respecto the all blocks at given level. Therefore, even if we
change the maximum refinement level during job restart, these coordinate
do not change.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we restart a job from a run with different maximum refinement level,
toplev parameter is set from a restart file and coordinate variables are
recreated. Setting toplev to maxlev all the time fails in recreating
correct coordinate variables and results in crashes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This change allows the code to be compiled with the PGI compilers, and
at the same time does not affect the compilation with the GNU compilers.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Give more control over the unphysical cell correction by allowing to
specify the minimum number of physical cells to perform averaging
(parameter "npavg") and the maximum distance to be considered from the
corrected cell (parameter "ngavg").
These two parameters allow to avoid averaging of extended unphysical
regions from two physical points.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If there are no enough physical neighbors, the cell cannot be corrected
and the code simply stops. Allow the code to continue the execution in
such a case by simply correcting the unphysical cells by replacing the
negative values of positive variables with a lower bounds, dmin and
pmin, for density and pressure, respectively.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>