CEPS  24.01
Cardiac ElectroPhysiology Simulator
Input/Output

This page regroups additional information on inputs and outputs of CEPS. See this page for text file inputs.

Meshes

File Format

Readable mesh formats are

  • .mesh (medit,gmsh,...)
  • .ele (Tetgen). .face .node files must be present alongside the .ele file.
  • .pvtu (parallel XML VTK file)
  • .vtk (legacy VTK file)

The prefered mesh format is vtk or pvtu, for the reasons listed in sections below.

All meshes must have 3 dimensional coordinates, even if it is a 2d or 1d mesh.

The expected unit for coordinates in cardiac problems is the centimeter. Use the geometry scale parameter in the text input file for easy unit change.

Dimension, boundary elements

Several meshes can be given for each dimension (1d,2d,3d). The meshes will be merged into a single computational domain, but not coupled by default. To couple meshes refer to the coupled nodes section.

CEPS requires boundary elements to impose boundary conditions. For each dimension $d$, a mesh can contain volumic simplices of dimension $d$, and boundary simplices of dimension $-1$. The elements given in a mesh in a input line of lower dimension will not be considered as boundary elements of the higher dimension mesh. Boundary elements must be given in the same mesh file than volumic elements.

For example, when meshing a 3D domain with gmsh, save the 2D elements on boundary and the 3D elements in the same mesh file. Give this file as input with the 3d mesh entry.

Attributes

In CEPS, several attributes can be given to each point and/or cell within a mesh. Attributes are used to locate regions of the computational domain. For example, a boundary condition can be imposed on part of the boundary thanks to attributes.

Here are some information to keep in mind when building a mesh that will be used by CEPS:

  • All integer arrays from vtk files are considered as attributes, for other types of data, use real data arrays.
  • Only positive attributes are imported in CEPS. The -1 attribute is reserved as "Everywhere else" attribute.
  • Attributes given to a cell are all passed to all vertices that delimit the cell. Be careful when giving attribute to cells and points, as there is a risk to "overwrite" attributes.

Coupling meshes through nodes

It is possible to couple meshes two by two by providing a list of node indices between which an edge will be added. To work properly, the file containing coupling data must be given in the main input file using the coupled nodes entry.

The file must contain the following pattern for each pair of coupled meshes:

COUPLING
<meshA>
<meshB>
<N>
<nodeA1> <nodeB1>
<nodeA2> <nodeB2>
...
<nodeAN> <nodeBN>
[COUPLING
...]

where meshA and meshB are the complete file names of the two linked meshes, N is the number of couples to be read and nodeABX are the respective IDs of the coupled nodes in those meshes. Several couplings can be given in the same file.

Data arrays

Real-valued data arrays can be passed to CEPS. They can be made of scalar, vector or tensorial data. Some problems can be parametrized with custom coefficients imported from mesh files

Fibers

In order to pass fibers orientation to CEPS, it is possible to do it in two ways:

  • if the mesh is provided in a vtk file, fibers can be given in the same file, in 3 vectorial cell-data arrays named "fibers" for longitudinal direction, and "fibers_transverse" and "fibers_normal" for other directions.
  • for other mesh formats, in a separate .msh file (not .mesh) where orientations are given element per element (one line per element) eight lines after the keyword "$ElementData". Each line must have at least 3 scalars for main direction, then optionally 3 for transverse and 3 more for normal direction.

Outputs

Regular outputs format

When solving a PDE, CEPS will write the following files.

For spatial data, either one of these three formats, selected with the "output format" option:

  • with the "MUSICARDIO" option, which is the same as "VTK_LEGACY", a collection of legacy .vtk files will be generated in a subdirectory called snapshots, along with a .xml file in the main output directory, that can be opened in the MUSICARDIO software.
  • with the "PARAVIEW_SERIES" (or "PSERIES" for short), the snaphot files will be of the .vtu format. The collection file name ends in .series and can be opened in Paraview to load all the data at once.
  • with the "CEPS" options, a custom file format is used for snapshots. These files can be loaded on the input mesh thanks to the Paraview plugin that creates the "AppendCepsData" filter. See below.

Note that the MUSICARDIO, VTK_LEGACY and CEPS outputs require communications between CPUS at each writing step, since only the master CPUs writes a single file. The PARAVIEW_SERIES files are written in parallel. The CEPS output files do not duplicate the geometry, though. Choosing the output format is then a trade-off between disk usage and computation time.

Additionally, if probe points are given in the main text input file, a text file (suffixed _probes.dat) is written, with values of the PDE unknowns interpolated at the probe points on each column, for each time iteration.

Cardiac outputs

When solving a cardiac problem, maps of activation time, APD50, custom APDxx% and AP peak values can be computed along the simulation and output in the end. To do so, you must fill the activation time data entry in the main text input file.

activation time data : <id1> <t1> <p1> <m1> [, <id2> <t2> <p2> <m2> , ...]

Each group of four numbers declares how the action potential signal is processed for an unknown of the problem. id is the identifier of that unknown and the real values t p m are used as follows:

Peak is defined as the first point with negative time derivative after the minimum value m has been reached.

Paraview plugin for outputs

This plugin, located in the contrib directory, can be added to Paraview (Tools -> Manage Plugins... -> Load New). The plugin creates the AppendCepsData filter. This filter can be applied on the input mesh that CEPS used for computation of spatial data. With the ... button next to File Names in the left column, select the files within the snapshots directory that have the ceps_vtk extension, then click on Apply.