Name

gf_mesh_get — General mesh inquiry function. As this function does not modify the mesh object, a mesh_fem object handle can be used instead of a mesh handle.

Calling Sequence

int I = gf_mesh_get(M, 'dim')
int N = gf_mesh_get(M, 'nbpts')
int N = gf_mesh_get(M, 'nbcvs')
mat PT = gf_mesh_get(M, 'pts'[, ivec PIDLST])
ivec PTID = gf_mesh_get(M, 'pid')
ivec CVID = gf_mesh_get(M, 'cvid')
int I = gf_mesh_get(M, 'max pid')
int I = gf_mesh_get(M, 'max cvid')
[ivec PID,ivec IDX] = gf_mesh_get(M, 'pid from cvid'[,ivec CVLST])
ivec V = gf_mesh_get(M, 'pid from coords', mat PT)
ivec V = gf_mesh_get(M, 'cvid from pid', ivec PTID)
ivec V = gf_mesh_get(M, 'orphaned pid')
ivec V = gf_mesh_get(M, 'faces from pid', ivec PTID)
imat CVFACELST = gf_mesh_get(M, 'faces from cvid', ivec CVLST[, 'merge'])
imat CVFACELST = gf_mesh_get(M, 'outer faces' [, ivec CVLST])
ivec BLST = gf_mesh_get(M, 'regions')
imat CVFLST = gf_mesh_get(M, 'region', int rnum)
mat E[,vec C] = gf_mesh_get(M, 'edges' [, ivec CVLST][,'merge'])
mat E[,vec C] = gf_mesh_get(M, 'curved edges', int N, [, ivec CVLST])
mat T = gf_mesh_get(M, 'triangulated surface', int N, [, ivec CVLST])
mat N = gf_mesh_get(M, 'normal of face', int CV, int F[, int FPTNUM])
mat N = gf_mesh_get(M, 'normal of faces', imat CVFLST)
vec Q = gf_mesh_get(M, 'quality',[CVLST])
vec A = gf_mesh_get(M, 'convex area',[CVLST])
cvstruct CVS[, CV2STRUC] = gf_mesh_get(M, 'cvstruct',[CVLST])
geotrans GT[, GT2STRUC] = gf_mesh_get(M, 'geotrans',[CVLST])
gf_mesh_get(M, 'save', string FILENAME)
string s = gf_mesh_get(M, 'char')
gf_mesh_get(M,'export_to_vtk', filename, ... [,'ascii'][,'quality'])
gf_mesh_get(M,'export_to_dx', filename, ...[,'ascii'][,'append'][,'as', name,[,'serie', serie_name]][,'edges'])
int m = gf_mesh_get(M, 'memsize')

Description

General mesh inquiry function. All these functions accept also a mesh_fem argument instead of a mesh M (in that case, the mesh_fem linked mesh will be used).

  • gf_mesh_get(M, 'dim') : return the dimension of the mesh (2 for a planar mesh, etc...).

  • gf_mesh_get(M, 'nbpts') : return the number of points of the mesh. Please note that these points might not be numbered from 1 to N.

  • gf_mesh_get(M, 'nbcvs') : return the number of convexes of the mesh. Please note that these convexes might not be numbered from 1 to N.

  • PT = gf_mesh_get(M, 'pts' [, PIDLST]) : return the list of point coordinates of the mesh M, each point being stored in a column of PT. If PIDLST is specified, only those points are listed. Otherwise, PT will have gf_mesh_get(M, 'max pid') rows, which might be greater than gf_mesh_get(M, 'nbpts') (if you destroyed some convexes or points in the mesh for example). The columns corresponding to inexistent points will be filled with NaN. You can use gf_mesh_get(M, 'pid') to filter such invalid points.

  • gf_mesh_get(M, 'pid') : return the list of point numbers stored in M (their numbering is not supposed to be contiguous from 1 to gf_mesh_get(M,'nbpts'), especially if you destroyed some convexes) in a row vector.

  • gf_mesh_get(M, 'cvid') : return the list of convex numbers composing M (their numbering is not supposed to be contiguous from 1 to gf_mesh_get('nbcvs'), especially if you destroyed some convexes) in a row vector.

  • gf_mesh_get(M, 'max pid') : return the highest point ID in the mesh (this is the same value as MAX(gf_mesh_get(M, 'pts id')), but it won't be equal to gf_mesh_get(M, 'nbpts') if some points have been destroyed and the mesh was not "repacked" with gf_mesh_set(M, 'optimize structure')).

  • gf_mesh_get(M, 'max cvid') : return the maximum ID of all convexes in the mesh (see 'max pid').

  • [PID,IDX]=gf_mesh_get(M, 'pid from cvid'[, CVLST]) : can be used in order to find the points of the convexes listed in CVLST (if not used, then the points of all convexes will be returned, which is equivalent to CVLST=1:gf_mesh_get(M,'max cvid')). Since the convexes might have different number of points, the result is stored as an indirect sparse array: IDX is a row vector, which length is equal to length(CVLST)+1, and PID is a row vector containing the concatenated list of points of each convex in cvlst. Each entry of IDX is the position of the corresponding convex point list in PID. For example, the list of points of the second convex is PID(IDX(2):IDX(3)-1).

    If you specified convex numbers which do not exist in CVLST, their point list will be empty.

  • V=gf_mesh_get(M, 'pid from coords', PT) : can be used to retrieve the point indices from their coordinates. PT is an array containing a list of these point coordinates. On return, V is a row vector containing the id of the points which are part of the mesh, and -1 for those which where not found in the mesh (a small error of about 1e-6 is allowed in the coordinates - this might be important if your mesh is very small!).

  • gf_mesh_get(M, 'cvid from pid', PTID) : return the list of convexes that share the points numbers given in PTID in a row vector (possibly empty).

  • gf_mesh_get(M, 'faces from pid', PTID) : return the list of convexes faces of which every vertex is in PTID. On return, the first row of V contains the convex number, and the second row contains the face number.

  • gf_mesh_get(M, 'faces from cvid', CVLST,[ 'merge']) : return the list of convex faces from a list of convex numbers, and optionally merges the common faces of two convexes from CVLST.

  • gf_mesh_get(M, 'outer faces' [, CVLST]) : return the list of faces which are not shared by two convexes (i.e. the faces on the boundary of the mesh). The search can be restricted to the optional argument CVLST.

  • gf_mesh_get(M, 'regions') : return the list of valid regions (created with gf_mesh_set(M,'region')). Regions are sets of convexes and/or convexes faces, stored in the mesh, and refered by a simple region number. They are typically used for the application of boundary conditions.

  • CVFLST=gf_mesh_get(M, 'region', rnum) : return the list of faces on the boundary rnum. On output, the first row of CVFLST contains the convex numbers, and the second row contains the face numbers (0 when the whole convex is is the region). See also gf_mesh_fem_get(MF, 'basic dof on region').

  • E=gf_mesh_get(M, 'edges' [, CVLST][, 'merge']) : warning This function has been obsoleted by mesh slice objects

  • E=gf_mesh_get(M, 'curved edges', N, [, CVLST]) : warning This function has been obsoleted by mesh slice objects

  • T=gf_mesh_get(M, 'triangulated surface', N, [, CVLST]) : warning This function has been obsoleted by mesh slice objects

  • gf_mesh_get(M, 'normal of face', CV, F[, FPTNUM]) and

    gf_mesh_get(M, 'normal of faces', CVFLST) : evaluates the normal of convex faces. The first form returns the normal of convex CV for its face F, evaluated at the FPTNUMth point of the face. If FPTNUM is not specified, then the normal is evaluated at each geometrical node of the face. The second form returns the normal for a set of faces of convex, each normal being computed at the center of the face (CVFLST is supposed to contain convex numbers at its first row and convex face number in its second row).

  • gf_mesh_get(M, 'quality',[CVLST]) : return an estimate of the convex quality (in a finite element sense).

  • gf_mesh_get(M, 'convex area',[CVLST]) : return an estimate the convex areas.

  • [CVS,CV2STRUC]=gf_mesh_get(M, 'cvstruct',[CVLST]) : return an array of all the convex structure used in the mesh (optionally restricted to the convexes of CVLST), and a second optional output vector CV2STRUCT which maps the convexes indices in CVLST to the indice of its structure in CVS.

  • [GT,GT2STRUCT]=gf_mesh_get(M, 'geotrans',[CVLST]) : return an array of the geometric transformations (similar to gf_mesh_get(M, 'cvstruct').

  • gf_mesh_get(M, 'save', filename) : save the mesh object to an ASCII file. This mesh can be restored later with gf_mesh('load', filename). You may also use gf_mesh_get(M, 'char') to obtain a string description of the mesh M, that can be saved to files, or restored with gf_mesh('from string').

  • gf_mesh_get(M,'export_to_vtk', filename, ... [,'ascii'][,'quality']) : export a mesh to a VTK file. If 'quality' is specified, an estimation of the quality of each convex will be written to the file (see gf_slice_get('export_to_vtk') for more details).

  • gf_mesh_get(M,'export_to_dx', filename, ...[,'ascii'] [,'append'] [,'as', name,[,'serie', serie_name]][,'edges']) : export a mesh to an OpenDX file (see gf_slice_get('export_to_dx') for more details).

  • gf_mesh_get(M, 'memsize') : return the amount of memory (in bytes) used by the mesh object.

Examples

 
  Add an example here
 

See Also

gf_mesh_set, gf_mesh, gf_plot_mesh

Authors

Y. Collette