161 Commits

Author SHA1 Message Date
1b3eb9c933 BLOCKS: Nullify new neighbor fields in deallocate_metablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-07-05 13:50:48 -03:00
5262f29e3a BLOCKS: Nullify new neighbor fields in allocate_metablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-07-05 13:45:55 -03:00
37d3fd0d87 BLOCKS: Add face, edge and corner neighbor fields to meta block structure.
This commit extends the meta block structure by fields in which we store
pointers to face, edge and corner neighbors.

In the current implementation the boundary update is only done for block
faces, meaning that the corners are not properly updated between the blocks
on different levels. This, of course, can create unexpected problems,
like improper interpolation in the ghost zones, resulting in NaNs there.

The fields for neighbor pointers should allow for a quick access to neighbors
for full, properly done, boundary update.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-07-05 13:22:16 -03:00
c3d456e5b5 BLOCKS: Fix metablock_set_leaf() and metablock_unset_leaf().
Update the leaf state and counter nleafs in metablock_set_leaf() and
metablock_unset_leaf() only if they really change the state.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 15:28:25 -03:00
2b27685b41 BLOCKS: Update the number of leafs in remove_metablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 15:23:36 -03:00
2093a206bb BLOCKS: Move mblocks update to append_metablock(), remove_metablock(), etc.
Similarily to dblocks, mblocks should count the number of allocated meta
block which are stored in the meta block list, therefore it should be
updated in append_metablock(), remove_metablock(), insert_metablock_*(),
etc.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 15:17:41 -03:00
d38e543a82 BLOCKS: Move dblocks update to append_datablock() and remove_datablock().
The data block counter dblocks shouldn't be update in
allocate_datablock() and deallocate_datablock(), since these subroutines
can be used to allocate temporary data blocks. Instead, the counter
dblocks should count only allocated data blocks which are stored in the
list_data data block list.

