TestMoL

Roland Haas <rhaas@caltech.edu>

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 + tn (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 + 1 4tm (2)

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

= 1 + 1 2tn (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 difference between the two in diff_gf, diffslow_gf, diff_ga.

Parameter files for the tests are generated using a perl script ODEs.pl in the test directory. Its use is briefly explained in a comment near the top of the file.

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

General

Implements:

testmol

Inherits:

methodoflines

Grid Variables

6.0.1 PRIVATE GROUPS




  Group Names    Variable Names    Details   




evolved_gf   compact0
evolved_gf   descriptionan evolved grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels3
 variable typeREAL




rhs_gf   compact0
rhs_gf   descriptionthe rhs for the evolved grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




evolvedslow_gf   compact0
evolvedslow_gf   descriptiona slow evolved grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels3
 variable typeREAL




rhsslow_gf   compact0
rhsslow_gf   descriptionthe rhs for the slow evolved grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




constrained_gf   compact0
constrained_gf   descriptiona constrained grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels3
 variable typeREAL




sandr_gf   compact0
sandr_gf   descriptiona save-and-restore grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels3
 variable typeREAL








  Group Names    Variable Names    Details   




diff_gf   compact0
diff_gf   descriptiondifference to analytic solution in grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




analytic_gf   compact0
analytic_gf   descriptionanalytic solution in grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




diffslow_gf   compact0
diffslow_gf   descriptiondifference to analytic solution in grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




analyticslow_gf   compact0
analyticslow_gf   descriptionanalytic solution in grid function
  dimensions3
  distributionDEFAULT
  group typeGF
  timelevels1
 variable typeREAL




evolved_ga   compact0
evolved_ga   descriptionan evolved grid array
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL




rhs_ga   compact0
rhs_ga   descriptionthe rhs of the evolved grid array
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL








  Group Names    Variable Names    Details   




constrained_ga   compact0
constrained_ga   descriptiona constrained grid array
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL




sandr_ga   compact0
sandr_ga   descriptiona save-and-restore grid array
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL




diff_ga   compact0
diff_ga   descriptiondifference to analytic solution in grid function
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL




analytic_ga   compact0
analytic_ga   descriptionanalytic solution in grid function
  dimensions1
  distributionCONSTANT
  group typeARRAY
  size1
  timelevels3
 variable typeREAL




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]  
diff_gf[1] analytic_gf[1] diffslow_gf[1] analyticslow_gf[1]  
evolved_ga[3] constrained_ga[3] sandr_ga[3]  
rhs_ga[1]  
diff_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