Example 135: Generating a 3 generation lung mesh

This example uses the 'define mesh' command to create a 3 generation lung mesh. This is some of Merryn's boring stuff (sorry, Merryn!).


The comfile run by this example is as follows:

#Example_135  Generating a simple lung mesh

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

$RADIUS = 1;

fem de param;r;$example/lungmesh;
fem de coor;r;$example/lungmesh;     #define 3d rectangular cartesian
fem define base;r;$example/lungmesh; #define a 1D linear Lagrange basis func

#CREATE SYMMETRIC CONDUCTING MODEL AND MULTI-BRANCHING RESPIRATORY MODEL
#     read a file that defines a symmetric airway tree (number of 
#     generations, number of elements and their length in each generation).
#     the elements are labelled as 'conducting'. 
fem de mesh;r;$example/lungmesh as conducting field;
#     add a multi-branching respiratory airway mesh to the peripheral 
#     elements in the conducting airway tree. the basis function must 
#     be specified (1d). the elements are labelled as 'respiratory'.
fem de;add mesh;c airway multi_hbw basis_function 1 as respiratory field radius_field 1 alveolar_field 2; 

#CALCULATE RADII AND ALVEOLAR CROSS-SECTIONAL AREA
#     update the conducting airway radii using anatomical data from Weibel (1963)
fem update mesh geometry elem conducting radius_field $RADIUS anatomical weibel;
#     update the respiratory airway radii using anatomical data from 
#     Haefeli-Bleuer & Weibel (1988)
fem update mesh geometry elem respiratory radius_field $RADIUS anatomical hbw;

Additional testing commands:

FEM list node;


Files used by this example are:

Name             Modified     Size

example_135.com 07-Apr-2004 1.5k lungmesh.ipbase 10-Apr-2000 893 lungmesh.ipcoor 10-Apr-2000 570 lungmesh.ipmesh 31-Mar-2004 2.4k lungmesh.ippara 31-Mar-2004 5.7k test_output.com 31-Mar-2004 16

Download the entire example:

Name                      Modified     Size

examples_1_13_135.tar.gz 18-Aug-2006 24k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmFailureSun Mar 6 00:04:56 20160
last breakFri Nov 19 00:20:00 20101
last successSun Aug 16 01:14:00 20091
cm-debugFailureSun Mar 6 00:04:58 20161
last breakFri Nov 19 00:18:00 20101
last successFri Aug 21 00:20:00 20092
mips-irix
cmSuccessSun Aug 19 01:34:12 20077
cm-debugSuccessWed Aug 15 01:26:39 200711
cm-debug-clear-mallocSuccessSat Aug 18 01:33:17 200716
cm-debug-clear-malloc7SuccessMon Aug 20 01:31:02 200716
cm64SuccessSun Aug 19 01:34:23 20077
cm64-debugSuccessTue Aug 21 01:26:36 200711
rs6000-aix
cmSuccessWed Mar 4 01:06:48 20091
cm-debugSuccessMon Mar 2 01:07:09 20092
cm64SuccessWed Mar 4 01:07:56 20091
cm64-debugSuccessTue Mar 3 01:12:54 20092
x86_64-linux
cmFailureSun Mar 6 00:01:23 20160
last breakFri Nov 19 00:17:00 20100
last successSun Aug 16 01:03:00 20091
cm-debugFailureSun Mar 6 00:01:23 20160
last breakFri Nov 19 00:16:00 20101
last successFri Aug 21 00:13:00 20091

Testing status by file:


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

Input last modified: Wed Jul 7 17:34:46 2004


CMISS Help / Examples / 1 / 13 / 135