0 votes
by (350 points)
Not sure if this should be a bug report or just a question. I would love to know if there already exists a way around this problem I am having.

I can successfully use the prepacing_lats and associated options to initilize a simulation from a set of prescribed activation times. However, if I do so in a mesh that uses 1) the monodomain and 2) gregions that prescribe some tissue as scar (modeled as extracellular bath and therefore removed from the intracellular grid) I run into indexing issues. Specifically here is my pipeline:

1) Have a generated model
2) Generate a set of prescribed activation times across this model. These activation times are defined across every node of the model.
3) pass the model and activation times to openCARP as well as, on occasion, a retagfile to dynamically change some of the elements to scar tissue. openCARP will then generate an intracellular domain grid (which does not include the scar elements). This present a problem because now the activation times, which were defined on the whole mesh, no longer match up. This leads to an incorrect LAT-based initilization (it still proceeds but with a garbage activation sequence).

The preferred behavior would be for the provided prepacing_lats to be atuomatically clipped by the same process that generates the intracellular grid. I could of course generate the LAT map myself based on what will be the at runtime intracellular grid, but this is clunky especially if I have a combination of pre-defined scar elements and dynamic retagging of scar elements. It seems like openCARP should be able to do this as it already handles re-formatting all of the other node indicies for things like pacing sites, element tags, etc, to match the simulation grid even when they are input and defined in the context of the full mesh.

For context here is an example of what a job call would look like. The $runScript is just a simple carputils tools.carpexample job that parses my inputs and sets up the openCARP call with formatting for things like simulation time and setting up the dynamic retagging. In this case assume the tag 999 corresponds to scar tissue and that the mesh may or may not already have some scar tissue in it.

python3 -u $runScipt \
    --np $SLURM_NTASKS \
    --ParFile $parFile \
    --planFile $planFile\
    --build $build\
    --mesh $mesh \
    --outdir $outdir\
    --ID $outdir\
    --overwrite-behaviour "overwrite" \
    --CARP-opts "-gridout_i 2"\
    --CARP-opts "-prepacing_lats $prepaceFile"\
    --CARP-opts "-prepacing_beats 2"\
    --CARP-opts "-prepacing_bcl 250"\
    --addedTime 1000\
    --numStims 0\
    --RetagFile $retagFile\
    --ReTagVal 999\

1 Answer

0 votes
ago by (1.6k points)
Hey Jake,

I think there is currently no way around the indexing issue you experience when you essentially remove parts of the mesh from the intracellular grid at runtime.

The retagging and setup of the mesh is separate from the electrics setup where the LAT prepacing is processed. The electrics setup does not know about the retagging at all and gets initialized from the "new" mesh. That also makes it a bit more difficult to implement such behavior.

The simplest way to achieve what you want to do is to not move the scar tissue into the extracellular bath, but to keep it intracellular with a very small (but non-zero) isotropic conductivity. For monodomain, this might even be the preferred solution, since the scar tissue can still act as a sink for electrical charges. If you move the tissue to extracellular bath, you implicitly get the zero flux Neumann boundary condition on all scar borders.
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...