xx The scalar wave equation in Method of Lines form

The scalar wave equation in Method of Lines form

Ian Hawke

Date

Abstract

WaveMoL is an example implementation of a thorn that uses the method of lines thorn MoL. The wave equation in first order form is implemented.

1 Purpose

WaveToy is the simple test thorn that comes with Cactus as standard. This is written so that it solves the wave equation directly using the leapfrog scheme. This form of the equations isn’t suitable for use with the method of lines.

The purpose of this thorn is to rewrite the equations in first order form The first three equations (which expand to five separate PDEs) will be evolved. The final equation is used to set the initial data and can be thought of as a constraint.

This will be implemented using simple second order differencing in space. Time evolution is performed by the method of lines thorn MoL.

2 How it works

The equations are evolved entirely using the method of lines thorn. So all we have to provide (for the evolution) is a method of calculating the right hand side of equationx(??) and boundary conditions. The boundary conditions are standard from wavetoy itself. The right hand side is calculated using second order centred finite differences.

To be compatible with the method of lines thorn we must let it know that the GFs exist and where they are stored. They should all have at least two time levels (although the addition of extra time levels may not cause problems it’s just wasting space). The GFs corresponding to the right hand sides must also be registered with the MoL thorn. These should only have one time level. MoL is informed of the existence of these grid functions through the accumulator parameters and the aliased functions.

3 Parameters

11 bound 10 Scope: private01 KEYWORD

11 Description: Type of boundary condition to use

11 Range 10 01 Default: none
11 none  10 No boundary condition
11 flat  10 Flat boundary condition
11 radiation  10 Radiation boundary condition

11

11 wavemolxmaxnumconstrainedvars10 Scope: restricted01  INT

11 Description: The maximum number of constrained variables used by WaveMoL

11 Range 10 01 Default: 1
11 1:1  10 The energy

11

11 wavemolxmaxnumevolvedvars 10 Scope: restricted01  INT

11 Description: The maximum number of evolved variables used by WaveMoL

11 Range 10 01 Default: 5
11 5:5  10 Just 5: phi and the four derivatives

11 molxnumxconstrainedxvars  10 Scope: shared from METHODOFLINES01INT

11

11 molxnumxevolvedxvars  10 Scope: shared from METHODOFLINES01INT

11

11 molxnumxsaveandrestorexvars 10 Scope: shared from METHODOFLINES01INT

11

4 Interfaces

General Implements: wavemol

Grid Variables

4.0.1 PUBLIC GROUPS

11 x Group Names x 10 x Variable Names x01 Details x 11 x
11 scalarevolvemolxscalar 10                    01  compact 11 0
11                     10  phi  01 description 11 The scalar field and time derivative
11                     10  phit  01 dimensions 11 3
11                     10                    01 distribution 11 DEFAULT
11                     10                    01 group type 11 GF
11                     10                    01  tags 11 tensortypealias=”Scalar”
11                     10                    01 timelevels 11 3
11                     10                    01 variable type 11 REAL
11 scalarevolvemolxvector 10                    01  compact 11 0
11                     10  phix  01 description 11 The scalar field spatial derivatives
11                     10  phiy  01 dimensions 11 3
11                     10  phiz  01 distribution 11 DEFAULT
11                     10                    01 group type 11 GF
11                     10                    01  tags 11 tensortypealias=”U”
11                     10                    01 timelevels 11 3
11                     10                    01 variable type 11 REAL
11 scalarrhsmolxscalar 10                    01  compact 11 0
11                     10  phirhs  01 description 11 The right hand side for the scalar field
11                     10  phitrhs  01 dimensions 11 3
11                     10                    01 distribution 11 DEFAULT
11                     10                    01 group type 11 GF
11                     10                    01 timelevels 11 1
11                     10                    01 variable type 11 REAL
11 scalarrhsmolxvector 10                    01  compact 11 0
11                     10  phixrhs  01 description 11 The right hand side for the scalar field derivatives
11                     10  phiyrhs  01 dimensions 11 3
11                     10  phizrhs  01 distribution 11 DEFAULT
11                     10                    01 group type 11 GF
11                     10                    01 timelevels 11 1
11                     10                    01 variable type 11 REAL
11 energy 10 energy 01 compact 11 0
11                     10                    01 description 11 The energy of the field
11                     10                    01 dimensions 11 3
11                     10                    01 distribution 11 DEFAULT
11                     10                    01 group type 11 GF
11                     10                    01 timelevels 11 1
11                     10                    01 variable type 11 REAL

11

Uses header: Symmetry.h

5 Schedule This section lists all the variables which are assigned storage by thorn CactusExamples/WaveMoL. 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

11 Always:  11 x
11 scalarevolvemolxscalar[3] scalarevolvemolxvector[3] 11 x
11 scalarrhsmolxscalar scalarrhsmolxvector  11 x
11 energy  11 x

11 x  11 x

11

Scheduled Functions

CCTKxSTARTUP x wavemolxstartup x register banner x

11 x 11 Language: 11 c
11 x 11 Type:  11 function

11

CCTKxBASEGRID x wavemolxinitsymbound x schedule symmetries x

11 x 11 Language: 11 c
11 x 11 Options: 11 meta
11 x 11 Type:  11 function

11

MoLxRegister x wavemolxregistervars x register variables for mol x

11 x 11 Language: 11 c
11 x 11 Options: 11 meta
11 x 11 Type:  11 function

11

DriverxBoundarySelect x wavemolxselectdriverbc x choose boundary condtion for driver to apply x

11 x 11 Language: 11 c
11 x 11 Options: 11 global
11 x 11 Type:  11 function

11

MoLxCalcRHS x wavemolxcalcrhs x register rhs calculation for mol

11 x 11 Language: 11 c
11 x 11 Reads:  11 wavemol::phit(everywhere)
11 x 11 x  11 scalarevolvemolxvector
11 x 11 Type:  11 function
11 x 11 Writes: 11 wavemol::scalarrhsmolxscalar(interior)
11 x 11 x  11 scalarrhsmolxvector

11

MoLxPostStep x wavemolxboundaries x register boundary enforcement in mol x

11 x 11 Language: 11 c
11 x 11 Options: 11 level
11 x 11 Sync:  11 scalarevolvemolxscalar
11 x 11 x  11 scalarevolvemolxvector
11 x 11 Type:  11 function

11

MoLxPostStep x applybcs x apply boundary conditions for wavemol x

11 x 11 After: 11 wavemolxboundaries
11 x 11 Type: 11 group

11

MoLxPostStep x wavemolxenergy x calculate the energy x

11 x 11 After:  11 wavemolxapplybcs
11 x 11 Language: 11 c
11 x 11 Reads:  11 wavemol::phit(everywhere)
11 x 11 x  11 scalarevolvemolxvector
11 x 11 Type:  11 function
11 x 11 Writes: 11 wavemol::energy(everywhere)

11

CCTKxPOSTINITIAL x wavemolxenergy x calculate the energy x

11 x 11 Language: 11 c
11 x 11 Reads:  11 wavemol::phit(everywhere)
11 x 11 x  11 scalarevolvemolxvector
11 x 11 Type:  11 function
11 x 11 Writes: 11 wavemol::energy(everywhere)

11

Aliased Functions

11 Alias Name: xxxxxxx 11 Function Name:
11 ApplyBCs  11 WaveMoLxApplyBCs