Therefore, move the update of dblocks to append_datablock() and
remove_datablock().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 15:09:28 -03:00
471e8a690a BLOCKS: Add timer for neighbor consistency check.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-28 10:50:41 -03:00
c1d1d54b42 BLOCKS: Rewrite and micro optimize iterate_over_neighbors().
We prepare a set of indices for all faces in the block.  Those indices
point to edges and corners for each face, and are set one during the
first execution.  Then, we simply iterate over faces and call
iterate_over_face() in order to apply subroutine pprocedure to edges and
corners connected to a given face.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-28 10:43:37 -03:00
e06a7edfdd BLOCKS: Check neighbor consistency if DEBUG=Y.
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>
2014-04-27 21:00:08 -03:00
9edf7111b5 BLOCKS: Iterate over corners from all edges in 2D iterate_over_neighbors().
In 2D case, if we update corners using only X-edge neighbors, we get
some rare problems with symmetry.  If we additionally use Y-edge
neighbors, to update corners, those problems disappear.  This should be
additionally tested for both, 2D and 3D cases.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-25 12:45:00 -03:00
75eb97125e BLOCKS, MESH, IO: Fix restart with less processes.
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>
2014-04-23 17:33:44 -03:00
4bbd84147f BLOCKS: Rewrite neighbor selection for refinement.
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>
2014-02-07 10:25:53 -02:00
0cd8abb47c BLOCKS: Clean up comments in refine_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-29 15:51:28 -02:00
2d4f4eac5b BLOCKS: Prepare arrays order, config, and set once in refine_block().
Those arrays are prepared only at the first execution and then stored in
memory, therefore there is no need to preparing them each time
refine_block() is called. This removes also one 'select which' condition
check.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-29 15:48:32 -02:00
c2656c9b6a BLOCKS: Field %coords mean global coordinates at the block level.
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>
2014-01-29 14:00:42 -02:00
fa6ca28885 BLOCKS: All real variables should be double precision.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-29 13:36:44 -02:00
bd53c20597 BLOCKS: Mark blocks and neighbors for update when (de)refining.
This patch marks all refined or derefined blocks to be updated. All
their face, edge, and corner neighbors are marked for update as well, in
order to keep the boundary consistency.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-23 10:34:42 -02:00
823b958c72 BLOCKS: Add set_blocks_update().
This subroutine marks or unmarks all blocks on the meta block list to be
updated depending on the input argument.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 20:20:44 -02:00
63cc647747 BLOCKS: Add subroutines to mark and unmark block update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 19:27:14 -02:00
d182934fcf BLOCKS: Rename meta block field %cpu to %process.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 19:20:41 -02:00
aaccd7fff0 BLOCKS: Rename meta block field %coord to %coords.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 19:09:30 -02:00
1956fecad2 BLOCKS: Rename meta block field %config to %conf.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 19:06:31 -02:00
3ec7bdf232 BLOCKS, MESH: Remove checking the meta block structure.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 19:01:41 -02:00
a695f90dd7 BLOCKS: Rewrite metablock_(un)set_leaf().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:58:47 -02:00
d95d4354cc BLOCKS: Rewrite metablock_set_bounds().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:52:00 -02:00
4d0b3c007b BLOCKS: Rename and rewrite metablock_set_coordinates().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:48:36 -02:00
88c6a0f1a6 BLOCKS: Rewrite metablock_set_position().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:43:53 -02:00
ee9595ffe6 BLOCKS: Rename and rewrite metablock_set_refinement().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:40:48 -02:00
afc2407881 BLOCKS: Rename and rewrite metablock_set_configuration().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:34:49 -02:00
7f16adaf48 BLOCKS: Change metablock_set_* subroutines order.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:27:37 -02:00
94f4dfcc5b BLOCKS: Rewrite metablock_set_level().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:23:15 -02:00
243475ee46 BLOCKS: Rename metablock_set_cpu() to metablock_set_process().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:18:07 -02:00
4ec6184026 BLOCKS: Rewrite subroutine metablock_set_id().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:13:06 -02:00
086cef9b6d BLOCKS: Move metablock_* subroutines to public section.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:07:36 -02:00
759fe27e78 BLOCKS: Rewrite function increase_id().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 18:04:01 -02:00
b2dbb01cd8 BLOCKS: Rename datablock_set_dims() to set_block_dimensions().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 17:58:28 -02:00
17b7286345 BLOCKS: Rewrite set/get_last_id(), get_mblocks(), etc.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-16 17:51:03 -02:00
81cd8ccb35 BLOCKS: Move set/get_last_id(), get_mblocks(), get_dblocks().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 17:20:01 -02:00
9c7715bd21 BLOCKS: Use metablock_set_config() in refine_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 17:15:16 -02:00
e63697ff43 BLOCKS: Rewrite derefine_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 17:09:16 -02:00
ff70d00833 BLOCKS: Rewrite significantly subroutine refine_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 16:56:47 -02:00
14109e483b BLOCKS: Move public definitions of (de)refine_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 14:50:36 -02:00
951594d4cb BLOCKS: Move (de)refine_block() to public subroutine section.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 14:49:19 -02:00
cce39b5c1c BLOCKS: Add insert_metablock_after/before().
Those two subroutines insert a new meta block after or before the block
which is provided by additional pointer.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 14:13:31 -02:00
cc7fb022c0 BLOCKS: Move subroutines (un)link_blocks().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 12:08:24 -02:00
e9e2f6919f BLOCKS: Rewrite subroutines (de)allocate_datablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 12:04:12 -02:00
0ac1f8f2b9 BLOCKS: Add (de)allocate_metablock() to public list.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 11:52:40 -02:00
6f9c267d55 BLOCKS: Rewrite allocate_metablock() and deallocate_metablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 11:50:48 -02:00
242abc4ea3 BLOCKS: Rewrite append_datablock() and remove_datablock().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-01-15 11:27:03 -02:00