Example 9823a: Embedding and deforming an arterial model within a lung surface volume

This example demonstrates the first stage of coupling lung mechanical deformation to pulmonary blood flow. The arterial model is embedded within the lung volume model. The nodal xi locations of the arterial network are calculated with respect to the lung volume model. A deformation is applied to the lung volume model which results in a consistent deformation of the embedded arterial geometry.

Created by Kelly Burrowes, 01/2007. To create an image in order to visualise the results of the simulation, use CMGUI with the file draw.com.

These figures demonstrate the lung surface and arterial mesh before and after deformation.

The comfile run by this example is as follows:

# Example 9823a

# 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;

fem de param;r;$example/mech-flow;                       #Define parameters
fem de coor 3,1;                                #Define coordinate system
fem de base;r;$example/all_lobe_cubic;                   #Define basis functions (1) 3D cubic hermite, 
                                                #(2) 2D cubic hermite, (3) 1D linear

fem de region;r;$example/two;                            #Defines 2 regions

fem de node;r;$example/left_fitted reg 1;                #Reads in lung volume nodes to region 1
fem de elem;r;$example/left_fitted reg 1;                #Reads in lung volume elements

fem export node;left_lung as left_lung reg 1;   #Exports lung nodes and elements
fem export elem;left_lung as left_lung reg 1;   #for viewing

fem de node;r;$example/small_arteries reg 2;             #Reads in simple arterial geometry
fem de elem;r;$example/small_arteries reg 2;             #into region 2

fem export node;arteries as arteries reg 2;     #Exports the arterial geometry
fem export elem;arteries as arteries reg 2;

fem de xi;c nodes contain of 2 in 1;            #Calculates the xi locations of the nodes of region 2 in region 1
fem de xi;w;art_nodes nodes contain reg 2;      #Writes out these xi locations to a file (art_nodes.ipxi)

fem de node;r;$example/left_scaled; #Reads in deformed nodal coordiates of host mesh

fem update mesh position of 2 in 1 undeform contain;

fem export node;arteries_2 as arteries_2 reg 1; #Exports the new arterial node and element locations
fem export node;arteries_2 as arteries_2 reg 2;

fem de node;w;left_art_deform reg 2;            #Writes the deformed nodal locations to a .ipnode file

Additional testing commands:

fem list nodes reg 2

Files used by this example are:

Name                     Modified     Size

example_9823a.com 18-Jan-2007 1.9k all_lobe_cubic.ipbase 18-Jan-2007 4.0k art_nodes.ipxi 18-Jan-2007 774 arteries.exelem 18-Jan-2007 2.0k arteries.exnode 18-Jan-2007 1.1k arteries_2.exnode 18-Jan-2007 1.1k cubic_1d.ipbase 18-Jan-2007 2.6k draw.com 18-Jan-2007 567 left_art_deform.ipnode 18-Jan-2007 2.4k left_fitted.ipelem 18-Jan-2007 35k left_fitted.ipnode 18-Jan-2007 164k left_lung.exelem 18-Jan-2007 202k left_lung.exnode 18-Jan-2007 61k left_lung_scaled.exelem 18-Jan-2007 202k left_lung_scaled.exnode 18-Jan-2007 61k left_scaled.ipelem 18-Jan-2007 35k left_scaled.ipnode 18-Jan-2007 164k mech-flow.ippara 18-Jan-2007 5.9k scale_lung.com 18-Jan-2007 465 small_arteries.ipelem 18-Jan-2007 2.5k small_arteries.ipnode 18-Jan-2007 2.2k test.com 18-Jan-2007 95 test_output.com 18-Jan-2007 21 two.ipregi 18-Jan-2007 93

Download the entire example:

Name                                 Modified     Size

examples_9_98_982_9823_9823a.tar.gz 20-Jan-2007 255k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:02:08 20161
cm-debugSuccessSat Mar 5 00:05:27 20163
cmSuccessSun Aug 19 01:38:45 200710
cm-debugSuccessWed Aug 15 01:34:12 200726
cm-debug-clear-mallocFailureTue Aug 21 02:23:35 200731
last breakWed Jan 24 02:55:00 200730
cm-debug-clear-malloc7FailureTue Aug 21 02:31:17 200730
last breakWed Jan 24 02:36:00 200729
cm64SuccessSun Aug 19 01:39:29 200710
cm64-debugSuccessTue Aug 21 01:34:40 200727
cmSuccessWed Mar 4 01:08:59 20092
cm-debugSuccessMon Mar 2 01:09:06 20098
cm64SuccessWed Mar 4 01:08:59 20092
cm64-debugSuccessTue Mar 3 01:14:50 20099
cmSuccessSun Mar 6 00:01:04 20161
cm-debugSuccessSat Mar 5 00:01:16 20162

Testing status by file:

Html last generated: Sun Mar 6 05:50:36 2016

Input last modified: Fri Jan 19 10:58:01 2007

CMISS Help / Examples / 9 / 98 / 982 / 9823 / 9823a