Finding elements
Elements can be found from the mesh using the function 'findElements'. It has the following syntax
elements = findElements(mesh, querystring, optional arguments);
For example
circle = findElements(mesh, 'circle', [x y], [r])
returns the elements contained within a circle with a radius r at (x,y).
A detailed documentation of the optional arguments and the query strings are given below.
Query string | Description | Optional arguments | Argument description | Length |
'rectangle' | Finds the elements that are contained in a rectangle at position | position | Center of the box | 1 |
width | Width of the box | 1 | ||
height | Height of the box | 1 | ||
'circle' | Find the elements contained within circular region. | location | Center of the circle | 2 |
radius | Radius of the circle | 1 | ||
'inverse' | Inverses the selection | elements | Array that contains the indices of the elements that are selected | Number of elements in the selection |
'location' | Finds the element nearest to a user specified location. | location | The location vector | 2 |
'region' | Finds the elements that lie within a boundary. 'boundary' is defined by line segments that are constructed using the indices of mesh coordinates, i.e. in similar fashion as mesh.BH (see List of structures/2d). | boundary | Index pair of a line segment in the boundary | 2 |