BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / solvers / incompressible / boundaryFoam / interrogateWallPatches.H
blob7fd01f0e9ebbe9268f4270e12b4eb967bd30a4e5
1 // Search for wall patches faces and store normals
3 label faceId(-1);
4 label patchId(-1);
5 label nWallFaces(0);
6 vector wallNormal(vector::zero);
8 const fvPatchList& patches = mesh.boundary();
10 forAll(patches, patchi)
12     const fvPatch& currPatch = patches[patchi];
14     if (isA<wallFvPatch>(currPatch))
15     {
16         const vectorField nf(currPatch.nf());
18         forAll(nf, facei)
19         {
20             nWallFaces++;
22             if (nWallFaces == 1)
23             {
24                 wallNormal = -nf[facei];
25                 faceId = facei;
26                 patchId = patchi;
27             }
28             else if (nWallFaces == 2)
29             {
30                 const vector wallNormal2 = -nf[facei];
32                 //- Check that wall faces are parallel
33                 if
34                 (
35                     mag(wallNormal & wallNormal2) > 1.01
36                  || mag(wallNormal & wallNormal2) < 0.99
37                 )
38                 {
39                     FatalErrorIn(args.executable())
40                         << "wall faces are not parallel for patches "
41                         << patches[patchId].name() << " and "
42                         << currPatch.name() << nl
43                         << exit(FatalError);
44                 }
45             }
46             else
47             {
48                 FatalErrorIn(args.executable()) << "number of wall faces > 2"
49                     << nl << exit(FatalError);
50             }
51         }
52     }
55 if (nWallFaces == 0)
57     FatalErrorIn(args.executable()) << "No wall patches identified"
58         << exit(FatalError);
60 else
62     Info<< "Generating wall data for patch: " << patches[patchId].name()
63         << endl;
66 // store local id of near-walll cell to process
67 label cellId = patches[patchId].faceCells()[faceId];
69 // create position array for graph generation
70 scalarField y
72     wallNormal
73   & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId])
76 Info<< "    Height to first cell centre y0 = " << y[cellId] << endl;