Issue in generating Tetrahedron mesh

Hi Fenics Community,

I am trying to use Tetrahedron from mshr as follow:

from dolfin import *
from mshr import *
import matplotlib.pyplot as plt
Tet1 = Tetrahedron(dolfin.Point(0.0, 44.0, 12.0), dolfin.Point(0.0, 64.0, 12.0), dolfin.Point(48.0, 64.0, 12.0), dolfin.point(0.0, 44.0, -2.0) )
mesh = generate_mesh(Tet1, 4)
plot(mesh)
plt.show()

The error:

AttributeError: ‘module’ object has no attribute ‘point’

I was looking for the source of this error from some of the available online resources but unfortunately, I couldn’t find any clue, so It would be great if someone could give me a hint in this case.

Thank you in advance,
Ali

import dolfin
from mshr import *

Tet1 = Tetrahedron(
    dolfin.Point(0.0, 44.0, 12.0),
    dolfin.Point(0.0, 64.0, 12.0),
    dolfin.Point(48.0, 64.0, 12.0),
    dolfin.Point(0.0, 44.0, -2.0),
)
mesh = generate_mesh(Tet1, 4)

from vtkplotter.dolfin import plot
plot(mesh)

capital p in point!

1 Like

Thanks for your response.
I am trying to get a 3D Cook membrane, so I should define more than four Tetrahedron as follows:

from dolfin import *
from mshr import *
import math
import matplotlib.pyplot as plt
Cube = Box(dolfin.Point(0.0, 0.0, 0.0), dolfin.Point(48.0, 64.0, 10.0))
Tet1 = Tetrahedron(
dolfin.Point(0.0, 44.0, 12.0),
dolfin.Point(0.0, 64.0, 12.0),
dolfin.Point(48.0, 64.0, 12.0),
dolfin.Point(0.0, 44.0, -2.0),
)
Tet2 = Tetrahedron(
dolfin.Point(0.0, 44.0, 12.0),
dolfin.Point(0.0, 44.0, -2.0),
dolfin.Point(0.0, 64.0, -2.0),
dolfin.Point(24.0, 54.0, 12.0),
)
Tet3 = Tetrahedron(
dolfin.Point(0.0, 44.0, 12.0),
dolfin.Point(0.0, 64.0, -2.0),
dolfin.Point(24.0, 54.0, 12.0),
dolfin.Point(48.0, 64.0, -2.0),
)
Tet4 = Tetrahedron(
dolfin.Point(48.0, 64.0, -2.0),
dolfin.Point(48.0, 64.0, -2.0),
dolfin.Point(0.0, 64.0, -2.0),
dolfin.Point(24.0, 54.0, 12.0),
)
geometry = Cube - Tet1 - Tet2 - Tet3 - Tet4
mesh = generate_mesh(geometry, 10)
plot(mesh)
vtkfile = dolfin.File(‘Figures/3Dcook.pvd’)
vtkfile << mesh

But It seems generate_mesh cannot get more than four input.

Error:

Error !!!
Error !!!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=59
:
system msg for write_line failure : Bad file descriptor

this is one possible issue…