mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Merge branch 'occ_propagete_maxh_later' into 'master'
Propagate maxh to children only in occgeom constructor See merge request ngsolve/netgen!648
This commit is contained in:
commit
2982427d34
@ -16,6 +16,7 @@ namespace netgen
|
||||
OCCSolid(TopoDS_Shape dshape)
|
||||
: solid(TopoDS::Solid(dshape))
|
||||
{ }
|
||||
TopoDS_Solid& GetShape() { return solid; }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1261,6 +1261,24 @@ namespace netgen
|
||||
}
|
||||
}
|
||||
|
||||
// Propagate maxh to children
|
||||
for(auto& solid : solids)
|
||||
{
|
||||
auto& shape = static_cast<OCCSolid&>(*solid).GetShape();
|
||||
if(!OCCGeometry::HaveProperties(shape))
|
||||
continue;
|
||||
for(auto& f : GetFaces(shape))
|
||||
{
|
||||
auto& face = GetFace(f);
|
||||
face.properties.maxh = min2(face.properties.maxh,
|
||||
GetProperties(shape).maxh);
|
||||
}
|
||||
}
|
||||
for(auto& face : faces)
|
||||
for(auto& edge : face->edges)
|
||||
edge->properties.maxh = min2(edge->properties.maxh,
|
||||
face->properties.maxh);
|
||||
|
||||
// Add identifications
|
||||
auto add_identifications = [&](auto & shapes, auto & shape_map)
|
||||
{
|
||||
|
@ -836,12 +836,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
||||
},
|
||||
[](TopoDS_Shape& self, double val)
|
||||
{
|
||||
for (auto typ : { TopAbs_SOLID, TopAbs_FACE, TopAbs_EDGE, TopAbs_VERTEX })
|
||||
for (TopExp_Explorer e(self, typ); e.More(); e.Next())
|
||||
{
|
||||
auto & maxh = OCCGeometry::GetProperties(e.Current()).maxh;
|
||||
maxh = min2(val, maxh);
|
||||
}
|
||||
OCCGeometry::GetProperties(self).maxh = val;
|
||||
}, "maximal mesh-size for shape")
|
||||
|
||||
.def_property("hpref",
|
||||
|
Loading…
Reference in New Issue
Block a user