FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

buildPatch.H

Go to the documentation of this file.
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(plane(planeToPatchDict), mesh);
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() << endl;
00058 }
00059 
00060 patchToPatchInterpolation interPatch
00061 (
00062     planePatch,
00063     patches[targetPatchNumber].patch()
00064 );
00065 
00066 
00067 PrimitivePatchInterpolation
00068 <
00069     PrimitivePatch<face, List, const pointField&>
00070 > planePatchInter
00071 (
00072     planePatch
00073 );
00074 
00075 
00076 PrimitivePatchInterpolation
00077 <
00078     PrimitivePatch<face, List, const pointField&>
00079 > toPatchInter
00080 (
00081     patches[targetPatchNumber].patch()
00082 );
00083 
00084 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines