Example 9811: Generating a 3D Voronoi alveolar mesh within a unit cube

This example creates an alveolar mesh (19 alveoli around an alveolar duct) using a 3-D Voronoi meshing technique within a unit cube host mesh. The unit cube mesh is read in, boundary (B) and internal boundary (IB) nodes are generated at the cube surfaces and internal (I) nodes are generated uniformly within the unit cube. Delaunay triangulation of these points is formed and a Voronoi mesh is created from this. The resulting structural alveolar mesh consists of 2-D linear surface elements.

Created by Kelly Burrowes, 05/2003.

Delaunay nodes in cube

Delaunay triangulation

Initial Voronoi mesh

Remaining alveoli and duct cells

Duct cells shown with surfaces

Alveolar mesh

Voronoi elements along a central passage are allocated as duct cells, to allow air passage. All Voronoi cells adjacent to the central duct are then grouped as alveoli, these form the alveolar units. The duct cells are discarded to produce the alveolar mesh.


The comfile run by this example is as follows:

fem de param;r;alveoli;example;          #defines parameters
fem de coor 3,1;                         #defines coordinates
fem de reg;r;three;example;              #defines 3 regions
fem de base;r;alveoli;example;           #defines linear 1D, 2D, 3D and simplex 2D, 3D bases
fem de node;r;cube_host;example reg 1;   #defines 3D unit cube host
fem de elem;r;cube_host;example reg 1; 
fem export node;cube as cube reg 1;      #exports cube host for viewing
fem export elem;cube as cube reg 1;
fem de node;c delaunay reg 1 target 2 div 4 rad 0.01 internal; 

#creates delaunay seed points within host region 1 in target region 2, using 4 divisions of 
#cube volume, radius of 0.01 for internal boundary and boundary nodes and defines 
#regularly spaced internal seed points

fem de mesh;c delaunay basis 4 B boundary IB internal_boundary IN_nodes internal reg 2;

#specifies boundary, internal boundary, and internal node groups in region 2

fem update delaunay reg 2;
fem de mesh;c voronoi basis 3 B boundary IB internal_boundary IN_nodes internal convert reg 2 target 3 gen 3;

#calculates the Voronoi mesh based on the defined Delaunay nodes in region 2
#converts the Voronoi cells to nodes and 1-D elements into target region 3
#gen 3 specifies 3 generations (bifurcations) of alveolar ducts

fem export node;cell as cell reg 3;      #exports Voronoi nodes
fem export elem;alveoli as alveoli elem alveoli reg 3; #exports Voronoi 
fem export elem;duct as duct elem duct reg 3;
fem 


#NB/ Different results are obtained on linux than on the irix and aix operating 
#systems the small differences are generated in the delaunay triangulation 
#procedure and are most probably due to differences in rounding on the 2 
#platforms. Therefore different results are compared in ndiff on the different 
#platforms (16th June 2003).

Additional testing commands:

fem list voronoi total region 1

Files used by this example are:

Name              Modified     Size

example_9811.com 16-Jun-2003 1.8k alveoli.exelem 26-Aug-2004 872k alveoli.ipbase 16-Jan-2003 6.0k alveoli.ippara 16-Jun-2003 5.9k cell.exnode 26-Aug-2004 90k cells.ipelem 20-Jan-2003 858k cells.ipnode 20-Jan-2003 314k cube.exelem 16-Jun-2003 3.6k cube.exnode 16-Jun-2003 1.0k cube_host.ipelem 16-Jan-2003 404 cube_host.ipnode 16-Jan-2003 1.7k draw.com 16-Jun-2003 799 duct.exelem 26-Aug-2004 207k test.com 10-Jul-2005 845 test.ipbase 16-Jan-2003 6.0k test_output.com 10-Jul-2005 32 three.ipregi 16-Jun-2003 93

Download the entire example:

Name                           Modified     Size

examples_9_98_981_9811.tar.gz 19-Aug-2006 343k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:07:19 20168
cm-debugSuccessSat Mar 5 01:13:18 201668
mips-irix
cmSuccessSun Aug 19 03:24:27 2007117
cm-debugSuccessWed Aug 15 05:39:37 2007952
cm-debug-clear-mallocSuccessSat Aug 4 05:47:54 2007984
cm-debug-clear-malloc7SuccessMon Aug 20 05:44:48 2007992
cm64SuccessSun Aug 19 03:31:59 2007140
cm64-debugSuccessTue Aug 14 05:38:20 2007986
cm64-debug-clear-mallocSuccessThu Apr 1 10:57:52 2004343
rs6000-aix
cmSuccessWed Mar 4 01:16:29 200915
cm-debugSuccessMon Mar 2 01:43:51 2009189
cm64SuccessWed Mar 4 01:16:29 200913
cm64-debugSuccessTue Mar 3 01:54:22 2009231
x86_64-linux
cmSuccessSun Mar 6 00:01:19 20165
cm-debugSuccessSat Mar 5 00:05:28 201631

Testing status by file:


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

Input last modified: Sun Jul 10 02:09:49 2005


CMISS Help / Examples / 9 / 98 / 981 / 9811