Merge remote-tracking branch 'origin/nr/multiSolverFix' into nextRelease
[foam-extend-3.2.git] / src / sampling / include / buildPatch.H
blob062133087062f4d3cddbd19a7f69ab2c45ace9d0
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()
58          << endl;
61 patchToPatchInterpolation interPatch
63     planePatch,
64     patches[targetPatchNumber].patch()
68 PrimitivePatchInterpolation
70     PrimitivePatch<face, List, const pointField&>
71 > planePatchInter
73     planePatch
77 PrimitivePatchInterpolation
79     PrimitivePatch<face, List, const pointField&>
80 > toPatchInter
82     patches[targetPatchNumber].patch()