module Mesh:Generic mesh structure to be used with various meshers. It also defines some functions to help to display and design geometries.`sig`

..`end`

General remark: The two dimensional arrays below are described for
the `fortran_layout`

. If you use a `c_layout`

, they are
transposed. Also indices, such as the indices points,
triangles,..., start at `0`

instead of `1`

. For example
`mesh#point`

is of size `n * 2`

and the coordinates of point `i`

are given by `(point.{i,0}, point.{i,1})`

.

**Author(s):** Christophe Troestler (Christophe.Troestler@umons.ac.be)

type`'a`

vec =`(float, Bigarray.float64_elt, 'a) Bigarray.Array1.t`

Float vector (parametrized by the layout).

type`'a`

mat =`(float, Bigarray.float64_elt, 'a) Bigarray.Array2.t`

Float matrix (parametrized by the layout).

type`'a`

int_vec =`(int, Bigarray.int_elt, 'a) Bigarray.Array1.t`

Integer vector (parametrized by the layout).

type`'a`

int_mat =`(int, Bigarray.int_elt, 'a) Bigarray.Array2.t`

Integer matrix (parametrized by the layout).

class`['a]`

pslg :`'a Bigarray.layout ->`

`object`

..`end`

Planar Straight Line Graph datastructure.

class type`['a]`

t =`object`

..`end`

Object describing various caracteristics of a mesh.

class type`['a]`

voronoi =`object`

..`end`

Voronoi diagram.

`val is_c_layout : ``'a pslg -> bool`

`is_c_layout`

returns true if the mesh layout is C.`val band_height_P1 : ``'a #t -> int`

`band_height mesh`

returns the number of nonzero super-diagonals +
1 (for the diagonal) of symmetric band matrices for P1 finite
elements inner products. It is the maximum on all triangles T of
max(|i1 - i2|, |i2 - i3|, |i3 - i1|) where i1, i2, and i3 are
the indices of the nodes of the three corners of the triangle T.`val cuthill_mckee : ``?rev:bool -> ?perm:'a int_vec -> 'a #t -> 'a t`

`cuthill_mckee mesh`

return a new mesh that is identical to `mesh`

except that the labelling of the nodes has been changed to lower
its band (as computed by `Mesh.band_height_P1`

).`rev`

: whether if true, use the Reverse CutHill-McKee algorithm.
Default: `true`

.`perm`

: if provided, the permutation will be stored in that
vector. More precisely, `perm.{l} = i`

means that `l`

is the new
label for the node initially labeled `i`

. This permutation is
needed to transfer vectors defined on the initial labeling. The
length of the permutation vector must be the number of nodes.module LaTeX:`sig`

..`end`

LaTex output.

`val scilab : ``'a #t -> 'a vec -> string -> unit`

`scilab mesh z file`

saves the mesh data and the function values
`z`

(i.e. `z.{i}`

is the function value at the point
`mesh.point.{_,i}`

(`fortran layout`

)) on that mesh so that when
Scilab runs the created `file`

.sci script, the graph of the
function is drawn.`val matlab : ``'a #t -> 'a vec -> string -> unit`

`matlab mesh z file`

saves the mesh data and the function values
`z`

(i.e. `z.{i}`

is the function value at the point
`mesh.point.{_,i}`

(`fortran layout`

)) on that mesh so that when
Matlab runs the created `file`

.m script, the graph of the
function is drawn.`val mathematica : ``'a #t -> 'a vec -> string -> unit`

`mathematica mesh z file`

saves the mesh data and the function
values `z`

(i.e. `z.{i}`

is the function value at the point
`mesh.point.{_,i}`

(`fortran layout`

)) in the file `file`

.m so
that running "<<file.m" in mathematica plots the function. The
variables `File`xyz`

and `File`adj`

(where `File`

is the
capitalized file name which is used as the context) are defined
and the mathematica command ```
TriangularSurfacePlot[File`xyz,
File`adj]
```

does the plot.
If `file`

contains other digits than alphanumeric
(e.g. underscores), they are removed for the context names
`File`

used for internal variables.