triSurface patch(prefix + ".stl"); // Read patches List > patchNames(patch.patches().size()); forAll (patch.patches(), patchI) { patchNames[patchI] = Tuple2(patch.patches()[patchI].name(), patchI); } Info << "Patches: " << patchNames << endl; // Create polyMesh faceList faces(patch.size()); labelList faceLabels(patch.size()); labelList faceRegion(patch.size()); forAll (patch, faceI) { faces[faceI] = face(patch[faceI]); faceLabels[faceI] = faceI; faceRegion[faceI] = patch[faceI].region(); } polyMesh mesh ( IOobject ( polyMesh::defaultRegion, runTime.constant(), runTime ), xferCopy(patch.points()), xferCopy(faces), xferCopy(labelList(0)), xferCopy(labelList(0)), false ); { // Add zones List pz(0); List fz(1); List cz(0); fz[0] = new faceZone ( "roof", faceLabels, boolList(patch.size(), false), 0, mesh.faceZones() ); mesh.addPatches(List(0), true); mesh.addZones(pz, fz, cz); }