BUG: singleCellFvMesh : locally (but not globally) zero sized patches

This commit is contained in:
mattijs
2010-10-06 16:20:55 +01:00
parent 04c5454b21
commit dfbcf6eb46

View File

@ -42,24 +42,26 @@ void Foam::singleCellFvMesh::agglomerateMesh
const polyBoundaryMesh& oldPatches = mesh.boundaryMesh(); const polyBoundaryMesh& oldPatches = mesh.boundaryMesh();
// Check agglomeration within patch face range and continuous // Check agglomeration within patch face range and continuous
labelList nAgglom(oldPatches.size()); labelList nAgglom(oldPatches.size(), 0);
forAll(oldPatches, patchI) forAll(oldPatches, patchI)
{ {
const polyPatch& pp = oldPatches[patchI]; const polyPatch& pp = oldPatches[patchI];
if (pp.size() > 0)
nAgglom[patchI] = max(agglom[patchI])+1;
forAll(pp, i)
{ {
if (agglom[patchI][i] < 0 || agglom[patchI][i] >= pp.size()) nAgglom[patchI] = max(agglom[patchI])+1;
forAll(pp, i)
{ {
FatalErrorIn if (agglom[patchI][i] < 0 || agglom[patchI][i] >= pp.size())
( {
"singleCellFvMesh::agglomerateMesh(..)" FatalErrorIn
) << "agglomeration on patch " << patchI (
<< " is out of range 0.." << pp.size()-1 "singleCellFvMesh::agglomerateMesh(..)"
<< exit(FatalError); ) << "agglomeration on patch " << patchI
<< " is out of range 0.." << pp.size()-1
<< exit(FatalError);
}
} }
} }
} }
@ -155,6 +157,8 @@ void Foam::singleCellFvMesh::agglomerateMesh
forAll(oldPatches, patchI) forAll(oldPatches, patchI)
{ {
patchStarts[patchI] = coarseI;
const polyPatch& pp = oldPatches[patchI]; const polyPatch& pp = oldPatches[patchI];
if (pp.size() > 0) if (pp.size() > 0)
@ -170,8 +174,6 @@ void Foam::singleCellFvMesh::agglomerateMesh
// From agglomeration to compact patch face // From agglomeration to compact patch face
labelList agglomToFace(nAgglom[patchI], -1); labelList agglomToFace(nAgglom[patchI], -1);
patchStarts[patchI] = coarseI;
forAll(pp, i) forAll(pp, i)
{ {
label myAgglom = agglom[patchI][i]; label myAgglom = agglom[patchI][i];
@ -223,9 +225,9 @@ void Foam::singleCellFvMesh::agglomerateMesh
); );
} }
} }
patchSizes[patchI] = coarseI-patchStarts[patchI];
} }
patchSizes[patchI] = coarseI-patchStarts[patchI];
} }
//Pout<< "patchStarts:" << patchStarts << endl; //Pout<< "patchStarts:" << patchStarts << endl;