Boundary condition on faces

Hello all,

I’d like to know if there is a way to get the face number and associated boundary condition for a given 3D mesh (generated in netgen/ngsolve)? We try to double check some results with another software and therefore would like to recreate the mesh there.

In the tutorial about mesh topology I already found ways to return faces associated to cells, edges to faces, nodes to edges and materials to elements. However, I struggle with creating a list of the kind “(face.nr, face.bc)”.

Once again, thanks in advance :slight_smile:

Greetings,
Philipp

Edit: To clarify, I need the label of the bc on the resp. face or all face.nr for a given label.

Hi Philip,

faces are all inter-element faces in the mesh, also inside. In contrast, boundary elements exist only for geometry boundaries. You can query boundary indices for boundary elements:

for bel in mesh.Elements(BND):
print (bel.index, bel.mat)

Joachim