116 Commits

Author SHA1 Message Date
Grzegorz Kowal
e28a0a83c8 Make module BLOCKS independent of VARIABLES.
- add a new subroutine set_datablock_dims() to set dimensions of the
   allocatable arrays in data blocks; this subroutine is called from
   init_mesh(), which is the right place to initiate BLOCK module;

 - remove dependency of blocks.o on variables.o;

 - boundaries.o depends on timers.o;
2011-05-05 15:56:38 -03:00
Grzegorz Kowal
67ba2b5422 Module blocks does not depend on mpitools. 2011-05-05 14:26:26 -03:00
Grzegorz Kowal
0494df3285 Add CONSERVATIVE flag to the build system.
- CONSERVATIVE flag determines if the scheme must be fully
   conservative; this works only when adaptive mesh is used; in such a
   case instead of update variables at each block, we first calculate
   high order integration of fluxes, then we synchronize them between
   blocks at different levels, and finally we perform one-step update
   for each block using updated fluxes; this might be also a first step
   to implement Galerkin methods;
2011-04-30 11:45:48 -03:00
Grzegorz Kowal
4406f4cedd Implement a log file for storing mesh statistics.
- a new file 'mesh.log' is created with the following colums: step,
   time, the number of leafs, the number of meta blocks, the coverage
   efficiency, which is the number of leafs divided by the number of top
   level blocks covering the whole domain, the AMR efficiency which
   shows the advantage of using adaptive mesh (with boundaries taken
   into account), block distribution over levels and processors;

 - the AMR efficiency is the number of leafs multiplied by the number of
   cells in one block (with boundaries included) and divided by the
   effective resolution with boundaries included; if this parameter is
   smaller than 1.0 we should expect faster calculations due to the
   adaptive mesh, if the parameter is larger than 1.0, we only slow down
   the calculations by using the adaptive mesh;
2011-04-28 12:04:22 -03:00
Grzegorz Kowal
0ff433e16b Rename the code from Godunov-AMR to AMUN. 2011-04-25 13:44:34 -03:00
Grzegorz Kowal
fa01b0e205 Fix correction of FLUX in Makefile. 2011-04-24 09:59:45 -03:00
Grzegorz Kowal
042a520be7 Store random number generator seed in HDF5 files.
- the number of seeds and seed values must be stored in the restart
   file in order to restart a job properly and guarantee unchanged
   generation of random numbers after restart;
2011-04-24 09:02:35 -03:00
Grzegorz Kowal
3df814ab8a Store evolution parameters in the restart files. 2011-04-15 00:09:50 +02:00
Grzegorz Kowal
a0f7d5118f Introduce the compression of the HDF5 output files. 2011-03-26 13:31:52 -03:00
Grzegorz Kowal
b3b4b42ad8 Change flag RESIS to RESISTIVITY. 2011-03-22 17:24:28 -03:00
Grzegorz Kowal
ca30b0674c Implement Roe Riemann solver for isothermal hydrodynamics. 2011-03-21 14:58:18 -03:00
Grzegorz Kowal
2e77f327b1 Implement viscous terms. 2011-03-18 15:33:24 -03:00
Grzegorz Kowal
5a8cd7d184 Implement 'multi current sheet' problem. 2011-03-18 14:00:27 -03:00
Grzegorz Kowal
cd91d350ab Introduce a compilation flag REFINE.
- the flag REFINE determines if the code should be compiler with the
   adaptive mesh refining/derefining; otherwise, the static mesh is
   generated;
2011-03-10 01:08:00 -03:00
Grzegorz Kowal
de3d89bb1b FORCE: implement and use Fourier transform of velocity.
- we need to calculate Fourier transform of velocity for all forcing
   components in order to minimize the velocity-force correlation;
2011-03-07 00:08:31 -03:00
Grzegorz Kowal
36967b6f00 INTEGRALS: add initial support for calculation of integrals.
- add a new module INTEGRALS which handles initialization and
   calculation of the conserved variables and energies;
 - add make dependencies to makefile;
 - call the initialization, storage and termination subroutines from the
   driver;
2011-03-02 15:52:33 -03:00
Grzegorz Kowal
fb4218e542 Add support for timer in the FORCING module subroutines. 2011-03-01 18:58:18 -03:00
Grzegorz Kowal
b3c1c94e1c MAKE: add more cleaning options to makefile. 2011-02-28 16:08:20 -03:00
Grzegorz Kowal
272a8b2d50 DRIVER: change a bit the progress info. 2011-02-28 16:04:38 -03:00
Grzegorz Kowal
5520e726bf RESISTIVITY: add a compilation flag to turn on resistivity. 2010-12-10 15:38:17 -02:00
Grzegorz Kowal
23fd6d9deb FORCING: implement real_forcing().
- implement the subroutine real_forcing() which returns the forcing
   terms transformed to real space;
