Example i56: 3D Cylinder Slow Wave with Unemap Export (Uses Curve from i55)

This example simulates the slow wave activity in a 3D cylinder that mimics a part of the small intestine. The cylinder wall has three layers to represent the circular muscle (CM), Interstitial Cells of Cjal (ICC) and longitudinal muscle (LM) layers. The cylinder was generated by a script written by V. Rajagopal and fixed up by T. Austin. The cylinder has eight elements into the wall, four elements around, and one element along the length of the cylinder. We also export the solution at select grid points to be later viewed in unemap. See the description of example_i55 for a image representing this domain.

The comfile run by this example is as follows:

set Num_threads 1

$Vm = 1;
$intestine = 1;

fem def para;r;$example/cylinder
fem def coor 3,1

# Read in cylinder geometry
fem def node;r;$example/cylinder reg $intestine
fem def base;r;$example/cylinder reg $intestine
fem def elem;r;$example/cylinder reg $intestine

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

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

# Group the faces to allow connection
fem group grid face xi3 low element 13..16 as ICC1 reg $intestine
fem group grid face xi3 low element 21..24 as ICC2 reg $intestine

# Create subgroups to define layer groups
fem group grid element 1..4 as ELEMSa reg $intestine
fem group grid element 17..20 as ELEMSb reg $intestine
fem group grid element 9..12 as ELEMSc reg $intestine
fem group grid element 25..28 as ELEMSd reg $intestine
fem group grid element 5..8 as ELEMSe reg $intestine
fem group grid element 21..24 as ELEMSf reg $intestine
fem group grid element 13..16 as ELEMSg reg $intestine
fem group grid element 29..32 as ELEMSh reg $intestine

# Group the different layers
fem group grid grid ELEMSg,ELEMSh as LM reg $intestine			
fem group grid grid ELEMSf as ICC reg $intestine
fem group grid grid ELEMSa,ELEMSb,ELEMSc,ELEMSd,ELEMSe as CM reg $intestine
fem group grid external as boundary reg $intestine

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

# Cut 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 equa;r;$example/cylinder reg $intestine class $Vm
fem define cell;r;$example/cylinder reg $intestine class $Vm
fem define mate;r;$example/cylinder reg $intestine class $Vm cell
fem define mate;r;$example/cylinder reg $intestine class $Vm
fem define init;r;$example/cylinder reg $intestine class $Vm
fem define solv;r;$example/cylinder reg $intestine class $Vm

fem open history;intestine write variables yqs niqlist 1 binary;

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

# Solve with a time step of 0.02s to 0.1s
$end = 5;
for $M ( 0..$end ) {


     fem solve restart to $time reg $intestine class $Vm
     fem write history time $time variables yqs niqlist 1 binary;

     # Reconnect layers
     fem update grid stimulus grid ICC1,ICC2 diffusion 0.3 up_potential direction 3 reg $intestine class $Vm

     # Export the electrical activity solution after the final step
     if($M == 5) {
        fem export ele;intestine_mono_pot reg $intestine class $Vm field as intestine; 


fem close history binary;


fem evaluate electrodes;$SIGNALFILE history intestine from grid yqs iy 1 electrodes $COMPPTS binary;

fem def export;r;$example/signal;
fem export sign;$SIGNALFILE signal $SIGNALFILE electrodes;


Files used by this example are:

Name             Modified     Size

example_i56.com 10-Jul-2006 3.1k cylinder.cml 07-Jul-2006 8.9k cylinder.ipbase 07-Jul-2006 7.4k cylinder.ipcell 07-Jul-2006 3.5k cylinder.ipelem 07-Jul-2006 16k cylinder.ipelfb 07-Jul-2006 7.6k cylinder.ipequa 07-Jul-2006 1.5k cylinder.ipfibr 07-Jul-2006 10k cylinder.ipgrid 07-Jul-2006 613 cylinder.ipinit 07-Jul-2006 214 cylinder.ipmatc 07-Jul-2006 723k cylinder.ipmate 07-Jul-2006 2.6k cylinder.ipnode 07-Jul-2006 129k cylinder.ippara 11-Jul-2006 5.9k cylinder.ipsolv 13-Apr-2007 2.1k signal.ipexpo 07-Jul-2006 712

Download the entire example:

Name                      Modified     Size

examples_i_i5_i56.tar.gz 14-Apr-2007 83k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:25:31 201662
cm-debugSuccessSat Mar 5 02:30:03 2016370
cmSuccessSun Aug 19 05:50:32 2007572
cm-debugSuccessWed Jul 18 05:32:56 20074402
cm-debug-clear-mallocSuccessSat Aug 18 04:57:55 20074402
cm-debug-clear-malloc7SuccessMon Jul 2 05:41:24 20074404
cm64SuccessSun Aug 19 05:54:08 2007649
cm64-debugSuccessFri Jul 13 05:30:49 20074924
cmSuccessWed Mar 4 01:28:01 200960
cm-debugSuccessMon Mar 2 02:50:16 20091457
cm64SuccessWed Mar 4 01:29:11 200970
cm64-debugSuccessTue Mar 3 02:58:42 20091362
cmSuccessSun Mar 6 00:02:32 201631
cm-debugSuccessSat Mar 5 00:11:23 2016216

Testing status by file:

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

Input last modified: Fri Apr 13 10:43:48 2007

CMISS Help / Examples / i / i5 / i56