FreeFOAM The Cross-Platform CFD Toolkit
buildPatch.H
Go to the documentation of this file.
1 
2 IOdictionary planeToPatchDict
3 (
4  IOobject
5  (
6  "planeToPatchDict",
7  runTime.system(),
8  runTime,
9  IOobject::MUST_READ,
10  IOobject::NO_WRITE
11  )
12 );
13 
14 Switch planeMapping
15 (
16  planeToPatchDict.lookup("mappingPlane")
17 );
18 
19 Info << "Constructing planePatch" << endl;
20 cuttingPlane cut(plane(planeToPatchDict), mesh);
21 
22 primitiveFacePatch planePatch
23 (
24  cut.faces(),
25  cut.points()
26 );
27 
28 Info << "Finding target patch" << endl;
29 
30 word toPatchName
31 (
32  planeToPatchDict.lookup("targetPatchName")
33 );
34 
35 const fvPatchList& patches = mesh.boundary();
36 bool targetPatchNamePresent(false);
37 label targetPatchNumber = -1;
38 
39 forAll(patches, patchI)
40 {
41  if (patches[patchI].name() == toPatchName)
42  {
43  targetPatchNamePresent = true;
44  targetPatchNumber = patchI;
45  }
46 }
47 
48 const labelList& cutCells(cut.cells());
49 
50 if (!targetPatchNamePresent)
51 {
52  targetPatchNumber = 1;
53  Serr<< "Target patch not present. " << endl;
54 }
55 else
56 {
57  Serr<< "Target patch name: " << patches[targetPatchNumber].name() << endl;
58 }
59 
61 (
62  planePatch,
63  patches[targetPatchNumber].patch()
64 );
65 
66 
67 PrimitivePatchInterpolation
68 <
69  PrimitivePatch<face, List, const pointField&>
71 (
72  planePatch
73 );
74 
75 
76 PrimitivePatchInterpolation
77 <
78  PrimitivePatch<face, List, const pointField&>
80 (
81  patches[targetPatchNumber].patch()
82 );
83 
84 // ************************ vim: set sw=4 sts=4 et: ************************ //