gf_slice_get — Get informations related to mesh slices
int I = gf_slice_get(sl, 'dim') scalar I = gf_slice_get(sl, 'area') ivec cvlst = gf_slice_get(sl, 'cvs') int n = gf_slice_get(sl, 'nbpts') mat P = gf_slice_get(sl, 'pts') ivec NS = gf_slice_get(sl, 'nbsplxs') int NS = gf_slice_get(sl, 'nbsplxs',int dim) [imat S, ivec CV2SPLX] = gf_slice_get(sl, 'splxs', int dim) mat E = gf_slice_get(sl, 'edges') [mat P, ivec E1, ivec E2] = gf_slice_get(sl, 'edges') vec Usl=gf_slice_get(sl, 'interpolate_convex_data', Ucv) mesh m = gf_slice_get(sl, 'linked mesh') gf_slice_get(sl,'export_to_vtk', filename ... [, 'ascii'][, 'edges'],...) gf_slice_get(sl,'export_to_pov', filename, ...) gf_slice_get(sl,'export_to_dx', filename, ...[, 'ascii'][, 'edges'][, 'append'])int ms=gf_slice_get(sl, 'memsize')
d = gf_slice_get(sl,'dim') Return the dimension of the slice (2 for a 2D mesh, etc..).
a = gf_slice_get(sl,'area') Return the area of the slice.
CVids = gf_slice_get(sl,'cvs') Return the list of convexes of the original mesh contained in the slice.
n = gf_slice_get(sl,'nbpts') Return the number of points in the slice.
ns = gf_slice_get(sl,'nbsplxs'[, int dim]) Return the number of
simplexes in the slice. Since the slice may contain points (simplexes
of dim 0), segments (simplexes of dimension 1), triangles etc., the
result is a vector of size gf_slice_get(sl,'dim')+1 , except if the
optional argument dim
is used.
P = gf_slice_get(sl,'pts') Return the list of point coordinates.
list(S, CV2S) = gf_slice_get(sl,'splxs',int dim) Return the list
of simplexes of dimension dim
.
On output, S has dim+1 rows, each column
contains the point numbers of a simplex. The vector
CV2S
can be used to find the list of simplexes for
any convex stored in the slice. For example
S(:,CV2S(4):CV2S(5)-1) gives the list of
simplexes for the fourth convex.
list(P, E1, E2) = gf_slice_get(sl,'edges') Return the edges of
the linked mesh contained in the slice. P
contains
the list of all edge vertices, E1
contains the
indices of each mesh edge in P
, and
E2
contains the indices of each "edges" which is on
the border of the slice. This function is useless except for
post-processing purposes.
Usl = gf_slice_get(sl,'interpolate_convex_data',mat Ucv)
Interpolate data given on each convex of the mesh to the slice nodes.
The input array Ucv
may have any number of
dimensions, but its last dimension should be equal to
gf_mesh_get(m,'max cvid').
Example of use:
gf_slice_get(sl,'interpolate_convex_data', gf_mesh_get(m,'quality'))
m = gf_slice_get(sl,'linked mesh') Return the mesh on which the slice was taken.
z = gf_slice_get(sl,'memsize') Return the amount of memory (in bytes) used by the slice object.
gf_slice_get(sl,'export to vtk',string filename ... [,
'ascii'][, 'edges'] ...) Export a slice to VTK. Following the
filename
, you may use any of the following
options:
if 'ascii' is not used, the file will contain binary data (non portable, but fast).
if 'edges' is used, the edges of the original mesh will be written instead of the slice content
More than one dataset may be written, just list them. Each dataset consists of either:
a field interpolated on the slice (scalar, vector or tensor), followed by an optional name.
a mesh_fem and a field, followed by an optional name.
Examples:
gf_slice_get(sl,'export to vtk','test.vtk',Usl,'first_dataset', mf, U2, 'second_dataset') gf_slice_get(sl,'export to vtk','test.vtk','ascii',mf,U2) gf_slice_get(sl,'export to vtk','test.vtk','edges','ascii',Uslice)
gf_slice_get(sl,'export to pov',string filename, ...) Export a the triangles of the slice to POV-RAY.
gf_slice_get(sl,'export to dx',string filename, ...) Export a slice to OpenDX. Following the file name, you may use any of the following options:
if 'ascii' is not used, the file will contain binary data (non portable, but fast).
if 'edges' is used, the edges of the original mesh will be written instead of the slice content.
if 'append' is used, the opendx file will not be overwritten, and the new data will be added at the end of the file.
More than one dataset may be written, just list them. Each dataset consists of either:
a field interpolated on the slice (scalar, vector or tensor), followed by an optional name.
a mesh_fem and a field, followed by an optional name.