![]() |
|
00001 00002 IOdictionary planeToPatchDict 00003 ( 00004 IOobject 00005 ( 00006 "planeToPatchDict", 00007 runTime.system(), 00008 runTime, 00009 IOobject::MUST_READ, 00010 IOobject::NO_WRITE 00011 ) 00012 ); 00013 00014 Switch planeMapping 00015 ( 00016 planeToPatchDict.lookup("mappingPlane") 00017 ); 00018 00019 Info << "Constructing planePatch" << endl; 00020 cuttingPlane cut(mesh, plane(planeToPatchDict)); 00021 00022 primitiveFacePatch planePatch 00023 ( 00024 cut.faces(), 00025 cut.points() 00026 ); 00027 00028 Info << "Finding target patch" << endl; 00029 00030 word toPatchName 00031 ( 00032 planeToPatchDict.lookup("targetPatchName") 00033 ); 00034 00035 const fvPatchList& patches = mesh.boundary(); 00036 bool targetPatchNamePresent(false); 00037 label targetPatchNumber = -1; 00038 00039 forAll(patches, patchI) 00040 { 00041 if(patches[patchI].name() == toPatchName) 00042 { 00043 targetPatchNamePresent = true; 00044 targetPatchNumber = patchI; 00045 } 00046 } 00047 00048 const labelList& cutCells(cut.cells()); 00049 00050 if(!targetPatchNamePresent) 00051 { 00052 targetPatchNumber = 1; 00053 Serr << "Target patch not present. " << endl; 00054 } 00055 else 00056 { 00057 Serr << "Target patch name: " << patches[targetPatchNumber].name() 00058 << endl; 00059 } 00060 00061 patchToPatchInterpolation interPatch 00062 ( 00063 planePatch, 00064 patches[targetPatchNumber].patch() 00065 ); 00066 00067 00068 PrimitivePatchInterpolation 00069 < 00070 PrimitivePatch<face, List, const pointField&> 00071 > planePatchInter 00072 ( 00073 planePatch 00074 ); 00075 00076 PrimitivePatchInterpolation 00077 < 00078 PrimitivePatch<face, List, const pointField&> 00079 > toPatchInter 00080 ( 00081 patches[targetPatchNumber].patch() 00082 );