Example i73: Relaxation of the GOJ (predicting the undeformed state from a deformed state)

This example modells the relaxation of the GOJ using finite elasticity and coupled to a cavity mesh. This involves computing the undeformed state from a deformed mesh. NOTE: The example reads in the deformed mesh resulted from example_i71 and predicts the undeformed mesh.


The comfile run by this example is as follows:

#
# This file modells the relaxation of the GOJ.
# Author: Rita Yassi 
# Last updated: 26/06/08
# Aim: reverse mechanics, predicting the undeformed mesh from a deformed state
#

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

set echo;
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/GOJ_contract reg $WALL;
fem define elements;r;$example/GOJ_contract reg $WALL;      
fem define fibre;r;$example/GOJ_contract reg $WALL;
fem define element;r;$example/GOJ_contract 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 of selected nodes in x
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 of selected nodes in y
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 of bottom nodes in x, y, and z
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 elementes
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

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

# Using the first option of the exponential laws
fem define material;r;$example/GuccioneLaw class $TISSUE reg $WALL;

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

# define initial and boundary conditions
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_contract region $CAVITY;
fem define element;r;$example/Cavity_contract region $CAVITY;

# the shared nodes of the cavity must have the same BC as the outer wall
# all displacements and derivatives of the central nodes of the cavity 
# must be fixed in all directions with the exception of one node free to 
# move in z
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
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;

fem update solution cavity_reference region $CAVITY;

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

# *****************************************************************
# *************************** Relaxation ****************************
# *****************************************************************
$file = "relax";

# define the Ca parameter
fem define active;r;$example/contract_1;
# solve for the undeformed mesh
fem solve coupled undeformed iter $MAX_ITERS error $TOL;
fem export node;GOJ_${file}_1 as GOJ class $TISSUE region $WALL;
fem export elem;GOJ_${file}_1 as GOJ class $TISSUE region $WALL;

###########################################################################
# Note: full simultion takes approximately 4 hours, for simplification
# the code was reduced. The following code can be used to obtain the full
# simulaton. draw.com will use the results obtained from the full code
# to represent the visual effects. If the long code is used, make sure 
# you read in the final contracted meshes of the cavity and the GOJ 
# from the contraction of the GOJ with no cavity example. 
# files will be Cavity_relax2swallow and GOJ_relax2swallow
#
# $file = "swallow2relax";
# $inc=0.04;
# $maxiter = 1/$inc;
# 
# for ($iter=1;$iter<$maxiter+1;$iter++) {
#   # define the Ca parameter
#   fem define active;r;contract_$iter;
#   # solve for the undeformed mesh
#   fem solve coupled undeformed iter $MAX_ITERS error $TOL;
#   fem export node;GOJ_$iter as GOJ class $TISSUE region $WALL;
#   fem export elem;GOJ_$iter as GOJ class $TISSUE region $WALL;
#
###########################################################################
# write out the results

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

fem define node;w;Cavity_$file region $CAVITY;
fem define elem;w;Cavity_$file region $CAVITY;

set output off


Files used by this example are:

Name                                    Modified     Size

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

Download the entire example:

Name                      Modified     Size

examples_i_i7_i73.tar.gz 16-Aug-2014 392k

Testing status by version:

StatusTestedReal time (s)
rs6000-aix
cm64SuccessWed Mar 4 01:52:46 2009430
cm64-debugSuccessTue Mar 3 05:02:17 20095360
x86_64-linux
cmSuccessSun Mar 6 00:14:57 2016524
cm-debugSuccessSat Mar 5 00:35:23 20161472

Testing status by file:


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

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


CMISS Help / Examples / i / i7 / i73