Example b212a: 2D bidomain point using Beeler Reuter (defib) 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.


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.
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_b212a.com 13-Dec-2002 1.6k 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_b212a.tar.gz 14-Apr-2007 13k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:02:20 20161
cm-debugSuccessSat Mar 5 00:04:54 20161
mips-irix
cmSuccessSun Aug 19 01:45:19 200713
cm-debugSuccessWed Aug 15 01:35:57 200725
cm-debug-clear-mallocSuccessSat Aug 18 01:40:47 200730
cm-debug-clear-malloc7SuccessMon Aug 20 01:38:21 200729
cm64SuccessSun Aug 19 01:45:25 200713
cm64-debugSuccessTue Aug 21 01:33:42 200725
cm64-debug-clear-mallocSuccessThu Apr 1 11:17:55 200412
rs6000-aix
cmSuccessWed Mar 4 01:07:39 20092
cm-debugSuccessMon Mar 2 01:07:59 20094
cm64SuccessWed Mar 4 01:07:39 20092
cm64-debugSuccessTue Mar 3 01:13:17 20093
x86_64-linux
cmSuccessSun Mar 6 00:01:05 20160
cm-debugSuccessSat Mar 5 00:01:36 20161

Testing status by file:


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

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


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