CEPS

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:
Numerical error is computed with respect to a reference solution that is computed beforehand, usually on a very fine mesh with a very small timestep. Then several numerical solutions are computed on coarser meshes and with larger time steps. CEPS provides the following errors for each numerical solution:
where 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
.
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:
The mesh used to compute the reference solution
The time step used to compute the reference solution.
This is the name of the data arrays that will be loaded from solution files and used for error measurement.
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.
Time steps for which numerical solutions will be computed. These time steps must be a multiple of the reference time step.
The name of the file where errors will be written.
(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.
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.
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).