Example b211m: 3D Explicit LR2

Explict Luo-Rudy phase 2 over a small, one element, cube. If the geometry and fields are exported, they can be viewed using the cmiss_input/cmiss_input/movie.com command file. The signal file can be viewed using UnEMAP.

The comfile run by this example is as follows:

# Example b211m - Explict Luo-Rudy phase 2 over a small, one element,
# cube. If the geometry and fields are exported, they can be viewed 
# using the draw.com command file. The signal file can be viewed using 

# If the example path is not set, default to current directory
if (! defined $example) {
    $example = "./";
# Drop off the trailing / in the example path
$chopped = chop $example;
if ($chopped ne "/") {
    $example .= $chopped;
#Set up problem size
fem define para;r;$example/cube;

#Define geometry of the problem
fem define coor;r;$example/cube;
fem define node;r;$example/cube;
fem define base;r;$example/cube;
fem define elem;r;$example/cube;
fem define fibr;d;
fem define elem;r;$example/cube fibre;
fem define grid;r;$example/cube;
fem update grid geometry;
fem update grid metric;
#  Some useful groups
fem group grid external as boundary;
fem group grid grid 92,93,101 as stimulus_site;

#Define equation to solve
#  Define monodomain with LR2 kinetics
fem define equa;r;$example/lr;

#Define material properties for the problem

#  Define cellular material properties
fem define cell;r;$example/lr;
#    Define cell variants and spatially varying material parameters
fem define mate;r;$example/cube cell;
#  Define continuum material parameters
fem define mate;r;$example/cube;
fem update grid material;

#Define continuum initial conditions
#  Set no-flux boundary condition
fem define init;r;$example/cube;

#Define the explicit solve, using the adams integrator
fem define solv;r;$example/test;

#The geometry can be exported to CMGUI via these commands
fem export node;3dcube as cube;              #Export node geometry
fem export elem;3dcube as cube;              #Export element geometry

#Can export the cellular material parameters with the command:
fem export element;parameters as cube field cell;

#Solve the problem

#  Initialise the solve
fem solve to 0;

#  Open a binary history file to store the membrane potential (YQ(1))
fem open history;cube write variables yq niqlist 1 binary;

# Loop through time (solve for 3ms)
for $HUN ( 0..0 ) {
    for $TEN ( 0..0 ) {
        for $UNIT ( 0..5 ) {
            # Solve for the current time
            fem solve restart to "${HUN}${TEN}$UNIT";
            # Write the membrane potential to the history file
            fem write history time "${HUN}${TEN}$UNIT" variables yq binary;
            # Export the field to CMGUI
            fem export elem;gridfield_1${HUN}${TEN}$UNIT field as cube;

# Close the history file
fem close history binary;
# Calculate the binary signal file from the history file
fem evaluate electrode;cube history cube from grid binary;
# Define UnEmap export properties
fem define export;r;$example/cube;
# Export the binary signal file to UnEmap
fem export signal;cube electrode signal cube;

Files used by this example are:

Name               Modified     Size

example_b211m.com 23-Jan-2003 2.8k cube.ipbase 10-Apr-2000 2.4k cube.ipcoor 10-Apr-2000 570 cube.ipelem 10-Apr-2000 404 cube.ipelfb 10-Apr-2000 233 cube.ipequa 26-May-2003 1.4k cube.ipexpo 10-Apr-2000 660 cube.ipgrid 06-Mar-2003 600 cube.ipinit 10-Apr-2000 213 cube.ipmatc 30-Jan-2003 727 cube.ipmate 10-Apr-2000 1.7k cube.ipnode 10-Apr-2000 1.8k cube.ippara 12-Nov-2002 5.9k cube.ipsolv 13-Apr-2007 1.8k cube.ipsolv.old 10-Apr-2000 1.4k draw.com 03-Oct-2000 3.5k lr.ipcell 20-Nov-2001 4.5k lr.ipequa 26-May-2003 1.4k movie.com 10-Apr-2000 445 test.ipsolv 23-Jan-2003 1.3k

Download the entire example:

Name                                 Modified     Size

examples_b_b2_b21_b211_b211m.tar.gz 14-Apr-2007 45k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:07:28 20167
cm-debugSuccessSat Mar 5 00:31:14 201620
cmSuccessSun Aug 19 02:22:02 200750
cm-debugSuccessWed Aug 15 02:46:19 2007190
cm-debug-clear-mallocSuccessSat Aug 18 03:05:56 2007210
cm-debug-clear-malloc7SuccessMon Aug 20 03:05:21 2007206
cm64SuccessSun Aug 19 02:22:55 200753
cm64-debugSuccessTue Aug 21 02:56:52 2007199
cm64-debug-clear-mallocSuccessThu Apr 1 11:16:26 200486
cmSuccessWed Mar 4 01:12:25 20097
cm-debugSuccessMon Mar 2 01:25:28 200961
cm64SuccessWed Mar 4 01:13:01 20096
cm64-debugSuccessTue Mar 3 01:28:46 200968
cmSuccessSun Mar 6 00:01:18 20165
cm-debugSuccessSat Mar 5 00:03:15 201613

Testing status by file:

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

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

CMISS Help / Examples / b / b2 / b21 / b211 / b211m