The Dune Grid Format (DGF)
[I/O]

General

The DGF format allows the simple description of macrogrids, which can be used to construct Dune grids independent of the underlying implementation. Due to the generality of the approach only a subset of the description language for each grid implementation is available through this interface.

Usage

There are two ways of constructing Dune grids using DGF files:

  1. By including the file gridtype.hh from the dune/grid/io/file/dgfparser directory:
    by defining one of the symbols ALBERTAGRID , ALUGRID_CUBE , ALUGRID_SIMPLEX , ALUGRID_CONFORM , SGRID , UGGRID , or YASPGRID and the integer GRIDDIM one obtains a definition of the type GridType and the required header files for the desired grid and the macrogrid parser are included.
  2. By directly including one of the files dgf*.hh from the dune/grid/io/file/dgfparser directory:
    in this case only the required header files for the desired grid and the macrogrid parser are included but no typedef is made.

After a grid type (denoted with GridType in the following) is selected in some way, the grid can be constructed either by calling

       Dune::GridPtr<GridType> gridptr(filename, mpiHelper.getCommunicator() ); 
or
       Dune::GridPtr<GridType> gridptr(filename); 
or
       Dune::GridPtr<GridType> gridptr;
       ...
       gridptr=Dune::GridPtr<GridType>(filename); 

where in the second and third example MPIHelper::getCommunicator() is selected as default value; filename is the name of the dgf file. This creates an auto pointer like object Dune::GridPtr<GridType> holding a pointer to a the grid instance described through the dgf file. Access to the grid is gained by calling the operator * of GridPtr.

       GridType & grid = *gridptr; 

Remarks:

  1. The last argument should be of the type Dune::MPIHelper::MPICommunicator which defaults to MPI_COMM_WORLD for parallel runs or some default value for serial runs.
  2. If the file given through the first argument is not a dgf file a suitable constructure on the GridType class is called - if one is available.

Format Description

We assume in the following that the type GridType is suitably defined, denoting a dune grid type in dimworld space dimension. A point in dimworld space is called a vector.

In general dgf files consists of one or more blocks, each starting with a keyword and ending with a line starting with a # symbol. In a block each full line is parsed from the beginning up to the first occupance of a % symbol, which can be used to include comments. Trailing whitespaces are ignored during line parsing. Also the parsing is not case sensitive.

Some example files are given below (Examples).

First line

DGF files must start with the keyword DGF. Files passed to the grid parser not starting with this keyword are directly passed to a suitable constructure in the GridType class.

Blocks

In the following all blocks are briefly described in alphabetical order. The construction of the grid is detailed below. In general lines are parser sequentially, with the exception of lines starting with a special keyword which are treated separately.

The Grid Construction Process

For simplicity we first describe how the grid is manually constructed, i.e., if no Simplexgenerator block is found. Details on how Tetgen/Triangle can be used is detailed below (see Using Tetgen/Triangle). How to access the element and vertex parameter is detailed in Section Accessing parameters. The details of the construction are logged in the file dgfparser.log.

The construction of the grid depends on the type of elements the grid given by GridType can handle.

Cartesian grids

(Dune::SGrid , or Dune::YaspGrid )

The grid is constructed using only the information from the first three lines of the Interval block.

Simplex grids

(Dune::AlbertaGrid, or Dune::ALUSimplexGrid<3,3>, and Dune::ALUSimplexGrid<2,2>)

The vertices and elements of the grid are constructed in the following three steps:

  1. The file is parser for an Interval block; if present a Cartesian grid is build for each interval defined in this block and each element is partitioned either into two triangles or into six tetrahedron. The user has to make sure that this process leads to a conforming grid.
  2. If no Interval block is found, the grid is generated using the information from the Vertex and the Simplex or Cube blocks. If a non-empty Simplex block is found the element information is only taken from there; in the case where no Simplex block is found or in the case where it is empty, the Cube block is read and each cube is partitioned into simplex elements - in 3d this process will not always lead to a correct macro triangulation! Note that no specific ordering of the local numbering of each simplex is required but the cubes must either conform with the Dune reference element or the mapping must be prescribed using the map keyword.
If the simplex generation process was successful, boundary ids are assigned to all boundary faces of the macrogrid.
  1. If the macrogrid was constructed in the third step of the generation process detailed above (i.e. using the vertex block), then the file is first parsed for Boundarysegment block. Here boundary ids can be individually assigned to each boundary segment of the macrogrid by specifying the vertex ids. Boundary segments can either be described as simplex elements or as cube elements.
  2. All Boundary segments which have not yet been assigned an identifier and lie inside the interval defined by the first line of the Boundarydomain block are assigned the corresponding id. This process is then repeated with the remaining boundary segments using the following intervals defined in the Boundarydomain block. If after this process boundary segments without id remain, then the default id is used if one was specified in the Boundarydomain block - if no default was given, the behavior of the parser is not well defined.
Remark:
  1. Bisection:
    the refinement edge is always chosen to be the longest edge.

Cube grids

(Dune::ALUCubeGrid<3,3>)

The grid is constructed using the information from the Interval block, if present; otherwise the Vertex and Cube blocks are used.

The boundary ids are assigned in the same manner as for simplex grids described above.

Mixed grids

(Dune::UGGrid )

Note that in this version only grids consisting of one element type are constructed even if the implemented grid allows for mixed elements.

The vertices and elements of the grid are constructed in one of the following stages:

  1. The file is first parser for an Interval block; if present a Cartesian grid is build; a simplex grid is generated if a Simplex block is present otherwise a cube grid is constructed.
  2. If no Interval block is found, the grid is generated using the information from the Vertex block; cube elements are constructed if the Cube block is present otherwise the Simplex blocks is read. If both a Cube and a Simplex block is found, then only the element information from the Cube block is used and each cube is split into simplex elements so that a simplex grid is constructed.
Boundary ids are assigned in the same manner as described for simplex grids.

Accessing parameters

In addition to the element and vertex information it is possible to add a set of parameters through the DGF file. Using the construction mechanism via the Dune::GridPtr<GridType> class these parameters can be accessed using the Dune::GridPtr<GridType>::parameters(const Entity& en) method. Depending on the codimentsion of en the method returns either the element or vertex parameters of that entity in the DGF file which has minimal distance from the midpoint of the entity en. Note that in this implementation the search procedure requires is O(N) where N is the number of entities defined in the DGF file - in future releases this will be replaced by a nearest neighbor search. The number of parameters for a given codimension can be retrived using the method Dune::GridPtr<GridType>::nofParameters.

Using Tetgen/Triangle

The freely available simplex grid generators are direcltly called via system call through the dgfparser. Therefore one should either add the path containing the executables of Triangle and/or Tetgen to the environment variable PATH or use the path option described below. One can either use a file in Tetgen/Triangle format to directly generate a macro grid or one can prescribe vertices and boundary faces which will be used to generate the grid directly in th DGF file:
  1. For the first approach use the token file to give a filemane and the type of the file (e.g. node, mesh, ply...). Example:
                file name mesh 
    
    If the filetype is givn, it will be appended to name and this will be passed to Tetgen/Triangle. Additional parameters for the grid generators can be given by the the parameter token. If no file type is given it is assumed that in a previous run of Tetgen/Triangle files name.node and name.ele were generated and these will be used to described the vertices and elements of the Dune grid.
  2. In the second approach the vertex and the interval blocks (if present) are used to generate the vertices of the grid; the Cube and Simplex blocks are used for element information in the interior and the boundarysegment block is used for boundary information:
    • If only a vertex and/or interval block is found the resulting .node file is passed directly to Tetgen/Triangle and a tessellation of the convex hull of the points is generated.
    • A more detailed description of the domain is possible by using the Boundarysegment block together with the vertex block. Planar polyhedral boundary faces of the domain can be prescribed in this way. Note that in this case the whole domain boundary has to be defined (see the description of the .poly files in the Tetgen documentation). In 3d each polyhedral face (p0,..,pn) is automatically closed by adding the segment between p0 and pn. To define the whole boundary of a 2d domain using only one polyhedron the closing segment has to be added, i.e., (p0,..,pn,p0).
    • If a cube or simplex block is found the element information is also passed to tetgen/triangle together with the parameters - if given. Note that triangle can only handle one region atribute in its .poly files so that only the first parameter is the simplex or cube block can be retrived.
