193 Commits

Author SHA1 Message Date
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
acd4d8d105 The 'l' and 'u' are handled by the default restriction. 2010-02-14 17:59:10 -02: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
ea00024b65 Remove unnecessary dimension variable fm from bnd_prol(). 2010-02-12 15:38:05 -02:00
Grzegorz Kowal
25eee11a94 Reorganize interpolation. Set 'm' as default. 2010-02-12 04:13:55 -02:00
Grzegorz Kowal
1c8d37a333 Switch to a special geometry for 2D blast problem. 2010-02-12 00:05:02 -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
beee9ee2d4 Initial support for the MHD equations.
VARIABLES

 - add indices for the magnetic field components, both face and cell
   centered

SOLVER, MHD

 - add support for the magnetohydrodynamic (MHD) equations to the
   subroutines cons2prim(), prim2cons()

 - add MHD flux and the fastest speed calculation in the subroutine
   fluxspeed()

 - include magnetosonic speed in the calculation of the maximum speed in
   the system required for estimation of the new time step

 - extend the HLL solver in subroutine hll() to support MHD

 - calculate the magnetic field update according to a CT scheme in the
   subroutine update()

INTERPOLATION

 - add subroutine magtocen() to interpolate cell centered magnetic field

EVOLUTION

 - add evolution of the magnetic field components in the evolve_euler()
   and evolve_rk2() time integration subroutines

 - also call the subroutine magtocen() in the right places

BOUNDARY CONDITIONS

 - support for magnetic field boundary update only in the case of blocks
   with the same level so far; later we need to include proper
   restriction and prolongation for the magnetic field to keep its
   divergence equal zero

PROBLEMS, BLAST

 - extend the blast problem to include the initial magnetic field

IO, HDF5

 - write down in a HDF5 file magnetic field components
2009-10-28 00:12:18 -02:00
Grzegorz Kowal
7bd227afda Implement Hilbert space filling curve for 3D. 2009-10-03 20:11:03 -03:00
Grzegorz Kowal
3747646780 Some arrays cannot be stored as attributes.
DATA I/O, HDF5

 - arrays of indices, levels, and the block bounds cannot be stored as
   attributes since they can easily exceed the allowed space for
   attributes; instead, they have to be stored as dataset, which
   overcome this limit

 - store the lowest level block dimensions as well
2009-09-30 20:23:35 -03:00
Grzegorz Kowal
719b40c77d Rewrite write_data() using more efficient storage.
IO, HDF5

 - rewrite subroutine write_data() using more efficient storage,
   especially with compression; we are storing only the domain part of
   blocks and their primitive variables, which is selected by setting
   ftype='p'; storing restart files with all parameters will be done
   later

BLOCKS,

 - remove array c(:,:,:) from data_block which stored the values for
   refinement/derefinement estimations
2009-09-30 16:28:17 -03:00
Grzegorz Kowal
36e2dbac40 Fix boundary restriction subroutine bnd_rest() for 3D. 2009-09-30 01:26:05 -03:00
Grzegorz Kowal
463be7ad77 Rewrite and add support for 3D to subroutine derefine_block(). 2009-09-29 17:19:26 -03: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
ef0658a215 Add support for 3D in function check_ref(). 2009-09-29 15:56:25 -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
9cad26602f Fix prolongation of boundaries and add suport for 3D. 2009-09-28 18:41:30 -03:00
Grzegorz Kowal
6a862ea650 Improve restriction of boundaries and add support for 3D. 2009-09-27 17:45:48 -03:00
Grzegorz Kowal
53c47874ef Fix the case when boundaries are not periodic and we use MPI. 2009-09-27 03:07:23 -03:00
Grzegorz Kowal
c80833d56c Use specific domain initialization for blast problem for 2D only. 2009-09-26 15:44:25 -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
1baa4b452c Use MPI by default on acrux.home. 2009-09-26 12:20:06 -03:00
Grzegorz Kowal
ad09c4b150 Add host file for daphne.iag.usp.br. 2009-09-26 12:16:11 -03:00
Grzegorz Kowal
75e8ec7b0e Merge branch 'mpi'
Conflicts:
	src/config.F90
2009-09-26 12:12:28 -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
449975d9e7 Move bounds of the block to meta structure.
MESH STRUCTURE

 - move the bounds of the block (xmin, xmax, ...) from data to the meta
   structure; in this case we can deallocate data blocks without losing
   the information about it bounds
2009-09-25 11:41:19 -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
1ebcd50803 Fix nleafs counting and store it in HDF5 files. 2009-09-21 17:16:29 -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
4af8724e19 One fix more for the boundaries. 2009-09-21 01:15:08 -03:00
Grzegorz Kowal
25d035fd68 Fix prolongation of the boundary conditions.
BOUNDARY CONDITIONS

 - fix prolongation of the boundary conditions
 - use the same subroutines for the uniprocessor and MPI version
   boundaries
2009-09-21 01:12:32 -03:00
Grzegorz Kowal
f399274574 Finish implementing proper handling of boundary conditions for MPI.
BOUNDARY CONDITIONS

 - using a list of info blocks the implementation of boundary conditions
   for neighbor blocks laying on different processors is successfully
   completed; it is simpler and more clear than the previous
   implementation
2009-09-18 20:34:23 -03:00
Grzegorz Kowal
f8f6ea29a1 Continue work on the boundaries.
BOUNDARY CONDITIONS

 - blocks belonging to the same process can exchange boundaries now;
   blocks with neighbors from other processes still need to be updated

BLOCK STRUCTURE

 - a new structure block_info has been added which will be used for
   defining lists of blocks which have neighbors belonging to other
   processes; these lists will be later used to exchange block data
2009-09-18 17:43:48 -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
bf5e332ce1 Evolve new list of data blocks.
TIME INTEGRATION

 - now update the solution using new list of data blocks belonging to
   the current process only
2009-09-14 18:28:17 -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
900b8ec7e0 Initiate neighbors of the root block. 2009-09-10 18:23:18 -03:00
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