fedoo.Mesh.find_nodes
- Mesh.find_nodes(selection_criterion: str, value: float = 0, tol: float = 1e-06) 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
- Return type:
List of node index
Notes
Aritrary expressions allow the use of “and” and “or” logical operator, parenthesis, and the following compareason operators: “>”, “<”, “<=”, “>=”, “==”, “!=”. The coordinates ‘X’, ‘Y’ and ‘Z’ are available in the expression. In case of arbitrary expression, value and tol parameters are ignored
Example
Create a one element mesh from a 2d mesh in a 3d space:
>>> import fedoo as fd >>> mesh = fd.mesh.disk_mesh() >>> mesh.find_nodes("(X>0.2 and X<0.5) or Y>0.4")