Now, the selective update after refinement/derefinement process is on.
Before checking the refinement and update the mesh, We set all blocks to
not be updated. Then, only blocks which are refined or derefined
including all their neighbors, are set to be updated. This reduces the
repeated work, i.e. boundary update and variable conversion, on blocks
which didn't actually change.
After the mesh refinement, boundary and variable update, we mark all
blocks to be updated, so the regular temporal integration process works.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Now, module EQUATIONS provides a complet interface for equation systems,
including the definition of the number of equations/independent
variables, variable indices and names, conversion subroutines between
primitive and conservative variables, flux and characteristic speed
calculation, and maximum speed determination.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The maximum level was estimated from the list of data blocks. If we
have many processors, sometimes all blocks could lay at level smaller
than maxlev, what can cause wrong dx_min estimation and desyncronization
between processors.
There is no need to convert conservative variables to primitive ones,
since they are already up to date, so pass primitive variables directly
to Riemann solvers in subroutine update_flux().
Subroutine advance() is a replacement for the subroutine evolve(). It
performs one step variable update by calling the selected integration
method. So far only 2nd order Runge-Kutta is supported, which is
implemented in subroutine advance_rk2().
Subroutine advance_rk2() advances the conservative variables by one step
using the 2nd order Runge-Kutta method with the boundary update after
each substep. This results in the reduced number of ghost zones, for
example 2 instead of 4, as in the previous version.
- the new parameter tbfor determines the time when the forcing starts
to be introduced gradually; the parameter tefor determines at what
time the forcing operates with the full power; the transition between
tbfor and tefor is described by sinus function;
- the new parameter toplev stores the level of refinement larger or
equal to maxlev; this level cannot be set in the config.in, but is
determined during the initiation or restarting the job;
- several subroutines have been updated to use toplev instead of
maxlev;
- the subroutine flux_rk2() updates one dimensional fluxes using the
2nd order Runge-Kutta method, and then calculates the averaged flux,
which is used to update the block variables;
- instead of calculating all fluxes at once in update_flux(), select
the direction as a subroutine argument and calculate only the flux
along this direction;
- directional fluxes are needed for the directional RK integration of
the numerical fluxes;
- update subroutines flux_euler(), flux_rk2(), and flux_rk3() to use
new update_flux() subroutine;