2010-12-08 19:37:01 -02:00
Grzegorz Kowal
ac2a969636 EVOLUTION: evolve the forcing source terms.
- call subroutine evolve_forcing() before the update of all blocks;
   this subroutine evolves the forcing source terms by an interval dt in
   the Fourier space; then during the update the forcing Fourier
   coefficients will be transformed to real space for each block
   separately;
2010-12-08 18:19:16 -02:00
Grzegorz Kowal
bd28a527d7 FORCING: implement evolution of forcing terms.
- implement subroutine evolve_forcing() which evolves the driving
   components in Fourier space during the one hydrodynamic timestep; the
   integrated forcing Fourier components are stored in module array
   ftab; this complex array will be used to calculate forcing in real
   space for each block;
2010-12-08 17:45:24 -02:00
Grzegorz Kowal
29a7e0063a FORCING: add initial version of module.
- add a new module FORCING to handle forcing source terms, e.g. for
   turbulence driving;
 - implement initial versions of init_forcing() and clear_forcing()
   subroutines;
 - add compilation flag FORCING and use it during compilation process in
   makefile;
2010-12-08 12:21:41 -02:00
Grzegorz Kowal
edb8f970bc CONSTANTS: add constants module and utilize.
- a new module stores mathematical and physical constants and can be
   used in problem initialization or source terms calculation;
2010-12-08 11:56:44 -02:00
Grzegorz Kowal
59db37fbae RANDOM: add random number generator module.
- add a new module RANDOM which handles initialization and generation
   of different type random number distributions;
 - include the module in the compilation process;
 - initialize the random generator from driver;
2010-12-08 11:40:38 -02:00
Grzegorz Kowal
6d31ce2c4b INTERPOLATION: implement the MP family of reconstruction.
- implement the monotonicity preserving family of reconstruction; the
   implementation covers the 5th, 7th and 9th order spacial MP
   reconstruction;
 - implement two new functions used by the MP reconstructions, minmod()
   and median();
2010-12-07 10:08:30 -02:00
Grzegorz Kowal
478de929c1 MAKE: add TVD flag for TVD reconstruction.
- other types of reconstruction may include WENO or MP;
2010-12-06 16:58:00 -02:00
Grzegorz Kowal
41e44779e5 Revert "INTERPOLATION: pass the spacial increment to reconstruct()."
This reverts commit d92ae5d3a62743b66e97c42be4aa5f31ef5993d1.
2010-12-06 16:20:49 -02:00
Grzegorz Kowal
d92ae5d3a6 INTERPOLATION: pass the spacial increment to reconstruct().
- pass the spacial increment to the reconstruction subroutine since
   some interpolation methods require it; in addition, move obtaining
   the spacial interval and its inversion to the subroutine update();
2010-12-06 16:09:09 -02:00
Grzegorz Kowal
ce57f9710f MAKE: add flag to select spacial reconstruction method.
- add a new makefile flag to select the method of reconstruction;
2010-12-05 00:24:56 -02:00
Grzegorz Kowal
5fc6eb70c4 SCHEME: rewrite the HLLC Riemann solver.
- rewrite the HLLC hydrodynamic Riemann solver;
 - also add more conditions for compilation flags;
2010-12-03 16:29:28 -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
a8dd14def4 Heavy reawrite of the I/O module.
IO

 - the subroutine write_data() is now a wrapper subroutine which call
   the subroutine writing in a supported file format; the file format is
   chosen at the time of compilation;
 - the subroutine write_data_h5() is a new subroutine taking care of
   initialization and storage data in the HDF5 format; depending on the
   file type it calls subroutines to create specific groups and store
   the right data;
 - new subroutines write_atrributes_h5(), write_coordinates_h5(),
   write_variables_h(), write_variables_full_h5(),
   write_metablocks_h5(), write_datablocks_h5(), and number of other
   supporting subroutines to store all data in the proper format for job
   restart, vizualization, and debugging;

MAKE

 - add option to enable/disable HDF5 file compression;
2010-10-11 01:39:15 -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
98849f3369 Prepare code for central differencing scheme for magnetic field. 2010-02-22 12:01:58 -03: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
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
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
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
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
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
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
6fac1d38b2 Reorganization of the block subroutines.
Preparation of the block module for MPI support.
2008-12-18 23:47:58 -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
f673596f20 Refinement based on density. More cleanups. 2008-12-13 22:41:37 -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