Library
Module
Module type
Parameter
Class
Class type
Generic mesh structure to be used with various meshers. It also defines some functions to help to display and design geometries.
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})
.
type 'layout vec = (float, Bigarray.float64_elt, 'layout) Bigarray.Array1.t
Float vector (parametrized by the layout).
type 'layout mat = (float, Bigarray.float64_elt, 'layout) Bigarray.Array2.t
Float matrix (parametrized by the layout).
type 'layout int_vec = (int, Bigarray.int_elt, 'layout) Bigarray.Array1.t
Integer vector (parametrized by the layout).
type 'layout int_mat = (int, Bigarray.int_elt, 'layout) Bigarray.Array2.t
Integer matrix (parametrized by the layout).
class 'l pslg : 'l Bigarray.layout -> object ... end
Planar Straight Line Graph datastructure. By default, creating an object from this class results in all methods being initialized with empty arrays.
val pslg :
?hole:'l mat ->
?region:'l mat ->
?point_marker:'l int_vec ->
'l mat ->
?segment_marker:'l int_vec ->
'l int_mat ->
'l pslg
pslg point segment
creates a PSLG with the proper methods. The default values for unspecified values are empty arrays.
class type 'layout t = object ... end
Object describing various characteristics of a mesh.
val create :
?hole:'l mat ->
?region:'l mat ->
?point_marker:'l int_vec ->
'l mat ->
?segment_marker:'l int_vec ->
?segment:'l int_mat ->
?neighbor:'l int_mat ->
?edge:'l int_mat ->
?edge_marker:'l int_vec ->
'l int_mat ->
'l t
create point triangle
creates a mesh with the proper methods. The default values for unspecified values are empty arrays.
class type 'layout voronoi = object ... end
Voronoi diagram.
val layout : 'l pslg -> 'l Bigarray.layout
layout mesh
returns the layout of mesh
.
val is_c_layout : 'l pslg -> bool
is_c_layout
returns true if the mesh layout is C.
new copy mesh
returns an identical mesh where all matrices are a fresh copy of the ones of mesh
.
sub mesh ?pos len
returns a new mesh keeping only the points with indices between pos
and pos + len - 1
(included). Only triangles whose 3 vertices have been selected are kept. Beware that some sub-matrices may be shared.
permute_points mesh p
returns a new mesh identical to the given mesh
except that the points indices are transformed through the permutation p
: the point of index i
in the new mesh will be the one of index p.{i}
in mesh
. In other words, p
lists mesh
indices in the order they will have after permutation.
permute_triangles mesh p
returns a new mesh identical to the given mesh
except that the trangle indices are transformed through the permutation p
: the triangle of index i
in the new mesh will be the one of index p.{i}
in mesh
. In other words, p
lists mesh
indices in the order they will have after permutation.
val band_height_P1 : ?filter:(int -> bool) -> 'l 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.
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 band_height_P1
).
module LaTeX : sig ... end
LaTex output. It is given in terms of three macros \meshline
, \meshpoint
, and \meshtriangle
to plot edges, points and (filled) triangles. The arguments of these macros are described by comments in the output files. If you do not provide your own implementations, default ones will be used. The LaTeX package tikz is required -- which works for PostScript as well as PDF output.
val scilab :
'l t ->
?longitude:float ->
?azimuth:float ->
?mode:[ `Triangles | `Triangles_only | `No_triangles ] ->
?box:[ `None | `Behind | `Box_only | `Full ] ->
?edgecolor:[ `Color of int | `Grey of float ] ->
'l 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 :
'l t ->
?edgecolor:[ `None | `Flat | `Interp | `Color of int ] ->
?linestyle:string ->
?facealpha:float ->
'l 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.
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.