Time

Gabrielle Allen

\( \)Date\( \)

Abstract

Calculates the timestep used for an evolution

1 Purpose

This thorn provides routines for calculating the timestep for an evolution based on the spatial Cartesian grid spacing and a wave speed.

2 Description

Thorn Time uses one of four methods to decide on the timestep to be used for the simulation. The method is chosen using the keyword parameter time::timestep_method.

In all cases, Thorn Time sets the Cactus variable cctk_delta_time which is passed as part of the macro CCTK_ARGUMENTS to thorns called by the scheduler.

Note that for hyperbolic problems, the Courant condition gives a minimum requirement for stability, namely that the numerical domain of dependency must encompass the physical domain of dependency, or

                        √----
Δt ≤ min (Δxi )∕wave speed∕ dim

3 Examples

Fixed Value Timestep

time::timestep_method = "given"
time::timestep        = 0.1

Calculate Static Timestep Based on Grid Spacings

The following parameters set the timestep to be 0.25

grid::dx    = 0.5
grid::dy    = 1.0
grid::dz    = 1.0
time::timestep_method = "courant_static"
time::dtfac = 0.5

4 Parameters




courant_fac
Scope: private  REAL



Description: The courant timestep condition dt = courant_fac*max(delta_space)/speed/sqrt(dim)



Range   Default: 0.9
0:*
For positive timestep
*:0
For negative timestep






dtfac
Scope: private  REAL



Description: The standard timestep condition dt = dtfac*max(delta_space)



Range   Default: 0.5
0:*
For positive timestep
*:0
For negative timestep






timestep
Scope: private  REAL



Description: Absolute value for timestep



Range   Default: 0.0
*:*
Could be anything






timestep_outevery
Scope: private  INT



Description: How often to output courant timestep



Range   Default: 1
1:*
Zero means no output






verbose
Scope: private  BOOLEAN



Description: Give selective information about timestep setting



  Default: no






timestep_method
Scope: restricted  KEYWORD



Description: Method for calculating timestep



Range   Default: courant_static
given
Use given timestep
courant_static
Courant condition at BASEGRID (using dtfac)
courant_speed
Courant condition at POSTSTEP (using wavespeed and courant_fac)
courant_time
Courant condition at POSTSTEP (using min time and courant_fac)






timestep_outonly
Scope: restricted  BOOLEAN



Description: Don’t set a dynamic timestep, just output what it would be



  Default: no






cctk_final_time
Scope: shared from CACTUS REAL






terminate
Scope: shared from CACTUS KEYWORD



5 Interfaces

General

Implements:

time

Grid Variables

5.0.1 PRIVATE GROUPS




  Group Names    Variable Names    Details   




couranttemps   compact0
courant_dt   descriptionVariable just for output
  dimensions0
  distributionCONSTANT
  group typeSCALAR
  timelevels1
 variable typeREAL




5.0.2 PUBLIC GROUPS




  Group Names    Variable Names    Details   




speedvars   compact0
courant_wave_speed   descriptionSpeed to use for Courant condition
courant_min_time   dimensions0
  distributionCONSTANT
  group typeSCALAR
  timelevels1
 variable typeREAL




6 Schedule

This section lists all the variables which are assigned storage by thorn CactusBase/Time. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage

 

Always:  
speedvars couranttemps 
   

Scheduled Functions

CCTK_BASEGRID

  time_initialise

  initialise time variables

 

 Before: time_simple
 Language:c
 Options: global
 Type: function
 Writes: time::speedvars
   time::courant_dt(everywhere)

CCTK_BASEGRID (conditional)

  time_simple

  set timestep based on courant condition (courant_static)

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Type: function

CCTK_BASEGRID (conditional)

  time_courant

  set timestep based on courant condition (courant_speed)

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Reads: time::speedvars
 Type: function
 Writes: time::courant_dt(everywhere)

CCTK_POSTSTEP (conditional)

  time_courant

  reset timestep each iteration

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Reads: time::speedvars
 Type: function
 Writes: time::courant_dt(everywhere)

CCTK_BASEGRID (conditional)

  time_simple

  set timestep based on courant condition (courant_time)

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Type: function

CCTK_POSTSTEP (conditional)

  time_courant

  reset timestep each iteration

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Reads: time::speedvars
 Type: function
 Writes: time::courant_dt(everywhere)

CCTK_BASEGRID (conditional)

  time_given

  set fixed timestep

 

 After: spatialspacings
 Language:c
 Options: singlemap
 Type: function

Aliased Functions

 

Alias Name:        Function Name:
Time_Courant TemporalSpacings
Time_Given TemporalSpacings
Time_Simple TemporalSpacings