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, the elements of a sphere with radii r at (x,y,z) can be obtaned by
sphere = findElements(mesh, 'sphere', [x y z], r)
A detailed documentation of the optional arguments and the query strings are given below.
Query string | Description | Optional arguments | Argument description | Row length |
'cylinder' | Finds elements that are contained within a cylinder. The cylinder is defined by a line that intersects the cylinder (axis of the cyliner). The line starts from origin and is directed to waypoint. The length of the cylinder is the same as direction | origin | Starting coordinate of the line | 3 |
waypoint | End coordinate of the line | 3 | ||
radius | 1 | |||
'box' | Finds the elements that are contained in a cuboid at origin. | origin | Location of the box | 3 |
width | Width of the box | 1 | ||
height | Height of the box | 1 | ||
'sphere' | Find the elements contained within spherical region. | location | Center of the circle | 3 |
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 | 3 |
'region' | Finds the elements that lie within a boundary. 'boundary' is defined by triangles that are constructed using the indices of mesh coordinates, i.e. in similar fashion as mesh.BH (see List of structures/3d). Note that the boundary must define an enclosed region for the function to work. | boundary | Index triplets that define a triangle in the mesh | 3 |