Receive Mesh from python as static method

This commit is contained in:
Lukas Kogler 2019-04-17 12:22:38 +02:00
parent d6f1cf2bda
commit fbe660f775

View File

@ -576,12 +576,12 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
else self->SendRecvMesh(); else self->SendRecvMesh();
return self; return self;
}, py::arg("comm")) }, py::arg("comm"))
.def("Receive", [](NgMPI_Comm comm) { .def_static("Receive", [](NgMPI_Comm comm) -> shared_ptr<Mesh> {
auto mesh = make_shared<Mesh>(); auto mesh = make_shared<Mesh>();
mesh->SetCommunicator(comm); mesh->SetCommunicator(comm);
mesh->SendRecvMesh(); mesh->SendRecvMesh();
return mesh; return mesh;
}) }, py::arg("comm"))
.def("Load", FunctionPointer .def("Load", FunctionPointer
([](shared_ptr<Mesh> self, const string & filename) ([](shared_ptr<Mesh> self, const string & filename)
{ {