Some identifiers can be used to influence the quality of the generated mesh: In this case the grid is constructed using two calls to Tetgen/Triangle. The details of the call are logged in the dgfparser.log file.

Note: vertex parameters are interpolated in triangle but tetgen assigns a zero to all newly inserted vertices; therfore quality enhancement and vertex parameters should not be combined in 3d. On the other hand element parameters and boundary ids can be used together with quality enhancement.

The remaining identifiers are

Note that parameters can be attached to the vertices and elements of the grid as described in the Triangle/Tetgen manual. Then can be retrieved as described in Section Accessing parameters.

Download

Work in progress

  1. There should be a mechanism to fix the desired refinement edge for simplex grids. An automatic selection is performed using the longest edge, but it should be possible to turn off this automatic selection.
  2. A callback to the user between parsing the DGF file and the construction of the dune grid; here e.g. a post-processing of the vertex coordinates could be included.

Examples

In two space dimensions:

In three space dimensions:

Manual Grid Construction

A tessellation of the unit square into six simplex entities. Some boundary segments on the lower and right boundary are given their own id the remaining are given a default id.

DGF
Vertex        % the verticies of the grid
-1   -1       % vertex 0
-0.2 -1       % vertex 1
 1   -1       % vertex 2
 1    -0.6    % vertex 3
 1    1       % vertex 4
-1    1       % vertex 5
0.2  -0.2     % vertex 6
#
SIMPLEX       % a simplex grid
0 1 5         % triangle 0, verticies 0,1,5
1 3 6         % triangle 1
1 2 3         % triangle 2
6 3 4         % triangle 3
6 4 5         % triangle 4
6 5 1         % triangle 5
#
BOUNDARYSEGMENTS
2   1 2       % between vertex 1,2 use id 2
2   2 3       % between vertex 2,3 use id 2
4   3 4       % between vertex 3,4 use id 4
#
BOUNDARYDOMAIN
default 1     % all other boundary segments have id 1
#
# examplegrid1s.dgf

examplegrid1s.png

The resulting grid

A tessellation into cubes using the same vertices as before,

DGF
Vertex        % the verticies of the grid
-1   -1       % vertex 0
-0.2 -1       % vertex 1
 1   -1       % vertex 2
 1    -0.6    % vertex 3
 1    1       % vertex 4
-1    1       % vertex 5
0.2  -0.2     % vertex 6
#
CUBE            % a cube grid
0 1 5 6         % cube 0, verticies 0,1,5,6
1 2 6 3         % cube 1
6 3 5 4         % cube 2
#
BOUNDARYSEGMENTS
2   1 2       % between vertex 1,2 use id 2
2   2 3       % between vertex 2,3 use id 2
4   3 4       % between vertex 3,4 use id 4
#
BOUNDARYDOMAIN
default 1     % all other boundary segments have id 1
#
# examplegrid1c.dgf

examplegrid1c.png

The resulting grid

Using the last input file with a simplex grid or by adding an empty Simplex block
   Simplex
   #
leads to the following macro triangulation

examplegrid1cs.png

The resulting grid

Automated Grid Construction

Automatic tessellation using Triangle, with vertices defined as in the example dgfexample1:

DGF
Simplexgenerator
min-angle 30
display 0

% to use Triangle from a certain path, uncomment this path line 
%path $HOME/bin  % path to Triangle

#
Vertex        % the verticies of the grid
-1   -1       % vertex 0
-0.2 -1       % vertex 1
 1   -1       % vertex 2
 1    -0.6    % vertex 3
 1    1       % vertex 4
-1    1       % vertex 5
0.2  -0.2     % vertex 6
#
BOUNDARYDOMAIN
default 1     % all other boundary segments have id 1
#
# examplegrid1gen.dgf

examplegrid1gen.png

The resulting grid

The quality of the grid can be enhanced by adding the line
   min-angle 30
in the Simplexgenerator block

examplegrid1genangle.png

The resulting grid

Automatic tessellation using Triangle, with vertices are defined on a Cartesian grid with two additional vertices in the top right corner and one vertex outside the unit square.

All boundary are given a default id.

DGF
Interval
-1  -1       % first corner 
 1  1        % second corner
 4  4        % 4 cells in x and 4 in y direction
#
Vertex       % some additional points
 0.75 0.75   % inside the interval
 0.9 0.9     % also inside the interval
 1.25 1.25   % and one outside of the interval
#
Simplexgenerator
display 0    % show result using Triangle viewer

% to use Triangle from a certain path, uncomment path line 
%path $HOME/bin   % path to Triangle

#
BOUNDARYDOMAIN
default 1    % all boundaries have id 1
#BOUNDARYDOMAIN
# examplegrid2a.dgf

examplegrid2a.png

The resulting grid

Adding some quality enhancement. The boundaries are numbered counterclockwise starting at the left boundary from one to four.

DGF
Interval
-1  -1       % first corner 
 1  1        % second corner
 4  4        % 4 cells in x and 4 in y direction
#
Vertex       % some additional points
 0.75 0.75   % inside the interval
 0.9 0.9     % also inside the interval
 1.25 1.25   % and one outside of the interval
#
Simplexgenerator  
min-angle 30      % quality enhancment
display 0         % show result using Triangle viewer
% area restriction

% to use Triangle from a certain path, uncomment this path line
%path $HOME/bin   % path to Triangle

#
BOUNDARYDOMAIN
1   1 -1    1.25  1.25  % right boundary has id 1
2  -1  1    1.25  1.25  % upper boundary has id 2
3  -1 -1   -1  1        % left boundary has id 3
4  -1 -1    1 -1        % lower boundary has id 4
#BOUNDARYDOMAIN
# examplegrid2b.dgf

examplegrid2b.png

The resulting grid

Using both quality enhancement and a maximum area restriction. The bottom boundary is given the id 1 all other boundaries have id 2; here we do not use a default value.

DGF
Interval
-1  -1       % first corner 
 1  1        % second corner
 4  4        % 4 cells in x and 4 in y direction
#
Vertex       % some additional points
 0.75 0.75   % inside the interval
 0.9 0.9     % also inside the interval
 1.25 1.25   % and one outside of the interval
#
Simplexgenerator
min-angle 30    % quality enhancment
max-area 0.01   % area restriction
display 0       % show result using Triangle viewer

% to use Triangle from a certain path, uncomment this path line
%path $HOME/bin      % path to Triangle

#
BOUNDARYDOMAIN
1  -1 -1    1 -1       % lower boundary has id 1
2  -10 -10    10  10   % all others have id 2 (could use default keyword...)
#BOUNDARYDOMAIN
# examplegrid2c.dgf

examplegrid2c.png

The resulting grid

A similar grid is generated by prescribing the boundary of the domain:

DGF
Vertex       % some additional points
 -1 -1
  1 -1
  1  1
 -1  1
 0.75 0.75   % inside the interval
 0.9 0.9     % also inside the interval
 1.25 1.25   % and one outside of the interval
#
Simplexgenerator
min-angle 30    % quality enhancment
max-area 0.01   % area restriction
display 0       % show result using Triangle viewer

% to use Triangle from a certain path, uncomment this path line
%path $HOME/bin      % path to Triangle
#
BOUNDARYSEGMENTS
1 0 1
2 1 6 3 0
#
# examplegrid2d.dgf

examplegrid2d.png

The resulting grid

Using Parameters

We use the same domain as in the previous example but include vertex and element parameters:

DGF
vertex
parameters 2
       -1  -1  0  -1    
       1  -1  1  1    
       1  1  2  1    
       -1  1  1  -1    
       0.75  0.75  2  0.75    
       0.90000000000000002  0.90000000000000002  2  0.90000000000000002    
       1.25  1.25  -1  1.25    
# 
simplex
parameters 1
          0     4     3  1 
          4     0     1  -1 
          3     4     5  1 
          5     1     2  1
          1     5     4  -1
          2     6     3   1
          6     2     1  -1
          5     2     3  -1 
#
boundarydomain
default 1
#
Simplexgenerator
min-angle 30    % quality enhancment
max-area 0.01   % area restriction
display 0       % show result using Triangle viewer
% to use Triangle from a certain path, uncomment this path line
path $HOME/bin      % path to Triangle
#
# examplegrid2e.dgf
 

The results in piecewise constant data on the elements and piecewise linear date using the vertex parameters:

examplegrid2e.png

The resulting grid with element and vertex parameters

Interval Domain

A automatic tessellation of the unit square using a Cartesian Grid. All boundaries have id 1.

DGF
Interval
 0  0         % first corner 
 1  1         % second corner
 4  8         % 4 cells in x and 8 in y direction
#
% Simplex
#

GridParameter
% set overlap to 1
overlap 1
% set periodic boundaries in x direction
periodic 0  
% set closure to none for UGGrid 
closure none
# 

BOUNDARYDOMAIN
default 1     % default boundary id
#BOUNDARYDOMAIN
# examplegrid5.dgf

examplegrid5c.png

The resulting grid using SGrid<2,2>

examplegrid5s.png

The resulting grid using AlbertaGrid<2,2>

If UGGrid<2,2> is used the result would be the same as for SGrid<2,2>. If an empty Simplex Block
   Simplex
   #
is added than the same simplex grid as for AlbertaGrid<2,2> would be constructed.

Grid Generation in 3d

An automatic tessellation of the unit square using a Cartesian Grid is shown. All boundaries have id 1 except boundary segment on the lower boundary which have value 2.

First we use only the interval block:

DGF

Interval
0 0 0          % first corner 
10 10 10       % second corner
4 4 3         % 5 cells in x, 2 in y, and 10 in z direction
#
simplex 
#
BOUNDARYDOMAIN
default 1      % default boundary id
% all boundary segments in the interval [(-1,-1,-1),(11,11,0)]
% have boundary id 2, i.e., the bottom boundary 
2   -1 -1 -1    11 11 0  
#
# examplegrid6.dgf

examplegrid6c.png

The resulting grid using ALUCubeGrid<3,3>

examplegrid6s.png

The resulting grid using ALUSimplexGrid<3,3>

Now the vertices are still defined through the interval block; the simplicies are constructed using Tetgen (note the comment symbol % in the Simplexgenerator block):

DGF
Simplexgenerator
%min-angle 1.1        % quality enhancment 
%max-area 0.1         % maximum element area restriction
display 0              % show result using the Tetgen viewer

% to use TetGen from a certain path, uncomment this path line
%path $HOME/bin         % path to Tetgen
#

Interval
0 0 0                  % first corner
10 10 10               % second corner
2 5 10                 % 5 cells in x, 2 in y, and 10 in z direction
#

BOUNDARYDOMAIN
default 1              % default boundary id 
% all boundary segments in the interval [(-1,-1,-1),(11,11,0)]
% have boundary id 2, i.e., the bottom boundary 
2   -1 -1 -1    11 11 0
#
# examplegrid7.dgf

examplegrid7.png

The resulting grid using ALUSimplexGrid<3,3>

Note that in the grid would be the same as in the above example if ALUCubeGrid<3,3> where used.

Now we can also include some quality enhancement:

First: min-angle = 1.2 (remove the first % in the Simplexgenerator block)

examplegrid7angle.png

The resulting grid using ALUSimplexGrid<3,3>

Second: min-angle = 1.2 and max-area = 0.1 (remove both % in the Simplexgenerator block)
examplegrid7area.png

The resulting grid using ALUSimplexGrid<3,3>

This examples show different ways to define a grid for the following domain and boundary ids:

examplegrid10.png

An example domain

Manual grid construction: Note that the reference element used to define the cube is not the one used in dune so that the mapping has to be given; furthermore the vertex index are numbered starting with 1. If a simplex grid is to be constructed some care must be taken in the numbering of the nodes so that a conforming grid is constructed.

DGF
vertex 
firstindex 1
 0   0  5   # 1
 0   0  0   # 2
 0 -10  0   # 3 
 0 -10 10   # 4 
 0  10 10   # 5 
 0  10  5   # 6 

30  10  0   # 7 
30 -10  0   # 8 
30 -10 10   # 9 
30  10 10   # 10 

25  10  0   # 11 
25   0  0   # 12 
25   0  5   # 13 
25  10  5   # 14 

0    0 10   # 15 

30   0  0   # 16
30   0  5   # 17
30   0 10   # 18
30  10  5   # 19
30 -10  5   # 20

25  10 10   # 21
25   0 10   # 22
25 -10 10   # 23
25 -10  5   # 24 
25 -10  0   # 25

0  -10  5   # 26
#
Cube
map 0 1 3 2  4 5 7 6
21 14 13 22  5  6  1 15 
23 22 13 24  4 15  1 26 
25 24 13 12  3 26  1  2 
17 19 7 16  13 14 11 12 
17 16 8 20  13 12 25 24 
17 20 9 18  13 24 23 22 
17 18 10 19 13 22 21 14 
#
boundarysegments
2   1 2 3 26
2   26 4 15 1
2   1 15 5 6

1   7 16 17 19
1   19 17 18 10
1   8 16 17 20
1   20 17 18 9

4   21 10 19 14 
4   11 7 19 14
4   5 6 14 21

4   15 5 22 21 
4   4 15 22 23
4   23 9 18 22
4   22 18 10 21
# 
boundarydomain
default 3 
#
# examplegrid10.dgf

examplegrid10c.png

The resulting cube grid

examplegrid10s.png

The resulting simplex grid

Using multiple intervale: Here the boundary ids are not set correctly; this could be done using different boundarydomains.

DGF
Interval
% first interval
0 0 5          % first corner 
25 10 10       % second corner
5 1 2          % 8 cells in x, 2 in y, and 2 in z direction
% second interval
25 -10 0         % first corner 
30 10 10       % second corner
3 2 4          % 2 cells in x, 2 in y, and 4 in z direction
% third interval
0   -0  0      % first corner 
25 -10  10      % second corner
5 1 4         % 2 cells in x, 2 in y, and 4 in z direction
#
BOUNDARYDOMAIN
default 3      % default boundary id
% ... further domain ...
#
# examplegrid11.dgf

examplegrid11a.png

The resulting cube grid

examplegrid11b.png

The resulting simplex grid

By only defining the boundary faces and using Tetgen:

DGF
Simplexgenerator
min-angle 1.1  % quality enhancment
max-area 0.5   % maximum element area restriction
display 0        % show result using the Tetgen viewer

% to use TetGen from a certain path, uncomment this path line
path $HOME/bin  % path to Tetgen
#
vertex 
0   0  5
0   0  0
0 -10  0
0 -10 10
0  10 10
0  10  5

30  10  0
30 -10  0 
30 -10 10
30  10 10

25  10 0
25   0 0
25   0 5
25  10 5
#
boundarysegments 
% 2 out, 1 in, 3 slip, 4 reflect
2  0 1 2 3 4 5       % ausgang
1  6 7 8 9           % eingang
3  10 11 12 13       % balken
3  11 12 0 1         % balken
3  13 12 0 5         % balken
3  3 4 9 8           % seite
3  2 3 8 7           % unten
4  6 10 13 5 4 9     % sym. oben
4  6 10 11 1 2 7     % sym. seite
#
# examplegrid12.dgf

Without the max-area and min-angle keywords the following grid is constructed:

examplegrid12_1.png

The resulting grid

With the quality enhancement active:

examplegrid12_2.png

The resulting grid

Finally we demonstrate the use of parameters. With a simple modification of the above example

DGF
vertex 
firstindex 1
 0   0  5   # 1
 0   0  0   # 2
 0 -10  0   # 3 
 0 -10 10   # 4 
 0  10 10   # 5 
 0  10  5   # 6 

30  10  0   # 7 
30 -10  0   # 8 
30 -10 10   # 9 
30  10 10   # 10 

25  10  0   # 11 
25   0  0   # 12 
25   0  5   # 13 
25  10  5   # 14 

0    0 10   # 15 

30   0  0   # 16
30   0  5   # 17
30   0 10   # 18
30  10  5   # 19
30 -10  5   # 20

