194 Commits

Author SHA1 Message Date
Grzegorz Kowal
202ace1438 Add a few helper subroutines to set different block fields.
MESH STRUCTURE

 - add subroutines metablock_setleaf(), metablock_unsetleaf() to set and
   unset the leaf flag of a meta block
 - add subroutine metablock_setconfig() to set the config of a block
 - add subroutine metablock_setlevel() to set the refinement level of a
   block
2009-09-10 18:15:30 -03:00
Grzegorz Kowal
a3cd1e38a7 Store data from a list of data blocks.
DATA I/O

 - instead of blocks from old list, store data from a list of data
   blocks
2009-09-10 17:59:51 -03:00
Grzegorz Kowal
df071923c9 Add subroutine to associate meta and data blocks and to set bounds.
MESH STRUCTURE

 - add subroutine associate_blocks() to associate a pair of meta and
   data blocks
 - add subroutine datablock_setbounds() to set the geometry bounds for a
   given block
2009-09-10 17:46:36 -03:00
Grzegorz Kowal
10cef69f0c Add subroutines to allocate meta and data blocks.
MESH STRUCTURE

 - add subroutines allocate_metablock() and allocate_datablock()
   allocating new meta and data blocks in memory
 - add subroutines append_metablock() and append_datablock() appending
   the allocated block to the meta and data block lists
 - create root meta and data blocks in domain_default()
 - create two new pointers last_meta nad last_data pointing to the last
   blocks in the meta and data block lists
2009-09-10 17:25:28 -03:00
Grzegorz Kowal
a7a71c3c53 Add initialization and termination of the meta and data blocks.
MESH STRUCTURE

 - initialize meta and data block lists in init_blocks()
 - deallocate and nullify meta and data block lists in clear_blocks()
 - new subtourine deallocate_metablock() for meta block deallocation
 - new subroutine deallocate_datablock() for data block deallocation
2009-09-10 16:18:59 -03:00
Grzegorz Kowal
95f4a2a3ad Create new structures for block meta and data info.
MESH STRUCTURE

 - two types of structures are created:
     block_meta - structure storing metadata of each block
     block_data - structure storing geometry and variable information

 - two lists corresponding to stored objects of block_meta and
   block_data:
     list_meta - the list of objects of block_meta type is shared and
                 synchronized between processors
     list_data - the list of objects of block_data type is private for
                 each processors

 - corresponding pointers to both structures are created too
2009-09-09 16:49:28 -03:00
Grzegorz Kowal
66b3cfc176 Extend bounds for criterion calculation and remove junk.
REFINEMENT

 - move the bounds for the criterion calculation by one cell out of the
   domain, so we catch the refinement before it gradients enter the
   block

MAINTANCE

 - remove junk code from the update_mesh subroutine
2009-09-09 14:21:46 -03:00
Grzegorz Kowal
0f34a18cf6 Calculate number of blocks more precisely. 2009-08-22 13:51:40 -03:00
Grzegorz Kowal
3c74c9a8ea More work on the block refinement.
The initial block mesh refinement seems to be optimized now. However,
more work in the MPI version is required, e.g. refine blocks on all CPUs
until the number of blocks exceeds some number dependent on the number
of CPUs. From that point refine independently on each CPU.

The initial work on the mesh update has been done too, but the processes
do not exchange block information.
2009-05-18 22:46:19 +02:00
Grzegorz Kowal
1b718dea86 Selecting blocks for refinement/derefinement with MPI.
This next approach to select blocks for refinement/derefinement with MPI
seems to be working. Moreover, it is simple and efficient, however,
there might be still some room for improvements.
2009-01-08 00:08:52 -06:00
Grzegorz Kowal
c216adb422 First approach to implement MPI refinement.
It seems to be pretty complex. So far I collect blocks selected for
refinement which have neighbors laying on other processors. Using this I
set the neighbors from other processors for refinement if required. The
remaining things are the neighbors update after refinement and MPI
version of derefinement.
2009-01-03 22:49:04 -06:00
Grzegorz Kowal
c686e301fc Fix boundary update and reduce the next time step over all CPUs.
The boundary conditions finally works when using MPI with arbitrary
number of processors. This is however a dirty hack. Has to be done in a
better way later, since now it may be very tricky to generalize the code
to 3D.

The next time step should be reduced to the minimum value over all
processes. This has been added in subroutine 'evolution' now.

The block structure contains a new field %pos which specifies the
position of the child block in its parent.
2009-01-02 20:18:57 -06:00
Grzegorz Kowal
53d1a2e23d A bit better approach to update boundaries with MPI.
In this version first we determine the number of blocks to exchange for
each process, then we update this across all processes. Using this
information we send the IDs and level of blocks and their data to the
neighboring processes.
2009-01-01 23:17:49 -06:00
Grzegorz Kowal
240f63d7b1 Reorganize and optimize block exchange in boundary update.
In this version we send each block only once. This block is used to
update boundaries of all neighbors. We use three communications between
each block: the number of blocks to send, the IDs and levels of blocks
which are send, and the %u field of all blocks which are send packed as
one big buffer 'rbuf'.
2008-12-31 16:07:23 -06:00
Grzegorz Kowal
3f6321cfe0 Add initial velocity configuration for binaries problem. 2008-12-31 12:57:31 -06:00
Grzegorz Kowal
6c620a97cf Implement boundary block exchange between processes.
Now, in the boundary subroutine we collect information about the blocks
which neighbors lay on a different processor. Using this information we
send neighboring blocks and update the block boundaries. This is the
initial implementation, not very well optimized and containg some bugs.
2008-12-31 12:02:36 -06:00
Grzegorz Kowal
398ffd385c Prepare subroutine 'boundary' in order to support MPI.
There are several conditions for the boundaries. If the neighbor block
is on the same processor do as usuall. If it lays on a different
processor, prepare it for exchange. After echanging blocks we need to
perform similar update as it would lay on the same processor, i.e. we
need to perform copying, restriction, or prolongation.
2008-12-29 07:36:06 -06:00
Grzegorz Kowal
90182faf2b Merge branch 'mpi' of /home/kowal/Web/godunov-amr into mpi 2008-12-28 17:28:16 -06:00
Grzegorz Kowal
20837eb739 Divide the initial blocks between processes.
The blocks of initial mesh are now divided between all processes. The
procedure updates also the %cpu field of all neighbors according to the
number of process they are running at.

The subroutine 'deallocate_block' takes care about the plist pointer
now. It also allows for the flexible removal of any block, even from the
middle of the list by updating fields %next and %prev of the previous
and next blocks, respectively.

In addition, we now store the %cpu field of each block in the HDF5 files
too.
2008-12-28 13:09:14 -06:00
Grzegorz Kowal
82843c43f4 Add TODO about the way of refinement with MPI. 2008-12-23 11:46:26 -06:00
Grzegorz Kowal
a07f970b5d Add TODO about the way of refinement with MPI. 2008-12-22 16:15:27 -06:00
Grzegorz Kowal
2719b0b451 Merge branch 'master' into mpi
Conflicts:

	src/mesh.F90
2008-12-22 16:08:51 -06:00
Grzegorz Kowal
0626f616cb Add problem specific domain initialization.
The domain initialization is performed in the problem.F90 now. This will
allow a user to initialize his own domain according to the defined
problem. Since the initialization in problem-dependent we don't need the
subroutine allocate_blocks anymore.
2008-12-22 15:34:02 -06:00
Grzegorz Kowal
5601bd6081 Add printing info about the MPI enabled. 2008-12-22 15:09:05 -06:00
Grzegorz Kowal
1f581e9610 Add new module for MPI handling.
A new 'mpitools' module has been added. This module contains subroutines
to initialize, deinitialize and handle MPI communication. This initial
version can now initialize and deinitialize parallelization. It does not
support full parallelization yet.
2008-12-22 14:57:31 -06:00
Grzegorz Kowal
d67f05d650 Add a new module for MPI communication. 2008-12-19 17:33:29 -06:00
Grzegorz Kowal
e0213bcca5 Change type of the field 'child' to blockref. 2008-12-19 17:24:36 -06:00
Grzegorz Kowal
e5878fc459 Remove references to the field 'pneigh'.
Since we now only use the field 'neigh' we don't need pointers stored in
'pneigh' anymore.
2008-12-19 16:46:17 -06:00
Grzegorz Kowal
f64bbd7e5e Use field neigh to assign and refer to neighbors.
We use the field 'neigh' instead of the field 'pneigh'. The field
'neigh' is of the type of 'blockref' which simplifies the reference to
the neighbors blocks when using MPI. Each reference contains two fields:
cpu and id. In MPI version we cannot use pointers stored in pneigh, but
using blockref structures we can refer to the blocks belonging to other
processors.
2008-12-19 16:36:07 -06:00
Grzegorz Kowal
c977c610ff Introduce new type of block reference by cpu and id.
The new type 'blockref' is a reference to a block by two integer
numbers, the first points to the cpu that block is running, and the
second one is the block identificator.
2008-12-19 00:19:44 -06:00
Grzegorz Kowal
1aa75ac2ef Change the leaf field of the block to be logical.
This change should speed up a bit the conditions, since it is faster
than the character comparisons.
2008-12-19 00:02:05 -06:00
Grzegorz Kowal
6fac1d38b2 Reorganization of the block subroutines.
Preparation of the block module for MPI support.
2008-12-18 23:47:58 -06:00
Grzegorz Kowal
a9c9cef27e Cosmetic changes to the block pointer type definition. 2008-12-18 22:51:08 -06:00
Grzegorz Kowal
1206194deb Add support for the shapes in the domain.
Now, we can define any shape for a given problem inside the domain,
which is not updated during the evolution. This allows for using the
sources of any kind in the problem studies, such as the colliding winds
in the binary stars.
2008-12-18 12:18:36 -06:00
Grzegorz Kowal
fe054b3caf Binary stars problem implemented.
I've implemented the problem of binary stars to study the colliding
winds.
2008-12-18 11:09:42 -06:00
Grzegorz Kowal
f5eb7d0fcf Restructured problem module to allow adding of more problems.
Now the subroutine init_problem call the initialization os selected
problem determined by the config parameter 'problem'. In this way we can
choose problem without recompiling the code.
2008-12-18 10:20:15 -06:00
Grzegorz Kowal
9b4abbd520 Added control of refinement/derefinement criterions.
Now we can control the levels of refinement/derefinement criterion from
the config file. The bounds of the domains are stored in the HDF5 files
from now.
2008-12-16 22:34:54 -06:00
Grzegorz Kowal
136fcb1daa Implemented open and reflective boundary conditions. 2008-12-16 19:56:07 -06:00
Grzegorz Kowal
96406e3f98 Store global attributes and coordinates.
Now we store global attributes like block dimensions and number of ghost
cells in the HDF5 output files. We store coordinates for each level as well.
2008-12-16 18:54:38 -06:00
Grzegorz Kowal
30bdd1cef9 HLLC solver implemented.
The HLLC solver is implemented now. It resolves contact discontinuities
properly. A small adjustment to the criterion has been done too.
2008-12-16 14:38:04 -06:00
Grzegorz Kowal
e56aee34c0 Play more with the refinements criterion. 2008-12-16 13:40:34 -06:00
Grzegorz Kowal
f673596f20 Refinement based on density. More cleanups. 2008-12-13 22:41:37 -06:00
Grzegorz Kowal
b39673bf85 Fixed generation of dx, dy, and dz.
The generation of dx, dy, dz for each level didn't include the base
grid, i.e. they were 2 times larger. Now it is fixed. Also plenty of
minor corrections in different places.
2008-12-13 21:05:51 -06:00
Grzegorz Kowal
505339c247 Write primitive variables instead of conservative.
Now we dump primitive variables in the HDF5 files.
2008-12-13 20:33:27 -06:00
Grzegorz Kowal
7bc74a39d9 Initial version of refinement/derefinement is working.
It looks like the refining and derefining work more or less, at least
without interrupting the execution. Nevertheless, there are still some
artifacts, like the lack of symmetry after some time or not efficient
derefining of the mesh. This could be cause by the solver, however.

The refinement criterion is computed using pressure now.
2008-12-13 15:08:18 -06:00
Grzegorz Kowal
00e688eb5c Block boundary update implemented.
Now all block update their boundary values from the neighboring blocks.
Blocks of the same level copy their values, but block of different
levels shrink or expand the boundary values from the neighbor,
depending on the level change. In order to complete this I've
implemented subroutines expand and interpolate in the interpolation
module.

By default the boundary conditions are set to periodic. So far only this
type of conditions is supported, but the other types should be easy to
implement.
2008-12-12 16:39:03 -06:00
Grzegorz Kowal
d77dc8079e A few bugs fixed. Some reorganization of dimension variables. 2008-12-09 22:28:29 -06:00
Grzegorz Kowal
be78017530 Initial mesh generation is periodic now.
Also, some fixes in the boundary code.
2008-12-09 21:42:01 -06:00
Grzegorz Kowal
71a602156a New time integration method EULER. 2008-12-09 21:06:21 -06:00
Grzegorz Kowal
247ecd1178 Added more helpful dimension indices. 2008-12-09 21:02:33 -06:00