Example 9812: Generating a 2D Voronoi capillary mesh over a 3D alveolar mesh

This example creates a 2-D Voronoi pulmonary capillary mesh over the surface of a 3-D Voronoi alveolar mesh (5 alveoli around a central duct). Regularly distributed points are created on the surface of a unit half-sphere, these points are projected onto the alveolar surface, grouped according to alveolus and projected back onto the sphere surface. This ensures mesh continuity between adjacent alveoli, i.e. a single capillary sheet is shared by two adjacent alveoli. A delaunay triangulation of these points is then formed and from this a Voronoi mesh. The mesh is projected back onto the alveolar surface. An inlet and outlet vessel are also created.

Created by Kelly Burrowes, 01/2003.

Alveolar surface mesh

Delaunay triangulation (green) & Voronoi (white)

Voronoi / capillary mesh

Final capillary mesh 3-D perspective

The comfile run by this example is as follows:

fem de param;r;capillary;example   #defines parameters
fem de coor 3,1                    #defines co-ordinates
fem de regi;r;four;example         #defines 4 regions
fem de base;r;capillary;example    #defines 2-D and 3-D linear bases

fem de node;r;alveoli;example      #reads in alveolar mesh nodes 
fem de elem;r;alveoli;example      #and elements

fem export node;alveoli as alveoli #exports alveolar mesh
fem export elem;alveoli as alveoli

fem group elem 100..107,642..687 as alveolus1 #groups alveolar elements
fem group elem 151..158,642..648,688..727 as alveolus2
fem group elem 195..202,688..694,728..767 as alveolus3
fem group elem 238..245,728..734,768..807 as alveolus4
fem group elem 284..291,649..655,768..774,808..841 as alveolus5

fem export elem;1 as 1 elem alveolus1  #exports each alveolus element group 
fem export elem;2 as 2 elem alveolus2
fem export elem;3 as 3 elem alveolus3
fem export elem;4 as 4 elem alveolus4
fem export elem;5 as 5 elem alveolus5

fem de mesh;r;capillary;example reg 2  #creates capillary mesh on alveolar 
fem export node;capillary as cap reg 2 #exports capillary mesh
fem export elem;capillary as cap reg 2

fem export node;centre as centre reg 3 #exports nodes on sphere

fem export node;delaunay as delaun reg 4 #exports delaunay nodes 
fem export elem;delaunay as delaun reg 4 #and elements

Additional testing commands:

fem list nodes region all

Files used by this example are:

Name              Modified     Size

example_9812.com 16-Jun-2003 1.4k 1.exelem 16-Jan-2003 17k 2.exelem 16-Jan-2003 17k 3.exelem 16-Jan-2003 17k 4.exelem 16-Jan-2003 17k 5.exelem 16-Jan-2003 18k alveoli.exelem 16-Jan-2003 221k alveoli.exnode 16-Jun-2003 148k alveoli.ipelem 16-Jan-2003 239k alveoli.ipnode 16-Jan-2003 313k capillary.exelem 08-Oct-2003 795k capillary.exnode 26-Aug-2004 391k capillary.ipbase 16-Jan-2003 3.2k capillary.ipmesh 26-Aug-2004 3.0k capillary.ippara 08-Oct-2003 6.1k centre.exnode 26-Aug-2004 46k delaunay.exelem 08-Oct-2003 1.7M delaunay.exnode 26-Aug-2004 198k draw.com 16-Jan-2003 719 four.ipregi 16-Jan-2003 102 test.com 16-Jun-2003 856 test_output.com 16-Jan-2003 26

Download the entire example:

Name                           Modified     Size

examples_9_98_981_9812.tar.gz 19-Aug-2006 702k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:03:31 20163
cm-debugSuccessSat Mar 5 00:14:38 20165
cmSuccessSun Aug 19 02:05:02 200736
cm-debugSuccessWed Aug 15 02:13:13 2007113
cm-debug-clear-mallocSuccessSat Aug 18 02:38:34 2007119
cm-debug-clear-malloc7SuccessMon Aug 20 02:27:26 2007125
cm64SuccessSun Aug 19 02:06:37 200737
cm64-debugSuccessTue Aug 21 02:23:01 2007129
cm64-debug-clear-mallocSuccessThu Apr 1 10:55:01 200461
cmSuccessWed Mar 4 01:10:54 20094
cm-debugSuccessMon Mar 2 01:11:30 200920
cm64SuccessWed Mar 4 01:10:54 20094
cm64-debugSuccessTue Mar 3 01:18:49 200921
cmSuccessSun Mar 6 00:01:05 20162
cm-debugSuccessSat Mar 5 00:01:52 20163

Testing status by file:

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

Input last modified: Thu Aug 26 16:09:34 2004

CMISS Help / Examples / 9 / 98 / 981 / 9812