FUNCTION REFERENCE

findElements

Find element IDs in a 2-D PDE mesh by face, box, radius, or attached nodes.

Find element IDs in a 2-D PDE mesh by face, box, radius, or attached nodes.

Syntax

ids = findElements(mesh, 'region', 'Face', faceIDs); ids = findElements(mesh, 'box', xlim, ylim); ids = findElements(mesh, 'radius', center, r); ids = findElements(mesh, 'attached', nodeIDs)

Returns a sorted row vector of 1-based element IDs in a pde.FEMesh object. For 'box' and 'radius', an element is selected when all of its nodes (3 for linear, 6 for quadratic) lie inside the box or closed disk. 'attached' selects every element containing at least one of the specified node IDs.

Example

R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); mesh=generateMesh(m,'Hmax',0.5,'GeometricOrder','linear'); numel(findElements(mesh,'region','Face',1)) == size(mesh.Elements,2)

Differences from MATLAB: 2-D meshes only; 'box' and 'radius' always require all nodes of an element to lie inside the region (no 'completely'/'partially' flag).

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.