**Delaunay_2D** and **Delaunay_3D** are used to compute the Delaunay tessellation of a discrete particle distribution (such as a N-Body simulation or a catalog of object coordinates) in 2D and 3D respectively and possibly in parallel. The output is an unstructured network in *NDnet* format, with density computed for each vertex using DTFE (i.e. density at a given vertex is proportional to the total volume of the surrounding cells). In order to compute the correct topology and density close to the boundaries, the distribution is extrapolated over a band outside the domain of definition (see options *-margin*, *-btype* and *-periodic*). The output network can be used as input file for mse to compute the Morse-Smale complex of the initial discrete sample (the index of the vertices in the output network correspond to the index of the sampling particles in the input file).

Usage:

delaunay_nD<fname> [-outName <fname>] [-outDir <dir>] [-subbox <x0> <y0> [<z0>] <dx> <dy> [<dz>]] [-periodic] [-minimal] [-blocks <NChunks> <NThreads>] [-margin <M>] [-btype <t=mirror>] [-mask <fname.ND>] [-smooth <N=0>] [-angmask <fname.fits> [<maximum angular size (degrees) = 5.00>]] [-radialDensity <A> <Dr> <B>] [-subSample < 0<s<1 >]

**<fname>**:

- The name of a file containing the discrete particle coordinates in a field format.

**-outName <fname>**:

- Specifies the base name of the file in output (extensions are added to this base name depending on the output type).

Default value: the name of the input file.

- Specifies the base name of the file in output (extensions are added to this base name depending on the output type).

**-outDir <dir>**:

- Specifies the output directory.

Default value: the current working directory.

- Specifies the output directory.

**-subbox <x0> <y0> [<z0>] <dx> <dy> [<dz>]**:

- Restricts the computation to a box of size [dx dy dz] and with origin [x0,y0,z0]. The box may be larger than the actual bounding box or cross its boundaries. The distribution outside the box will depend on the boundary type, as set with option
*-btype*. Note that the distribution within the margin of the subbox (see option*-margin*) is still used to compute the topology close to the boundaries, so this option may be used to cut a large distribution into several small sub-boxes with matching boundary distribution.

- Restricts the computation to a box of size [dx dy dz] and with origin [x0,y0,z0]. The box may be larger than the actual bounding box or cross its boundaries. The distribution outside the box will depend on the boundary type, as set with option

**-periodic**:

- Use this option to force periodic boundary conditions for the output network. When this option is used,
*delaunay_nD*will try to reconnect the simplices crossing the bounding box so that the space is compactified to a torus. The operation may fail if the margin size is too small, as cells crossing opposite boundaries may not match, so always check the output of the program as an estimation of the correct margin size will be indicated in that case (see also option*-margin*). Note that this option wil set default boundary type to*-btype periodic*.

- Use this option to force periodic boundary conditions for the output network. When this option is used,

**-minimal**:

- when using this option, only the minimal necessary information to define the tesselation is stored in the output file (i.e. In dimensions D, the vertex coordinates and simplices of dimension D, and the additional data associated to them). Note that it is preferable NOT to use this option when the ouput file is to be fed to mse, as it will force the program to recompute the topology of intermediate simplices using a slower algorithm every time it is run.

**-blocks <NChunks> <NThreads>**:

- instead of computing the delaunay tesselation of the full distribution, divide it into
*NChunks*overlapping sub blocks and process them*NThreads*at a time. The subblocks are then automatically reassembled into the full delaunay tesselation. This option can either be used to increase speed by parallelizing the process (for high values of*NThreads*) or decrease the memory consumption (when*NChunks*>>*NThreads*). Note that it is incompatible with options*-mask*,*-btype smooth*,*-angmask*and*-radialDensity*.

- instead of computing the delaunay tesselation of the full distribution, divide it into

**-margin <M>**:

- Suggests a startup trial size for the additional margin used to compute the topology and density close to the boundary. The margin size is expressed as a fraction of the bounding box (or subbox if option
*-subbox*is used). Note the the program can probably make a better guess than you so it is not recommanded to set it by hand ...

- Suggests a startup trial size for the additional margin used to compute the topology and density close to the boundary. The margin size is expressed as a fraction of the bounding box (or subbox if option

**-btype <t=mirror>**:

- This option sets the type of the boundaries. This option is used to set how the distribution should be extrapolated outside the bounding box (an estimation of the distribution outside the bounding box is needed to correctly estimate the topology and density of the distribution close to its boundaries). Possible boundary types are:
- -
*mirror*: the distribution outside the bounding box is a mirrored copy of that inside. - -
*periodic*: use periodic boundary condition (i.e. space is paved with copies of the distribution in the bounding box). Note that this option does *NOT* enforce periodic boundary conditions as it does not tell*delaunay_nD*to reconnect the Delaunay cells that cross the bounding box (this is achieved with*-periodic*). - -
*smooth*: a surface of guard particles is added outside the bounding box and new particles are added by interpolating the estimated density computed on the boundary of the distribution. This boundary type is useful when the actual boundaries of the sample are complex (i.e. not a cube), such as for a 3D galaxy catalog limited to a portion of the sky. - -
*void*: the distribution is supposed to be void outside the bounding box.

- -

- This option sets the type of the boundaries. This option is used to set how the distribution should be extrapolated outside the bounding box (an estimation of the distribution outside the bounding box is needed to correctly estimate the topology and density of the distribution close to its boundaries). Possible boundary types are:

**-mask <fname.ND>**:

- Specifies a mask. The file must be a 1D array of values of size the number of vertices (or pixels) in the network, in a readable grid format. A value of
*0*corresponds to a non-masked particle while any other value masks the particle. Note that masked particles are still used to compute the Delaunay tessellation and estimate the density but they will change the topology of the actual distribution.

- Specifies a mask. The file must be a 1D array of values of size the number of vertices (or pixels) in the network, in a readable grid format. A value of

**-smooth <N=0>**:

- Smooth the estimated DTFE density by averaging N times its value at each vertex with that at the neighboring vertices (i.e two vertices are considered neighbors if they both belong to the boundary of at list one given cell).

**-angmask <fname.fits> [<maximum angular size (degrees) = 5.00>]**:

- Not documented ... you should not use it anyway :)

**-radialDensity <A> <Dr> <B>**:

- Not documented ...

**-subSample < 0<s<1 >**:

- Computes the Delaunay tessellation over a subsets of the actual distribution containing only a randomly selected fraction
*0<s<1*of the particles.

- Computes the Delaunay tessellation over a subsets of the actual distribution containing only a randomly selected fraction