Example i72: Active contraction of the GOJ and passive pressure of crura

This example modells the active contraction of the GOJ using finite elasticity and coupled to a cavity mesh. In addition, a passive pressure was applied to a selection of elements to model the effect of the crura. NOTE: The example only shows the first loading step. The code used to obtain the final contracted stage of the GOJ are commented out in the .com file and will take approximately 4 hours to run.


The comfile run by this example is as follows:

#
# This file modells the active contraction of the GOJ coupled to 
# a cavity mesh. In addition, a passive pressure was applied to the
# external faces of a selection of elements to model the effect of the crura
# Author: Rita Yassi taken largely from example 5f2 written by Andre
# Last updated: 26/06/08
# Aim: active contraction of the GOJ
#
#

if (!defined $example)
{
    $OUT="output"; unless (-d $OUT) {mkdir $OUT};
    $example ='.';
} else
{
    $OUT=".";
}

set echo;
# write out an output file
set output;output on


# ************* define variables *********************************
# Region
$WALL = "1";
$CAVITY = "2";
# Classes
$TISSUE = "1";

# Solution parameters
$MAX_ITERS = 20;
$TOL = 1.0e-6;

$CAVITY_PRESSURE_NY = 2681;

# *****************************************************************

# ************ define problem *************************************
fem define parameters;r;$example/GOJ;
fem define coor;r;$example/3drc;

# Define all the bases (unit scale factors)
#  1 Geometry
fem define bases;r;$example/3CubicHermite_4x4x4Gauss;
#  2 Faces
fem define ;add bases;r;$example/2CubicHermite_4x4Gauss;
#  3  
fem define ;add bases;r;$example/2Linear-CubicHermite_4x4x4Gauss;
#  4 Fibre 
fem define ;add bases;r;$example/3Linear_4x4x4Gauss;
#  5  
fem define ;add bases;r;$example/Linear-2CubicHermite_4x4x4Gauss;
#  6 Faces
fem define ;add bases;r;$example/Linear-CubicHermite_4x4x4Gauss;
#  7 Faces
fem define ;add bases;r;$example/2Linear_4x4Gauss;
#  8 Faces
fem define ;add bases;r;$example/CubicHermite-Linear_4x4x4Gauss;
#  9 Pressure (pressure is linearly varied within each element)
fem define ;add bases;r;$example/3Linear-2PressAuxXi3_4x4x4Gauss;
# 10 Cavity geometry
fem define ;add bases;r;$example/2CubicHermite-Linear_4x4x4Gauss;
# 11 Cavity pressure
fem define ;add bases;r;$example/PressAuxXi3_4x4x4Gauss;

# *****************************************************************
# **************** Define the wall mesh **************************
fem define nodes;r;$example/2LayersGOJ reg $WALL;
fem define elements;r;$example/2LayersGOJ reg $WALL;      
fem define fibre;r;$example/2LayersGOJ reg $WALL;
fem define element;r;$example/2LayersGOJ fibre reg $WALL;

$undeformed= "undeformed_GOJ";

# Export initial undefomed geometry
fem export node;$undeformed as $undeformed region $WALL;
fem export elem;$undeformed as $undeformed region $WALL;

# Boundary conditions
# fix the displacements in the x direction
fem group node 230,238,293..294 as fixed_x1 region $WALL;
fem group node 301..302,358,366,403,407 as fixed_x2 region $WALL;
fem group node fixed_x1,fixed_x2 as fixed_x region $WALL;
# fix the displacements in the y direction 
fem group node 226,234,289..290 as fixed_y1 region $WALL;
fem group node 297..298,355,362,401,405 as fixed_y2 region $WALL;
fem group node fixed_y1,fixed_y2 as fixed_y region $WALL;
# fix the displacements in the x, y, and z directions of the bottom nodes
fem group node 83..84,86,88,92,94..96,178,180,183..184,189..192,321..322,325,327,329,331,333,335 as fixed_botnodes region $WALL;

# group elements
fem group elem 1..24,33..56,65..80,97..120,129..152,161..176 as AllElem #this is exluding the fundus part
fem group elem 9..24,41..48,65..80,105..120,137..144,161..176 as ActiveElem
fem group elem 97..120,129..152,161..176 as LMElem
fem group elem 105..109,112,118..119,137..138,140..144,165..167,172..176 as CruraElem

# Define static analysis of 3D finite elasticity
fem define equation;r;$example/finelas_tch_incomp class $TISSUE reg $WALL;

# Define the constitutive law
fem define material;r;$example/GuccioneLaw class $TISSUE reg $WALL;

# Initialise calcium activation to 0
fem define active;r;$example/Ca;

# Set the displacement bounday condidtions
fem define initial;r;$example/GOJ class $TISSUE reg $WALL;  

# ****************************** Set up cavity region *******************************

# Cavity region and geometry
fem define region;r;$example/coupled; 
fem define coord;r;$example/cavity region $CAVITY;
fem define node;r;$example/cavity region $CAVITY;
fem define element;r;$example/cavity region $CAVITY;

# The BC's for the cavity/wall interface nodes must match
fem group node 901..905 as cavity_fixed_nodes region $CAVITY;
fem group node 906 as cavity_free_node region $CAVITY;
$VALVE_NODE = "906";
$VALVE_NODES = "257,259,261,263,265,267,269,271";

# Set up equations, material properties and initial conditions
# for cavity region
fem define equation;r;$example/coupled region $WALL,$CAVITY lock;

# define cavity stiffness
fem define material;r;$example/cavity region $CAVITY;

# set BC 
# The displacements and derivatives of the internal nodes of the cavity must be fixed 
# with the exception of one node free to move in z
fem define initial;r;$example/cavity region $CAVITY;

# Define cavity-to-wall coupling and solution procedure information
fem define coupling;r;$example/coupled; 
fem define solve;r;$example/coupled_lu_nosparse coupled region $WALL,$CAVITY;

# Transfer wall deformation from the inflation problem to 
# geometric dependent variables for the cavity region
fem update solution coupled source_region $WALL class $TISSUE;

# ensure the central cavity node ($VALVE_NODE) is set to the average of the 
# x-coords for the adjacent interface nodes ($VALVE_NODES - this can 
# be a list of nodes)
fem update solution cavity_reference average $VALVE_NODE in 3 node $VALVE_NODES region $CAVITY;

# Export initial cavity geometry
fem export node;cavity_initial as cavity region $CAVITY;
fem export elem;cavity_initial as cavity region $CAVITY;

# Check that the current coupled solution is converged (as expected!)
# i.e. check that the sum of squared residuals at the bottom of the file
#      is a very small number!!
fem evaluate residuals;coupled_residuals wrt geom_params coupled;
fem list map;coupled_meshes solution coupled;

#get the pressure values of the cavity mesh (8 values of 1 should be visible)
fem list variable;pressure_inflation iy 1 array yp ny $CAVITY_PRESSURE_NY nc 1 set_variable CAVITY_PRESSURE class $TISSUE region $CAVITY;

# *************************** ISOVOLUMIC CONTRACTION ****************************

$file = "GOJ_contract";
$iter = 1;

# increase the Ca(acive) parameter
fem define active;r;$example/contract_$iter;
# solve
fem solve coupled inc 0.04 iter $MAX_ITERS error $TOL;
# export the nodes and elements
fem export node;${file}_${iter} field as GOJ class $TISSUE region $WALL;
fem export elem;${file}_${iter} field as GOJ class $TISSUE region $WALL;
# this shows the cavity pressure (final values in the file)
fem list variable;pressure_${iter} iy 1 array yp ny $CAVITY_PRESSURE_NY nc 1 set_variable CAVITY_PRESSURE class $TISSUE region $CAVITY;

###################################################################################################
# NOTE: these lines were used to produce the final files, however full simulations take 3-4 hours
# therefore for illustration purposes in the example, only the first increment was used. All files
# associated with the following code are available in the directory of this example.
# 
# $inc=0.04;
# $maxiter = 1/$inc;
# $file = "GOJ_relax2swallow";
#
# for ($iter=1;$iter<$maxiter+1;$iter++) {  
#   fem define active;r;contract_$iter;
#   fem solve coupled inc $inc iter $MAX_ITERS error $TOL;
#   fem export node;${file}_${iter} field as GOJ class $TISSUE region $WALL;
#   fem export elem;${file}_${iter} field as GOJ class $TISSUE region $WALL;
#   fem list variable;pressure_${iter} iy 1 array yp ny $CAVITY_PRESSURE_NY nc 1 set_variable CAVITY_PRESSURE class $TISSUE region $CAVITY;
# }
###################################################################################################

# update the solution before writing out the solutions
fem update geom from solution region all

fem define node;w;$file region $WALL;
fem define elem;w;$file region $WALL;

