Example b211j: Implicit 1D/2D coupled branch/tissue

This example solves the monodomain equation using the cubic ionic current model implicitly. There are three 1d elements coupled to one 2d element. Activation spreads down the 1d elements and into the 2d host mesh.


The comfile run by this example is as follows:

#--------------
#Assign regions
#--------------

# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: ASSIGN variable MESH2D 1
$MESH2D = 1


# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: ASSIGN variable TREE1D 2
$TREE1D = 2

 
fem define para;r;branch;example

 
#--------------------------------------------
#Define two regions, one for the tree and one
#  for the host mesh.
#--------------------------------------------
fem define regi;r;branch;example
 
#---------------------------------------------
#Define a 1d basis for the tree and a 2d basis
#  for the host mesh.
#---------------------------------------------
fem define base;r;branch;example
 
#-------------------------------------
#Define the host mesh in region MESH2D
#-------------------------------------
fem define node;r;square;example reg $MESH2D
fem define elem;r;square;example reg $MESH2D
fem define fibr;d reg $MESH2D
fem define elem;r;square;example fibre reg $MESH2D
 
#-------------------------------------
#Define the host mesh in region MESH2D
#-------------------------------------
fem define node;r;branch;example reg $TREE1D
fem define elem;r;branch;example reg $TREE1D
 
#-----------------------------------------------
#Set up a finite difference grid in both regions
#-----------------------------------------------
fem define grid;r;1and2d;example reg $MESH2D,$TREE1D
fem update grid geometry reg $MESH2D,$TREE1D
fem update grid metric reg $MESH2D,$TREE1D
fem group grid external as boundary1 reg $MESH2D
fem group grid external as boundary2 reg $TREE1D
 
#-----------------------------------
#Set up equations in the two regions
#-----------------------------------
fem define equa;r;square;example reg $MESH2D,$TREE1D
 
#----------------------------------------------
#Define material parameters for the two regions
#----------------------------------------------
fem define mate;r;square;example reg $MESH2D
fem define cell;r;square;example reg $MESH2D
fem define mate;r;branch;example reg $TREE1D
fem define cell;r;branch;example reg $TREE1D
fem update grid material reg $MESH2D
fem update grid material reg $TREE1D
 
#--------------------------------------
#Define initial and boundary conditions
#--------------------------------------
fem define init;r;square;example reg $MESH2D
fem define init;r;branch;example reg $TREE1D
 
#-------------------------------
#Define coupling between regions
#-------------------------------
fem define coup;c tree_region $TREE1D tissue_region $MESH2D
 
#--------------------------
#Define solution parameters
#--------------------------
fem define solv;r;square;example reg $MESH2D,$TREE1D

fem export node;tissue as tissue reg $MESH2D
fem export elem;tissue as tissue reg $MESH2D
fem export node;tree as tree reg $TREE1D
fem export elem;tree as tree reg $TREE1D
 
#-----
#Solve
#-----
fem solve to 0 reg $MESH2D,$TREE1D
fem define wind;c
 

# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: DO UNIT=0..9
for $UNIT ( 0..9 ) 
{


# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: DO DEC=0,5
for $DEC ( 0,5 ) 
{


# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: fem solve restart to $UNIT//.//$DEC reg $MESH2D,$TREE1D
fem solve restart to "${UNIT}.$DEC" reg $MESH2D,$TREE1D

fem update grid solution
fem draw grid values zmin=-120 zmax=20 noscale reg $MESH2D
fem draw field grid 1 zmin=-120 zmax=20 noscale reg $TREE1D
refresh graphics

# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: fem export elem;tissue_//$UNIT//$DEC field reg $MESH2D as tissue
fem export elem;tissue_${UNIT}$DEC field reg $MESH2D as tissue


# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: fem export elem;tree_//$UNIT//$DEC field reg $TREE1D as tree
fem export elem;tree_${UNIT}$DEC field reg $TREE1D as tree


# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: ENDDO
}



# Command updated by fixcom.sh on Wed Aug 23 17:49:58 NZT 2000
# Old command: ENDDO
}



#See draw.com for viewing in cmgui

Additional testing commands:

fem list grid yq index v

Files used by this example are:

Name                    Modified     Size

example_b211j.com 20-Nov-2001 4.0k 1and2d.irgrid 11-Mar-2003 875 branch.ipbase 10-Apr-2000 1.9k branch.ipcell 10-Apr-2000 1.7k branch.ipelem 10-Apr-2000 833 branch.ipinit 10-Apr-2000 483 branch.ipmate 10-Apr-2000 1.7k branch.ipmate_cell_old 10-Apr-2000 3.5k branch.ipnode 10-Apr-2000 852 branch.ippara 12-Nov-2002 5.9k branch.ipregi 10-Apr-2000 93 draw.com 20-Nov-2001 2.2k square.ipcell 10-Apr-2000 1.7k square.ipelem 10-Apr-2000 336 square.ipelfb 10-Apr-2000 225 square.ipinit 10-Apr-2000 289 square.ipmate 10-Apr-2000 1.7k square.ipmate_cell_old 10-Apr-2000 3.5k square.ipnode 10-Apr-2000 801 square.irequa 26-May-2003 2.9k square.irsolv 13-Apr-2007 2.8k square.irsolv.old 10-Apr-2000 2.4k test_output.com 23-Apr-2001 25

Download the entire example:

Name                                 Modified     Size

examples_b_b2_b21_b211_b211j.tar.gz 14-Apr-2007 10k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:02:15 20161
cm-debugSuccessSat Mar 5 00:04:16 20161
mips-irix
cmSuccessSun Aug 19 01:35:41 20078
cm-debugSuccessWed Aug 15 01:35:31 200722
cm-debug-clear-mallocSuccessSat Aug 18 01:41:53 200732
cm-debug-clear-malloc7SuccessMon Aug 20 01:38:15 200730
cm64SuccessSun Aug 19 01:36:35 20078
cm64-debugSuccessTue Aug 21 01:31:26 200722
cm64-debug-clear-mallocSuccessThu Apr 1 11:14:00 200411
rs6000-aix
cmSuccessWed Mar 4 01:08:11 20092
cm-debugSuccessMon Mar 2 01:08:04 20094
cm64SuccessWed Mar 4 01:08:11 20092
cm64-debugSuccessTue Mar 3 01:13:15 20095
x86_64-linux
cmSuccessSun Mar 6 00:01:05 20161
cm-debugSuccessSat Mar 5 00:01:35 20161

Testing status by file:


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

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


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