This example demonstrates how to couple a single ventricle and a single torso region through a multiple surface fixed point iteration
#Example b2141 # # This example demonstrates how to couple a single ventricle # and a single torso region through a multiple surface fixed # point iteration # # Problem classes $CAVITY=1 $VENTCL=2 $BEMHRT=3 $GRIDHT=4 # Problem regions $TLPL=1 $BLPL=2 $TMEM=3 $EXTC=4 # Iteration variables $NUM_ITERS=0 $MAX_ITERS=50 $FINISHED=0 $POTE_TOL=0.1 $FLUX_TOL=0.1 $POTE1=1.0 $FLUX1=1.0 $POTE2=1.0 $FLUX2=1.0 $ALPHA1=0.0 $ALPHA2=0.7 # Define problem geometry fem define para;r;torsoslice;example fem define regi;r;torsoslice;example fem define node;r;cavity3;example reg $CAVITY fem define node;r;ventcl3;example reg $VENTCL fem define node;r;bemhrt3;example reg $BEMHRT fem define node;r;gridht;example reg $GRIDHT fem define base;r;linear;example fem define elem;r;cavity3;example reg $CAVITY fem define elem;r;ventcl3;example reg $VENTCL fem define elem;r;bemhrt3;example reg $BEMHRT fem define elem;r;gridht;example reg $GRIDHT # Define finite difference grid fem define grid;r;gridht;example reg $GRIDHT fem update grid geom 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 1 xidirn 2 as stimulus reg $GRIDHT # Create node to grid mapping fem update node grid grid_reg $GRIDHT bem_reg $BEMHRT fem update node geomet from grid reg $BEMHRT # Define equations fem define equa;r;cavity;example reg $CAVITY class $TLPL lock fem define equa;r;ventcl;example reg $VENTCL class $BLPL lock fem define equa;r;gridht;example reg $GRIDHT class $TMEM,$EXTC lock # Define material parameters fem define mate;r;cavity;example reg $CAVITY class $TLPL fem define mate;r;ventcl;example reg $VENTCL class $BLPL fem define mate;r;gridht;example reg $GRIDHT class $TMEM,$EXTC fem define cell;r;gridht;example reg $GRIDHT class $TMEM,$EXTC fem update grid material reg $GRIDHT class $TMEM,$EXTC # Define initial conditions fem define init;r;cavity;example reg $CAVITY class $TLPL fem define init;r;ventcl;example reg $VENTCL class $BLPL fem define init;r;gridht;example reg $GRIDHT class $TMEM,$EXTC # Define grid to boundary element coupling fem up elem region $GRIDHT,$VENTCL,$CAVITY class $EXTC,$BLPL,$TLPL grids boundary # Define solution parameters fem define solv;r;gridht;example reg $GRIDHT class $TMEM fem define solv;r;gridht;example reg $GRIDHT class $EXTC fem define solv;r;cavity;example reg $CAVITY class $TLPL fem define solv;r;ventcl;example reg $VENTCL class $BLPL # Solve the passive torso problems fem solve reg $CAVITY class $TLPL fem solve reg $VENTCL class $BLPL # Solve the bidomain problem fem solve activ coupled to 0 reg $GRIDHT,$CAVITY,$VENTCL class $TMEM,$EXTC,$TLPL,$BLPL for $TEN ( 0..0 ) { for $UNIT (0..0) { for $DECI ( 0..9 ) { for $HUND ( 0..9 ) { # 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 solution while( !$FINISHED && $NUM_ITERS<=$MAX_ITERS ) { $NUM_ITERS++ fem solve activ coupled extra rest reg $GRIDHT,$CAVITY,$VENTCL cl $TMEM,$EXTC,$TLPL,$BLPL noupdate static alpha $ALPHA1 fem update init from grid region $CAVITY,$BEMHRT,$GRIDHT class $EXTC,$TLPL,$EXTC alpha $ALPHA2 fem update init from grid region $VENTCL,$BEMHRT,$GRIDHT class $EXTC,$BLPL,$EXTC alpha $ALPHA2 fem solve reg $CAVITY class $TLPL fem solve reg $VENTCL class $BLPL fem check conv grid_reg $BEMHRT grid_cl $EXTC bem_reg $CAVITY bem_cl $TLPL grid_update_cl $EXTC return POTE1 FLUX1 fem check conv grid_reg $BEMHRT grid_cl $EXTC bem_reg $VENTCL bem_cl $BLPL grid_update_cl $EXTC return POTE2 FLUX2 $FINISHED = (abs($POTE1)<=$POTE_TOL && abs($FLUX1)<=$FLUX_TOL && abs($POTE2)<=$POTE_TOL && abs($FLUX2)<=$FLUX_TOL) print("Iteration $NUM_ITERS\n"); } # Update the transmembrane potential field fem solve activ coupled trans rest reg $GRIDHT,$CAVITY,$VENTCL class $TMEM,$EXTC,$TLPL,$BLPL update static alpha $ALPHA1 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 b2141 fem list node sol reg 1 cl 1 fem list node sol reg 2 cl 2
Name Modified Size
example_b2141.com 06-Jun-2001 4.4k bemhrt3.ipelem 06-Jun-2001 32k bemhrt3.ipnode 06-Jun-2001 38k cavity.ipequa 26-May-2003 1.2k cavity.ipinit 06-Jun-2001 2.2k cavity.ipmate 06-Jun-2001 606 cavity.ipsolv 13-Apr-2007 1.5k cavity3.ipelem 06-Jun-2001 32k cavity3.ipnode 06-Jun-2001 38k gridht.ipcell 06-Jun-2001 1.7k gridht.ipelem 06-Jun-2001 2.2k gridht.ipequa 26-May-2003 1.4k gridht.ipgrid 06-Mar-2003 541 gridht.ipinit 06-Jun-2001 841 gridht.ipmate 06-Jun-2001 1.8k gridht.ipnode 06-Jun-2001 5.1k gridht.ipsolv 13-Apr-2007 1.9k gridht.ipsolv.old 06-Jun-2001 1.4k linear.ipbase 06-Jun-2001 2.2k test_output.com 06-Jun-2001 82 torsoslice.ipbase 06-Jun-2001 2.5k torsoslice.ippara 12-Nov-2002 5.9k torsoslice.ipregi 06-Jun-2001 93 ventcl.ipequa 26-May-2003 1.2k ventcl.ipinit 06-Jun-2001 1.2k ventcl.ipmate 06-Jun-2001 606 ventcl.ipsolv 13-Apr-2007 1.2k ventcl3.ipelem 06-Jun-2001 16k ventcl3.ipnode 06-Jun-2001 19k
Name Modified Size
examples_b_b2_b21_b214_b2141.tar.gz 14-Apr-2007 30k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Success | Sun Mar 6 00:04:53 2016 | 5 |
cm-debug | Success | Sat Mar 5 00:24:27 2016 | 13 |
mips-irix | |||
cm | Success | Sun Aug 19 03:08:52 2007 | 101 |
cm-debug | Success | Wed Aug 15 02:59:00 2007 | 240 |
cm-debug-clear-malloc | Success | Sat Aug 18 03:14:55 2007 | 245 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 03:13:37 2007 | 244 |
cm64 | Success | Sun Aug 19 03:13:46 2007 | 106 |
cm64-debug | Success | Tue Aug 21 03:46:32 2007 | 265 |
cm64-debug-clear-malloc | Success | Thu Apr 1 11:21:52 2004 | 119 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:12:02 2009 | 5 |
cm-debug | Success | Mon Mar 2 01:20:14 2009 | 42 |
cm64 | Success | Wed Mar 4 01:11:31 2009 | 6 |
cm64-debug | Success | Tue Mar 3 01:25:00 2009 | 40 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:14 2016 | 3 |
cm-debug | Success | Sat Mar 5 00:02:18 2016 | 8 |
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. |
Html last generated: Sun Mar 6 05:51:13 2016
Input last modified: Fri Apr 13 10:39:20 2007