ENH: RASModel.C: clipping input to log
[OpenFOAM-1.7.x.git] / src / sampling / include / buildPatch.H
blob0d6338ebb0321d98b6a60c5cd44f470734dba8dd
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(plane(planeToPatchDict), mesh);
22 primitiveFacePatch planePatch
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     }
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() << endl;
60 patchToPatchInterpolation interPatch
62     planePatch,
63     patches[targetPatchNumber].patch()
67 PrimitivePatchInterpolation
69     PrimitivePatch<face, List, const pointField&>
70 > planePatchInter
72     planePatch
76 PrimitivePatchInterpolation
78     PrimitivePatch<face, List, const pointField&>
79 > toPatchInter
81     patches[targetPatchNumber].patch()