The second part of update_mesh(), in which we update neighbor refinement
flags, has been moved to a new subroutine update_neighbor_refinement().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The first part of update_mesh(), where we check and update the
refinement flags, has been moved to a new private subroutine
check_data_block_refinement().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Add subroutines to iterate over all block neighbors and check if they
reference to correct meta blocks. The neighbor consistency check is
done after initial mesh generation and each time the mesh has been
updated.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The job restart with smaller number of processors than the number of
files didn't work well, since all metablocks of all remaining files
where set to the last process before actually reading the corresponding
data blocks. This resulted in a crash in redistribute_blocks() due to
pointer not associated.
The fix lets the meta blocks to be restored with the original process
numbers. While reading files with the indices larger than the index of
the last process, all meta blocks which corresponding data blocks are
stored in the read file, are set to the process number of the reading
process. After reading data blocks from each file, the blocks are
redistributed. However, only data blocks belonging to the active
processes are redistributed.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
In this patch we make a general subroutine iterating over all neighbors
iterate_over_neighbors() which takes as arguments a pointer to the block
which neighbors are evaluated and pointer to subroutine which should be
called with each neighbor. So far two such subroutines are used, one to
select the proper refinement flag, and another to select the neighbor
for update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we take the whole domain and divide it between blocks of the size
corresponding to the current lever, the field %coords identifies the
position of the current block in the domain.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Subroutine print_error() does not stop the execution anymore. This
should be controlled by the code.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The new version uses the minimum amount of memory (1 data block per
process) with a small sacrifice of the problem initialization speed.
This version fully supports 2D and 3D with and without MPI.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>