Example b362: Noble 98 - HMT 2D sheet with infarct & SAC's

This example uses the coupled Noble 98 - HMT cellular model within a 2D bicubic-Hermite sheet of 64 elements with a constant fibre angle of 0°. The is one element which is a simulated "infarct" with lower conductivity and increased SAC density.

The model is stimulated with a plane wave at the left-hand edge. There are two fixed nodes in the upper left-hand edge of the mesh.

The image below illustrates the results from this example, a quicktime movie is available as well.

Sheet Animation

draw.com can be used to visualise the results of this simulation.


The comfile run by this example is as follows:


# Timing information
$tstart = 0.0;
$tend = 2.0;
$tstep = 1.0;

# Classs definitions
$MECHANICS = 1
$CELL = 2

# FE Mechanics solve information
$MECH_ERRTOL = 0.001
$MAX_MECH_ITER = 99

# Define problem size 
fem define parameter;r;emech;example

# Set up the geometry 8x8 elements 32*32mm bicubic Hermite basis
fem define node;r;emech-8x8-cubic;example
fem define base;r;emech-cubic;example
fem define elem;r;emech-8x8-cubic;example
# 0deg fibre angles everywhere
# define a linear basis for the fibres
fem define;add base;r;emech-linear;example
fem define fibr;d
fem define elem;r;emech-8x8;example fibre

fem update scale_factor normalise

# Node/element groups to set BCs
fem group node external as bdy_nodes
fem group node 81,72 as fixed_nodes
fem group element 1..64 as ALL_ELEMENTS
# The infarct element
fem group element 26 as INFARCT
fem group element 1..25,27..64 as NON_INFARCT

# Set up the FE mechanics
fem define equa;r;mech-cubic;example class $MECHANICS lock
fem define mate;r;mech-cubic;example class $MECHANICS
fem define init;r;mech-cubic;example class $MECHANICS
fem define solv;r;mech-cubic;example class $MECHANICS
fem define acti;r;mech-cubic;example class $MECHANICS

# Set up the cell modelling
fem define grid;r;cell-18x18;example class $CELL
fem update grid geometry
fem update grid metric
fem group grid xi1=0 oneoff as stimulus1_site
fem define equa;r;cell-n98_hmt;example class $CELL
fem define mate;r;cell-n98_hmt-block;example class $CELL
fem define cell;r;cell-n98_hmt;example class $CELL
fem define mate;r;cell-n98_hmt;example cell class $CELL
fem update grid material class $CELL
fem define init;r;cell-n98_hmt;example class $CELL
fem define solv;r;cell-n98_hmt-explicit-euler;example class $CELL

# Export the geometry....
# ... undeformed ...
fem export node;sheet as sheet
fem export element;sheet as sheet
# ... and define the deformed field ...
fem export element;deformed field as sheet
# ... and the grid point numbers ...
fem export element;numbers as sheet grid_numbers
# ... and the cell parameters
fem export element;parameters field cell as sheet class $CELL

# Initialise the cell integration
fem solve class $CELL to 0

####
#### Use the isometric tension.....
####
# Tension index for grid (YQS) and Gauss (YG) variables
####fem inquire cell_variable Tension return_variables T_GRIDARRAY,T_GRIDIDX
fem inquire cell_variable IsometricTension return_variables T_GRIDARRAY,T_GRIDIDX
$T_GAUSSARRAY = "YG"
$T_GAUSSIDX = 1

# Fibre extension ratio index for grid (YQS) and mechanics variables
fem inquire cell_variable ExtensionRatio return_variables L_GRIDARRAY,L_GRIDIDX
$L_MECHIDX = 1

# [Ca]i index for grid (YQS)
fem inquire cell_variable Cai return_variables CAI_GRIDARRAY,CAI_GRIDIDX

# Vm index for grid (YQS)
fem inquire cell_variable Vm return_variables VM_GRIDARRAY,VM_GRIDIDX

# The stretch-activated currents
$IK_stretch  = 23;
$INa_stretch = 24;
$ICa_stretch = 25;
$INs_stretch = 26;
$IAn_stretch = 27;

# Open the history files for tension, extension ratio, and [Ca]i
#fem open history;output/cell-n98_hmt write unit 21 variables yqs niqslist $VM_GRIDIDX,$T_GRIDIDX,$L_GRIDIDX,$CAI_GRIDIDX,$IK_stretch,$INa_stretch,$ICa_stretch,$INs_stretch,$IAn_stretch binary class $CELL

# Solve the coupled equations
for ($time=0;$time<=$tend;$time+=$tstep)
{
  print "\033[0;30;42mtime = $time\033[0m\n";

  # Compute and store fibre extension ratio for HMT grid problem
  print "\033[0;7m                                                      \n";
  fem update grid extension_ratio component $L_MECHIDX $L_GRIDARRAY $L_GRIDIDX class $MECHANICS
  print "                                                      \033[0m\n";

  # Solve the cell model
  print "\033[0;36m";
  fem solve class $CELL restart to $time
  print "\033[0m";
    
  # Write to the history file
  #fem write history unit 21 time $time variables yqs binary class $CELL

  # Interpolate active tension from grid point variables to Gauss pts,
  # ignoring the infarcted region.
  fem update gauss gridvars $T_GRIDARRAY $T_GRIDIDX $T_GAUSSARRAY $T_GAUSSIDX exclude element INFARCT

  # Solve the continuum mechanics
  fem solve class $MECHANICS increment 0.0 iterate $MAX_MECH_ITER error $MECH_ERRTOL
  fem update grid geom deformed class $CELL from_class $MECHANICS
  fem update grid metric deformed class $CELL from_class $MECHANICS
  fem update grid material class $CELL

  # Export the deformed nodes - need field on the export node to 
  # get the deformed geometry
  fem export node;deformed_$time field as sheet

  # Now export the membrane potential YQ(1)
  fem export element;field_$time field as sheet class $CELL
}

