Example b212b: 2D bidomain point using Beeler Reuter (defib with electroporation) model

This example uses the defibrillation Beeler Reuter model to solve for transmembrane potential in the smallest 2D bidomain possible (3 by 3 gridpoints). The action potential can be viewed using UNEMAP. This exmaple includes electroporation and scales the action potential duration by a factor of 8.


The comfile run by this example is as follows:

# Set up for bidomain.
$VM = 1
$PHI_E = 2

# Define parameter set
fem def para;r;test;example

# Define geometry
fem def base;r;spiral;example
fem def node;r;point;example
fem def elem;r;check_eg;example

# Define grid and useful grid groups.
fem def grid;r;point;example
fem update grid geometry 
fem update grid metric 
fem group grid external as boundary

# Define bidomain equations and material properties.
#  Turn on electroporation and scale the APD
fem def equa;r;spiral_bi;example class $VM,$PHI_E

fem def mate;r;check_eg;example class $VM,$PHI_E
fem def cell;r;spiral;example class $VM,$PHI_E
fem update grid material;example class $VM,$PHI_E

# Define initial and boundary conditions.
fem def init;r;point_bi;example class $VM,$PHI_E
fem def solve;r;spiral;example class $VM
fem def solve;r;spiral;example class $PHI_E

# Define window and solve to 0.
fem define window;c
fem solve to 0 class $VM,$PHI_E
fem draw field grid 1 zmin=-110 zmax=80 class $VM

# Open a binary history file to store the membrane potential
fem open history;test write variables yq niqlist 1 class $VM

# Loop through time

for $HUN ( 0..0 ) 
{
  for $TEN ( 0..9 ) 
  {
    for $UNIT ( 0..9 ) 
    {
      fem solve restart to "${HUN}${TEN}$UNIT" class $VM,$PHI_E
      fem draw field grid 1 zmin=-110 zmax=80 class $VM
      refresh graphics

      fem write history time "${HUN}${TEN}$UNIT" variables yq
    }
  }
}

# Close the history file, calculate the signal file
# from the history file, define export properties and export.
fem close history class $VM
fem evaluate electrode;test history test from grid yq
fem define export;r;point;example
fem convert signal infile test outfile test
fem export signal;test electrode signal test

Additional testing commands:

fem list signal signal test binary
fem list grid yq index v class 1
fem list grid yq index v class 2

Files used by this example are:

Name               Modified     Size

example_b212b.com 13-Dec-2002 1.7k check_eg.ipelem 02-Oct-2002 341 check_eg.ipmate 10-Apr-2000 1.7k point.ipexpo 10-Apr-2000 657 point.ipgrid 06-Mar-2003 535 point.ipnode 02-Oct-2002 825 point_bi.ipinit 10-Apr-2000 1.3k spiral.ipbase 10-Apr-2000 1.1k spiral.ipcell 10-Apr-2000 2.0k spiral.ipsolv 13-Apr-2007 1.8k spiral.ipsolv.old 10-Apr-2000 1.4k spiral_bi.ipequa 26-May-2003 1.6k test.binhis 10-Apr-2000 4.2k test.ippara 12-Nov-2002 5.9k test_output.com 23-Apr-2001 101

Download the entire example:

Name                                 Modified     Size

examples_b_b2_b21_b212_b212b.tar.gz 14-Apr-2007 13k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:02:21 20160
cm-debugSuccessSat Mar 5 00:04:41 20162
mips-irix
cmSuccessSun Aug 19 01:46:38 200713
cm-debugSuccessWed Aug 15 01:36:24 200725
cm-debug-clear-mallocSuccessSat Aug 18 01:42:26 200730
cm-debug-clear-malloc7SuccessMon Aug 20 01:38:46 200729
cm64SuccessSun Aug 19 01:46:00 200713
cm64-debugSuccessTue Aug 21 01:34:05 200725
cm64-debug-clear-mallocSuccessThu Apr 1 11:18:05 200412
rs6000-aix
cmSuccessWed Mar 4 01:08:13 20091
cm-debugSuccessMon Mar 2 01:08:08 20094
cm64SuccessWed Mar 4 01:07:40 20091
cm64-debugSuccessTue Mar 3 01:13:21 20094
x86_64-linux
cmSuccessSun Mar 6 00:01:05 20160
cm-debugSuccessSat Mar 5 00:01:37 20161

Testing status by file:


Html last generated: Sun Mar 6 05:51:11 2016

Input last modified: Fri Apr 13 10:38:46 2007


CMISS Help / Examples / b / b2 / b21 / b212 / b212b