Skip to content

Quadratic tet meshing causes python to crash! #42

@SimonCom

Description

@SimonCom

Describe the bug, what's wrong, and what you expected.

Tetgen tetrahedralization with quadratic elements causes Python to crash on surface meshes with concave structures (e.g. a hole), although linear meshing works.

Steps to reproduce the bug.

import pyvista
import pyacvd
import pymeshfix
import tetgen

cyl = pyvista.Cylinder()
cylScale = cyl.scale([2,0.5,0.5]).triangulate()
sphere = pyvista.Sphere()
sphereCut = sphere.boolean_difference(cylScale)

clus = pyacvd.Clustering(sphereCut)
clus.subdivide(3)
clus.cluster(sphereCut.n_points)
remesh = clus.create_mesh()

clus2 = pyacvd.Clustering(remesh)
clus2.subdivide(2)
clus2.cluster(1000)
remesh2 = clus2.create_mesh()

fixer = pymeshfix.MeshFix(remesh2)
fixer.repair()
fixMesh = fixer.mesh

tet = tetgen.TetGen(fixMesh)
tet.tetrahedralize(switches='pq1.1/20Ya0.003o2')
grid = tet.grid

### System Information
--------------------------------------------------------------------------------
  Date: Tue Jul 12 13:51:39 2022 CEST

                OS : Darwin
            CPU(s) : 4
           Machine : x86_64
      Architecture : 64bit
               RAM : 8.0 GiB
       Environment : Jupyter
       File system : apfs
        GPU Vendor : Intel Inc.
      GPU Renderer : Intel Iris OpenGL Engine
       GPU Version : 4.1 INTEL-16.5.9

  Python 3.9.12 (main, Apr  5 2022, 01:53:17)  [Clang 12.0.0 ]

           pyvista : 0.34.1
               vtk : 9.1.0
             numpy : 1.21.5
           imageio : 2.9.0
           appdirs : 1.4.4
            scooby : 0.5.12
        matplotlib : 3.5.1
             PyQt5 : 5.9.2
           IPython : 8.2.0
          colorcet : 1.0.0
             scipy : 1.7.3
              tqdm : 4.64.0
            meshio : 5.3.4

  Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904
  for Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions