mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-27 14:20:34 +05:00
Fix Mesh::GetSubMesh for 2d meshes
This commit is contained in:
parent
bb3c3ff565
commit
a504372f82
@ -7284,18 +7284,28 @@ namespace netgen
|
|||||||
regex regex_faces(faces);
|
regex regex_faces(faces);
|
||||||
regex regex_domains(domains);
|
regex regex_domains(domains);
|
||||||
|
|
||||||
|
if(dimension == 3) {
|
||||||
for(auto dom : Range(ndomains))
|
for(auto dom : Range(ndomains))
|
||||||
{
|
|
||||||
if(regex_match(mesh.GetMaterial(dom+1), regex_domains))
|
if(regex_match(mesh.GetMaterial(dom+1), regex_domains))
|
||||||
keep_domain.SetBit(dom);
|
keep_domain.SetBit(dom);
|
||||||
}
|
|
||||||
|
|
||||||
for(auto fi : Range(nfaces))
|
for(auto fi : Range(nfaces))
|
||||||
{
|
{
|
||||||
auto & fd = mesh.FaceDescriptors()[fi];
|
auto & fd = mesh.FaceDescriptors()[fi];
|
||||||
if (keep_domain[fd.DomainIn()] || keep_domain[fd.DomainOut()] || regex_match(fd.GetBCName(), regex_faces))
|
if (regex_match(fd.GetBCName(), regex_faces)
|
||||||
|
|| keep_domain[fd.DomainIn()] || keep_domain[fd.DomainOut()])
|
||||||
keep_face.SetBit(fd.BCProperty());
|
keep_face.SetBit(fd.BCProperty());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(auto fi : Range(nfaces))
|
||||||
|
{
|
||||||
|
auto & fd = mesh.FaceDescriptors()[fi];
|
||||||
|
auto mat = GetMaterial(fd.BCProperty());
|
||||||
|
if (regex_match(mat, regex_faces))
|
||||||
|
keep_face.SetBit(fd.BCProperty());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto filter_elements = [&keep_point](auto & elements, auto & keep_region)
|
auto filter_elements = [&keep_point](auto & elements, auto & keep_region)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user