Check if a node is on the surface using PyDPF.

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 470
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭

Check if a node is on the surface using PyDPF.

Tagged:

Comments

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 470
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    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.")