Example i53: 3D Duodenum - Slow Wave and Dipole Source

This example simulates the slow wave activity in the fully detailed 3D duodenum. The wall of this duodenal model contained three layers to represent the circular muscle (CM), Interstitial Cells of Cjal (ICC) and longitudinal muscle (LM) layers.A single dipole at each element from the transmembrane potential gradients is generated to investigate the wall effects (refer Master Thesis Section 5.2 - A. Lin (2003)).

An example of the transmembrane potential at two specific times is given below.

LM          ICC           CM

LM          ICC           CM

t=5s

t=298s


The comfile run by this example is as follows:

set Num_threads 1

# Set up region
$intestine = 1;
# Set up class
$active1 = 1;

# Read in geometry of the duodenum
fem define para;r;$example/3layers_duo
fem de coor 3,1
fem define nodes;r;$example/3layers_duo reg $intestine
fem de base;r;$example/3layers_duo
fem define ele;r;$example/3layers_duo reg $intestine

# Add fibre into the CM and LM layers
fem def fibr;r;$example/3layers_duo reg $intestine 	
fem def elem;r;$example/3layers_duo fibre reg $intestine #trilinear interpolation

# Apply different grid schemes to each layer
fem define grid;r;$example/3layers_duo reg $intestine
fem update grid geometry reg $intestine

# Group the facses to allow connection
fem group grid face xi3 low element 321..480 as ICC1 reg $intestine
fem group grid face xi3 low element 161..320 as ICC2 reg $intestine

# Group the different layers
fem group grid element 321..480 as LM reg $intestine			
fem group grid element 161..320 as ICC reg $intestine
fem group grid element 1..160 as CM reg $intestine
fem group grid external as boundary reg $intestine

#cuts the connection in the xi3 direction ie. between ICC and LM
fem update grid conn grid ICC1 direction 3 reg $intestine		
#cuts the connection in the -xi3 direction ie. between ICC and CM
fem update grid conn grid ICC2 direction -3 reg $intestine	

# Define the activation in the duodenum
fem define equ;r;$example/ICCcmiss_mono reg $intestine class $active1
fem define cell;r;$example/ICCcmiss_mono reg $intestine class $active1
fem define mate;r;$example/ICCcmiss_mono reg $intestine class $active1 cell
fem define mate;r;$example/ICCcmiss_mono reg $intestine class $active1
fem define init;r;$example/ICCcmiss_mono reg $intestine class $active1
fem define solv;r;$example/ICCcmiss_mono reg $intestine class $active1

# Perform an initial solve
fem solve to 0 reg $intestine class $active1

# Export duodenum geometry
fem export node;intestine reg $intestine as intestine
fem export elem;intestine reg $intestine as intestine 
fem export elem;intestine_mono_pot_0 reg $intestine class $active1 field as intestine;
fem export elem;grid reg $intestine class $active1 as intestine grid_numbers
fem export elem;fibre as intestine fibre

# Solve with a time step of 0.02s and output every 1s
$counter=50;
$over_time=5;
$step=0.02;
$endloop=$over_time/$step;
for $M ( 0..$endloop) 
{
    $time=$M*$step;
    # Reconnect layers
    fem update grid stimulus grid ICC1,ICC2 diffusion 0.3 up_potential direction 3 reg $intestine class $active1;
    fem solve restart to $time reg $intestine class $active1;
    
    if ($counter>=49) 
    {
	print "Current time is: $time\n";
	# Export the electrical activity solution
	fem export ele;intestine_mono_pot_$time reg $intestine class $active1 field as intestine; 
	# Calculate the dipole source per element
	fem define sour;c grid grregion $intestine grclass $active1 time $time;
	$counter=0;
    }else {
	$counter++;	
    }
}

# Write out the dipole sources
fem define sour;w;dipoles_elem grid grregion $intestine grclass $active1;
fem export sour;dipole_all as dipole;

Files used by this example are:

Name                  Modified     Size

example_i53.com 28-Jan-2009 3.0k 3layers_duo.ipbase 27-Oct-2005 12k 3layers_duo.ipelem 17-Jan-2011 200k 3layers_duo.ipelfb 09-Jan-2006 102k 3layers_duo.ipfibr 27-Oct-2005 85k 3layers_duo.ipgrid 27-Oct-2005 1.5k 3layers_duo.ipnode 27-Oct-2005 594k 3layers_duo.ippara 04-Jan-2006 5.9k ICCcmiss_mono.ipcell 28-Oct-2005 3.5k ICCcmiss_mono.ipequa 27-Oct-2005 1.5k ICCcmiss_mono.ipinit 27-Oct-2005 214 ICCcmiss_mono.ipmatc 27-Oct-2005 5.6M ICCcmiss_mono.ipmate 27-Oct-2005 2.5k ICCcmiss_mono.ipsolv 13-Apr-2007 2.1k ICCcmiss_new.cml 27-Oct-2005 8.9k

Download the entire example:

Name                      Modified     Size

examples_i_i5_i53.tar.gz 18-Jan-2011 1.5M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 01:07:32 2016309
cm-debugSuccessSat Mar 5 04:55:08 20161576
mips-irix
cmSuccessThu Jul 5 06:06:22 20074009
cm-debugSuccessWed Jan 11 08:33:50 200625855
cm-debug-clear-mallocSuccessMon Jan 16 19:57:59 200619375
cm-debug-clear-malloc7SuccessTue Jan 17 15:40:58 200625602
cm64SuccessSun Aug 12 05:33:59 20074194
cm64-debugSuccessTue Jan 10 10:10:57 200627446
rs6000-aix
cmSuccessWed Mar 4 02:00:47 2009480
cm-debugSuccessMon Mar 2 04:38:20 20096796
cm64SuccessWed Mar 4 02:02:22 2009471
cm64-debugSuccessTue Mar 3 05:45:28 20096748
x86_64-linux
cmSuccessSun Mar 6 00:07:05 2016169
cm-debugSuccessSat Mar 5 00:24:30 2016896

Testing status by file:


Graphical output from this problem is given here.


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

Input last modified: Mon Jan 17 13:16:54 2011


CMISS Help / Examples / i / i5 / i53