Example b211c: Single element cube using grid-based FEM with Noble 98

This example solves the Noble 98 ionic current model in a single element, tri-cubic Hermite cube using the grid-based FEM solution technique. The model is stimulated at all grid points just in from the left-hand face of the cube.

The result of this simulation can been seen in the animation below and visualised with draw.com.


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";

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

# 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;emech;example;
fem define node;r;emech-1x1x1-cubic;example;
fem define base;r;emech-cubic-linear;example;
fem define element;r;emech-1x1x1-cubic;example;

# 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;emech-0deg;example;
fem define element;r;emech-1x1x1-linear;example fibre;

# Define one grid scheme which is 9x9x9 grid points
fem define grid;r;cell-9x9x9;example;
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;n98;example;

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

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

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

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

# 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 Vm 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;
}

# 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;cube;example;
fem export signal;$output/Vm electrode signal $output/Vm;


Files used by this example are:

Name                                Modified     Size

example_b211c.com 24-Jul-2001 2.8k cell-9x9x9.ipgrid 12-Sep-2003 610 cell.ipexpo 24-Jul-2001 659 cube.ipexpo 24-Jul-2001 660 emech-0deg.ipfibr 24-Jul-2001 6.9k emech-1x1x1-cubic.ipelem 24-Jul-2001 573 emech-1x1x1-cubic.ipnode 24-Jul-2001 15k emech-1x1x1-linear.ipelfb 24-Jul-2001 377 emech-cubic-linear.ipbase 24-Jul-2001 7.4k emech.ipcoor 24-Jul-2001 570 implicit_grid_based_fem.ipsolv 13-Apr-2007 2.2k implicit_grid_based_fem.ipsolv.old 24-Jul-2001 1.9k minimal.ippara 12-Nov-2002 5.9k n98.ipcell 24-Jul-2001 9.2k n98.ipequa 26-May-2003 1.4k n98.ipinit 24-Jul-2001 237 n98.ipmatc 30-Jan-2003 674 n98.ipmate 24-Jul-2001 1.8k

Download the entire example:

Name                                 Modified     Size

examples_b_b2_b21_b211_b211c.tar.gz 14-Apr-2007 200k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:03:04 20163
cm-debugSuccessSat Mar 5 00:16:44 20168
mips-irix
cmSuccessSun Aug 19 01:50:40 200719
cm-debugSuccessWed Aug 15 02:03:36 200789
cm-debug-clear-mallocSuccessSat Aug 18 02:22:09 200796
cm-debug-clear-malloc7SuccessMon Aug 20 02:20:00 200799
cm64SuccessSun Aug 19 01:51:18 200720
cm64-debugSuccessTue Aug 21 02:06:45 200797
cm64-debug-clear-mallocSuccessThu Apr 1 11:12:14 200447
rs6000-aix
cmSuccessWed Mar 4 01:09:47 20092
cm-debugSuccessMon Mar 2 01:13:53 200929
cm64SuccessWed Mar 4 01:09:14 20093
cm64-debugSuccessTue Mar 3 01:20:43 200928
x86_64-linux
cmSuccessSun Mar 6 00:01:06 20161
cm-debugSuccessSat Mar 5 00:02:01 20164

Testing status by file:


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

Input last modified: Fri Apr 13 10:37:54 2007


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