Two new arrays barray and bcount are allocated during the module
initialization and deallocated during the module finalization.
Those two arrays are used to store information about neighbors which
lay on different processes and need some boundary data to exchange.
Subroutines prepare_exchange_array() and release_exchange_array() are
responsinble for initialization of barray and bcount and for
deallocation all array elements, respectively.
Subroutine append_exchange_block() helps to append a new block pairs to
the exchange array.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
When blocks belong to the same process which is not the current one, the
block exchange structure is unnecessary allocated, and is not
deallocated after the block exchange.
Fix this by allocating block exchange structures only when the block and
its neighbor processes are different.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The list of processor pairs in round-robin order should guarantee the
optimal MPI exchange between processors, i.e. that all processors will
be involved in the data exchange in the same time.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The resistive source terms are calculated without assumption about the
uniform resistivity coefficient.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The energy term which corresponds to the viscous stress tensor was
incorrect. This patch implements the correct term.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The viscous source term can be expressed as the laplacian only in the
incompressible case (div V = 0) with uniform viscosity. If we have
compressibility or non-uniform viscosity, we need to use the full
viscous stress tensor.
This patch implements it.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
These changes introduce if the restart files are using the old or new
data block format storing, and respectively restores data in the proper
way.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This format change is required to remove unnecessary allocation of large
arrays in order to store primitive and conservative variables in the
restart files. With this format change the memory limit of the half of
the available total memory is removed. However, in the case of use of
the data compression the sizes of restart files are typically large. The
compression ratio, however, can be improved by repacking the files using
the tools provided by the HDF5 libraries.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
With the standard formatting, there are only two digits for the
exponent, however, the double precision numbers can have exponents down
to -308 and up to 308. That means that three digit exponents are
required to the number representation in the integral files.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The tag for boundary flux update was overfloating producing invalid tag
for MPI Send, while using high number of processes. Make sure that all
tags in module BOUNDARIES are generated without overflow.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>