620 Commits

Author SHA1 Message Date
28de30a8d5 INTEGRALS: Use workspace for local arrays.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 23:01:23 -03:00
8ddb4a3681 REFINEMENT: Use workspace in vorticity & current density criterions.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 22:42:53 -03:00
a381fc0cce MESH: Remove workspace from this module.
Use everywhere the workspace provided by module WORKSPACE.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 22:35:05 -03:00
79b137a355 WORKSPACE: Add module to handle workspace explicitely.
Perform its initialization and finalization in the driver.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 22:26:50 -03:00
7b4a54f71a FORCING: Use workspace in inject_fmodes_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 14:10:53 -03:00
14dd5039ab Revert "SOURCES: Use workspace in refinement criterion calculation."
This reverts commit 1860fe97b093cb825171d495ab075bee0a51bc03.

This comming introduced a circular dependency.
2021-11-12 14:08:04 -03:00
1860fe97b0 SOURCES: Use workspace in refinement criterion calculation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 13:55:29 -03:00
d5a5c612e0 MESH: Increase the workspace default size.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 12:56:16 -03:00
0c1dab5a95 SCHEMES: Eliminate local arrays from update_flux().
However, the arrays which are used to store the reconstructed primitive
variables at Riemann states are passed now from update_increment() in
module EAVOLUTION. These arrays use the common workspace.

The array used for 4-vector velocity reconstruction is removed by
utilizing the output array for fluxes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 12:43:40 -03:00
d4e442ead3 SOURCES: Use workspace in update_sources().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 11:53:43 -03:00
812bd1b2f9 MESH: Quit, if workspace cannot be increased in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 10:08:49 -03:00
f045189b8d EVOLUTION: Use workspace in update_increment().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 10:05:43 -03:00
9acf0bdb0d Revert "EVOLUTION: Use workspace in initialize_time_step()."
This reverts commit 4bb02028df6bc4dd9fa21e7689131592c6466d86.

We need to use workspace in update_increment().

Subroutine initialize_time_step() is called only once at the beginning,
so it is fine to use allocated arrays here.
2021-11-12 09:35:17 -03:00
4bb02028df EVOLUTION: Use workspace in initialize_time_step().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 09:15:15 -03:00
e01285e903 MESH: Export nwork too.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 09:10:54 -03:00
f28803350b MESH: Use workspace in prolong_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 08:57:53 -03:00
024fd4b82f MESH: Add a common workspace to be used in various modules.
This workspace removes the necessity of allocating the local subroutine
arrays. It is allocated once in initialize_mesh() and can be used in any
place of the code. By default, the size of this workspace is controlled
by the block dimensions, the number of variables, and the simulation
dimension, but it can be controlled by a parameter 'workspace_size'.

Additionally, there is a logical flag 'work_in_use' exported from this
module to permit the verification if the workspace is currently in use.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-12 08:07:59 -03:00
58605eb177 FORCING: Use %dU instead of local arrays for acceleration.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 20:35:25 -03:00
2dc4d3ca17 EVOLUTION: Make the arrays allocatable in initialize_time_step().
Two arrays used in the initial time step estimation, sc and df, are
allocated only if the integration methods support the estimation of
error.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 18:09:30 -03:00
8e7369388f REFINEMENT: Use data block's %du for the refinement criterion.
Each data block has a field %du which is used only during the
integration step (module EVOLUTION). Therefore, it can be used as a
temporary array to store the vorticity and the current density in case
these refinement criterions are used.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 17:54:54 -03:00
d8e0f2954d MESH: Rewrite redistribute_blocks().
This rewrite removes large buffers used by the MPI exchange of data
block arrays between processes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 17:31:50 -03:00
1f7906271a MESH: Rewrite prepare_sibling_derefinement().
This removes the use of extra buffer for MPI block exchange. The
exchange is now a zero-copy operation.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 17:08:12 -03:00
52ca353fe4 MESH: Allocate the prolongation array in prolong_block().
The prolongation is not expected to be done very frequently, comparing
to the number of leafs. Therefore, allocate the prolongation array only
when it is required.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 16:39:43 -03:00
c0c549453d MESH: Rewrite prolong_block() in order to reduce its memory usage.
Instead of using a temporary array for all variables, we now reuse the
same array for the prolongation of each variable.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 16:11:10 -03:00
731d4e1c32 INTEGRALS: Do not store errors if the integration is not embedded.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 22:45:57 -03:00
7578206f83 EVOLUTION: Treat any unphysical state properly in RK4.10 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 10:01:34 -03:00
1d22adb2fa EVOLUTION: Treat any unphysical state properly in RK3.5 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:51:06 -03:00
c42310b3cb EVOLUTION: Treat any unphysical state properly in RK3.4 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:37:21 -03:00
9d3123eeed EVOLUTION: Treat any unphysical state properly in RK3 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:31:30 -03:00
3ffbf1a3c2 EVOLUTION: Treat any unphysical state properly in RK2 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:25:31 -03:00
d6b4b70aab EVOLUTION: Treat any unphysical state properly in EULER method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:18:19 -03:00
3117c19a75 EVOLUTION: Improve initial time step estimation.
In case the estimation returns an unphysical state, its time step is
reduced and the estimation is repeated. If it fails for 10 consecutive
times, the estimation is abandoned and the CFL time step is used.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:04:05 -03:00
a9cf789833 EVOLUTION: Rewrite SSPRK2(1)m method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 22:16:40 -03:00
a87bcce907 EVOLUTION: Reorganize methods.
Put first non-embedded and then embedded methods.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:16:26 -03:00
6dcd400219 EVOLUTION: Treat any unphysical state properly in SSPRK3(2)4 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:09:32 -03:00
a52da2830d EVOLUTION: Treat any unphysical state properly in SSPRK3(2)n² method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:05:22 -03:00
380e4c8d7e EVOLUTION: Synchronize status among processes in update_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 15:59:34 -03:00
89bc706673 EVOLUTION: Treat any unphysical state properly in 3S*+ method.
If any unphysical cell is detected, the integration is immediately
reverted and resumed with a time step reduced by a factor or four.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 15:37:47 -03:00
ea49382c49 EQUATIONS: Add status flag to all cons2prim_*() subroutines.
We also check if the positive variables are indeed positive.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 13:21:32 -03:00
17f867cb08 EQUATIONS: Add status flag to update_primitive_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 12:51:23 -03:00
86cf55e836 EVOLUTION: Add status flag to update_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 12:32:49 -03:00
9f1c072704 DRIVER: Use only few last steps to estimate the remaining time.
This improved the remaining time estimation in case the number of leafs
changes significantly.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-08 22:35:38 -03:00
4f73c95616 BOUNDARIES: Use the same buffer for boundary copy.
The copy of boundaries between blocks at the same level always uses the
same size of buffer, so instead of using two of them, one for sending
and another for receiving, use just one for sending and receiving. This
will use the appropriate subroutine from MPITOOLS
exchange_arrays_same().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-04 10:22:13 -03:00
787e07d572 BLOCKS: Rename %block to %meta in block_info structure.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-04 09:31:44 -03:00
f3ad7924ea MPITOOLS: Use interface for exchange_arrays().
Implement two subroutines, one for exchange of arrays of different
sizes, and the second for exchange of arrays of the same sizes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 22:44:30 -03:00
95617866b1 MPITOOLS: Use MPI_IN_PLACE in all MPI_Allreduce().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 22:39:33 -03:00
9ecbf83d5f MESH: Make sure again the index nc is not out of the range.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 12:32:48 -03:00
01d0549bf5 MESH: Make sure the index nc is no out of the range.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-03 10:32:23 -03:00
20cb799fba MPITOOLS: Fix argument intent in exchange_arrays().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-01 13:11:35 -03:00
2098661d3c EQUATIONS: Remove cruft.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-30 16:59:32 -03:00