xx CTMultiLevel

CTxMultiLevel

Eloisa Bentivegna <eloisa.bentivegna@ct.infn.it>

May 27 2013

Abstract

This thorn implements a multigrid solver for systems of elliptic partial differential equations. It uses Carpet’s interface to handle loops over the grid hierarchy and pass information between different components. The system of equations is passed to the solver via parameters pointing to the external grid functions that hold the equation coefficients.

1 Introduction

CTxMultiLevel is a Cactus thorn that implements a multigrid solver for elliptic partial differential equations (PDEs). The implementation is rather standard, and it also allows for local AMR grids (in which case it uses a rudimentary multilevel algorithm).

This thorn requires Carpet, which it uses to manage the access to the grid structure (via the BEGINx*xLOOP and ENDx*xLOOP macros) and to pass information between the different levels (via the restriction and prolongation operators).

Structurally, the solver can tackle any type of equation or system of equations, their coefficients being passed to CTxMultiLevel via string parameters holding the names of the corresponding grid function. The thorn comes with a number of test cases which should be easy to customize and extend.

2 Principle of multigrid

Multigrid schemes are designed to solve elliptic equations on a hierarchy of grids, with the goal of speeding up the convergence rate of relaxation algorithms (such as Gauss-Seidel) by eliminating different frequency modes of the solution error on different grids. It is known that relaxation techniques are very effective at eliminating the high-frequency part of the error; when solving an elliptic PDE on a grid, it is then advantageous to relax it on a coarser grid beforehand and interpolate the result back onto the original grid. Complex schemes involving several grid levels, each with a different PDE, can be designed to maximize the speed up. Please refer tox[?] for the details.

3 Using This Thorn

CTxMultiLevel, along with the rest of the Cosmology arrangement, is released under the General Public License, version 2 and higher. The copyright of this thorn remains with myself.

3.1 Obtaining This Thorn

CTxMultiLevel is publicly available in COSMOTOOLKIT’s git repository:

xxxgitxclonexhttps://eloisa@bitbucket.org/eloisa/cosmology.git

A helper thorn CTxAnalytic is available under the same repository.

3.2 Basic Usage

In order to solve an elliptic PDE with CTxMultiLevel, CTxMultiLevel can be simply compiled in, with the requirement that Carpet is compiled as well. The thorn also inherits from boundary and grid for boundary APIs and coordinate labels.

Currently, the equation is solved in a single schedule call at CCTKxINITIAL, in GLOBALxLATE mode (to ensure that necessary objects such as the grid arrays have been populated).

As the equation coefficients will be set by grid functions, a thorn allocating and setting these grid functions to the desired values has to be included. Another thorn in the Cosmology arrangement, CTxAnalytic, serves this purpose. Grid functions of other origin are naturally just as good.

Each equation in the system to solve is parametrized as follows:

All the coefficients and the powers can be specified by setting the parameters *xgfname[*] to the desired grid function name. These parameters are arrays to allow for the solution of systems of equations.

The only other parameter which must be set to ensure correct operation is CTxMultiLevel::topMGlevel, which tells the solver which is the finest refinement level that covers the entire domain in which the equation is to be solved. All levels below and including this will be used in the classical multigrid sense (e.g., in a V- or FMG-cycle). The ones above will be treated as local AMR boxes, and be solved via a multilevel prescription; presently, this involves simply interpolating the solution from the topMGlevel refinement level at the end of the multigrid part and relaxing it progressively, from coarser to finer, on all the local grids.

Other parameters control the stopping criteria (numbers of relaxation sweeps and residual tolerance), the finite-differencing order used to discretized the equation, the number of equations in the system, and whether the solution error should be calculated (this obviously requires the exact solution to be known and stored in a grid function, its name passed to CTxMultiLevel via the usual parameter mechanism).

Concrete examples on how to set these parameters are provided below.