The attribute, provided by the group identifier to which it is linked
and its name, is opened inside the subroutine
read_attribute_integer_h5().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we restart a job with a different snapshot interval, the snapshot
number will continue from a different value corresponding to the
simulation time.
The snapshot number shouldn't be related to the current simulation time.
It should be always increasing. The simulation time is stored as an
attribute, anyway. This patch makes the snapshot number always
increasing continuously, without any gaps for restarted jobs.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Now, the boundary type is stored in an integer array instead of string
variables. This should reduce the comparison time in
boundary_specific().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Since we use the reflective boundary conditions for this problem, the
initial profile should respect that and also apply reflection at the
boundaries.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This subroutine is called after updating the boundaries of primitive
variables. It converts those primitive variables to their conservative
representation in all ghost cells.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The new order is to first, convert the updated conserved variables to
their primitive representation in the block interiors, update boundaries
of the primitive variables, and finally, convert the primitive variables
at the ghost cells to conserved ones.
The change updates the primitive variables in the block interiors before
the boundary update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Conversion of the conserved to primitive variables can be expensive for
some sets of equations, such as the relativistic MHD. Therefore, we
will convert only the interior parts of blocks and update the ghost
zones later in the boundary update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This guarantees that the very edges or corners are always physical and
minimizes their influence on the variable evolution in the ghost zones.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This is just in case we would like to use interpolation to reconstruct
the full domain resolution.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
In this patch we make a general subroutine iterating over all neighbors
iterate_over_neighbors() which takes as arguments a pointer to the block
which neighbors are evaluated and pointer to subroutine which should be
called with each neighbor. So far two such subroutines are used, one to
select the proper refinement flag, and another to select the neighbor
for update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
We take the maximum error along each direction instead of calculating
the norm sqrt(ex*ex+ey*ey+ez*ez). This solves the symmetry problems
with some of the reconstructions.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The meta block field %refine is 4 byte integer. Make the value returned
by check_refinement_criterion() of the same type.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Those arrays are prepared only at the first execution and then stored in
memory, therefore there is no need to preparing them each time
refine_block() is called. This removes also one 'select which' condition
check.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we take the whole domain and divide it between blocks of the size
corresponding to the current lever, the field %coords identifies the
position of the current block in the domain.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>