Example cellml/n98cube: Single element cube using grid-based FEM with Noble 98

This example is the same as example b211c, except it uses the CellML version of Noble 98 to define the cellular electrophysilogy model.

The comfile run by this example is as follows:

# Example b211c - A tri-cubic Hermite, single element cube, using 
# grid-based FEM to solve the Noble 98 ionic current model.

# Set-up some useful variables
$output = ".";
$format = "binary";
# 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;

# Define the problem size
fem define parameters;r;$example/minimal;

# Define the geometry - need a tri-cubic Hermite basis for the geometry
# and a tri-linear for the fibres and grid-based FEM
fem define coordinate;r;$example/emech;
fem define node;r;$example/emech-1x1x1-cubic;
fem define base;r;$example/emech-cubic-linear;
fem define element;r;$example/emech-1x1x1-cubic;

# Need to calculate the nodal derivatives since they are not in the
# ip files
fem update node derivative 1 linear;
fem update node derivative 2 linear;
fem update node derivative 3 linear;

fem group element 1 as ALL_ELEMENTS;

# Define 0 degree fibre orientation
fem define fibre;r;$example/emech-0deg;
fem define element;r;$example/emech-1x1x1-linear fibre;

# Define one grid scheme which is 9x9x9 grid points
fem define grid;r;$example/cell-9x9x9;
fem update grid geometry;
fem update grid metric;
fem group grid external as boundary;
# Set the stimulus site
fem group grid xi1=0 oneoff as stimulus_site;

# Define the model to use - Noble 98
fem define equation;r;$example/n98;
#fem define equation;r;n98_collocation;

# Define the cellular material parameters
fem define cell;r;$example/n98;
fem define material;r;$example/n98 cell;

# Define the continuum material parameters - using a 2:1 conductivity 
# ratio (fibre:(sheet/normal))
fem define material;r;$example/n98;
fem update grid material;

# Define the default no-flux boundary condition
fem define initial;r;$example/n98;

# Define the integrator - implicit Adams
fem define solve;r;$example/implicit_grid_based_fem;

# Export the geometry
fem export node;$output/3dcube as cube;
fem export element;$output/3dcube as cube;

# Initialise the solve
fem solve to 0;

# Grab the membrane potential index
fem inquire cell_variable V return_variables VM_ARRAY,VM_IDX;

# Create a history file to hold the membrane potential at all grid
# points through time
fem open history;$output/cube write variables $VM_ARRAY niqslist $VM_IDX $format;

# The time loop
for $time ( 0..5 ) {
    print "Time = $time\n";
    # Solve the model
    fem solve restart to $time;
    # Write the solution to the history file
    fem write history time $time variables $VM_ARRAY $format;
    # Export the potential field for use in CMGUI
    fem export element;$output/potential_$time field as cube;
    # Export the FieldML version - not to useful at present, but needs
    # to be tested.
    fem export fieldml;$output/potential_$time cellml;

# Close the history file
fem close history $format;

# Create a CMISS signal file from the history file
fem evaluate electrode;$output/Vm history $output/cube from grid $VM_ARRAY iy $VM_IDX $format;

# Export the membrane potential at all grid points to a UnEMAP signal
# file
fem define export;r;$example/cube;
fem export signal;$output/Vm electrode signal $output/Vm;

# For testing we compare the generated CMISS signal files
if ($TESTING) {
    fem compare signal;Vm basis both masterfile $example/Vm comparefile Vm $format;

Files used by this example are:

Name                            Modified     Size

n98cube.com 10-Apr-2003 3.3k Vm.binsig 10-Apr-2003 51k cell-9x9x9.ipgrid 12-Sep-2003 610 cube.ipexpo 10-Apr-2003 660 emech-0deg.ipfibr 10-Apr-2003 6.9k emech-1x1x1-cubic.ipelem 10-Apr-2003 573 emech-1x1x1-cubic.ipnode 10-Apr-2003 15k emech-1x1x1-linear.ipelfb 10-Apr-2003 377 emech-cubic-linear.ipbase 10-Apr-2003 7.4k emech.ipcoor 10-Apr-2003 570 implicit_grid_based_fem.ipsolv 15-Apr-2007 2.2k minimal.ippara 10-Apr-2003 5.9k n98.cml 09-Jun-2003 204k n98.ipcell 10-Apr-2003 23k n98.ipequa 26-May-2003 1.5k n98.ipinit 10-Apr-2003 237 n98.ipmatc 10-Apr-2003 648 n98.ipmate 10-Apr-2003 1.8k

Download the entire example:

Name                            Modified     Size

examples_cellml_n98cube.tar.gz 16-Apr-2007 198k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:04:12 20164
cm-debugSuccessSat Mar 5 00:18:55 20169
cmSuccessSun Aug 19 02:26:49 200757
cm-debugSuccessWed Aug 15 02:21:51 2007132
cm-debug-clear-mallocSuccessSat Aug 18 02:43:04 2007135
cm-debug-clear-malloc7SuccessMon Aug 20 02:45:27 2007141
cm64SuccessSun Aug 19 02:28:18 200755
cm64-debugSuccessTue Aug 21 02:28:32 2007135
cm64-debug-clear-mallocSuccessThu Apr 1 11:49:39 2004211
cmSuccessWed Mar 4 01:11:44 20095
cm-debugSuccessMon Mar 2 01:17:44 200930
cm64SuccessWed Mar 4 01:11:46 20096
cm64-debugSuccessTue Mar 3 01:21:20 200928
cmSuccessSun Mar 6 00:01:12 20162
cm-debugSuccessSat Mar 5 00:02:08 20166

Testing status by file:

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

Input last modified: Sun Apr 15 11:59:48 2007

CMISS Help / Examples / cellml / n98cube