mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Merge branch 'restricth_line' into 'master'
Add RestrictHLine function in Python See merge request jschoeberl/netgen!364
This commit is contained in:
commit
0c002e9efa
@ -1197,13 +1197,25 @@ project_boundaries : Optional[str] = None
|
||||
return mp;
|
||||
}), py::arg("mp")=nullptr, meshingparameter_description.c_str())
|
||||
.def("__str__", &ToString<MP>)
|
||||
.def("RestrictH", FunctionPointer
|
||||
([](MP & mp, double x, double y, double z, double h)
|
||||
.def("RestrictH", [](MP & mp, double x, double y, double z, double h)
|
||||
{
|
||||
mp.meshsize_points.Append ( MeshingParameters::MeshSizePoint (Point<3> (x,y,z), h));
|
||||
}),
|
||||
py::arg("x"), py::arg("y"), py::arg("z"), py::arg("h")
|
||||
mp.meshsize_points.Append ( MeshingParameters::MeshSizePoint(Point<3> (x,y,z), h));
|
||||
}, py::arg("x"), py::arg("y"), py::arg("z"), py::arg("h")
|
||||
)
|
||||
.def("RestrictH", [](MP & mp, const Point<3>& p, double h)
|
||||
{
|
||||
mp.meshsize_points.Append ({p, h});
|
||||
}, py::arg("p"), py::arg("h"))
|
||||
.def("RestrictHLine", [](MP& mp, const Point<3>& p1, const Point<3>& p2,
|
||||
double maxh)
|
||||
{
|
||||
int steps = int(Dist(p1, p2) / maxh) + 2;
|
||||
auto v = p2 - p1;
|
||||
for (int i = 0; i <= steps; i++)
|
||||
{
|
||||
mp.meshsize_points.Append({p1 + double(i)/steps * v, maxh});
|
||||
}
|
||||
}, py::arg("p1"), py::arg("p2"), py::arg("maxh"))
|
||||
;
|
||||
|
||||
m.def("SetTestoutFile", FunctionPointer ([] (const string & filename)
|
||||
|
Loading…
Reference in New Issue
Block a user