fem define node;w;Cavity_contract region $CAVITY;
fem define elem;w;Cavity_contract region $CAVITY;

set output off


Files used by this example are:

Name                                    Modified     Size

example_i72.com 15-Sep-2008 7.8k 2CubicHermite-Linear_4x4x4Gauss.ipbase 15-Sep-2008 1.9k 2CubicHermite_4x4Gauss.ipbase 15-Sep-2008 1.6k 2LayersGOJ.ipelem 15-Sep-2008 89k 2LayersGOJ.ipelfb 15-Sep-2008 54k 2LayersGOJ.ipfibr 15-Sep-2008 33k 2LayersGOJ.ipnode 15-Sep-2008 385k 2Linear-CubicHermite_4x4x4Gauss.ipbase 15-Sep-2008 1.8k 2Linear_4x4Gauss.ipbase 15-Sep-2008 1.2k 3CubicHermite_4x4x4Gauss.ipbase 15-Sep-2008 1.9k 3Linear-2PressAuxXi3_4x4x4Gauss.ipbase 15-Sep-2008 1.9k 3Linear_4x4x4Gauss.ipbase 15-Sep-2008 1.4k 3drc.ipcoor 15-Sep-2008 570 Ca.ipacti 15-Sep-2008 785 CubicHermite-Linear_4x4x4Gauss.ipbase 15-Sep-2008 1.5k GOJ.ipinit 15-Sep-2008 4.0k GOJ.ippara 15-Sep-2008 5.9k GuccioneLaw.ipmate 15-Sep-2008 3.4k Linear-2CubicHermite_4x4x4Gauss.ipbase 15-Sep-2008 1.9k Linear-CubicHermite_4x4x4Gauss.ipbase 15-Sep-2008 1.5k PressAuxXi3_4x4x4Gauss.ipbase 15-Sep-2008 1.1k cavity.ipcoor 15-Sep-2008 565 cavity.ipelem 15-Sep-2008 27k cavity.ipinit 15-Sep-2008 3.4k cavity.ipmate 15-Sep-2008 368 cavity.ipnode 15-Sep-2008 101k contract_1.ipacti 15-Sep-2008 832 contract_10.ipacti 15-Sep-2008 831 contract_11.ipacti 15-Sep-2008 832 contract_12.ipacti 15-Sep-2008 832 contract_13.ipacti 15-Sep-2008 832 contract_14.ipacti 15-Sep-2008 832 contract_15.ipacti 15-Sep-2008 831 contract_16.ipacti 15-Sep-2008 832 contract_17.ipacti 15-Sep-2008 832 contract_18.ipacti 15-Sep-2008 832 contract_19.ipacti 15-Sep-2008 832 contract_2.ipacti 15-Sep-2008 832 contract_20.ipacti 15-Sep-2008 831 contract_21.ipacti 15-Sep-2008 832 contract_22.ipacti 15-Sep-2008 832 contract_23.ipacti 15-Sep-2008 832 contract_24.ipacti 15-Sep-2008 832 contract_25.ipacti 15-Sep-2008 829 contract_3.ipacti 15-Sep-2008 832 contract_4.ipacti 15-Sep-2008 832 contract_5.ipacti 15-Sep-2008 831 contract_6.ipacti 15-Sep-2008 832 contract_7.ipacti 15-Sep-2008 832 contract_8.ipacti 15-Sep-2008 832 contract_9.ipacti 15-Sep-2008 832 coupled.ipcoup 15-Sep-2008 477 coupled.ipregi 15-Sep-2008 111 coupled.irequa 15-Sep-2008 3.8k coupled_lu_nosparse.irsolv 16-Aug-2010 2.6k coupled_lu_nosparse.irsolv.old 15-Sep-2008 2.4k finelas_tch_incomp.ipequa 15-Sep-2008 2.0k view.com 15-Sep-2008 2.8k

Download the entire example:

Name                      Modified     Size

examples_i_i7_i72.tar.gz 16-Aug-2014 300k

Testing status by version:

StatusTestedReal time (s)
rs6000-aix
cm64SuccessWed Mar 4 02:15:36 2009689
cm64-debugSuccessTue Mar 3 06:45:52 20098622
x86_64-linux
cmSuccessSun Mar 6 00:20:19 2016800
cm-debugSuccessSat Mar 5 00:51:36 20162286

Testing status by file:


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

Input last modified: Fri Aug 15 11:59:15 2014


CMISS Help / Examples / i / i7 / i72