porting changes
[OpenFOAM-1.5.x.git] / src / sampling / include / buildPatch.H
blob8363d0b05f00ccece91850dcb2793737042597ae
2 IOdictionary planeToPatchDict
4     IOobject
5     (
6         "planeToPatchDict",
7         runTime.system(),
8         runTime,
9         IOobject::MUST_READ,
10         IOobject::NO_WRITE
11     )
14 Switch planeMapping
16     planeToPatchDict.lookup("mappingPlane")
19 Info << "Constructing planePatch" << endl;
20 cuttingPlane cut(mesh, plane(planeToPatchDict));
22 primitiveFacePatch planePatch
23 (   
24     cut.faces(),
25     cut.points()
28 Info << "Finding target patch" << endl;
30 word toPatchName
32     planeToPatchDict.lookup("targetPatchName")
35 const fvPatchList& patches = mesh.boundary();
36 bool targetPatchNamePresent(false);
37 label targetPatchNumber = -1;
39 forAll(patches, patchI)
41     if(patches[patchI].name() == toPatchName)
42     {
43         targetPatchNamePresent = true;
44         targetPatchNumber = patchI;
45     }
46 }   
48 const labelList& cutCells(cut.cells());
50 if(!targetPatchNamePresent)
52     targetPatchNumber = 1;
53     Serr << "Target patch not present. " << endl;
55 else
57     Serr << "Target patch name: " << patches[targetPatchNumber].name() 
58          << endl;
61 patchToPatchInterpolation interPatch
63     planePatch,
64     patches[targetPatchNumber].patch()
68 PrimitivePatchInterpolation
70     PrimitivePatch<face, List, const pointField&>
71 > planePatchInter
73     planePatch
76 PrimitivePatchInterpolation
78     PrimitivePatch<face, List, const pointField&>
79 > toPatchInter
81     patches[targetPatchNumber].patch()