Hi,
is there some 3D equivalent to
mesh = UnitTriangleMesh.create()
I found the reasonable command
mesh = UnitTetrahedronMesh.create()
but it does not seem to work (my dolfin version is 2019.1.0).
Best regards,
Johannes
Hi,
is there some 3D equivalent to
mesh = UnitTriangleMesh.create()
I found the reasonable command
mesh = UnitTetrahedronMesh.create()
but it does not seem to work (my dolfin version is 2019.1.0).
Best regards,
Johannes
Dear @joh_annes,
In the newest version, the UnitTetrahedronMesh
has not been exposed to the python-layer.
However, you can expose it by adding the following code to your problem:
from dolfin import *
cpp_binder ="""
#include <pybind11/pybind11.h>
#include <dolfin/generation/UnitTetrahedronMesh.h>
namespace py = pybind11;
PYBIND11_MODULE(SIGNATURE, m)
{
// dolfin::UnitTetrahedronMesh
py::class_<dolfin::UnitTetrahedronMesh>(m, "UnitTetrahedronMesh")
.def_static("create", &dolfin::UnitTetrahedronMesh::create);
}
"""
cpp_function = compile_cpp_code(cpp_binder)
mesh = cpp_function.UnitTetrahedronMesh.create()