adapt missing from pybind11 interface
Issue #1005
new
adapt for adapting MeshFunction to refined meshes, formerly dolfin.cpp.fem.adapt is missing from new pybind11 interface. https://fenicsproject.org/docs/dolfin/dev/python/_autogenerated/dolfin.cpp.fem.html https://fenicsproject.org/docs/dolfin/2017.2.0/python/programmers-reference/cpp/fem/adapt.html
Comments (3)
-
-
reporter Thanks for the workaround.
-
I think what is needed in pybind is the following:
Add
#include <dolfin/adaptivity/adapt.h> #include "casters.h" namespace py = pybind11; namespace dolfin_wrappers { void fem(py::module& m) { // Adapt functions m.def("adapt", [](dolfin::Mesh mesh){return dolfin::adapt(mesh);});
for each adapt function. I will see if I can make a PR for several functions tomorrow. MWE of python demo:
from dolfin import * import matplotlib.pyplot as plt mesh = UnitSquareMesh(10,10) rmesh = cpp.fem.adapt(mesh) plot(mesh, color="b") plt.figure() plot(rmesh, color="r") plt.show()
Which adapt functions from the c++ side is wanted, @sa_wu?
- Log in to comment
A quick workaround for this omission: