124 Commits

Author SHA1 Message Date
Grzegorz Kowal
7cb4e2f352 INTERPOLATION: rename expand_tvd() to expand(). 2010-12-05 09:56:27 -02:00
Grzegorz Kowal
8fa4cdf4c7 MESH: use expand_tvd() in prolong_block(). 2010-12-05 09:46:16 -02:00
Grzegorz Kowal
523198433d MESH: remove part for FLUXCT. 2010-12-05 09:18:07 -02:00
Grzegorz Kowal
4eb6c1ab2b MESH: remove FIELDCD and FLUXCT parts. 2010-12-05 09:12:47 -02:00
Grzegorz Kowal
72d15710c7 MESH, GLM-MHD: prolongate proper variables during refinement.
- in subroutine prolong_block() prolongate the magnetic field
   components and scalar potential during the block refinements if the
   GLM-MHD equations are used;
2010-12-01 13:54:46 -02:00
Grzegorz Kowal
9e2f69c745 MESH, GLM-MHD: restrict proper variables during derefinement.
- in subroutine restrict_block() restrict the magnetic field components
   and scalar potential during the derefinement if GLM-MHD equations are
   used;
2010-12-01 13:45:54 -02:00
Grzegorz Kowal
226c2a3fe9 Move variable indices to new module 'variables'.
VARIABLES

 - create new module 'variables' which stores references to variable
   indices; we gonna store dofferent objects related to variables in
   this module;
2010-12-01 09:25:30 -02:00
Grzegorz Kowal
c72b862db4 Rename variable nblocks to mblocks.
BLOCK STRUCTURE

 - the global variable nblocks tells how many metablocks are allocated,
   thus its name is changed to mblocks;
 - remove unnecessary checking of the list allocation;
2010-12-01 09:23:03 -02:00
Grzegorz Kowal
aab8831bbf Update the copyright info and fix the length of separating lines. 2010-10-13 03:32:10 -03:00
Grzegorz Kowal
c182e08352 Set the initial coordinates and calculate them during the refinement. 2010-10-11 22:46:07 -03:00
Grzegorz Kowal
1d56dc6266 Rewrite the subroutine restrict_block(). 2010-09-19 11:49:21 +02:00
Grzegorz Kowal
d4e6f7d0ee Use a pointer to the data structure in prolong_block(). 2010-09-19 11:46:00 +02:00
Grzegorz Kowal
8ae2964b4f Do not allow for the derefinement in the lowest level. 2010-09-19 11:38:55 +02:00
Grzegorz Kowal
b6dc6095ac Make GNU compiler happy and fix indexing of emf. 2010-09-18 11:42:09 +02:00
Grzegorz Kowal
26e103ce86 Rewrite subroutine restrict_block.
MESH

 - subroutine restrict_block has been rewritten to use one big array for
   storage variables from all children and them restricting this array
   and putting resulted variables in a new data block;
2010-07-04 01:15:34 -03:00
Grzegorz Kowal
81c241a76a Remove argument ng from all restriction subroutines.
BOUNDARY CONDITIONS

 - remove the third argument from all calls of the subroutine shrink();

INTERPOLATION

 - remove ng argument from subroutines shrink() and shrink_1d();
 - small fixes to subroutine magtocen() in the divergence free
   correction calculation;

MESH

 - fix index calculation and remove the third argument from calling the
   subroutine shrink();
2010-03-22 02:17:44 -03:00
Grzegorz Kowal
aa1a0867bd Implement divergence-free reconstruction. Rewrite bnd_prol().
BOUNDARY CONDITIONS

 - rewrite subroutine bnd_prol() and use expand_mag() in it;

 - fix some index calculations in bnd_rest();

INTERPOLATION

 - implement new subroutine expand_mag() performing divergence-free
   prolongation of the staggered magnetic field;

 - implement divergence-free correction in interpolation of cell
   centered magnetic field in subroutine magtocen();

MESH

 - use new subroutine expand_mag() in block prolongation;
