fedoo.Mesh.find_nodes

Mesh.find_nodes(selection_criterion: str, value: float = 0, tol: float = 1e-06, name: str | None = None) ndarray[int]

Return a list of nodes from a given selection criterion

Parameters:
  • selection_criterion (str) –

    selection criterion used to select the returned nodes. Possibilities are:

    • ’X’: select nodes with a specified x coordinate value

    • ’Y’: select nodes with a specified y coordinate value

    • ’Z’: select nodes with a specified z coordinate value

    • ’XY’ : select nodes with specified x and y coordinates values

    • ’XZ’ : select nodes with specified x and z coordinates values

    • ’YZ’ : select nodes with specified y and z coordinates values

    • ’Point’: select nodes at a given position

    • ’Distance’: select nodes at a given distance from a point

    • Arbitrary str expression

  • value (scalar or list of scalar of numpy array) –

    • if selection_criterion in [‘X’, ‘Y’, ‘Z’] value should be a scalar

    • if selection_criterion in [‘XY’, ‘XZ’, ‘YZ’] value should be a list (or array) containing 2 scalar which are the coordinates in the given plane

    • if selection_criterion == ‘point’, value should be a list containing 2 scalars (for 2D problem) or 3 scalars (for 3D problems) which are the coordinates of the point.

    • if selection_criterion == ‘distance’, value is a tuple where value[0] contains the coordinate (list of int) of the point from which the distance is computed and value[1] the distance.

    • value is ignored if selection_criterion is an arbitrary expression

  • tol (float) – Tolerance of the given criterion. Ignored if selection_criterion is an arbitrary expression

  • name (str, optional) – If name is given a node_set is added to the mesh.

Return type:

List of node index

Notes

Aritrary expressions accept the use of:
  • node coordinates (at least one): ‘X’, ‘Y’, ‘Z’

  • arithmetic operators: +, -, , *, /

  • compareason (compulsory): >, <, !=, <=, >=, ==

  • Logical: and, or, &, |

  • function: abs(…)

  • parentheses, numbers

Example

Create a disk mesh and find nodes from an expression.

>>> import fedoo as fd
>>> mesh = fd.mesh.disk_mesh()
>>> mesh.find_nodes("(X**2>0.2 and X<0.5) or abs(Y)>0.4")