TestMoL

February 12 2014

Abstract

This thorn provides tests (partially correctness tests) for MoL. It integrates a known function in time choosing for each ODE method a polynomial in time that can be exactly integrated by the method.

1 Introduction

The method of lines thorn (MoL) provides time integration facilities in Cactus. It basically is a wrapper for ODE integrators. As such it can be tested by comparing its results against known analytic solutions.

2 Physical System

For grid functions we integrate

 $ẏ=-1+{t}^{n}$ (1)

where $n$ is chosen such that a given ODE method can integrate the polynomial exactly, eg. $n=3$ for the classical Runge-Kutta method. For multi-rate ODE methods, the slow sector integrates

 $ẏ=-1+\frac{1}{4}{t}^{m}$ (2)

where $m$ is usually smaller than $n$, eg. $2$ for the RK4-RK2 scheme. Finally grid arrays integrate

 $ẏ=-1+\frac{1}{2}{t}^{n}$ (3)

where $n$ is the same as for (fast) grid functions.

3 Numerical Implementation

All numerical methods are provided by MoL. We construct the numerical solution be evaluating the RHS on the full domain, no ghost or boundary zones are required. We provide the numerical solution in evolved_gf, evolvedslow_gf, evolved_ga for the grid function, slow sector grid function and grid array respectively. For each type we provide the analytical solution in analytic_gf, analyticslow_gf, analytic_ga. We provide the diﬀerence between the two in diff_gf, diffslow_gf, diff_ga.

Parameter ﬁles for the tests are generated using a perl script ODEs.pl in the test directory. Its use is brieﬂy explained in a comment near the top of the ﬁle.

4 Using This Thorn

This thorn provides no functionality other than the tests.

4.1 Obtaining This Thorn

This thorn is part of the CactusTest arrangement and can be checked out from the same source as Cactus.

4.2 Interaction With Other Thorns

This thorn requires MoL.

5 Parameters

 evolve_grid_array Scope: private BOOLEAN Description: register an evolved grid array with MoL Default: yes

 evolve_grid_function Scope: private BOOLEAN Description: register an evolved grid function with MoL Default: yes

 rhsexpression Scope: private KEYWORD Description: expression to use for the right-hand-side of the ODE Range Default: 1 1 unit rhs t linear in time rhs t**2 quadratic in time rhs t**3 cubic in time rhs t**4 quartic in time rhs t**5 quintic in time rhs t**6 sixth order in time rhs t**7 seventh order in time rhs t**8 eight order in time rhs t**9 ninth order in time rhs exp(t) exponential in time rhs

 rhsslowexpression Scope: private KEYWORD Description: expression to use for the right-hand-side of the slow ODE Range Default: 1 1 unit rhs t linear in time rhs t**2 quadratic in time rhs t**3 cubic in time rhs t**4 quartic in time rhs t**5 quintic in time rhs t**6 sixth order in time rhs t**7 seventh order in time rhs t**8 eight order in time rhs t**9 ninth order in time rhs exp(t) exponential in time rhs

6 Interfaces

Implements:

testmol

Inherits:

methodoﬂines

Grid Variables

6.0.1 PRIVATE GROUPS
 Group Names Variable Names Details evolved_gf compact 0 evolved_gf description an evolved grid function dimensions 3 distribution DEFAULT group type GF timelevels 3 variable type REAL rhs_gf compact 0 rhs_gf description the rhs for the evolved grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL evolvedslow_gf compact 0 evolvedslow_gf description a slow evolved grid function dimensions 3 distribution DEFAULT group type GF timelevels 3 variable type REAL rhsslow_gf compact 0 rhsslow_gf description the rhs for the slow evolved grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL constrained_gf compact 0 constrained_gf description a constrained grid function dimensions 3 distribution DEFAULT group type GF timelevels 3 variable type REAL sandr_gf compact 0 sandr_gf description a save-and-restore grid function dimensions 3 distribution DEFAULT group type GF timelevels 3 variable type REAL
 Group Names Variable Names Details diﬀ_gf compact 0 diﬀ_gf description diﬀerence to analytic solution in grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL analytic_gf compact 0 analytic_gf description analytic solution in grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL diﬀslow_gf compact 0 diﬀslow_gf description diﬀerence to analytic solution in grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL analyticslow_gf compact 0 analyticslow_gf description analytic solution in grid function dimensions 3 distribution DEFAULT group type GF timelevels 1 variable type REAL evolved_ga compact 0 evolved_ga description an evolved grid array dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL rhs_ga compact 0 rhs_ga description the rhs of the evolved grid array dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL
 Group Names Variable Names Details constrained_ga compact 0 constrained_ga description a constrained grid array dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL sandr_ga compact 0 sandr_ga description a save-and-restore grid array dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL diﬀ_ga compact 0 diﬀ_ga description diﬀerence to analytic solution in grid function dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL analytic_ga compact 0 analytic_ga description analytic solution in grid function dimensions 1 distribution CONSTANT group type ARRAY size 1 timelevels 3 variable type REAL

7 Schedule

This section lists all the variables which are assigned storage by thorn CactusTest/TestMoL. 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: evolved_gf[3] evolvedslow_gf[3] constrained_gf[3] sandr_gf[3] rhs_gf[1] rhsslow_gf[1] diﬀ_gf[1] analytic_gf[1] diﬀslow_gf[1] analyticslow_gf[1] evolved_ga[3] constrained_ga[3] sandr_ga[3] rhs_ga[1] diﬀ_ga[1] analytic_ga[1]

Scheduled Functions

MoL_Register

testmol_registervars

register evolved, rhs variables

 Language: c Options: meta Type: function

CCTK_INITIAL

testmol_initvars

provide initial data for all variables

 Language: c Type: function

MoL_CalcRHS

testmol_rhs_gf

compute the rhs for the evolved grid function

 Language: c Type: function

MoL_CalcRHS

testmol_rhsslow_gf

compute the rhs for the slow evolved grid function

 Language: c Type: function

MoL_CalcRHS

testmol_rhs_ga

compute the rhs for the evolved grid function

 Language: c Type: function

CCTK_ANALYSIS

testmol_compare_gf

compare analytic and numerial result in grid function

 Language: c Type: function

CCTK_ANALYSIS

testmol_compare_ga

compare analytic and numerial result in grid array

 Language: c Type: function