package mesh
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=1e356ceffaf5d22be6cdbb2f543e24adb1445170494b404c883b07b87ae96c2a
md5=d293a1715cd69ee9d76bfbb1385de224
doc/mesh/Mesh/index.html
Module Mesh
Source
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})
.
Mesh data format
Float vector (parametrized by the layout).
Float matrix (parametrized by the layout).
Integer vector (parametrized by the layout).
Integer matrix (parametrized by the layout).
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.
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.
layout mesh
returns the layout of mesh
.
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.
Band computation and reduction
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
).
LaTeX output
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.
Scilab
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.
Matlab
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
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.