diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C index fc0739e79faf42d048b133d79b2a97f572b99388..55f6a907676e7f241fd34c11befaa23a5de4332f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceOrthogonality // Coupled faces pointField neighbourCc; - syncTools::swapBoundaryCellList(mesh, cc, neighbourCc); + syncTools::swapBoundaryCellPositions(mesh, cc, neighbourCc); forAll(pbm, patchI) { @@ -123,7 +123,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness // (i.e. treat as if mirror cell on other side) pointField neighbourCc; - syncTools::swapBoundaryCellList(mesh, cellCtrs, neighbourCc); + syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neighbourCc); forAll(pbm, patchI) { diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C index 2d007ad9faf92fb439fd67bb3f897d914fdfc691..4326d43f38f3f33dd0f7ea35f86a7720e49ee2ac 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C @@ -27,6 +27,44 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +void Foam::syncTools::swapBoundaryCellPositions +( + const polyMesh& mesh, + const UList<point>& cellData, + List<point>& neighbourCellData +) +{ + if (cellData.size() != mesh.nCells()) + { + FatalErrorIn + ( + "syncTools<class T>::swapBoundaryCellPositions" + "(const polyMesh&, const UList<T>&, List<T>&)" + ) << "Number of cell values " << cellData.size() + << " is not equal to the number of cells in the mesh " + << mesh.nCells() << abort(FatalError); + } + + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + label nBnd = mesh.nFaces()-mesh.nInternalFaces(); + + neighbourCellData.setSize(nBnd); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + const labelUList& faceCells = pp.faceCells(); + forAll(faceCells, i) + { + label bFaceI = pp.start()+i-mesh.nInternalFaces(); + neighbourCellData[bFaceI] = cellData[faceCells[i]]; + } + } + syncTools::swapBoundaryFacePositions(mesh, neighbourCellData); +} + + Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) { PackedBoolList isMasterPoint(mesh.nPoints()); diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H index d089d04f9eaaf91baa1d76a3aad4606582160fe2..cb1484b3b0f7316358e021ddc31a5eb707545be1 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H @@ -442,18 +442,17 @@ public: } //- Swap coupled positions. - template<class T> static void swapBoundaryFacePositions ( const polyMesh& mesh, - UList<T>& l + UList<point>& l ) { syncBoundaryFaceList ( mesh, l, - eqOp<T>(), + eqOp<point>(), mapDistribute::transformPosition() ); } @@ -490,6 +489,14 @@ public: List<T>& neighbourCellData ); + //- Swap to obtain neighbour cell positions for all boundary faces + static void swapBoundaryCellPositions + ( + const polyMesh& mesh, + const UList<point>& cellData, + List<point>& neighbourCellData + ); + // Sparse versions //- Synchronize values on selected points. @@ -531,11 +538,11 @@ public: } //- Synchronize locations on selected edges. - template<class T, class CombineOp> + template<class CombineOp> static void syncEdgePositions ( const polyMesh& mesh, - EdgeMap<T>& l, + EdgeMap<point>& l, const CombineOp& cop ) { diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C index b91ec33b8285b7bbb31f417938d4c4dd810c1557..039e14555f8515fa01346f9cc2a643d563606bab 100644 --- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,7 +120,7 @@ void Foam::searchableSurfaceToFaceZone::applyToSet // Boundary faces vectorField nbrCellCentres; - syncTools::swapBoundaryCellList(mesh_, cc, nbrCellCentres); + syncTools::swapBoundaryCellPositions(mesh_, cc, nbrCellCentres); const polyBoundaryMesh& pbm = mesh_.boundaryMesh();