25  10 10   # 21
25   0 10   # 22
25 -10 10   # 23
25 -10  5   # 24 
25 -10  0   # 25

0  -10  5   # 26
#
Cube
map 0 1 3 2  4 5 7 6
parameters 2
21 14 13 22  5  6  1 15  0 1
23 22 13 24  4 15  1 26  1 -1
25 24 13 12  3 26  1  2  2 1
17 19 7 16  13 14 11 12  3 -1
17 16 8 20  13 12 25 24  4 1
17 20 9 18  13 24 23 22  5 -1
17 18 10 19 13 22 21 14  6 1
#
boundarysegments
2   1 2 3 26
2   26 4 15 1
2   1 15 5 6

1   7 16 17 19
1   19 17 18 10
1   8 16 17 20
1   20 17 18 9

4   21 10 19 14 
4   11 7 19 14
4   5 6 14 21

4   15 5 22 21 
4   4 15 22 23
4   23 9 18 22
4   22 18 10 21
# 
boundarydomain
default 3 
#
# examplegrid10a.dgf

we can define parameters on each element:

examplegrid10a.png

The resulting grid with element parameters

The following example

DGF
vertex 
parameters 1
firstindex 1
 0   0  5   5   # 1
 0   0  0   0   # 2
 0 -10  0 -10   # 3 
 0 -10 10   0   # 4 
 0  10 10  20   # 5 
 0  10  5  15   # 6 

30  10  0   40 # 7 
30 -10  0   20 # 8 
30 -10 10   30 # 9 
30  10 10   50 # 10 

25  10  0   35 # 11 
25   0  0   25 # 12 
25   0  5   30 # 13 
25  10  5   40 # 14 

0    0 10   10 # 15 

30   0  0   30 # 16
30   0  5   35 # 17
30   0 10   40 # 18
30  10  5   45 # 19
30 -10  5   25 # 20

25  10 10   45 # 21
25   0 10   35 # 22
25 -10 10   25 # 23
25 -10  5   20 # 24 
25 -10  0   15 # 25

0  -10  5   -5 # 26
#
Cube
map 0 1 3 2  4 5 7 6
21 14 13 22  5  6  1 15 
23 22 13 24  4 15  1 26 
25 24 13 12  3 26  1  2 
17 19 7 16  13 14 11 12 
17 16 8 20  13 12 25 24 
17 20 9 18  13 24 23 22 
17 18 10 19 13 22 21 14 
#
boundarysegments
2   1 2 3 26
2   26 4 15 1
2   1 15 5 6

1   7 16 17 19
1   19 17 18 10
1   8 16 17 20
1   20 17 18 9

4   21 10 19 14 
4   11 7 19 14
4   5 6 14 21

4   15 5 22 21 
4   4 15 22 23
4   23 9 18 22
4   22 18 10 21
# 
boundarydomain
default 3 
#
# examplegrid10b.dgf

defines parameters for each vertex of the grid, leading to a piecewise linear function

examplegrid10b.png

The resulting grid with vertex parameters

Importing Grids written in a Tetgen/Triangle format

Here a .mesh file used to generate a 3d simplex grid through Tetgen. The mesh file is taken from http://www-c.inria.fr/Eric.Saltel/download/download.php

DGF
Simplexgenerator
% to use TetGen from a certain path, uncomment this path line
path $HOME/dune/modules/tetgen1.4.0         % path to Tetgen

% read information from file (uncomment each line seperatly)
% file BBEETH1M.d_cut mesh
% file Orb_cut mesh
% file bunny.p65.param_skin mesh
% file pmdc.1 
% all grids are for dimension 3
dimension 3
#

BOUNDARYDOMAIN
default 1
#
# examplegrid9.dgf

BBEETH1M.d_cut.png

The resulting grid using ALUSimplexGrid<3,3>

Orb_cut.png

The resulting grid using ALUSimplexGrid<3,3>

bunny.p65.param_skin.png

The resulting grid using ALUSimplexGrid<3,3>

pmdc.png

The resulting grid using ALUSimplexGrid<3,3>

Generated on 9 Apr 2008 with Doxygen (ver 1.5.2) [logfile].