diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index d9ec65959c..5cdab910ac 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -51,9 +51,6 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Repatches external face or creates baffle for internal face -// with user specified patches (might be different for both sides). -// Returns label of added face. Foam::label Foam::meshRefinement::createBaffle ( const label faceI, @@ -131,46 +128,6 @@ Foam::label Foam::meshRefinement::createBaffle } -//// Check if we are a boundary face and normal of surface does -//// not align with test vector. In this case there'd probably be -//// a freestanding 'baffle' so we might as well not create it. -//// Note that since it is not a proper baffle we cannot detect it -//// afterwards so this code cannot be merged with the -//// filterDuplicateFaces code. -//bool Foam::meshRefinement::validBaffleTopology -//( -// const label faceI, -// const vector& n1, -// const vector& n2, -// const vector& testDir -//) const -//{ -// -// label patchI = mesh_.boundaryMesh().whichPatch(faceI); -// if (patchI == -1 || mesh_.boundaryMesh()[patchI].coupled()) -// { -// return true; -// } -// else if (mag(n1&n2) > cos(degToRad(30))) -// { -// // Both normals aligned. Check that test vector perpendicularish to -// // surface normal -// scalar magTestDir = mag(testDir); -// if (magTestDir > VSMALL) -// { -// if (mag(n1&(testDir/magTestDir)) < cos(degToRad(45))) -// { -// //Pout<< "** disabling baffling face " -// // << mesh_.faceCentres()[faceI] << endl; -// return false; -// } -// } -// } -// return true; -//} - - -// Determine patches for baffles on all intersected unnamed faces void Foam::meshRefinement::getBafflePatches ( const labelList& globalToMasterPatch, @@ -385,11 +342,11 @@ Foam::Map Foam::meshRefinement::getZoneBafflePatches } } } + return bafflePatch; } -// Create baffle for every face where ownPatch != -1 Foam::autoPtr Foam::meshRefinement::createBaffles ( const labelList& ownPatch, @@ -509,6 +466,7 @@ Foam::autoPtr Foam::meshRefinement::createBaffles } } } + // Pick up neighbour side of baffle (added faces) forAll(faceMap, faceI) { @@ -535,7 +493,6 @@ Foam::autoPtr Foam::meshRefinement::createBaffles void Foam::meshRefinement::checkZoneFaces() const { const faceZoneMesh& fZones = mesh_.faceZones(); - const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); forAll(pbm, patchI) @@ -664,27 +621,26 @@ Foam::autoPtr Foam::meshRefinement::createZoneBaffles Info<< "Created " << nZoneFaces << " baffles in = " << mesh_.time().cpuTimeIncrement() << " s\n" << nl << endl; } + return map; } -// Extract those baffles (duplicate) faces that are on the edge of a baffle -// region. These are candidates for merging. -// Done by counting the number of baffles faces per mesh edge. If edge -// has 2 boundary faces and both are baffle faces it is the edge of a baffle -// region. Foam::List Foam::meshRefinement::freeStandingBaffles ( const List& couples, const scalar planarAngle ) const { + // Done by counting the number of baffles faces per mesh edge. If edge + // has 2 boundary faces and both are baffle faces it is the edge of a baffle + // region. + // All duplicate faces on edge of the patch are to be merged. // So we count for all edges of duplicate faces how many duplicate // faces use them. labelList nBafflesPerEdge(mesh_.nEdges(), 0); - // This algorithm is quite tricky. We don't want to use edgeFaces and // also want it to run in parallel so it is now an algorithm over // all (boundary) faces instead. @@ -698,10 +654,8 @@ Foam::List Foam::meshRefinement::freeStandingBaffles // So now any edge that is used by baffle faces only will have the // value 2*1000000+2*1. - const label baffleValue = 1000000; - // Count number of boundary faces per edge // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -729,11 +683,9 @@ Foam::List Foam::meshRefinement::freeStandingBaffles } } - DynamicList