Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / finiteArea / createFaMeshFromStl / makePolyMesh.H
blob13872316c5e6be53dd577e8bd417bded7e6c1e91
1     triSurface patch(prefix + ".stl");
3     // Read patches
4     List<Tuple2<word, label> > patchNames(patch.patches().size());
6     forAll (patch.patches(), patchI)
7     {
8         patchNames[patchI] =
9             Tuple2<word, label>(patch.patches()[patchI].name(), patchI);
10     }
12     Info << "Patches: " << patchNames << endl;
14     // Create polyMesh
15     faceList faces(patch.size());
16     labelList faceLabels(patch.size());
17     labelList faceRegion(patch.size());
19     forAll (patch, faceI)
20     {
21         faces[faceI] = face(patch[faceI]);
22         faceLabels[faceI] = faceI;
23         faceRegion[faceI] = patch[faceI].region();
24     }
26     polyMesh mesh
27     (
28         IOobject
29         (
30             polyMesh::defaultRegion,
31             runTime.constant(),
32             runTime
33         ),
34         xferCopy(patch.points()),
35         xferCopy(faces),
36         xferCopy(labelList(0)),
37         xferCopy(labelList(0)),
38         false
39     );
42     // Add zones
43     List<pointZone*> pz(0);
44     List<faceZone*> fz(1);
45     List<cellZone*> cz(0);
47     fz[0] = new faceZone
48     (
49         "roof",
50         faceLabels,
51         boolList(patch.size(), false),
52         0,
53         mesh.faceZones()
54     );
56     mesh.addPatches(List<polyPatch*>(0), true);
57     mesh.addZones(pz, fz, cz);