ENH: baflfing: use consistent neighbouring cell centre

This commit is contained in:
mattijs
2013-05-03 09:56:45 +01:00
parent e0b972606b
commit 35b9d63645
2 changed files with 12 additions and 6 deletions

View File

@ -446,6 +446,7 @@ private:
// have corresponding faceZone.
void findCellZoneGeometric
(
const pointField& neiCc,
const labelList& closedNamedSurfaces,
labelList& namedSurfaceIndex,
const labelList& surfaceToCellZone,

View File

@ -1150,6 +1150,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
// Finds region per cell for cells inside closed named surfaces
void Foam::meshRefinement::findCellZoneGeometric
(
const pointField& neiCc,
const labelList& closedNamedSurfaces, // indices of closed surfaces
labelList& namedSurfaceIndex, // per face index of named surface
const labelList& surfaceToCellZone, // cell zone index per surface
@ -1232,7 +1233,9 @@ void Foam::meshRefinement::findCellZoneGeometric
}
else
{
const point& neiFc = mesh_.faceCentres()[faceI];
//const point& neiFc = mesh_.faceCentres()[faceI];
const point& neiFc = neiCc[faceI-mesh_.nInternalFaces()];
// Perturbed cc
const vector d = 1e-4*(neiFc - ownCc);
candidatePoints[nCandidates++] = ownCc-d;
@ -2568,6 +2571,12 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
// Swap neighbouring cell centres and cell level
labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
calcNeighbourData(neiLevel, neiCc);
// Mark faces intersecting zoned surfaces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -2579,11 +2588,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
// Statistics: number of faces per faceZone
labelList nSurfFaces(faceZoneNames.size(), 0);
// Swap neighbouring cell centres and cell level
labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
calcNeighbourData(neiLevel, neiCc);
// Note: for all internal faces? internal + coupled?
// Since zonify is run after baffling the surfaceIndex_ on baffles is
// not synchronised across both baffle faces. Fortunately we don't
@ -2748,6 +2752,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
findCellZoneGeometric
(
neiCc,
closedNamedSurfaces, // indices of closed surfaces
namedSurfaceIndex, // per face index of named surface
surfaceToCellZone, // cell zone index per surface