This example demonstrates how to couple a single ventricle by direct assembly while iterating on the epicardial surface to get a continuous solution.
#Example b2143 # # This example demonstrates how to couple a single ventricle # by direct assembly while iterating on the epicardial # surface to get a continuous solution. # # Problem classes $TLPL=1 $BLPL=2 $TMEM=3 $EXTC=4 # Problem regions $CAVITY=1 $BLOOD=2 $BEMHT=3 $MUSCLE=4 $GRIDHT=5 # Iteration variables $NUM_ITERS=0 $MAX_ITERS=50 $FINISHED=0 $POTE_TOL=0.1 $FLUX_TOL=0.1 $POTE1=1.0 $FLUX1=1.0 $ALPHA1=0.0 $ALPHA2=0.5 # Define problem geometry fem define para;r;fembem;example fem define regi;r;fembem;example fem define node;r;refx4;example reg all fem define base;r;fembem;example fem define elem;r;refx4;example reg all fem define fibr;r;refx4;example reg $GRIDHT fem define elem;r;test;example fibre reg $GRIDHT # Define finite difference grid fem define grid;r;heart;example reg $GRIDHT fem update grid geometry reg $GRIDHT fem update grid metric reg $GRIDHT fem group grid xi2=0 as endocardium reg $GRIDHT fem group grid xi2=1 as epicardium reg $GRIDHT fem group grid external as boundary reg $GRIDHT fem group grid line 849 xidirn 2 as stimulus reg $GRIDHT # Create node to grid mapping fem update node grid grid_reg $GRIDHT bem_reg $BEMHT fem update node geomet from grid reg $BLOOD # Define equations fem define equa;r;torso;example reg $CAVITY,$MUSCLE class $TLPL lock fem define equa;r;blood;example reg $BLOOD class $BLPL lock fem define equa;r;heart;example reg $GRIDHT class $TMEM,$EXTC # Define material parameters fem define mate;r;torso;example reg $CAVITY,$MUSCLE class $TLPL fem define mate;r;blood;example reg $BLOOD class $BLPL fem define mate;r;heart;example reg $GRIDHT class $TMEM,$EXTC fem define cell;r;heart;example reg $GRIDHT class $TMEM,$EXTC fem update grid material reg $GRIDHT class $TMEM,$EXTC # Define initial conditions fem define init;r;torso;example reg $CAVITY,$MUSCLE class $TLPL fem define init;r;blood;example reg $BLOOD class $BLPL fem define init;r;heart;example reg $GRIDHT class $TMEM,$EXTC # Define torso region coupling fem define coup;r;torso;example class $TLPL # Define grid to boundary element coupling fem up elem region $GRIDHT,$CAVITY class $EXTC,$TLPL grids epicardium # Define solution parameters fem define solv;r;heart;example reg $GRIDHT class $TMEM fem define solv;r;heart2;example reg $GRIDHT class $EXTC fem define solv;r;torso;example coupled reg $CAVITY,$MUSCLE class $TLPL fem define solv;r;blood;example reg $BLOOD class $BLPL # Solve the passive torso problems fem solve coupled reg $CAVITY,$MUSCLE class $TLPL fem solve reg $BLOOD class $BLPL # Solve the bidomain problem fem solve activ coupled to 0 reg $GRIDHT,$BLOOD,$CAVITY class $TMEM,$EXTC,$BLPL,$TLPL grid endocardium cptype 3 for $TEN ( 0..0 ) { for $UNIT ( 0..0 ) { for $DECI ( 0..4 ) { for $HUND ( 0,2,4,6,8 ) { # Solve a bidomain time step fem solve activ coupled transmembrane restart to "$TEN$UNIT".'.'."$DECI$HUND" reg $GRIDHT class $TMEM,$EXTC noupdate $NUM_ITERS = 0 $FINISHED = 0 # Find a converged epicardial solution while( !$FINISHED && $NUM_ITERS<=$MAX_ITERS ) { $NUM_ITERS++ fem solve activ coupled extra rest reg $GRIDHT,$BLOOD,$CAVITY cl $TMEM,$EXTC,$BLPL,$TLPL noupdate static alpha $ALPHA1 grid endocardium cptype 3 fem update init from grid region $CAVITY,$BEMHT,$GRIDHT class $EXTC,$TLPL,$EXTC alpha $ALPHA2 fem solve coupled reg $CAVITY,$MUSCLE class $TLPL fem check conv grid_reg $BEMHT grid_cl $EXTC bem_reg $CAVITY bem_cl $TLPL grid_update_cl $EXTC return POTE1 FLUX1 $FINISHED = (abs($POTE1)<=$POTE_TOL && abs($FLUX1)<=$FLUX_TOL) print("Iteration $NUM_ITERS\n"); } # Update the transmembrane potential field fem solve activ coupled trans restart reg $GRIDHT,$BLOOD,$CAVITY class $TMEM,$EXTC,$BLPL,$TLPL update static grid endocardium cptype 3 if($NUM_ITERS<$MAX_ITERS) { print("Solution converged in $NUM_ITERS iterations\n"); } else { print("Solution did not converge in $MAX_ITERS iterations\n"); print("Outside potential $POTE1 Outside flux $FLUX1\n"); } } } } }
#Testing example b2143 # Torso cavity fem list node solu reg 1 class 1 fem list node flux reg 1 class 1 # Ventricle fem list node solu reg 2 class 2 fem list node flux reg 2 class 2
Name Modified Size
example_b2143.com 28-Jun-2001 4.1k blood.ipequa 26-May-2003 1.2k blood.ipinit 06-Jun-2001 2.1k blood.ipmate 06-Jun-2001 592 blood.ipsolv 13-Apr-2007 1.3k fembem.ipbase 28-Jun-2001 3.2k fembem.ippara 12-Nov-2002 5.9k fembem.ipregi 06-Jun-2001 93 heart.ipcell 06-Jun-2001 2.3k heart.ipequa 26-May-2003 1.5k heart.ipgrid 06-Mar-2003 1.1k heart.ipinit 06-Jun-2001 833 heart.ipmate 06-Jun-2001 1.7k heart.ipsolv 13-Apr-2007 1.9k heart.ipsolv.old 06-Jun-2001 1.5k heart2.ipsolv 13-Apr-2007 1.9k heart2.ipsolv.old 06-Jun-2001 1.5k refx4.ipfibr 28-Jun-2001 2.6k refx4.irelem 28-Jun-2001 160k refx4.irnode 06-Jun-2001 195k test.ipelfb 06-Jun-2001 1.2k test_output.com 06-Jun-2001 186 torso.ipcoup 21-Aug-2002 437 torso.ipcoup.old 06-Jun-2001 411 torso.irequa 26-May-2003 2.5k torso.irinit 28-Jun-2001 3.5k torso.irmate 06-Jun-2001 1.2k torso.irsolv 13-Apr-2007 1.6k
Name Modified Size
examples_b_b2_b21_b214_b2143.tar.gz 14-Apr-2007 406k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Success | Sun Mar 6 00:03:50 2016 | 3 |
cm-debug | Success | Sat Mar 5 00:17:01 2016 | 7 |
mips-irix | |||
cm | Success | Sun Aug 19 02:18:35 2007 | 46 |
cm-debug | Success | Wed Aug 15 02:15:12 2007 | 114 |
cm-debug-clear-malloc | Success | Sat Aug 18 02:32:05 2007 | 121 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 02:29:31 2007 | 122 |
cm64 | Success | Sun Aug 19 02:21:18 2007 | 49 |
cm64-debug | Success | Tue Aug 21 02:21:37 2007 | 127 |
cm64-debug-clear-malloc | Success | Thu Apr 1 11:21:17 2004 | 58 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:09:58 2009 | 4 |
cm-debug | Success | Mon Mar 2 01:13:51 2009 | 21 |
cm64 | Success | Wed Mar 4 01:11:06 2009 | 4 |
cm64-debug | Success | Tue Mar 3 01:18:54 2009 | 23 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:12 2016 | 1 |
cm-debug | Success | Sat Mar 5 00:01:56 2016 | 4 |
i686-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
mips-irix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc7: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
Success | cm64-debug-clear-malloc: | cmiss_test.log.retain. | |
rs6000-aix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
x86_64-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. |
i686-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
mips-irix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
rs6000-aix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
x86_64-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. |
i686-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
mips-irix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
rs6000-aix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
x86_64-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. |
Html last generated: Sun Mar 6 05:51:14 2016
Input last modified: Fri Apr 13 10:39:26 2007