mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
mp with named args in constructor
This commit is contained in:
parent
a39fc1e28c
commit
be8fa7286f
@ -163,7 +163,18 @@ void ExportNetgenMeshing()
|
||||
|
||||
|
||||
typedef MeshingParameters MP;
|
||||
bp::class_<MP> ("MeshingParameters")
|
||||
bp::class_<MP> ("MeshingParameters", bp::init<>())
|
||||
.def("__init__", bp::make_constructor
|
||||
(FunctionPointer ([](double maxh)
|
||||
{
|
||||
auto tmp = new MeshingParameters;
|
||||
tmp->maxh = maxh;
|
||||
return tmp;
|
||||
}),
|
||||
bp::default_call_policies(), // need it to use arguments
|
||||
(bp::arg("maxh")=1000)),
|
||||
"create meshing parameters"
|
||||
)
|
||||
.def("__str__", &ToString<MP>)
|
||||
.add_property("maxh",
|
||||
FunctionPointer ([](const MP & mp ) { return mp.maxh; }),
|
||||
|
Loading…
Reference in New Issue
Block a user