CEPS: Convergence Measurement of Implemented Methods

In addition to PDE solvers for cardiac applications, CEPS provides a tool that can be used to measure the numerical convergence rate of the solvers, in both spatial and time dimensions. The implementation allows for any "classical" PDE solver to be compatible with the convergence study.

The implementation of convergence studies necessitates to compile a new executable for each different PDE problem to be solved (e.g. one study for the monodomain application, one for the bidomain, etc). Once compiled, the study can be run like the normal application. For example:

./monodomainCvStudy params.pm


Numerical error is computed with respect to a reference solution $\bar{u}$ that is computed beforehand, usually on a very fine mesh with a very small time-step. Then several numerical solutions $u_i$ are computed on coarser meshes and with larger time steps. CEPS provides the following errors for each numerical solution:

\[ e_{1,i} = \max_t\left\| u_i^*-\bar{u} \right\|_{L^2(\Omega)}, \quad e_{2,i} = \max_t\left\| u_i^*-\bar{u} \right\|_{H^1(\Omega)}, \]

\[ e_{3,i} = \left\| u_i^*-\bar{u} \right\|_{L^2(\Omega)\times[0,T]}, \quad e_{4,1} = \left\| u_i^*-\bar{u} \right\|_{H^1(\Omega)\times[0,T]}, \]

where $u_i^*$ denotes the numerical solution interpolated in space and time on the reference mesh. The interpolation is performed by linear interpolation in space (vtk routines), and P3 Lagrange interpolation in time. All the computed errors are written in a text file as final result of the study.

As it is not always necessary to compute the reference solution (e.g. when new coarse meshes have been added). CEPS will not recompute the reference solution if no changes have been made to the related parameters of the input file. If wanted, the computation of the reference solution can be forced by using a specific parameter.

All solutions are written in the vtk legacy format, even if the study is run in parallel. This is needed as partitions may not overlap from one mesh to another. Files for the reference solution solution are put in a subdirectory named cv_ref under the main output directory. The currently computed numerical solution will be put in a subdirectory named cv_num.

Input file parameters

Most of the parameters given in the input file are common to the normal PDE solving application. However, additional parameters must be provided to control the convergence study:

reference<1,2,3>d mesh : <file name>

The mesh used to compute the reference solution

reference time step : <real>

The time step used to compute the reference solution.

convergence vtk array name : <string>

This is the name of the data arrays that will be loaded from solution files and used for error measurement.

convergence meshes : <file name1> , <file name2> , <file name3>, ...
convergence cell diameters : <real1>, <real2>, <real3>, ...

The meshes used to compute numerical solutions, and corresponding characteristic size (used for convergence plots). There must be as many meshes as cell diameters. The meshes must have the same dimensionnality as the reference mesh.

convergence time steps : <real1>, <real2>, <real3>, ...

Time steps for which numerical solutions will be computed. These time steps must be a multiple of the reference time step.

convergence results file : <fileName>

The name of the file where errors will be written.

reference computation : <1,yes,true>

(Optional) Activate this option if you want to force recomputation of reference solution. By default, the reference solution is not computed again if result files are present and parameters found in output directory match those in current input file.

Implementing a new convergence study

Convergence studies can be created for each PDE problem that is derived from the AbstractPdeProblem class.

For example, here is the core of the main function of the MonodomainConvergenceStudy.cpp file.

ConvergenceStudy s(p,pRef);
Defines and solve the monodomain problem, see models page of user doc.
Definition: MonodomainProblem.hpp:35

Two instances of the PDE problem must be created: one for the reference solution, one for the numerical solution. Then an instance of ConvergenceStudy is created with pointers to these two problems. With setupWithInputFile, the problems and the convergence study are parametrized, so that there is only to call the run method afterwards.

Note that to properly derive a new PDE problem from the AbstractPdeProblem or any child class, the methods \readParameters , initializeWithParameters, setupWithInputFile and run must be carefully redefined, eventually calling the same methods from the base class (see class CardiacProblem for examples).