General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

mesh_skin operator in Mechanical DPF extracts contact elements – area doubled

    • felix.kaule
      Subscriber

      Hello everyone,

      I’m using Ansys Mechanical 2024 R2  and want to calculate the surface area of my Tet10 mesh via the mesh_skin operator. However, the result includes contact elements (CONTA*/TARGE*), which leads to approximately twice the expected area.

      My Code:
      python
      skin_mesh = dpf.operators.mesh.skin(
          mesh=sub_mesh,
          mesh_scoping=node_scoping
      ).outputs.mesh.GetData()
      area_field = dpf.operators.geo.surface_area(mesh=skin_mesh).outputs.fields_container.GetData()[0]

      Expected: Only the true boundary faces of the Tet10 elements.
      Actual: Additional faces from contact elements are included.

      What I tried:

      • Filtering by mapdl_element_type_id via scoping.on_property

      • Using mesh.faces instead of mesh.skin

      • Explicit element vs. nodal scoping

      Question:
      How can I exclude contact elements from the skin mesh extraction so that only the structural boundary faces remain?

      Thanks in advance for your help!

      Best regards,
      Felix

    • Lydia
      Ansys Employee

      Hi Felix,

      For DPF and scripting related questions, you should go ahead and ask in the Ansys Developers Forum Home - Community Forum

      Thank you for your understanding.

      Regards,

      Lydia

    • felix.kaule
      Subscriber

      Hello Lydia,

      actually that's what I already did, you can delete this thread here if you want.

      Regards
      Felix

    • OmarWorthing90
      Subscriber

      Poor Bunny

      Hello felix.kaule!

      from ansys.dpf import core as dpf

      # Filter out contact elements (e.g., type IDs for CONTA/TARGE are usually 100+)
      element_types_to_keep = [1, 2, 3, 4, 5]  # Structural types (adjust based on your model)

      filtered_mesh_op = dpf.operators.mesh.mesh_filter()
      filtered_mesh_op.inputs.mesh.connect(sub_mesh)
      filtered_mesh_op.inputs.element_type.connect(element_types_to_keep)
      filtered_mesh = filtered_mesh_op.outputs.mesh()

      # Now apply skin and surface area
      skin_mesh = dpf.operators.mesh.skin(mesh=filtered_mesh).outputs.mesh.GetData()
      area_field = dpf.operators.geo.surface_area(mesh=skin_mesh).outputs.fields_container.GetData()[0]

       

    • felix.kaule
      Subscriber
      Hello,
       
      the solution was to get the mesh just from solid elements:
       
      python
      solid_op = dpf.operators.scoping.on_mesh_property()
      solid_op.inputs.property_name.Connect("solid_elements")
      solid_op.inputs.mesh.Connect(full_mesh)
       
      scoping_solids = dpf.operators.mesh.from_scoping()
      scoping_solids.inputs.mesh.Connect(full_mesh)
      scoping_solids.inputs.scoping.Connect(solid_op)
       
      skin_mesh_op = dpf.operators.mesh.skin()
      skin_mesh_op.inputs.mesh.Connect(scoping_solids)
      skin_mesh_op.inputs.mesh_scoping.Connect(scoped_nodes)
      skin_mesh = skin_mesh_op.outputs.getmesh()
       
      Regards
      Felix
Viewing 4 reply threads
  • You must be logged in to reply to this topic.