1322 Commits

Author SHA1 Message Date
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
f816303472 MESH: Remove unnecessary import in generate_mesh().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:51:13 -03:00
62d413303c MESH: Spell check in recently added subroutines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:42:45 -03:00
64a483cb91 MESH: Spell checking in update_mesh().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:39:00 -03:00
153cc89980 MESH: Remove unused variables from update_mesh().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:34:28 -03:00
1821c485d5 MESH: Move block prolongation to refine_selected_blocks().
The actual block prolongation has been moved from update_mesh() to a
separate one called refine_selected_blocks().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:27:00 -03:00
6f9de6e6c5 MESH: Move block restriction to derefine_selected_blocks().
The actual block restriction has been moved from update_mesh() to
a separate one called derefine_selected_blocks().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 16:14:36 -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
fe60e70e57 MESH: Move child processing from update_mesh() to prepare_sibling_derefinement().
After checking refinement flags and process neighbors, we need to check
if all siblings of blocks which were selected for derefinement, are
eligible for derefinement too, i.e. lay at the same level, and are also
selected for derefinement. After this step, we bring all siblings to the
same processor, so the derefinement can be done efficiently.

In this commit, the above step is moved from update_mesh() to
prepare_sibling_derefinement().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 13:03:24 -03:00
83c1a5da1e MESH: Move the second part of update_mesh() to update_neighbor_refinement().
The second part of update_mesh(), in which we update neighbor refinement
flags, has been moved to a new subroutine update_neighbor_refinement().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 10:33:10 -03:00
b12335528a MESH: Move part of update_mesh() to check_data_block_refinement().
The first part of update_mesh(), where we check and update the
refinement flags, has been moved to a new private subroutine
check_data_block_refinement().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 10:10:29 -03:00
ee9f32d7dd PROBLEMS: Fix compilation after last commit.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-23 09:49:13 -03:00
3f34888b6a PROBLEM: Improve integration at surface in 3D blast problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-21 19:59:15 -03:00
a375cb12c5 PROBLEMS: Fix parameters in the Kelvin-Helmholtz setup file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 23:08:47 -03:00
7500981dbe DRIVER: Update boundaries just after problem initialization.
Otherwise we can get some kind of mass leaking problem, like in the case
of Kelvin-Helmholtz test.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 23:06:28 -03:00
9695af7a64 PROBLEMS: Fix parameters in implosion setup file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 22:52:11 -03:00
847687b045 PROBLEMS: Fix parameters in blast problem setup file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 22:45:35 -03:00
f328991398 DOMAINS: Replace (xmax - xmin) with xlen, etc..
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 22:08:18 -03:00
9d53305eb6 PROBLEMS: Improve the edge interpolation in the blast problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 18:48:06 -03:00
288d6f201e INTEGRALS: Implement storing variable statistics.
Variable statistics, like average, minimum, and maximum values are now
stored in a separate file 'statistics_??.dat'.

Statistics of density, pressure, velocity, magnetic field, divergence
potential and Mach numbers, if they are applicable, are stored.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 13:18:02 -03:00
1417d45def COORDINATES: Add domain volume and its inversion.
Also calculate properly the domain sizes xlen, ylen, and zlen and use
them to generate coordinates.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 12:34:32 -03:00
477648d2e3 INTEGRALS: Utilize 'newunit=' option, to get file unit automatically.
This option requires Fortran 2008 compiler.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-11 11:39:36 -03:00
4ba9e86297 GENERAL: Add parameter files for several test problems.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 12:39:03 -03:00
696e65959b GENERAL: Add README file and rename LICENSE file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 12:11:05 -03:00
d8143673c1 GENERAL: Move src/license.txt to LICENSE.txt.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 12:05:14 -03:00
ad7125f27b EVOLUTION: Correct line formatting in new_time_step().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 11:47:37 -03:00
97054d050d EVOLUTION: Improve the stability for dt_hyd ~ dt_diff.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 10:37:43 -03:00
88a5519ff2 SOURCES: Rewrite the resistive source terms.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-06-02 10:37:18 -03:00
43c7350261 OPERATORS: Add subroutines to calculate the Laplace operator.
A new subroutine to calculate the second derivative was added to private
subroutines, as well.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-31 18:07:20 -03:00
4f83160782 PROBLEMS: Implement current sheet test problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-30 18:38:46 -03:00
7723a874f0 OPERATORS: Fix compilation for derivative_1st if NDIMS=3.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-29 14:05:23 -03:00
69d3348a93 COORDINATES: Do not read zmin/zmax if not 3D.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-29 13:12:17 -03:00
d5625ccb9f SOURCES: Implement resistive source term for MHD.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-29 12:04:55 -03:00
af1b2b28cd EQUATIONS: Add directional indices.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-29 11:32:27 -03:00
e675398b5f OPERATORS: Add divergence() and curl() to public subroutines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-28 19:26:03 -03:00
120f8bd2aa OPERATORS: Implement divergence and curl operators.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-28 19:16:59 -03:00
b4d2055f8b OPERATORS: Add initialization/finalization subroutines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-28 18:21:16 -03:00
9b22d2be7b OPERATORS: Add new module for differential operators.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-28 18:09:35 -03:00
c292b88cbd SOURCES: Implement simple model of viscosity.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-27 17:53:35 -03:00
81bec38a77 EVOLUTION: Move here update_increment() from SCHEMES.
Subroutine update_increment() was using time information which broke the
source term contribution. It has been moved to module EVOLUTION and its
arguments have been simplified.

The time step is now directly taken into account in the time integration
subroutines.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-05-27 16:29:53 -03:00
176076dce3 SOURCES: Fix gravitational acceleration from a point mass.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-30 14:06:56 -03:00
8ac8248279 SOURCES: Add initial version of source terms module.
This contains only point mass gravitational acceleration so far, as an
example.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-29 18:35:58 -03:00
936331581c EQUATIONS: Correct negative pressure if desired.
If option "fix_positivity" is on, we check if the pressure obtained from
conservative variables is positive. If it is negative, it is replaced by
a value corresponding to the maximum allowed sonic Mach number, provided
by option "msmax".  The new value of pressure and corresponding total
energy is set in all unphysical cells then.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-29 12:45:54 -03:00
7007221d25 INTERPOLATIONS: Option for clipping reconstruction near extrema.
If we set option "clip_extrema" to "on", we turn on the extrema clipping
or in other words, the reconstruction is limited in order to keep left
and right states to lay between their cell centered neighbors.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2014-04-29 12:43:22 -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