This example demonstrates how to couple a multiple ventricular regions by direct assembly while iterating on the epicardial surface to get a continuous solution.
#Example b2145 # # This example demonstrates how to couple a multiple ventricular # regions by direct assembly while iterating on the epicardial # surface to get a continuous solution. # # Problem classes $CAVITY=1 $LVENTL=2 $RVENTL=3 $BEMHRT=4 $GRIDHT=5 # Problem regions $TLAPLC=1 $LVECLS=2 $RVECLS=3 $GRDCLS=4 $EXTCLS=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;minimal;example fem define regi;r;torsoslice;example fem define node;r;cavity4;example reg $CAVITY fem define node;r;LV3;example reg $LVENTL fem define node;r;RV3;example reg $RVENTL fem define node;r;bemhrt3;example reg $BEMHRT fem define node;r;gridhtr;example reg $GRIDHT fem define base;r;linear;example fem define elem;r;cavity4;example reg $CAVITY fem define elem;r;LV3;example reg $LVENTL fem define elem;r;RV3;example reg $RVENTL fem define elem;r;bemhrt3;example reg $BEMHRT fem define elem;r;gridhtr;example reg $GRIDHT fem define fibr;r;gridhtr;example reg $GRIDHT fem define elem;r;gridhtr;example reg $GRIDHT fibre # Define finite difference grid fem define grid;r;gridhtr;example reg $GRIDHT fem update grid geomet reg $GRIDHT fem update grid metric reg $GRIDHT fem group grid xi2=0 elem 11..20,27,28 as LVendo reg $GRIDHT fem group grid xi2=1 elem 11,13,19,20 as RVendo1 reg $GRIDHT fem group grid xi2=0 elem 1,3,9,10,21,22,25,26 as RVendo2 reg $GRIDHT fem group grid grid RVendo1,RVendo2 as RVendo reg $GRIDHT fem group grid grid LVendo,RVendo as endocardium reg $GRIDHT fem group grid xi2=1 elem 1..10,21..26 as epicardium reg $GRIDHT fem group grid external as boundary reg $GRIDHT fem group grid line 1845 xidirn 2 as stimulus reg $GRIDHT # Create node to grid mapping fem update node grid grid_reg $GRIDHT bem_reg $BEMHRT exclude node 77,78 fem update node geomet from grid reg $BEMHRT except node 77,78 # Define equations fem define equa;r;cavity;example reg $CAVITY class $TLAPLC lock fem define equa;r;LV;example reg $LVENTL class $LVECLS lock fem define equa;r;RV;example reg $RVENTL class $RVECLS lock fem define equa;r;alto;example reg $GRIDHT class $GRDCLS,$EXTCLS lock # Define material parameters fem define mate;r;cavity;example reg $CAVITY class $TLAPLC fem define mate;r;LV;example reg $LVENTL class $LVECLS fem define mate;r;RV;example reg $RVENTL class $RVECLS fem define mate;r;alto;example reg $GRIDHT class $GRDCLS,$EXTCLS fem define cell;r;alto;example reg $GRIDHT class $GRDCLS,$EXTCLS fem update grid materi reg $GRIDHT class $GRDCLS,$EXTCLS # Define initial conditions fem define init;r;cavity2;example reg $CAVITY class $TLAPLC fem define init;r;LV;example reg $LVENTL class $LVECLS fem define init;r;RV;example reg $RVENTL class $RVECLS fem define init;r;alto;example reg $GRIDHT class $GRDCLS,$EXTCLS # Define right ventricular normal reversals fem define norm;r;ventcl;example # Define grid to boundary element coupling fem up elem region $GRIDHT,$CAVITY class $EXTCLS,$TLAPLC grids epicardium # Define solution parameters fem define solv;r;alto;example reg $GRIDHT class $GRDCLS fem define solv;r;alto;example reg $GRIDHT class $EXTCLS fem define solv;r;cavity;example reg $CAVITY class $TLAPLC fem define solv;r;LV;example reg $LVENTL class $LVECLS fem define solv;r;RV;example reg $RVENTL class $RVECLS # Solve the passive torso problems fem solve reg $CAVITY class $TLAPLC fem solve reg $LVENTL class $LVECLS fem solve reg $RVENTL class $RVECLS # Solve the bidomain problem fem solve activ coupled to 0 reg $GRIDHT,$LVENTL,$RVENTL,$CAVITY class $GRDCLS,$EXTCLS,$LVECLS,$RVECLS,$TLAPLC grid endocardium cptype 5 for $TEN ( 0..0 ) { for $UNIT ( 0..0 ) { for $DECI ( 0..9 ) { 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 $GRDCLS,$EXTCLS noupdate $NUM_ITERS = 0 $FINISHED = 0 while( !$FINISHED && $NUM_ITERS<=$MAX_ITERS ) { $NUM_ITERS++ fem solve activ coupled extra rest reg $GRIDHT,$LVENTL,$RVENTL,$CAVITY cl $GRDCLS,$EXTCLS,$LVECLS,$RVECLS,$TLAPLC noupdate static alpha $ALPHA1 grid endocardium cptype 5 fem update init from grid region $CAVITY,$BEMHRT,$GRIDHT class $EXTCLS,$TLAPLC,$EXTCLS alpha $ALPHA2 fem solve reg $CAVITY class $TLAPLC fem check conv grid_reg $BEMHRT grid_cl $EXTCLS bem_reg $CAVITY bem_cl $TLAPLC grid_update_cl $EXTCLS return POTE1 FLUX1 $FINISHED = (abs($POTE1)<=$POTE_TOL && abs($FLUX1)<=$FLUX_TOL) print("Iteration $NUM_ITERS\n"); } fem solve activ coupled trans rest reg $GRIDHT,$LVENTL,$RVENTL,$CAVITY class $GRDCLS,$EXTCLS,$LVECLS,$RVECLS,$TLAPLC update static alpha $ALPHA1 grid endocardium cptype 5 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 b2145 # Torso cavity fem list node solu reg 1 class 1 # Ventricles fem list node solu reg 2 class 2 fem list node solu reg 3 class 3
Name Modified Size
example_b2145.com 06-Jun-2001 5.0k LV.ipequa 26-May-2003 1.2k LV.ipinit 06-Jun-2001 1.2k LV.ipmate 06-Jun-2001 606 LV.ipsolv 13-Apr-2007 1.2k LV3.ipelem 06-Jun-2001 24k LV3.ipnode 06-Jun-2001 28k RV.ipequa 26-May-2003 1.2k RV.ipinit 06-Jun-2001 1.2k RV.ipmate 06-Jun-2001 606 RV.ipsolv 13-Apr-2007 1.2k RV3.ipelem 06-Jun-2001 24k RV3.ipnode 06-Jun-2001 28k alto.ipcell 06-Jun-2001 1.7k alto.ipequa 26-May-2003 1.4k alto.ipinit 06-Jun-2001 847 alto.ipmate 06-Jun-2001 1.8k alto.ipsolv 13-Apr-2007 1.8k alto.ipsolv.old 06-Jun-2001 1.4k bemhrt3.ipelem 06-Jun-2001 80k bemhrt3.ipnode 06-Jun-2001 94k cavity.ipequa 26-May-2003 1.3k cavity.ipmate 06-Jun-2001 606 cavity.ipsolv 13-Apr-2007 1.5k cavity2.ipinit 06-Jun-2001 1.4k cavity4.ipelem 06-Jun-2001 38k cavity4.ipnode 06-Jun-2001 45k gridhtr.ipelem 06-Jun-2001 7.5k gridhtr.ipelfb 06-Jun-2001 4.3k gridhtr.ipfibr 06-Jun-2001 7.0k gridhtr.ipgrid 06-Mar-2003 561 gridhtr.ipnode 06-Jun-2001 14k linear.ipbase 06-Jun-2001 2.2k minimal.ippara 12-Nov-2002 5.9k test_output.com 06-Jun-2001 152 torsoslice.ipregi 06-Jun-2001 93 ventcl.ipnorm 06-Jun-2001 418
Name Modified Size
examples_b_b2_b21_b214_b2145.tar.gz 14-Apr-2007 504k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Success | Sun Mar 6 00:03:37 2016 | 4 |
cm-debug | Success | Sat Mar 5 00:16:49 2016 | 7 |
mips-irix | |||
cm | Success | Sun Aug 19 02:21:05 2007 | 49 |
cm-debug | Success | Wed Aug 15 02:15:11 2007 | 115 |
cm-debug-clear-malloc | Success | Sat Aug 18 02:30:03 2007 | 119 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 02:31:29 2007 | 119 |
cm64 | Success | Sun Aug 19 02:22:57 2007 | 51 |
cm64-debug | Success | Tue Aug 21 02:18:03 2007 | 122 |
cm64-debug-clear-malloc | Success | Thu Apr 1 11:22:20 2004 | 56 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:11:10 2009 | 5 |
cm-debug | Success | Mon Mar 2 01:13:57 2009 | 21 |
cm64 | Success | Wed Mar 4 01:11:30 2009 | 4 |
cm64-debug | Success | Tue Mar 3 01:18:23 2009 | 21 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:08 2016 | 2 |
cm-debug | Success | Sat Mar 5 00:02:01 2016 | 3 |
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:32 2007