mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 06:30:34 +05:00
mesh constructor gets dim argument
This commit is contained in:
parent
c4b532aac2
commit
457c2ad96d
@ -262,7 +262,22 @@ DLL_HEADER void ExportNetgenMeshing()
|
|||||||
|
|
||||||
|
|
||||||
bp::class_<Mesh,shared_ptr<Mesh>,boost::noncopyable>("Mesh", bp::no_init)
|
bp::class_<Mesh,shared_ptr<Mesh>,boost::noncopyable>("Mesh", bp::no_init)
|
||||||
.def(bp::init<>("create empty mesh"))
|
// .def(bp::init<>("create empty mesh"))
|
||||||
|
|
||||||
|
.def("__init__", bp::make_constructor
|
||||||
|
(FunctionPointer ([](int dim)
|
||||||
|
{
|
||||||
|
auto mesh = make_shared<Mesh>();
|
||||||
|
mesh->SetDimension(dim);
|
||||||
|
return mesh;
|
||||||
|
}),
|
||||||
|
bp::default_call_policies(), // need it to use named arguments
|
||||||
|
(
|
||||||
|
bp::arg("dim")=3
|
||||||
|
)
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
.def("__str__", &ToString<Mesh>)
|
.def("__str__", &ToString<Mesh>)
|
||||||
.def("Load", FunctionPointer
|
.def("Load", FunctionPointer
|
||||||
([](Mesh & self, const string & filename)
|
([](Mesh & self, const string & filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user