2010-03-21 11:54:54 -03:00
Grzegorz Kowal
6a2b6f6fbb Implement boundary conditions for staggered magnetic field.
BOUNDARY CONDITIONS

  - rewrite bnd_copy() so first the indices are prepared and then there
    is one call to fill out the destination array; include the lower
    index change for staggered magnetic field components;

  - in the subroutine bnd_rest() implement correct restriction of the
    staggered magnetic field components; take into account the change
    of the lower index;

  - in the subroutine bnd_prol() implement correct prolongation of the
    staggered magnetic field components; take into account the change of
    the lowe index;

  - by default use 2 ghost cell and the restriction and expansion to
    prevent errors resulting from interpolation;

CONFIGURATION

  - enforce a lower limit for number of ghost zones to 6 when MHD=Y and
    4 otherwise

INTERPOLATION

  - remove unnecessary interpolation methods

  - limit 'c' interpolation to the second order only

MESH

  - implement divergence-free prolongation and restriction for the
    staggered magnetic field components in the block refinement and
    derefinement
2010-03-08 19:09:49 -03:00
Grzegorz Kowal
88761c9622 Implement FLUXCT integration of the induction equation.
SCHEME

  - implement Flux-CT scheme for the staggered magnetic field
    integration;

BLOCK STRUCTURE

  - use more space efficient storage of the variables, which means
    storing only staggered components of magnetic field; cell-centered
    components are calculated only when necessary;

EVOLUTION

  - remove loops in the field updates; operations are performed on the
    arrays;

BOUNDARY CONDITIONS

  - remove loops in the bnd_copy; operations are calculated on the whole
    array now;

INTERPOLATION

  - subroutine magtocen() has been rewritten to avoid problems with the
    array allocation; now as an argument we enter the array of all
    variables; subroutine uses indices for the face-centered and
    cell-centered magnetic field components internally;

MAKE

  - add flag defining Flux-CT scheme;

PROBLEM

  - use predefined array variables instead of allocated;
2010-02-28 18:35:57 -03:00
Grzegorz Kowal
cab66e8fc3 Implement FIELD-CD scheme for magnetic field evolution. 2010-02-22 16:21:20 -03:00
Grzegorz Kowal
98849f3369 Prepare code for central differencing scheme for magnetic field. 2010-02-22 12:01:58 -03:00
Grzegorz Kowal
245c4aa52a Use the 1st order TVD prolongation. 2010-02-22 11:47:50 -03:00
Grzegorz Kowal
6b88835994 Update cell-centered magnetic field in prolongation/restriction.
MESH:

 After restriction/prolongation of the face-centered magnetic field we
need to interpolate also cell-centered field components.
2010-02-14 17:54:51 -02:00
Grzegorz Kowal
bbf998e4a0 Boundaries, interpolation, indices.
Rewritten boundaries allow for a proper handling boundaries between
blocks at different refinement levels. Prolongation and restriction of
the boundaries are improved now.

Rewritten interpolation for prolongation and restriction.

References to the variable indices are assigned more properly.
2010-02-11 23:30:46 -02:00
Grzegorz Kowal
dd8af20c86 Refine the first level if there is only one block.
MESH REFINEMENT, INITIAL GEOMETRY

 - if there is only one block and it is set not to be refined, refine it
   anyway to catch situations when the initial resolution is too small
   for the problem initiation
2009-09-29 16:17:10 -03:00
Grzegorz Kowal
35fb0cac4f There is no need for importing the block_data structure. 2009-09-29 15:37:31 -03:00
Grzegorz Kowal
671985874f Improve block prolongation and add support for 3D.
MESH STRUCTURE, REFINEMENT

 - subroutine prolong_block() has been completely rewritten; now it
   supports 2D and 3D boxes, and the calculation of bounds for the
   expanded array is automated now
2009-09-29 15:32:58 -03:00
Grzegorz Kowal
1fdf2b72ae Improve block restriction and add support for 3D.
MESH STRUCTURE, DEREFINEMENT

 - subroutine restrict_block() has been completely rewritten; now it
   supports 2D and 3D boxes, and the calculation of bounds for
   source and destination arrays is automated
2009-09-29 15:12:19 -03:00
Grzegorz Kowal
4953cfbe22 Fix dimensions of the neigh field. Use better vars naming.
FIXES

 - the field neigh of meta blocks structure must use ndims, nsides, and
   nfaces variables

BLOCK STRUCTURE

 - use pmeta and pdata names for ponters to meta and data blocks,
   respectively; this helps reading the code

HOSTS

 - turn on DEBUG
2009-09-26 14:27:47 -03:00
Grzegorz Kowal
5074834673 Implement MPI auto balancing.
MESH STRUCTURE, MPI

 - implement auto balancing, which resends the blocks to the neighboring
   processors in order to keep the same number of data blocks on each
   processor
2009-09-26 01:51:44 -03:00
Grzegorz Kowal
03568cd974 Fix the initial balancing of the blocks.
MESH STRUCTURE, MPI

 - correct the initial division of the geometry, so each process is
   attached to the same number of blocks; blocks at the top level are
   allowed to be attached to different processors even if they are
   children of the same block
2009-09-26 00:39:41 -03:00
Grzegorz Kowal
ee413ffee6 After moving derefined blocks, set their cpu flags. 2009-09-26 00:14:23 -03:00
Grzegorz Kowal
8173d8e603 Move derefined blocks to the same processor.
MESH STRUCTURE, MPI

 - if the child blocks are selected to be derefined and lay on different
   processors, move them all to the processor of the parent block
2009-09-26 00:10:32 -03:00
Grzegorz Kowal
2a25d369c1 Improve the initial block division between processes.
BLOCK STRUCTURE, MPI

 - in the best division calculation use the number of data blocs only,
   but if the blocks are at the top level and have the same parent
   pack then together in the same process
2009-09-25 20:35:38 -03:00
Grzegorz Kowal
8104ee5775 Keep data blocks of leafs only.
MESH STRUCTURES

 - since blocks which are not leafs are not used to calculate the fields
   evolution, we don't need to keep their data blocks allocated; these
   changes allocated the parent data block only for blocks which are
   derefined, and deallocates data block of a block selected for
   refinement; in the case of many blocks and many refinement levels
   these modifications safe a substantial amount of memory
2009-09-25 19:24:02 -03:00
Grzegorz Kowal
06188d42fa Clean up and comments in init_mesh() and refine_mesh(). 2009-09-22 19:32:57 -03:00
Grzegorz Kowal
24da24004f Improve "blast" problem, add initial domain generation.
PROBLEMS

 - implement the blast problem in a similar way to the one implemented
   in GODUNOV code

 - generate initial domain of 2x3 blocks at the lowest level; it should
   be generalized to any dimension of blocks

MESH STRUCTURE

 - add new variable rdims(1:3) specifying dimensions of the initial
   blocks structure at lowest level

 - improve calculation of the effective resolution, and spatial
   increments
2009-09-22 17:30:53 -03:00
Grzegorz Kowal
6198a0f5c5 Remove old block structures and related code. 2009-09-21 19:02:05 -03:00
Grzegorz Kowal
0924f90bd7 Implement mesh update uniprocessors and MPI-friendly.
MESH STRUCTURE

 - subroutine mesh_update() performs refinement/derefinement of blocks
   using new structures of meta and data blocks; it is implemented for
   to be MPI friendly as well

 - update subroutine derefine_block() to use new structures of meta and
   data blocks

 - update subroutines restrict_block() and prolong_block() to use new
   meta and data structures
2009-09-21 16:57:34 -03:00
Grzegorz Kowal
ac188d32e4 Divide blocks among processors. Initial work on boundaries.
BLOCK STRUCTURE: MPI

 - divide initial block structure between all processors and remove
   non-local data blocks

DATA I/O

 - dump the total number of blocks and the number of data blocks

BOUNDARY CONDITIONS

 - initial work on the boundary condition for new structure of blocks
2009-09-14 19:15:21 -03:00
Grzegorz Kowal
7aff1ecd90 Remove junk comments from subroutine init_mesh(). 2009-09-14 18:19:27 -03:00
Grzegorz Kowal
71d334aedb Make the subroutine refine_block() works correctly.
MESH STRUCTURE

 - with new meta and data block structures the refinement of a block
   works correctly now
 - increase and decrease the number of blocks while allocated and
   dealocated, respectively
2009-09-13 22:58:55 -03:00
Grzegorz Kowal
7827e60f30 Rework subroutine refine_block() to use new meta and data blocks. 2009-09-11 21:52:18 -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
90182faf2b Merge branch 'mpi' of /home/kowal/Web/godunov-amr into mpi 2008-12-28 17:28:16 -06:00