Skip to content

Conversation

@ksugahar
Copy link

Summary

  • Fix regression where periodic boundary conditions set via Identify() + Glue() are lost during volume meshing

Problem

The DeleteData() call on identification points was introduced in commit 27b8b5e ("Fix handling identified points in Compress and MeshVolume").

However, this causes a regression where periodic boundary conditions set via Identify() + Glue() are lost during volume meshing. The issue is that the original mesh contains the identification information, but when merging subdomain meshes, this information is deleted before subdomain identifications (which typically don't exist) are copied.

Solution

Remove the DeleteData() call, preserving the original mesh's identification points. The subsequent loop still copies any subdomain identifications if they exist.

Test case

from netgen.occ import *

box1 = Box(gp_Pnt(0,0,0), gp_Pnt(1,1,1))
box2 = Box(gp_Pnt(2,0,0), gp_Pnt(3,1,1))
box1.faces[0].Identify(box2.faces[0], 'periodic', IdentificationType.PERIODIC)
shape = Glue([box1, box2])
geo = OCCGeometry(shape)
mesh = geo.GenerateMesh(maxh=0.5)
print(len(mesh.GetIdentifications()))  # Should be > 0, was 0 before fix

Related

🤖 Generated with Claude Code

The DeleteData() call on identification points was introduced in commit
27b8b5e ("Fix handling identified points in Compress and MeshVolume").

However, this causes a regression where periodic boundary conditions set
via Identify() + Glue() are lost during volume meshing. The issue is that
the original mesh contains the identification information, but when merging
subdomain meshes, this information is deleted before subdomain
identifications (which typically don't exist) are copied.

This fix removes the DeleteData() call, preserving the original mesh's
identification points. The subsequent loop still copies any subdomain
identifications if they exist.

Fixes: https://ngsolve.org/forum/ngspy-forum/1918-periodic-b-c-regression

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant