MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Data Types | Functions/Subroutines | Variables
mod_supertimestepping Module Reference

Generic supertimestepping method 1) in amrvac.par in sts_list set the following parameters which have the default values: sts_dtpar=0.9,sts_ncycles=1000,sts_method=1,sourcetype_sts=2 These parametes are general for all the methods added TODO: check if there is any need to have terms implemented with different sets of parameters, and these cannot be general anymore 2) then add programatically in the code a term with the subroutine add_sts_method This method takes as parameters a function which calculated the explicit timestep associated with the term, a subroutine which sets the source term types for the BC and the BC are generated from the variables startVar:endVar flux conservation (fixconserve) is done for the variables specified by ixChangeStart, ixChangeN, ixChangeFixC The following two steps are done in this way as in fortran it is not allowed to pass null function pointers as parameters: 3)in order to to have hooks before_first_cycle, after_last_cycle (e.g. conversion from e_tot to e_int before first sts cycle and back from e_int to e_tot after the last STS cycle for the thermal conductivity module) add them just afterwards with the subroutine set_conversion_methods_to_head 4) to add the hook for error handling (e.g check small values in the thermal conductivity module ) call set_error_handling_to_head which takes as parameter a subroutine the error handling subroutine is called before setting BC. More...

Data Types

interface  subr2
 interface for the function which gets the timestep in dtnew in the derived type More...
 
interface  subr_e
 interface for error handling subroutine in the derived type More...
 
interface  subr5
 interface for the subroutines before_first_cycle and after_last_cycle in the derived type More...
 
interface  subr3
 for the subroutines in this module, which do not depend on the term, but on the parameter sts_method = 1/2 in the parameter file sts_add_source More...
 

Functions/Subroutines

subroutine, public sts_init ()
 Initialize sts module. More...
 
pure logical function, public is_sts_initialized ()
 
subroutine, public add_sts_method (sts_getdt, sts_set_sources, startVar, nflux, startwbc, nwbc, evolve_B)
 subroutine which added programatically a term to be calculated using STS Params: sts_getdt function calculates the explicit timestep for this term sts_set_sources subroutine sets the source term startVar, endVar, nflux indices of start, end, and number of the variables that need fix conservation startwbc, nwbc indices of start and number of the variables that need ghost cell exchange These terms implemented by an element of the derived type sts_term are put in a linked list More...
 
subroutine, public set_conversion_methods_to_head (sts_before_first_cycle, sts_after_last_cycle)
 Set the hooks called before the first cycle and after the last cycle in the STS update This method should be called after add_sts_method. The hooks are added to the last term added with this subroutine Params: sts_before_first_cycle, sts_after_last_cycle subroutines which implement the hooks called before first cycle and after last cycle. More...
 
subroutine, public set_error_handling_to_head (sts_error_handling)
 Set the hook of error handling in the STS update. This method is called before updating the BC. This method should be called after add_sts_method. The hook is added to the last term added with this subroutine. Param: sts_error_handing the subroutine which handles the errors. More...
 
integer function sts_get_ncycles1 (dt, dtnew, dt_modified)
 method used to set the number of cycles for the STS1 method More...
 
logical function, public set_dt_sts_ncycles (my_dt)
 This sets the explicit dt and calculates the number of cycles for each of the terms implemented with STS. More...
 
pure double precision function chev (j, nu, N)
 
double precision function sum_chev (nu, N, limMax)
 
subroutine sts_add_source1 (my_dt)
 Iterates all the terms implemented with STS and adds the sources STS method 1 implementation. More...
 

Variables

integer, parameter, public sourcetype_sts_prior =0
 
integer, parameter, public sourcetype_sts_after =1
 
integer, parameter, public sourcetype_sts_split =2
 
integer, public sourcetype_sts = sourcetype_sts_split
 
procedure(subr3), pointer, public sts_add_source
 

Detailed Description

Generic supertimestepping method 1) in amrvac.par in sts_list set the following parameters which have the default values: sts_dtpar=0.9,sts_ncycles=1000,sts_method=1,sourcetype_sts=2 These parametes are general for all the methods added TODO: check if there is any need to have terms implemented with different sets of parameters, and these cannot be general anymore 2) then add programatically in the code a term with the subroutine add_sts_method This method takes as parameters a function which calculated the explicit timestep associated with the term, a subroutine which sets the source term types for the BC and the BC are generated from the variables startVar:endVar flux conservation (fixconserve) is done for the variables specified by ixChangeStart, ixChangeN, ixChangeFixC The following two steps are done in this way as in fortran it is not allowed to pass null function pointers as parameters: 3)in order to to have hooks before_first_cycle, after_last_cycle (e.g. conversion from e_tot to e_int before first sts cycle and back from e_int to e_tot after the last STS cycle for the thermal conductivity module) add them just afterwards with the subroutine set_conversion_methods_to_head 4) to add the hook for error handling (e.g check small values in the thermal conductivity module ) call set_error_handling_to_head which takes as parameter a subroutine the error handling subroutine is called before setting BC.

Function/Subroutine Documentation

◆ add_sts_method()

subroutine, public mod_supertimestepping::add_sts_method (   sts_getdt,
  sts_set_sources,
integer, intent(in)  startVar,
integer, intent(in)  nflux,
integer, intent(in)  startwbc,
integer, intent(in)  nwbc,
logical, intent(in)  evolve_B 
)

subroutine which added programatically a term to be calculated using STS Params: sts_getdt function calculates the explicit timestep for this term sts_set_sources subroutine sets the source term startVar, endVar, nflux indices of start, end, and number of the variables that need fix conservation startwbc, nwbc indices of start and number of the variables that need ghost cell exchange These terms implemented by an element of the derived type sts_term are put in a linked list

Definition at line 198 of file mod_supertimestepping.t.

◆ chev()

pure double precision function mod_supertimestepping::chev ( integer, intent(in)  j,
double precision, intent(in)  nu,
integer, intent(in)  N 
)

Definition at line 401 of file mod_supertimestepping.t.

◆ is_sts_initialized()

pure logical function, public mod_supertimestepping::is_sts_initialized

Definition at line 166 of file mod_supertimestepping.t.

◆ set_conversion_methods_to_head()

subroutine, public mod_supertimestepping::set_conversion_methods_to_head (   sts_before_first_cycle,
  sts_after_last_cycle 
)

Set the hooks called before the first cycle and after the last cycle in the STS update This method should be called after add_sts_method. The hooks are added to the last term added with this subroutine Params: sts_before_first_cycle, sts_after_last_cycle subroutines which implement the hooks called before first cycle and after last cycle.

Definition at line 251 of file mod_supertimestepping.t.

◆ set_dt_sts_ncycles()

logical function, public mod_supertimestepping::set_dt_sts_ncycles ( double precision, intent(inout)  my_dt)

This sets the explicit dt and calculates the number of cycles for each of the terms implemented with STS.

Definition at line 345 of file mod_supertimestepping.t.

◆ set_error_handling_to_head()

subroutine, public mod_supertimestepping::set_error_handling_to_head (   sts_error_handling)

Set the hook of error handling in the STS update. This method is called before updating the BC. This method should be called after add_sts_method. The hook is added to the last term added with this subroutine. Param: sts_error_handing the subroutine which handles the errors.

Definition at line 276 of file mod_supertimestepping.t.

◆ sts_add_source1()

subroutine mod_supertimestepping::sts_add_source1 ( double precision, intent(in)  my_dt)

Iterates all the terms implemented with STS and adds the sources STS method 1 implementation.

Definition at line 635 of file mod_supertimestepping.t.

Here is the call graph for this function:

◆ sts_get_ncycles1()

integer function mod_supertimestepping::sts_get_ncycles1 ( double precision, intent(inout)  dt,
double precision, intent(in)  dtnew,
logical, intent(inout)  dt_modified 
)

method used to set the number of cycles for the STS1 method

Definition at line 292 of file mod_supertimestepping.t.

Here is the call graph for this function:

◆ sts_init()

subroutine, public mod_supertimestepping::sts_init

Initialize sts module.

Definition at line 145 of file mod_supertimestepping.t.

Here is the call graph for this function:

◆ sum_chev()

double precision function mod_supertimestepping::sum_chev ( double precision, intent(in)  nu,
integer, intent(inout)  N,
double precision, intent(in)  limMax 
)

Definition at line 412 of file mod_supertimestepping.t.

Here is the call graph for this function:

Variable Documentation

◆ sourcetype_sts

integer, public mod_supertimestepping::sourcetype_sts = sourcetype_sts_split

Definition at line 40 of file mod_supertimestepping.t.

◆ sourcetype_sts_after

integer, parameter, public mod_supertimestepping::sourcetype_sts_after =1

Definition at line 38 of file mod_supertimestepping.t.

◆ sourcetype_sts_prior

integer, parameter, public mod_supertimestepping::sourcetype_sts_prior =0

Definition at line 37 of file mod_supertimestepping.t.

◆ sourcetype_sts_split

integer, parameter, public mod_supertimestepping::sourcetype_sts_split =2

Definition at line 39 of file mod_supertimestepping.t.

◆ sts_add_source

procedure (subr3), pointer, public mod_supertimestepping::sts_add_source

Definition at line 139 of file mod_supertimestepping.t.