This example illustrates the Mooney-Rivlin constitutive material law, defined by a CellML version of the model.Here is a PDF of the model equations. The example simulates shearing of a cube in the xz plane, with the Mooney-Rivlin material law defined via CellML
NOTE: This example requires a CellML 1.0 enabled version of CMISS to run.
# Example showing how to use a cellml model to implement a passive mechanics # constitutive law #******************************************************************************************************************************** # TIME PERFORMANCE IS CURRENTLY EXTREMELY BAD - REALLY SLOW. # A BETTER VERSION OF THIS FEATURE IS CURRENTLY BEING DEVELOPED TO MAKE IT PRACTICAL TO USE #******************************************************************************************************************************** # IMPORTANT NOTES ON ASSUMPTIONS AND UNDERLYING OPERATIONS #******************************************************************************************************************************** # It is assumed that the green-strain components used in the cellml model are taken from the following indices in the RCQS array # RCQS 3 - E11 comp 1 in CMISS # RCQS 4 - E12 comp 4 in CMISS # RCQS 5 - E13 comp 5 in CMISS # RCQS 6 - E22 comp 2 in CMISS # RCQS 7 - E23 comp 6 in CMISS # RCQS 8 - E33 comp 3 in CMISS #******************************************************************************************************************************** # It is assumed that once the cellml file has been evaluated for deviatoric components of stress, the resultant values are stored # in the following indices of the YQS array. They are then copied to the YG array # YQS 2 - Tdev11 - YG 1 # YQS 3 - Tdev12 - YG 2 # YQS 4 - Tdev13 - YG 3 # YQS 5 - Tdev22 - YG 4 # YQS 6 - Tdev23 - YG 5 # YQS 7 - Tdev33 - YG 6 #******************************************************************************************************************************** # CellML stores variables defined in the cellml file in alphanumeric order in the RCQS and YQS arrays. Also, upper case is given # higher precedence than lower case when storing in cell indices. So, E11 will be stored before c1. Therefore, make sure that # variable names are chosen so that they do not change the indices in which Eij are stored due to the assumption specified previously #******************************************************************************************************************************** # It is currently assumed that all cell problems are solved in class 2. #******************************************************************************************************************************** # IF ANY OF THE ABOVE CONSTRAINTS RESTRICT YOU IN SOLVING YOUR PROBLEM, THE CODE IN ZERE50 AND OPSTRE MUST BE ALTERED TO # GENERALISE WHICH ARRAYS ARE USED. #******************************************************************************************************************************** # 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 up CMISS mechanics model # # fem def para;r;emech;example fem def coor 3,1 # Set up bases fem define bas;r;TriCubicHerm;example #defines tricubic Hermite basis function for 3D geometry fem def;add base;r;BiCubicHerm;example #defines bicubic Hermite basis function for 2D faces of geometry fem def;add base;r;TriLinear;example #defines a trilinear basis function for the interpolation of grid parameters fem def;add base;r;BiLinear;example #defines bilinear basis function # Load the mesh fem define node;r;cubeherm_cube;example #define 8 nodes fem define elem;r;cubeherm_cube;example #define 1 element fem def fibre;r;cubeherm_cube;example #define fibre field. Lined up with rectangular cartesian coordinates in this example fem def elem;r;cubeherm_cube;example fibre #define the elemental description of fibre field # Define equations, materials and boundary conditions fem def equa;r;mechanics;example lock #defines the finite elasticity equation for 3D problem. lock ensures that the equation options are not overwritten in memory fem def mat;r;mooney_rivCellML;example #choose to have stresses defined at gauss points with grid coupling fem def init;r;cubeherm_cubesheared_cube;example #define the shearing boundary conditions on the xz plane fem def solve;r;cubeherm;example #define the solver to be used for the finite elasticity equations # fem group elem 1 as ALL_ELEMENTS #group the element and call it ALL_ELEMENTS #In this example we define displacements #************************************************************** # # #************************************************************** #set up a finite difference grid for the cell problem in class 2 # # WHEN DEFINING GRID GAUSS QUALIFIER SETS UP GRID POINTS AT GAUSS POINTS # IF YOU WANT A GRID SCHEME NOT AT GAUSS POINTS, THE SIMULATION WILL RUN VERY SLOWLY # AS YOU ARE NOW DEALING WITH A MORE GENERAL CASE. fem def grid;r;cubeherm_cube;example gauss class 2 #set up a grid at gauss scheme. choose trilinear basis (basis no. 5) to interpolate between grid points fem update grid geometry #sets up the grid geometry #group the grid points in the element group ALL_ELEMENTS as ALL_GRID_POINTS fem group grid element ALL_ELEMENTS as ALL_GRID_POINTS #define a cellml equation - see cellml.ipequa. The options chosen may seem wrong. #But the choices made allow us to use features that have been developed for cellular based modelling of cardiac electrical activation in CMISS, for our problem. fem def equa;r;cellml;example class 2 #fem def equa;r;user_cell;example class 2 #defines a cellml equation - see cellml.ipequa # # set up conductivities- defaulted. Once again, stuff that we don't need for finite elasticity, but currently required to use features of electrical activation fem def mate;d class 2 #define which FILENAME.cml file to read in as a material law. You have to save Tdev11...Tdev33 as they are going to be used in stress calculations. #Eij are spatially varying - obvious I hope, because strain at each gauss point can be different #c1 and c2 are constant throughout volume in this example. fem define cell;r;mooney_rivlin;example class 2 # needed for spatially varying parameters.green strain components in this case are the only spatially varying parameters fem def mate;r;mooney_rivlin;example cell class 2 #no flux boundary condition etc for electrical activation problems defined in next command #Once again just default as we only need it to use some features otherwise inaccessible fem def init;d class 2 #The solve file below is needed for solving differential equations present in electromechanics models. #We need to read this in eventhough we are not using it for the completely passive deformation example #Do not worry about the options chosen in this file. #You can just default everything, its once again needed just to allow us to use features of electrical activation in CMISS fem def solv;r;cell-hmt-implicit-adams;example class 2 # Initialise solvers. #runs the cellml time integration solver stuff once to initialise cellml solver things. The "0" class 2 to 0 says you have a 0 time step for the integration fem solve class 2 to 0; #************************************************************** fem solve iter 20 # solve the finite elasticity mechanics problem
fem list stress at 1 strain_energy
Name Modified Size
example_5g1.com 21-Jul-2009 7.1k BiCubicHerm.ipbase 17-Feb-2004 1.6k BiLinear.ipbase 13-Feb-2004 1.2k TriCubicHerm.ipbase 13-Feb-2004 1.9k TriLinear.ipbase 13-Feb-2004 1.4k cell-hmt-implicit-adams.ipsolv 13-Apr-2007 2.6k cellml.ipequa 13-Feb-2004 1.5k cubeherm.ipsolv 16-Aug-2010 2.3k cubeherm.ipsolv.old 01-Apr-2009 2.2k cubeherm_cube.ipelem 01-Apr-2009 576 cubeherm_cube.ipelfb 13-Feb-2004 389 cubeherm_cube.ipfibr 13-Feb-2004 12k cubeherm_cube.ipgrid 01-Apr-2009 610 cubeherm_cube.ipnode 27-Mar-2004 14k cubeherm_cubesheared_cube.ipinit 11-Apr-2009 3.8k emech.ippara 13-Feb-2004 5.9k mechanics.ipequa 02-May-2004 2.0k mooney_rivCellML.ipmate 13-Feb-2004 695 mooney_rivlin.cml 13-Feb-2004 11k mooney_rivlin.ipcell 17-Feb-2004 2.4k mooney_rivlin.ipmatc 13-Feb-2004 2.1k test_output.com 21-Jul-2009 35
Name Modified Size
examples_5_5g_5g1.tar.gz 16-Aug-2014 27k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Success | Sun Mar 6 00:03:00 2016 | 2 |
cm-debug | Success | Sat Mar 5 00:19:46 2016 | 11 |
mips-irix | |||
cm | Success | Sun Aug 19 01:38:37 2007 | 10 |
cm-debug | Success | Wed Aug 15 01:41:33 2007 | 39 |
cm-debug-clear-malloc | Success | Sat Aug 18 02:08:20 2007 | 78 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 02:42:59 2007 | 63 |
cm64 | Success | Sun Aug 19 01:39:07 2007 | 9 |
cm64-debug | Success | Tue Aug 21 01:42:29 2007 | 45 |
cm64-debug-clear-malloc | Success | Tue Feb 1 09:46:33 2005 | 25 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:08:54 2009 | 2 |
cm-debug | Success | Mon Mar 2 01:11:52 2009 | 13 |
cm64 | Success | Wed Mar 4 01:08:54 2009 | 2 |
cm64-debug | Success | Tue Mar 3 01:16:17 2009 | 13 |
x86_64-linux | |||
cm | Success | Sun Mar 6 00:01:04 2016 | 1 |
cm-debug | Success | Sat Mar 5 00:01:58 2016 | 4 |
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:50:28 2016
Input last modified: Fri Aug 15 11:59:12 2014