gf_mesh_set

Purpose

General function for modification of a mesh object.

Synopsis

ivec IDX = gf_mesh_set(M, 'add point', mat  PT)
gf_mesh_set(M, 'del point', ivec  IDX)
vec IDX = gf_mesh_set(M, 'add convex', geotrans  GT,mat  CVPTS)
gf_mesh_set(M, 'del convex', ivec  IDX)
gf_mesh_set(M, 'del convex of dim', ivec  DIM)
gf_mesh_set(M, 'region', int bnum, imat CVFLST)
gf_mesh_set(M, 'region_intersect', int R1, int R2)
gf_mesh_set(M, 'region_merge', int R1, int R2)
gf_mesh_set(M, 'region_substract', int R1, int R2)
gf_mesh_set(M, 'delete region', ivec blst)
gf_mesh_set(M, 'translate', vec  V)
gf_mesh_set(M, 'transform', mat  T)
gf_mesh_set(M, 'merge', const_mesh  M2)
gf_mesh_set(M, 'optimize structure')
gf_mesh_set(M  'refine' [, mat CVLST])

Description

IDX = gf_mesh_set(M, 'add point', PT) : insert new points in the mesh. PT should be an n×m matrix , where n is the mesh dimension, and m is the number of points that will be added to the mesh. On output, IDX contains the indices of these new points.

Remark: if some points are already part of the mesh, they won't be inserted again, be IDX will contains the previously assigned indices of the points.

gf_mesh_set(M, 'del point', IDX) : remove one or more points from the mesh. IDX should contain the point indexes, such as the one returned by the 'add point' command.

IDX=gf_mesh_set(M, 'add convex', GT, CVPTS) : add a new convex of structure GT (obtained with gf_geotrans), and whose point coordinates are given by the columns of CVPTS. On return, IDX contains the convex ID. CVPTS might be a three dimensional array (convex, point, coord) in order to insert more than one convex (or a two dimensional array correctly shaped).

gf_mesh_set(M, 'del convex', IDX) : remove one or more convexes from the mesh. IDX should contain the convexes IDs, such as the ones returned by the 'add convex' command.

gf_mesh_set(M, 'del convex of dim', DIM) : Remove all convexes of dimension listed in DIM. For example gf_mesh_set(M, 'del convex of dim', [1,2]) removes all line segments, triangles and quadrangles.

gf_mesh_set(M, 'region', bnum, CVFLST) or gf_mesh_set(M, 'boundary', bnum, CVFLST) : assign the boundary number bnum to the convex faces stored in each column of the matrix CVFLST (i.e. the first row of CVFLST contains a convex number, and the second row contains a face number in the convex).

gf_mesh_set(M, 'delete region', blst) or gf_mesh_set(M, 'delete boundary', blst) : remove the region listed in blst.

gf_mesh_set(M, 'region_intersect', R1, R2) : replace the region number R1 with its intersection with region number R2.

gf_mesh_set(M, 'region_merge', R1, R2) : merge region number R2 into region number R1.

gf_mesh_set(M, 'region_substract', R1, R2) : replace the region number R1 with its difference with region number R2.

gf_mesh_set(M, 'translate', V) : translate each point of the mesh from V, and gf_mesh_set(M, 'transform', T) applies the matrix T to each point of the mesh.

gf_mesh_set(M, 'merge', M2) : merge the mesh M2 in the mesh M (overlapping points won't be duplicated). If M2 is a mesh_fem object, its linked mesh will be used.

gf_mesh_set(M, 'optimize structure') : renumber points and convexes numbering, and ensures that there is no "hole" is the numbering.

gf_mesh_set(M, 'refine', CVLST) : refine the convexes listed in CVLST, with a Bank strategy. If CVLST is not given, the whole mesh is refined. Note that the regions, and the finite element methods and integration methods of the mesh_fem and mesh_im objects linked to this mesh will be automagically refined.

See Also