Line 350 of G4GDMLWriteStructure is where this class finds the G4LogicalBorderSurface associated with a given PhysVolume. I think this approach may be in error. G4LogicalBorderSurfaces are defined from one PhysVolume to another. Unlike a G4LogicalSkinSurface, one PhysVolume may have several BorderSurfaces defined from it. Indeed, one main reason to choose a BorderSurface over a SkinSurface is when the simulation requires multiple surfaces defined between a single PhysVolume and multiple adjacent volumes. The current implementation of this GDML class finds the first BorderSurface defined for the PhysVolume, not all BorderSurfaces that might be defined. As a result, some BorderSurfaces may never appear in the GDML output. I think the required change would be to have G4GDMLWriteStructure::GetBorderSurface() return a container of surfaces and to call G4GDMLWriteStructure:: BorderSurfaceCache() on each of those surfaces.
*** This problem has been marked as a duplicate of problem 2142 ***