Example e6: Forward/inverse calculations on a 2D slice

An example of applying an inverse matrix to a history file.


The comfile run by this example is as follows:

# Example e6 
# ----------
#


#----------------------------------------------------------#
#
# 2D torso slice simulation and inverse
#
#----------------------------------------------------------#


fem def para;r;torsoslice;example            #Sets up minimal parameter set.
fem def regi;r;torsoslice;example            #Two regions.
fem def node;r;;example region all           #Defines nodes for a 2D slice 
#                                            # through a torso and heart.
#fem define window;c
fem def base;r;;example                      #Defines a cubic Hermite BEM basis
#                                            # function.
fem def elem;r;;example region all           #Define 17 elements between heart 
#                                            # and torso.
#fem draw node region all                    #Draws the nodes around the torso 
#                                            # and heart.
#fem draw elements region all                #Draws the elements. Note that the
#                                            # elements lie around the boundary 
#                                            # of the slice, not running 
#                                            # 'through' it as they would with a
#                                            # FEM mesh.
#fem draw lines                              #We can now see the outline of the 
#                                            # 2D slice.
fem list elem region all total


#
#----------------------------#
# Setup equations
#----------------------------#
#
fem def equa;r;;example region all           #Defines a quasistatic analysis of 
#                                            # the standard Laplace equation.
fem def mate;r;;example region all
fem def init;r;;example region all
fem def sour;r;;example region 2             #Moving dipole inside heart.
fem def coup;r;;example                      #The type of coupling.
fem list coupling

Additional testing commands:

fem def solv;r;torsoslice_bin;example coupled region all
fem solve coupled


#
#----------------------------#
# Export geometry
#----------------------------#
#
fem export node;slice as slice
fem export elem;slice as slice


#
#----------------------------#
# Export field
#----------------------------#
#
fem export node;slice_hist his torsoslice as potentials bin 


#
#----------------------------#
# Epicardial to torso
#----------------------------#
#
fem def trans;r;torsoslice;example   
fem eval transfer;torsoslice SVD
fem def inve;r;;example
fem eval inverse;torsoslice SVD
fem apply inverse history infile torsoslice outfile inverse_torsoslice bin


#
#----------------------------#
# Not implemented yet for binary
#----------------------------#
#
#fem check solution inverse infile1 torsoslice infile2 inverse_torsoslice bin
#                                            #Check the inversion over the whole 
#                                            # time interval by comparing the 
#                                            # two history files.


#
#----------------------------#
# Not implemented yet for 
#  specfic times
#----------------------------#
#
#fem check sol inverse time 0.3,0.5,0.6 infile1 torsoslice infile2 inv_torsoslice binary
#                                            #Compare solutions at times 0.3 0.5 0.6.


fem eval elec hist torsoslice from nodes electr 46..51 coup bin reg all
#                                            #Tests for evaluation and adding signals.
fem eval elec;tslice1 hist torsoslice from nodes electr 46..51 coup bin reg all
fem eval elec;tslice2 hist torsoslice from nodes electr 46..51 coup bin reg all
#                                            #Evaluates the history file using 
#                                            # nodes 46..51 as the electrode 
#                                            # locations and outputs two binary
#                                            # *.binsig files.


fem add sign infile1 tslice1 a 1.0 infile2 tslice2 b -1.0 out tslice_diff bin
#                                            #Adds the two *.binsig files together 
#                                            # with coef -1.0 and 1.0. Effectivly 
#                                            # it performs a difference between
#                                            # the signals.


#
#----------------------------#
# Export signals
#----------------------------#
#
fem def export;r;torsoslice;example 
fem export signal;unemap_ts1 electrodes signal tslice1
fem export signal;unemap_ts2 electrodes signal tslice2
fem export signal;unemap_tsdiff electrodes signal tslice_diff


Files used by this example are:

Name                   Modified     Size

example_e6.com 20-Nov-2001 1.9k test_output.com 20-Nov-2001 2.6k torsoslice.ipbase 10-Apr-2000 1.2k torsoslice.ipcoup 21-Aug-2002 464 torsoslice.ipcoup.old 10-Apr-2000 413 torsoslice.ipexpo 10-Apr-2000 683 torsoslice.ipinve 06-Dec-2001 571 torsoslice.ipmate 10-Apr-2000 81 torsoslice.ippara 26-Feb-2003 5.9k torsoslice.ipregi 10-Apr-2000 93 torsoslice.ipsour 21-May-2002 78k torsoslice.iptrsf 01-Nov-2001 792 torsoslice.irelem 10-Apr-2000 5.8k torsoslice.irequa 26-May-2003 2.3k torsoslice.irinit 10-Apr-2000 8.7k torsoslice.irmate 10-Apr-2000 155 torsoslice.irnode 10-Apr-2000 7.2k torsoslice_bin.irsolv 13-Apr-2007 2.2k

Download the entire example:

Name                  Modified     Size

examples_e_e6.tar.gz 14-Apr-2007 43k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:02:34 20160
cm-debugSuccessSat Mar 5 00:04:27 20161
mips-irix
cmSuccessSun Aug 19 01:35:16 20077
cm-debugSuccessWed Aug 15 01:30:09 200715
cm-debug-clear-mallocSuccessSat Aug 18 01:37:28 200720
cm-debug-clear-malloc7SuccessMon Aug 20 01:33:54 200720
cm64SuccessSun Aug 19 01:33:38 20077
cm64-debugSuccessTue Aug 21 01:29:32 200716
cm64-debug-clear-mallocSuccessThu Apr 1 12:10:24 20048
rs6000-aix
cmSuccessWed Mar 4 01:12:14 200910
cm-debugSuccessMon Mar 2 01:08:32 20097
cm64SuccessWed Mar 4 01:12:15 200910
cm64-debugSuccessTue Mar 3 01:14:18 20098
x86_64-linux
cmSuccessSun Mar 6 00:01:07 20160
cm-debugSuccessSat Mar 5 00:01:38 20160

Testing status by file:


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

Input last modified: Fri Apr 13 10:42:00 2007


CMISS Help / Examples / e / e6