Example d122: Rectus femoris activation

This example takes the fibre created in the previous example and places it within a surface mesh of the rectus femoris. It then activates the fibre and uses dipoles to calculated potentials on the muscle surface.


The comfile run by this example is as follows:

# This comfile solves a couple muscle fibre/whole muscle problem #
#  using dipoles.                                                #

if( !$example ) {
  $example = ".";
}

# Use small mesh (1) or refined mesh (0)
$SmallMesh = 1;

# Regions
$RectusFemoris = 1;
$MuscleFibres = 2;

# Classes
$Laplace = 1;
$Activation = 2;

# Read in the geometries
fem define para;r;$example/2regions
fem define coor;r;$example/2regions
fem define regi;r;$example/2regions
if( $SmallMesh ) {
  fem define node;r;$example/refined_rectus_femoris region $RectusFemoris
} else {
  fem define node;r;$example/refinedx2 region $RectusFemoris
}
fem define node;r;$example/fibre region $MuscleFibres
fem define base;r;$example/combined
if( $SmallMesh ) {
  fem define elem;r;$example/refined_rectus_femoris region $RectusFemoris
} else {
  fem define elem;r;$example/refinedx2 region $RectusFemoris
}
fem define elem;r;$example/fibre region $MuscleFibres

# Define the whole muscle problem
fem define equa;r;$example/muscle region $RectusFemoris class $Laplace lock
fem define mate;r;$example/muscle region $RectusFemoris class $Laplace
fem group node 1 as firstapex region $RectusFemoris
fem group node 29 as secondapex region $RectusFemoris
if( $SmallMesh ) {
  fem group node 5..28,30..109 as surfaces region $RectusFemoris
} else {
  fem group node 5..19,21..28,30..109,137..464 as surfaces region $RectusFemoris
}
fem define init;r;$example/muscle region $RectusFemoris class $Laplace
fem define solv;r;$example/muscle region $RectusFemoris class $Laplace

# Define the fibre problem
fem define grid;r;$example/fibres region $MuscleFibres
fem update grid geometry region $MuscleFibres
fem update grid metric region $MuscleFibres
fem define equation;r;$example/fibres region $MuscleFibres class $Activation
fem define material;r;$example/fibres region $MuscleFibres class $Activation
fem define cell;r;$example/fibres region $MuscleFibres class $Activation
fem update grid material region $MuscleFibres class $Activation
fem define initial;r;$example/fibres region $MuscleFibres class $Activation
fem define solve;r;$example/fibres region $MuscleFibres class $Activation

# Solve the problems
fem solve region $RectusFemoris class $Laplace
fem solve to 0 region $MuscleFibres class $Activation

foreach $step ( 0..75 ) {
  $time = $step
  fem solve restart to $time region $MuscleFibres class $Activation
  fem define sour;c grid time $time
  fem update source region $RectusFemoris class $Laplace time $time
  fem solve region $RectusFemoris class $Laplace
#  fem export elem;fibre$time field region $MuscleFibres class $Activation as fibre_MB 
#  fem export node;muscle$time field region $RectusFemoris class $Laplace as muscle_MB 
}

# Export the whole muscle information
#fem export node;muscle_MB as muscle_MB region $RectusFemoris class $Laplace
#fem export elem;muscle_MB as muscle_MB region $RectusFemoris class $Laplace
#fem export elem;field0_MB as muscle_MB region $RectusFemoris class $Laplace field

# Export the fibre information
#fem export node;fibre_MB as fibre_MB region $MuscleFibres
#fem export elem;fibre_MB as fibre_MB region $MuscleFibres

Additional testing commands:

fem export elem;fibre75 field region $MuscleFibres class $Activation as fibre_MB 
fem export node;muscle75 field region $RectusFemoris class $Laplace as muscle_MB 

Files used by this example are:

Name                           Modified     Size

example_d122.com 13-Nov-2001 3.1k 2regions.ipcoor 13-Nov-2001 608 2regions.ippara 14-Mar-2003 5.9k 2regions.ipregi 13-Nov-2001 131 animate.com 13-Nov-2001 774 combined.ipbase 13-Nov-2001 5.3k draw.com 22-Nov-2001 2.7k fibre.ipelem 13-Nov-2001 8.0k fibre.ipnode 13-Nov-2001 6.5k fibres.ipcell 13-Nov-2001 1.8k fibres.ipequa 26-May-2003 1.5k fibres.ipgrid 06-Mar-2003 515 fibres.ipinit 13-Nov-2001 526 fibres.ipmate 13-Nov-2001 1.8k fibres.ipsolv 13-Nov-2001 927 muscle.ipequa 26-May-2003 1.4k muscle.ipinit 13-Nov-2001 818 muscle.ipmate 13-Nov-2001 920 muscle.ipsolv 13-Apr-2007 1.3k refined_rectus_femoris.ipelem 13-Nov-2001 37k refined_rectus_femoris.ipnode 13-Nov-2001 93k refinedx2.ipelem 13-Nov-2001 146k refinedx2.ipnode 13-Nov-2001 386k test_output.com 13-Nov-2001 164

Download the entire example:

Name                           Modified     Size

examples_d_d1_d12_d122.tar.gz 14-Apr-2007 110k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:03:54 20163
cm-debugSuccessSat Mar 5 00:21:45 201613
mips-irix
cmSuccessSun Aug 19 02:25:29 200752
cm-debugSuccessWed Aug 15 03:54:22 2007352
cm-debug-clear-mallocSuccessSat Aug 18 04:21:23 2007354
cm-debug-clear-malloc7SuccessMon Aug 20 04:31:37 2007351
cm64SuccessSun Aug 19 02:29:19 200757
cm64-debugSuccessTue Aug 21 02:47:42 2007325
cm64-debug-clear-mallocSuccessThu Apr 1 11:54:49 2004139
rs6000-aix
cmSuccessWed Mar 4 01:11:46 20095
cm-debugSuccessMon Mar 2 01:24:26 200961
cm64SuccessWed Mar 4 01:11:47 20095
cm64-debugSuccessTue Mar 3 01:31:38 200969
x86_64-linux
cmSuccessSun Mar 6 00:01:12 20162
cm-debugSuccessSat Mar 5 00:02:10 20168

Testing status by file:


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

Input last modified: Fri Apr 13 10:40:50 2007


CMISS Help / Examples / d / d1 / d12 / d122