This examples demonstrates how a user-specific function can be defined within CellML and used to simulate actice contraction. Here, a constant Calcium level is asumed. The user-specific function is used to enhance the 2nd Piola Kirchhoff stress tensor. The 'ipacti' file demonstrates how one chooses a CellMl-defined function, what type of stress this user-defined function resembles, and in which direction it should be added to. This example is based on a modified Mooney Rivlin constitutive law which can be enhanced by a passive and active stress response that depends on the fibrestretch. The example is twofold. First, we just elongate a unit cube in one direction by .1 (10%) and apply only a passive stress ($alpha=0). Then we keep the node values of the cube fixed and increase the activation level to a $alpha=0.2. This implies that we add to the 2nd PKST a passive and active stress component. This is explained in more detail in Rohrle o., Pullan A., "Three-dimensional finite element analysis of muscle forces during mastication", 2006 (submitted)
# # EXAMPLE 5d4: Active Contraction based on a user-defined CellML function # # This examples demonstrates how a user-specific function can be defined # within CellML and used to simulate actice contraction. Here, a constant # Calcium level is asumed. The user-specific function is used to enhance # the 2nd Piola Kirchhoff stress tensor. The 'ipacti' file demonstrates # how one chooses a CellMl-defined function, what type of stress this # user-defined function resembles, and in which direction it should be # added to. # # This example is based on a modified Mooney Rivlin constitutive law which # can be enhanced by a passive and active stress response that depends on # the fibrestretch. The example is twofold. First, we just elongate a unit # cube in one direction by .1 (10%) and apply only a passive stress ($alpha=0). # Then we keep the node values of the cube fixed and increase the activation # level to a $alpha=0.2. This implies that we add to the 2nd PKST a passive # and active stress component. # # This is explained in more detail in Rohrle o., Pullan A., "Three-dimensional # finite element analysis of muscle forces during mastication", 2006 (submitted) # # If the example path is not set, default to current directory if (! defined $example) { $example = "./"; } # Drop off the trailing / in the example path $chopped = chop $example; if ($chopped ne "/") { $example .= $chopped; } # Set the output directory $output = "."; if (! -d $output) { mkdir $output,0700; } # Definition of basic variables FEM define para ;r; $example/RunParameters FEM define coordinate 3,1 FEM define base ;r; $example/Activation # Definition of a unit cube FEM define node ;r; $example/UnitCube FEM define elem ;r; $example/UnitCube FEM define fibr ;r; $example/UnitCube30 FEM define elem ;r; $example/UnitCube fibre FEM define fiel ;r; $example/UnitCube FEM define elem ;r; $example/UnitCube field FEM group elem 1 as ALL_ELEMENTS # # Setup the mechanics problem, in particular that the constitutive law is referred # FEM define equa ;r; $example/Activation FEM define mate ;r; $example/Activation_cellml # # Write out reference state for visualisation (View_Results.com) # FEM update solution from geometry FEM UPDATE field 1 sub sol depvar 1 FEM UPDATE field 2 sub sol depvar 2 FEM UPDATE field 3 sub sol depvar 3 FEM export elem; $output/UnitCube as cube FEM export node; $output/UnitCube as cube # # Define which nodal values are Dirichlet (essential) boundary conditions # and can be changed later on (see below 'FEM change disp ...' command) # FEM define init ;r; $example/Activation # # Define grid for CellML and choose grid such that it coincides with # the gauss points of the elements # FEM define grid ;r; $example/Activation gauss class 2 FEM update grid geometry FEM group grid element ALL_ELEMENTS as ALL_GRID_POINTS class 2 # # Define everything for CellML use # Note that the function fibrestress in MooneyRivlin+FibreStretch.xml is only # defined and not used in any calculations of the stress tensor. This is the # total (Cauchy) stress value which is added to the 2nd PKST and represents the # active contraction part. FEM define equa ;r; $example/Activation_cellml class 2 FEM define mate ;d class 2 FEM define cell ;r; $example/Activation_cellml class 2 FEM define mate ;r; $example/Activation_cellml cell class 2 FEM define init ;d class 2 FEM define solv ;r; $example/Activation_cellml class 2 # # By choosing option (3) in at the type of contraction model, we can subsequently # choose the type of stress (Cauchy or 2nd PKST-type), to which component of the # stress tensor you would like to add this stress (in body coordinates, 1,1 # represents the fibre direction, and the name of the CellML function which evaluates # the stress component. In this example, the function fibrestress. # FEM define acti ;r; $example/Activation_cellml # # The different load steps should demonstrate the different states, eg. only passive # or active and passive stress. # $LoadStepStart = 1 $MAX_LoadSteps = 3 for ( $LoadStep=$LoadStepStart; $LoadStep<$MAX_LoadSteps; $LoadStep++ ) { if ($LoadStep==1) { $disp = 0.1 # displacement parameter $alpha = 0.0 # activation parameter } if ($LoadStep==2) { $disp = 0.0 # displacement parameter $alpha = 0.2 # activation parameter } print "\n\ndisplacement: ",$disp," and alpha: ",$alpha,"\n\n" # # Looks up in which cell array the variable 'alpha' is stored. 'Alpha' can be # understood as a parameter which represents the percentage of active muscle fibres # within a muscle. # FEM inquire cell_variable alpha return_variables v1,v2 print "\n\n",$v1," ",$v2,"\n\n" # # Update the CellML variable 'alpha' with a constant value # FEM update grid $v1 $v2 const $alpha # # Initialize all Dirichlet bc to 0. # This sets the boundary conditions which are equivalant to a translation of the # nodes 2,4,6,8 (right side of the unit cube) by 0.1 (or 0.0 in the second load step) # FEM change disp init FEM change disp translate nodes 2,4,6,8 by $disp,0,0 # # Solve the problem # FEM define solv;r; $example/Activation FEM solve iter 20 # # Compute the reaction forces necessary to obtain the deformed state, and # save the deformed state. # fem define fit;r; $example/Activation grid fem fit FEM UPDATE field 1 sub sol depvar 1 FEM UPDATE field 2 sub sol depvar 2 FEM UPDATE field 3 sub sol depvar 3 fem eval reac nh 1 to 4 noview fem eval reac nh 2 to 5 noview fem eval reac nh 3 to 6 noview FEM export nodes; $output/DefUnitCube_${LoadStep} as cube } # # The results can be visualised by the command View_Result.com # The time slider allows one to look at the different load steps. #
Name Modified Size
example_5d4.com 23-Aug-2006 5.8k Activation.ipbase 23-Aug-2006 12k Activation.ipequa 23-Aug-2006 2.0k Activation.ipfit 13-Apr-2007 1.6k Activation.ipgrid 23-Aug-2006 654 Activation.ipinit 23-Aug-2006 4.5k Activation.ipmate 23-Aug-2006 739 Activation.ippara 23-Aug-2006 6.0k Activation.ipsolv 16-Aug-2010 2.4k Activation.ipsolv.old 13-Apr-2007 2.3k Activation_cellml.ipacti 23-Aug-2006 605 Activation_cellml.ipcell 23-Aug-2006 3.3k Activation_cellml.ipequa 23-Aug-2006 1.6k Activation_cellml.ipmatc 23-Aug-2006 3.0k Activation_cellml.ipmate 23-Aug-2006 1.5k Activation_cellml.ipsolv 13-Apr-2007 2.3k MooneyRivlin+FibreStretch.xml 23-Aug-2006 19k RunParameters.ippara 23-Aug-2006 5.9k UnitCube.ipelem 23-Aug-2006 639 UnitCube.ipelfb 23-Aug-2006 388 UnitCube.ipelfd 23-Aug-2006 721 UnitCube.ipfiel 23-Aug-2006 38k UnitCube.ipnode 23-Aug-2006 15k UnitCube30.ipfibr 23-Aug-2006 12k View_Results.com 23-Aug-2006 3.8k
Name Modified Size
examples_5_5d_5d4.tar.gz 17-Aug-2010 36k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Failure | Sun Mar 6 00:16:42 2016 | 5 |
last break | Tue Feb 24 03:22:00 2015 | 4 | |
last success | Sun Apr 17 00:54:00 2011 | 10 | |
cm-debug | Failure | Sun Mar 6 00:40:30 2016 | 25 |
last break | Tue Feb 24 03:40:00 2015 | 25 | |
last success | Sat Apr 16 00:50:00 2011 | 39 | |
mips-irix | |||
cm | Success | Sun Aug 19 02:16:49 2007 | 45 |
cm-debug | Success | Wed Aug 15 02:54:58 2007 | 228 |
cm-debug-clear-malloc | Success | Sat Aug 18 03:23:32 2007 | 259 |
cm-debug-clear-malloc7 | Failure | Tue Aug 21 05:58:55 2007 | 28 |
last break | Mon Aug 28 01:39:00 2006 | 102 | |
cm64 | Success | Sun Aug 19 02:18:28 2007 | 47 |
cm64-debug | Success | Tue Aug 21 03:35:16 2007 | 256 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:12:59 2009 | 6 |
cm-debug | Success | Mon Mar 2 01:21:12 2009 | 85 |
cm64 | Success | Wed Mar 4 01:12:25 2009 | 8 |
cm64-debug | Success | Tue Mar 3 01:32:17 2009 | 80 |
x86_64-linux | |||
cm | Failure | Sun Mar 6 00:01:54 2016 | 3 |
last break | Sun May 8 00:27:00 2011 | 4 | |
last success | Sun Apr 17 00:27:00 2011 | 4 | |
cm-debug | Failure | Sun Mar 6 00:03:35 2016 | 12 |
last break | Mon Apr 18 00:11:00 2011 | 16 | |
last success | Sat Apr 16 00:20:00 2011 | 16 |
mips-irix | |||
SIGABRT | cm-debug-clear-malloc7: | exit due to SIGABRT signal. |
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. | |
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 | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: 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. | |
Missing | cm-debug-clear-malloc7: | output file not generated for ndiff; generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | 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 | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: significant differences with generic answer. |
i686-linux | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: 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. | |
Missing | cm-debug-clear-malloc7: | output file not generated for ndiff; generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | 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 | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: 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. | |
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. | |
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:50:27 2016
Input last modified: Mon Aug 16 11:19:15 2010