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

checkPatch.H

Go to the documentation of this file.
00001     if (bci != 0)
00002     {
00003         label bcIndex = bcIDs[bci];
00004         label regionIndex = 0;
00005 
00006         // Decompose moving faces into piston and valves using the idface array
00007         if (bci == 1)
00008         {
00009             if (kivaVersion == kiva3v)
00010             {
00011                 regionIndex = max
00012                 (
00013                     max(idface[quadFace[0]], idface[quadFace[1]]),
00014                     max(idface[quadFace[2]], idface[quadFace[3]])
00015                 );
00016 
00017                 if (regionIndex > 0)
00018                 {
00019                     bcIndex = VALVE;
00020                     regionIndex--;
00021                 }
00022             }
00023         }
00024 
00025         // Decompose fixed wall faces into cylinder-head and liner using
00026         // the fv array and split of the y=0 faces as a symmetry plane
00027         if (bci == 2)
00028         {
00029             if
00030             (
00031                 fv[quadFace[0]] == 6
00032              || fv[quadFace[1]] == 6
00033              || fv[quadFace[2]] == 6
00034              || fv[quadFace[3]] == 6
00035             )
00036             {
00037                 bcIndex = CYLINDERHEAD;
00038             }
00039 
00040             if
00041             (
00042                    mag(points[quadFace[0]].y()) < SMALL
00043                 && mag(points[quadFace[1]].y()) < SMALL
00044                 && mag(points[quadFace[2]].y()) < SMALL
00045                 && mag(points[quadFace[3]].y()) < SMALL
00046             )
00047             {
00048                 bcIndex = SYMMETRYPLANE;
00049             }
00050         }
00051 
00052         // Make the back part of the periodic boundary the second region
00053         // of the front part
00054         if (bci == 6)
00055         {
00056             bcIndex = WEDGE;
00057             regionIndex = 1;
00058         }
00059 
00060         if (regionIndex >= pFaces[bcIndex].size())
00061         {
00062             pFaces[bcIndex].setSize(regionIndex + 1);
00063         }
00064 
00065         quadFace[0] = pointMap[quadFace[0]];
00066         quadFace[1] = pointMap[quadFace[1]];
00067         quadFace[2] = pointMap[quadFace[2]];
00068         quadFace[3] = pointMap[quadFace[3]];
00069 
00070         label ti = 0;
00071         forAll (quadFace, i)
00072         {
00073             if (quadFace[i] != quadFace[(i+1)%4])
00074             {
00075                 triFace[(ti++)%3] = quadFace[i];
00076             }
00077         }
00078         
00079         if (ti == 4)
00080         {
00081             pFaces[bcIndex][regionIndex].append(quadFace);
00082         }
00083         else if (ti == 3)
00084         {
00085             pFaces[bcIndex][regionIndex].append(triFace);
00086         }
00087         // else the face has collapsed to an edge or point
00088     }
00089     else
00090     {
00091         FatalErrorIn(args.executable())
00092             << "bc not defined for active cell = " << i
00093             << exit(FatalError);
00094     }
00095 
00096 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines