7.12  Element selection

7.12  Element selection#

feutil FindElt supports a number of element selection criteria that are used by many functions. An element selection command is specified by giving a string command (for example 'GroupAll') to be applied on a model (nodes, elements, possibly alternate element set).

Basic commands are :

  • [eltind,elt] = feutil('findelt selector',model);
    or elt = feutil('selelt selector',model); this command applies the specified element selection command to a model structure. For example,
    [eltind,selelt] = feutil('findelt eltname bar1',model) selects the elements in model.Elt which type is bar1.
  • [eltind,elt] = femesh('findelt selector');
    this command applies the specified element selection command to the standard global matrices FEnode, FEelt, FEel0, …For example, [eltind,selelt] = femesh('findelt eltname bar1') selects the elements in FEelt which type is bar1.

Output arguments are eltind the selected elements indices in the element description matrix and selelt the selected elements.

Accepted selectors are


ConnectedTo ifinds elements in a group that contains the nodes i. This calls feutil DivideInGroups and thus only operates on groups of elements of a single type.
EGID ifinds elements with element group identifier i. Operators accepted.
EltId ifinds elements with identifiers i in FEelt. Operators accepted.
EltInd ifinds elements with indices i in FEelt. Operators accepted.
EltName sfinds elements with element name s. EltName flui will select all elements with name starting with flui. EltName ~= flui will select all elements with name not starting with flui. One can select superelements from their name using EltName SE:SEName. Selection of all elements but a single SE from its name is obtained using EltName ~= SE:SEName. Regular expressions on superelement names are accepted, one then replaces token SEName by the prefix # followed by the desired expression, e.g. EltName SE:#tgm* to select all superlement whose name starts with tgm.
Facing > cos x y zfinds topologically 2-D elements whose normal projected on the direction from the element CG to x y z has a value superior to cos. Inequality operations are accepted.
Group ifinds elements in group(s) i. Operators accepted.
InNode ifinds elements with all nodes in the set i. Nodes numbers in i can be replaced by a string between braces defining a node selection command. For example feutil('FindElt withnode {y>-230 & NodeId>1000}',model).
MatId ifinds elements with MatId equal to i. Relational operators are also accepted (MatId =1:3, ...).
ProId ifinds elements with ProId equal to i. Operators accepted.
WithNode ifinds elements with at least one node in the set i. i can be a list of node numbers. Replacements for i are accepted as above.
Set ifinds elements in element set(s) based on the .ID field (see set stack entries). Elements belonging to any set of ID of value i will be selected.


SetName sfinds elements in element set named s (see set stack entries).
  • By default an error is thrown if the set name does not exist in stack. Use command SafeSetName to get empty results instead.
  • By default no spaces in set names are allowed. For more complicated setnames, place the name into double quotes: SetName "my set name with spaces".
  • Selection by exclusion is possible with token :exclude. E.g. SetName unused:exclude will return all elements excluding the elements present in the set named unused.
  • Alternative calls to more advanced sets based on connectivity are possible,
    • SetName "name:con IdList" can be used to select a subset connected to nodes in the IdList (assuming the .NodeCon field is defined).
    • SetName "name:subname" can be used to select a subset in the set by connectivity format (see set).
WithoutNode ifinds elements without any of the nodes in the set i. i can be a list of node numbers. Replacements for i are accepted as above.
SelEdge typeselects the external edges (lines) of the currently selected elements (any element selected before the SelEdge selector), any further selector is applied on the model resulting from the SelEdge command rather than on the original model. The -All option skips the internal edge elimination step. It can be combined with option -noUni to keep edge duplicates between elements.
 Type g retains inter-group edges. m retains inter-material edges. Type p retains inter-property edges. all retains all edges. The MatId for the resulting model identifies the original properties of each side of the edge. The edge number is stored in the column after EltId.
SelFace typeselects the external faces (surfaces) of the currently selected elements. The face number is stored in the column after EltId to allow set generation. See more details under SelEdge. The -All option skips the internal face elimination step. Warning: the face number stored in the column after the EltId column interferes with the Theta property for shell elements (see quad4,tria3). If the selection output will be used as elements in a model, ensure that the Theta property is properly set for your application, see p_shell setTheta.
SelFaceNegsame behavior as SelFace but flips elements so that the normal direction is reversed. Face identifiers are then defined with the same numbering but with negative values. This allows selecting volume skins oriented with inward normals, ad also allows genereting dedicated orientations on shell elements. To be consistent token SelFacePos is also detected and behaves as SelFace.


SelFace -trim valtrims a surface selection to remove boundary elements that may overcome a sharp edge. The base application is thus to be able to select interior surfaces with robustness regarding the surface edges in a volume, where it is classical to end up with a layer of side elements. The sharp edges detection uses feutilb SurfaceAsQuad to whom the angle defined by val is passed. Sharp edge element groups exclusively containing elements with nodes on the edge of the surface are then removed from the selection.

Different selectors can be chained using the available logical operations

  • & finds elements that verify both conditions.
  • | finds elements that verify one or both conditions.
  • &~ finds elements that verify the left condition and not the right condition (exclusion from current selection state)

i1=feutil('FindEltGroup 1:3 & with node 1 8',model) for example. Condition combinations are always evaluated from left to right (parentheses are not accepted). Note that SelEdge and SelFace selectors do not output elements of the mesh but new elements of respectively 1D or 2D topology, so that some combinations may not be directly possible (e.g. if later combined to Group selector).

Command option epsl value can be used to give an evaluation tolerance for equality logical operators.

Numeric values to the command can be given as additional arguments. Thus the command above could also have been written i1=feutil('findelt group & withnode',model,1:3,[1 8]).