Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / engine / include / addPistonLayerFaces.H
blob8bc8b89a9e8e45d8287072eda1f49d196bbaeb61
1     if (piston().patchID().active())
2     {
3         // Add faces for piston layering
4         faceSet pistonFaceSet(*this, piston().pistonFaceSetName());
6         boolList flipPistonFaces(pistonFaceSet.toc().size(), false);
7 //        label nSet = pistonFaceSet.size();
8         label nSet = pistonFaceSet.toc().size();
9         label nFlip = 0;
11         forAll (flipPistonFaces, facei)
12         {
13             scalar scalProd =
14                 (faceAreas()[pistonFaceSet.toc()[facei]] & vector(0, 0, 1));
16             if (scalProd < 0)
17             {
18                 flipPistonFaces[facei] = true;
19                 nFlip++;
20             }
21         }
23         Info << "nSet = " << nSet << endl;
24         Info << "nFlip = " << nFlip << endl;
26         fz.append
27         (
28             new faceZone
29             (
30                 "pistonLayerFaces",
31                 pistonFaceSet.toc(),
32                 flipPistonFaces,
33                 nFaceZones,
34                 faceZones()
35             )
36         );
38         nFaceZones++;
40         pointSet movingPistonPoints(*this, piston().pistonPointSetName());
42         pz.append
43         (
44             new pointZone
45             (
46                 "pistonPoints",
47                 movingPistonPoints.toc(),
48                 nPointZones,
49                 pointZones()
50             )
51         );
53         nPointZones++;
54     }