Check if a node is on the surface using PyDPF.

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 408
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer

Check if a node is on the surface using PyDPF.

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 408
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Options
    from ansys.dpf import core as dpf
    
    nid = 10
    model = dpf.Model(r"\Path\to\file.rst")
    
    mesh = model.metadata.meshed_region
    skin_nodes = dpf.operators.mesh.skin(
        mesh=mesh).outputs.nodes_mesh_scoping().ids
    if nid in skin_nodes:
        print(f"Node ID {nid} lies on the surface.")
    else:
        print(f"Node ID {nid} lies in the body.")