156 Commits

Author SHA1 Message Date
8e4bd1712d EVOLUTION: Change safety factor to 0.91.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-06-11 00:22:56 -03:00
4af6e99ca8 EVOLUTION: Do not repeat if tolerance reached in embedded methods.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-06-09 18:04:53 -03:00
aa99145260 EQUATIONS: Print the location of unphysical cell.
Also slightly rewrite and simplify the arguments of
correct_unphysical_states().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-05-26 22:21:02 -03:00
2696d5dffb EVOLUTION: Rewrite the handling of unimplemented methods.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-05-24 19:20:57 -03:00
fbc04e4996 EVOLUTION: Mark updated blocks as physical in update_variables().
Otherwise, these blocks are considered as non-physical if the
fix_unphysical_cells is on.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 15:40:26 -03:00
95d117cd1a EVOLUTION: Quit update_variables() in case of problems.
The possible failure could take place in the boundary update or
conversion to the conservative variables. In case of a failure, jump
directly to the end part of subroutine in which the %boundary flag is
cleared.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:39:58 -03:00
a4890bb240 EQUATIONS: Rewrite slightly correct_unphysical_states().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:34:31 -03:00
571e352e5b EVOLUTION: Remove unused variable from check_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:12:30 -03:00
9aa74d2343 EVOLUTION: Rewrite update_variables().
After the boundary update, all respective blocks modified by the mesh or
boundary update are required to update their primitive variables. If a
data block contains a non-physical cell, it is corrected by
correct_unphysical_states(), if fix_unphysical_cells is switched on.
As the last steps, the shapes are updated if they are switched on.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:07:17 -03:00
a3a140b572 BLOCKS, BOUNDARIES, EVOLUTION: Fix block variable update.
When the block has been (de)refined, its field %update is set in order
to update its primitive variables. However, the block which are
neighbors of the (de)refined blocks, since their boundaries are updated
too, were not selected for the primitive variable update.

Fix this by adding a new meta block field %boundary, which indicates
that a block boundary has been updated, and update the corresponding
data block primitive variables either if the %update or %boundary flags
are set.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-11 22:37:46 -03:00
6ba8d5d34f SOURCES: Reduce the number of arguments to update_sources().
Pointer pdata already has a reference to the increment array dU(), so
remove the redundant argument du.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-09 16:25:07 -03:00
eea8c036b4 EVOLUTION: It is sufficient to update primitive variables once.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 18:33:18 -03:00
f510a2ec15 EVOLUTION: Call variable conversion after the boundary update.
The variable conversion is done for the whole blocks, including ghost
zones.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-04 16:40:20 -03:00
9e327d76ca EQUATIONS: Add option ghosts to update_primitive_variables().
This is a logical flag controling if the conversion should be done for
the whole block, including the ghost zones, or just the interior part.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-04 16:36:50 -03:00
4634081ca9 BOUNDARIES: Rewrite boundary_fluxes().
Slighly change the shape of block fluxes. Also add status flag to this
subroutine.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-02 16:39:51 -03:00
9829505650 Update copyright year to 2022.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-02 09:51:41 -03:00
124ad01eca EVOLUTION: Fix time step estimation with OpenMP.
The variable um should be also thread private in initialize_time_step()
and new_time_step().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-09 17:24:56 -03:00
a634d9bed5 VARIOUS: Make thread number thread private.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-08 11:52:16 -03:00
c56daa6991 EVOLUTION: Make variable initialization OpenMP conformant.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-08 11:12:15 -03:00
9b5198a5ff EQUATIONS, EVOLUTION: Rework get_maximum_speeds().
There is no need for the maximum characteristic speed. The divergence
correcting speed cglm is calculated using the maximum eigenvalue and
physical velocity.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-07 15:38:54 -03:00
c32e4adcde EVOLUTION: Use get_maximum_speeds() in the time step estimation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-01-06 22:48:35 -03:00
27fd2fb6e1 EVOLUTION: Improve the initial time step estimation.
First of all, the estimation is of the third order, so use the cubic
square in the calculation of h1. Secondly, fix the normalization factor
fnorm. Finally, use only the variables corresponding to the fluxes in
the increment norms sc(..) and df(..).

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-16 09:18:32 -03:00
df9b301734 EVOLUTION: Restore the initial state in initialize_time_step().
The estimation of the initial time step requires the advance of the
system by one step. This, however, alters the primitive variables of
data blocks. Restore the primitive variables to the initial state, once
the initial time step has been estimated, in order to solve this
inconsistency.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-15 09:11:49 -03:00
76695febbd EVOLUTION: Reorganize integration method selection.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-15 08:47:23 -03:00
5d8c6d994d EVOLUTION: Produce the same initial time step for OpenMP on and off.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-10 13:16:26 -03:00
c54539a379 EVOLUTION: Parallelize initialize_time_step() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-10 09:44:02 -03:00
21cbecef26 EVOLUTION: Remove unused variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 22:07:36 -03:00
46696e4790 EVOLUTION: Rename local variables c to something else.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 22:00:09 -03:00
93068909d9 EVOLUTION: Add 4th order 5-step SSPRK(5,4) method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 21:45:14 -03:00
416c35ed9a EVOLUTION: Parallelize evolve_ssprk410() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 16:23:53 -03:00
aa8f9b6fe9 EVOLUTION: Parallelize evolve_ssprk35() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 16:03:22 -03:00
df5791f0b5 EVOLUTION: Parallelize evolve_ssprk34() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 13:36:03 -03:00
b4622f3c48 EVOLUTION: Parallelize evolve_ssprk3() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 12:58:55 -03:00
7b13e8fdf1 EVOLUTION: Parallelize evolve_ssprk2() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 12:38:40 -03:00
a5202090a4 EVOLUTION: Parallelize evolve_euler() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-09 12:23:53 -03:00
a61c4fa52a EVOLUTION: Parallelize evolve_ssprk21m() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 22:12:22 -03:00
fce5e43b2a EVOLUTION: Parallelize new_time_step() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 21:54:40 -03:00
c680b7772a EVOLUTION: Parallelize evolve_ssprk32m() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 21:40:59 -03:00
ee89bc42e6 EVOLUTION: Parallelize evolve_ssp324() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 18:27:43 -03:00
537f8693bc EVOLUTION: Parallelize update_errors_max() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 17:36:46 -03:00
806d74d4cf EVOLUTION: Parallelize update_errors_l2() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 17:18:55 -03:00
beca028b2f EVOLUTION: Parallelize evolve_3sstarplus() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 16:58:12 -03:00
8568dbb709 EVOLUTION: Parallelize update_variables() using OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-08 16:40:10 -03:00
2151d483ec EVOLUTION: Make some variable threadprivate in update_increment().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-07 20:53:57 -03:00
ea0b9b83dc WORKSPACE: Make workspace thread safe.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-07 10:46:18 -03:00
e1fa68b54f EVOLUTION: Fix alignment.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-12-03 19:56:26 -03:00
fd40fffc64 BOUNDARIES: Add interface to custom boundaries.
Also return the call status from block_boundary_specific().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-26 16:42:53 -03:00
4ceb008987 SHAPES: Do not pull update_user_shapes() from module USER_PROBLEM.
The pointer to update_shapes can be associated in
initialize_user_problem().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-26 13:47:05 -03:00
1f1ae8084f EVOLUTION: Remove warning in initialize_evolution() if NDIMS=2.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-25 08:39:52 -03:00
78ae62528a EVOLUTION: Eliminate uninitialized conditions.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-24 13:16:59 -03:00