# Close the cell history file
#fem close history unit 21 binary class $CELL

# Generate the CMISS signal files for Vm
#fem evaluate electrode;output/potential history output/cell-n98_hmt from grid yqs iy $VM_GRIDIDX binary class $CELL
# and [Ca]i
#fem evaluate electrode;output/cai history output/cell-n98_hmt from grid yqs iy $CAI_GRIDIDX binary class $CELL
# and tension
#fem evaluate electrode;output/tension history output/cell-n98_hmt from grid yqs iy $T_GRIDIDX binary class $CELL
# and extension ratio
#fem evaluate electrode;output/extension_ratio history output/cell-n98_hmt from grid yqs iy $L_GRIDIDX binary class $CELL

# Export to UnEMAP signal files
# First the individual variables for all grid points
#fem evaluate electrode;output/IK_stretch output/cell-n98_hmt from grid yqs iy $IK_stretch binary class $CELL
#fem evaluate electrode;output/INa_stretch output/cell-n98_hmt from grid yqs iy $INa_stretch binary class $CELL
#fem evaluate electrode;output/ICa_stretch output/cell-n98_hmt from grid yqs iy $ICa_stretch binary class $CELL
#fem evaluate electrode;output/INs_stretch output/cell-n98_hmt from grid yqs iy $INs_stretch binary class $CELL
#fem evaluate electrode;output/IAn_stretch output/cell-n98_hmt from grid yqs iy $IAn_stretch binary class $CELL
# Then all variables for a single grid point
#fem define export;r;gp
#fem define lead;r;gp
#@gps = ("037","038","039","044","045","114","120","121","186");
#foreach $gp (@gps)
#{
#		fem evaluate electrode;output/$gp history output/cell-n98_hmt from gvariables yqs iy $VM_GRIDIDX,$CAI_GRIDIDX,$T_GRIDIDX,$L_GRIDIDX electrodes $gp binary class $CELL
#		fem export signal;output/${gp} lead signal output/$gp
#}

Files used by this example are:

Name                                    Modified     Size

example_b362.com 21-Feb-2003 6.2k cell-18x18.ipgrid 06-Mar-2003 547 cell-n98_hmt-block.ipmate 16-Nov-2001 2.3k cell-n98_hmt-explicit-euler.ipsolv 03-Oct-2001 924 cell-n98_hmt-explicit-euler.ipsolv.old 07-Dec-2000 878 cell-n98_hmt.ipcell 07-Dec-2000 11k cell-n98_hmt.ipequa 26-May-2003 1.3k cell-n98_hmt.ipinit 07-Dec-2000 237 cell-n98_hmt.ipmatc 30-Jan-2003 1.7k cell-n98_hmt.ipmate 07-Dec-2000 5.8k cell-n98_hmt.ipsolv 03-Oct-2001 1.3k cell-n98_hmt.ipsolv.old 07-Dec-2000 1.3k cell.ipexpo 07-Dec-2000 660 emech-8x8-cubic.ipelem 07-Dec-2000 16k emech-8x8-cubic.ipnode 07-Dec-2000 49k emech-8x8.ipelfb 15-Feb-2001 9.7k emech-cubic.ipbase 15-Feb-2001 1.5k emech-linear.ipbase 15-Feb-2001 1.1k emech.ippara 21-Feb-2003 5.9k mech-cubic.ipacti 07-Dec-2000 253 mech-cubic.ipequa 02-May-2004 1.8k mech-cubic.ipinit 12-Dec-2002 1.3k mech-cubic.ipmate 12-Dec-2002 6.4k mech-cubic.ipsolv 16-Aug-2010 2.2k mech-cubic.ipsolv.old 13-Apr-2007 2.0k

Download the entire example:

Name                           Modified     Size

examples_b_b3_b36_b362.tar.gz 17-Aug-2010 3.9M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:17:56 201630
cm-debugSuccessSat Mar 5 01:12:33 201663
mips-irix
cmSuccessSun Aug 19 04:36:46 2007206
cm-debugSuccessWed Aug 15 05:08:12 2007965
cm-debug-clear-mallocFailureFri Aug 17 03:35:17 2007943
last breakTue Apr 17 05:15:00 2007865
last successSat Jun 25 01:56:00 2005410
cm-debug-clear-malloc7FailureTue Aug 14 05:54:08 2007935
last breakWed Apr 18 02:47:00 2007953
last successMon Jun 27 01:55:00 2005400
cm64SuccessSun Aug 19 04:17:38 2007198
cm64-debugSuccessFri Aug 17 05:27:53 2007914
cm64-debug-clear-mallocSuccessThu Apr 1 11:32:59 2004415
rs6000-aix
cmSuccessWed Mar 4 01:18:40 200922
cm-debugSuccessMon Mar 2 01:49:28 2009234
cm64SuccessWed Mar 4 01:19:21 200921
cm64-debugSuccessTue Mar 3 01:53:16 2009240
x86_64-linux
cmSuccessSun Mar 6 00:02:06 201616
cm-debugSuccessSat Mar 5 00:05:56 201640

Testing status by file:


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

Input last modified: Mon Aug 16 11:26:30 2010


CMISS Help / Examples / b / b3 / b36 / b362