Name

gf_mesh_fem_get — General function for inquiry about mesh_fem objects.

Calling Sequence

int N = gf_mesh_fem_get(MF, 'nbdof')
int N = gf_mesh_fem_get(MF, 'nb basic dof')
ivec DOF = gf_mesh_fem_get(MF, 'basic dof from cv', ivec CVLST)
ivec [DOF,CV2DOF] = gf_mesh_fem_get(MF, 'basic dof from cvid', [ivec CVLST])
ivec DOF = gf_mesh_fem_get(MF, 'non conformal basic dof' [, ivec CVLST])
fem FEMLST[, ivec CV2F] = gf_mesh_fem_get(MF, 'fem' [, ivec CVLST])
ivec CVLST = gf_mesh_fem_get(MF, 'convex_index')
int N = gf_mesh_fem_get(MF, 'qdim')
ivec I = gf_mesh_fem_get(MF, {'is_lagrangian' | 'is_equivalent' | 'is_polynomial'} 
      [, ivec CVLST])
int N = gf_mesh_fem_get(MF, 'is_reduced')
spmat R = gf_mesh_fem_get(MF, 'reduction_matrix')
spmat R = gf_mesh_fem_get(MF, 'extension_matrix')
ivec DOFLST = gf_mesh_fem_get(MF, 'basic dof on region', ivec rlist)
ivec DOFLST = gf_mesh_fem_get(MF, 'dof on region', ivec rlist)
mat DOF_XY = gf_mesh_fem_get(MF, 'basic dof nodes'[, ivec DOFLST])
ivec DOFP = gf_mesh_fem_get(MF, 'dof partition')
vec U = gf_mesh_fem_get(MF, 'interpolate convex data', vec Ucv)
gf_mesh_fem_get(MF, 'save', string filename, ['with mesh'])
gf_mesh_fem_get(MF,'export_to_vtk', filename, ... ['ascii'], U, 'name'...)
gf_mesh_fem_get(MF,'export_to_dx', filename, ... ['as', mesh_name][,'edges']['serie',serie_name][,'ascii'][,'append'], U, 'name'...)
string S=gf_mesh_fem_get(M, 'char' [,'with mesh'])
mesh M=gf_mesh_fem_get(MF, 'linked mesh')
vec U=gf_mesh_fem_get(MF, 'eval', expr [,ivec DOFLST])
M=gf_mesh_fem_get(MF, 'memsize')
    

Description

  • n = gf_mesh_fem_get(MF,'nbdof') Return the number of degrees of freedom (dof) of the MeshFem.

  • n = gf_mesh_fem_get(MF,'nb basic dof') Return the number of basic degrees of freedom (dof) of the MeshFem.

  • DOF = gf_mesh_fem_get(MF,'dof from cv',mat CVids) Deprecated function. Use gf_mesh_fem_get(MF,'basic dof from cv') instead.

  • DOF = gf_mesh_fem_get(MF,'basic dof from cv',mat CVids) Return the dof of the convexes listed in CVids.

    WARNING: the Degree of Freedom might be returned in ANY order, do not use this function in your assembly routines. Use 'basic dof from cvid' instead, if you want to be able to map a convex number with its associated degrees of freedom. One can also get the list of basic dof on a set on convex faces, by indicating on the second row of CVids the faces numbers (with respect to the convex number on the first row).

  • DOF = gf_mesh_fem_get(MF,'dof from cvid'[, mat CVids]) Deprecated function. Use gf_mesh_fem_get(MF,'basic dof from cvid') instead.

  • list(DOFs, IDx) = gf_mesh_fem_get(MF,'basic dof from cvid'[, mat CVids]) Return the degrees of freedom attached to each convex of the mesh. If CVids is omitted, all the convexes will be considered (equivalent to CVids = 1 ... gf_mesh_get(M,'max cvid')). IDx is a Scilab row vector, length(IDx) = length(CVids)+1. DOFs is a Scilab row vector containing the concatenated list of dof of each convex in CVids. Each entry of IDx is the position of the corresponding convex point list in DOFs. Hence, for example, the list of points of the second convex is DOFs(IDx(2):IDx(3)-1). If CVids contains convex #id which do not exist in the mesh, their point list will be empty.

  • gf_mesh_fem_get(MF,'non conformal dof'[, mat CVids]) Deprecated function. Use gf_mesh_fem_get(MF,'non conformal basic dof') instead.

  • gf_mesh_fem_get(MF,'non conformal basic dof'[, mat CVids]) Return partially linked degrees of freedom. Return the basic dof located on the border of a convex and which belong to only one convex, except the ones which are located on the border of the mesh. For example, if the convex 'a' and 'b' share a common face, 'a' has a P1 FEM, and 'b' has a P2 FEM, then the basic dof on the middle of the face will be returned by this function (this can be useful when searching the interfaces between classical FEM and hierarchical FEM).

  • gf_mesh_fem_get(MF,'qdim') Return the dimension Q of the field interpolated by the MeshFem. By default, Q=1 (scalar field). This has an impact on the dof numbering.

  • list(FEMs, CV2F) = gf_mesh_fem_get(MF,'fem'[, mat CVids]) Return a list of FEM used by the MeshFem. FEMs is an array of all Fem objects found in the convexes given in CVids. If CV2F was supplied as an output argument, it contains, for each convex listed in CVids, the index of its correspounding FEM in FEMs. Convexes which are not part of the mesh, or convexes which do not have any FEM have their correspounding entry in CV2F set to -1.

  • CVs = gf_mesh_fem_get(MF,'convex_index') Return the list of convexes who have a FEM.

  • bB = gf_mesh_fem_get(MF,'is_lagrangian'[, mat CVids]) Test if the MeshFem is Lagrangian. Lagrangian means that each base function Phi[i] is such that Phi[i](P[j]) = delta(i,j), where P[j] is the dof location of the jth base function, and delta(i,j) = 1 if i==j, else 0.

    If CVids is omitted, it returns 1 if all convexes in the mesh are Lagrangian. If CVids is used, it returns the convex indices (with respect to CVids) which are Lagrangian.

  • bB = gf_mesh_fem_get(MF,'is_equivalent'[, mat CVids]) Test if the MeshFem is equivalent. See gf_mesh_fem_get(MF,'is_lagrangian')

  • bB = gf_mesh_fem_get(MF,'is_polynomial'[, mat CVids]) Test if all base functions are polynomials. See gf_mesh_fem_get(MF,'is_lagrangian')

  • bB = gf_mesh_fem_get(MF,'is_reduced') Return 1 if the optional reduction matrix is applied to the dofs.

  • bB = gf_mesh_fem_get(MF,'reduction matrix') Return the optional reduction matrix.

  • bB = gf_mesh_fem_get(MF,'extension matrix') Return the optional extension matrix.

  • DOFs = gf_mesh_fem_get(MF,'basic dof on region',mat Rs) Return the list of basic dof (before the optional reduction) lying on one of the mesh regions listed in Rs. More precisely, this function returns the basic dof whose support is non-null on one of regions whose #ids are listed in Rs (note that for boundary regions, some dof nodes may not lie exactly on the boundary, for example the dof of Pk(n,0) lies on the center of the convex, but the base function in not null on the convex border).

  • DOFs = gf_mesh_fem_get(MF,'dof on region',mat Rs) Return the list of dof (after the optional reduction) lying on one of the mesh regions listed in Rs. More precisely, this function returns the basic dof whose support is non-null on one of regions whose #ids are listed in `Rs` (note that for boundary regions, some dof nodes may not lie exactly on the boundary, for example the dof of Pk(n,0) lies on the center of the convex, but the base function in not null on the convex border). For a reduced mesh_fem a dof is lying on a region if its potential corresponding shape function is nonzero on this region. The extension matrix is used to make the correspondance between basic and reduced dofs.

  • DOFpts = gf_mesh_fem_get(MF,'dof nodes'[, mat DOFids]) Deprecated function. Use gf_mesh_fem_get(MF,'basic dof nodes') instead.

  • DOFpts = gf_mesh_fem_get(MF,'basic dof nodes'[, mat DOFids]) Get location of basic degrees of freedom. Return the list of interpolation points for the specified dof #IDs in `DOFids` (if `DOFids` is omitted, all basic dof are considered).

  • DOFP = gf_mesh_fem_get(MF,'dof partition') Get the 'dof_partition' array. Return the array which associates an integer (the partition number) to each convex of the MeshFem. By default, it is an all-zero array. The degrees of freedom of each convex of the MeshFem are connected only to the dof of neighbouring convexes which have the same partition number, hence it is possible to create partially discontinuous MeshFem very easily.

  • gf_mesh_fem_get(MF,'save',string filename[, string opt]) Save a MeshFem in a text file (and optionaly its linked mesh object if opt is the string 'with_mesh').

  • gf_mesh_fem_get(MF,'char'[, string opt]) Output a string description of the MeshFem. By default, it does not include the description of the linked mesh object, except if opt is 'with_mesh'.

  • m = gf_mesh_fem_get(MF,'linked mesh') Return a reference to the Mesh object linked to `mf`.

  • gf_mesh_fem_get(MF,'export to vtk',string filename, ... ['ascii'], U, 'name'...) Export a MeshFem and some fields to a vtk file. The FEM and geometric transformations will be mapped to order 1 or 2 isoparametric Pk (or Qk) FEMs (as VTK does not handle higher order elements). If you need to represent high-order FEMs or high-order geometric transformations, you should consider gf_slice_get(sl,'export to vtk').

  • gf_mesh_fem_get(MF,'export to dx',string filename, ...['as', string mesh_name][,'edges']['serie',string serie_name][,'ascii'][,'append'], U, 'name'...) Export a MeshFem and some fields to an OpenDX file. This function will fail if the MeshFem mixes different convex types (i.e. quads and triangles), or if OpenDX does not handle a specific element type (i.e. prism connections are not known by OpenDX). The FEM will be mapped to order 1 Pk (or Qk) FEMs. If you need to represent high-order FEMs or high-order geometric transformations, you should consider gf_slice_get(sl,'export to dx').

  • gf_mesh_fem_get(MF,'export to pos',string filename[, mat U1, string nameU1[, mat U2, string nameU2,...]) Export a MeshFem and some fields to a pos file. The FEM and geometric transformations will be mapped to order 1 isoparametric Pk (or Qk) FEMs (as GMSH does not handle higher order elements).

  • gf_mesh_fem_get(MF,'dof_from_im',MeshIm mim[, int p]) Return a selection of dof who contribute significantly to the mass-matrix that would be computed with mf and the integration method mim. p represents the dimension on what the integration method operates (default p = mesh dimension).

    IMPORTANT: you still have to set a valid integration method on the convexes which are not crosses by the levelset!

  • U = gf_mesh_fem_get(MF,'interpolate_convex_data',mat Ucv) Interpolate data given on each convex of the mesh to the MeshFem dof. The MeshFem has to be lagrangian, and should be discontinuous (typically a FEM_PK(N,0) or FEM_QK(N,0) should be used). The last dimension of the input vector Ucv should have gf_mesh_get(M,'max cvid') elements.

    Example of use: gf_mesh_fem_get(MF,'interpolate_convex_data', gf_mesh_get(M,'quality'))

  • z = gf_mesh_fem_get(MF,'memsize') Return the amount of memory (in bytes) used by the mesh_fem object. The result does not take into account the linked mesh object.

  • gf_mesh_fem_get(MF,'has_linked_mesh_levelset') ???.

  • gf_mesh_fem_get(MF,'linked_mesh_levelset') ???

Examples

 
cvid=gf_mesh_get(mf,'cvid');
[f,c2f]=gf_mesh_fem_get(mf, 'fem');
sf = list()
for i=1:size(f), sf(i)=gf_fem_get('char',f(i)); end;
for i=1:size(c2f),
  disp(sprintf('the fem of convex %d is %s', cvid(i),sf(i)));
end

U1=gf_mesh_fem_get_eval(mf,1)
U2=gf_mesh_fem_get_eval(mf,[1;0]) // output has two rows
U3=gf_mesh_fem_get_eval(mf,[1 0]) // output has one row, only valid if qdim(mf)==2
U4=gf_mesh_fem_get_eval(mf,list('x';'y.*z';4;myfunctionofxyz))
 

See Also

gf_mesh_get, gf_mesh_set

Authors

Y. Collette