From bd4854d15e698d938c2e4d59c204a1d843bc087a Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 8 Jul 2011 12:06:08 +0100 Subject: [PATCH] Minor clean-up --- .../polyMesh/globalMeshData/globalMeshData.C | 41 ++++++++++++------- .../polyMesh/globalMeshData/globalMeshData.H | 6 +-- .../laplaceTetDecompositionMotionSolver.H | 2 +- .../addParallelPointPatchCellDecomp.C | 4 +- .../tetPolyBoundaryMeshCellDecomp.C | 5 ++- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 9da720900..fb34d12c5 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -43,7 +43,10 @@ License defineTypeNameAndDebug(Foam::globalMeshData, 0); // Geometric matching tolerance. Factor of mesh bounding box. -const Foam::scalar Foam::globalMeshData::matchTol_ = 1E-8; +const Foam::scalar Foam::globalMeshData::matchTol_ +( + debug::tolerances("globalMeshDataMatchTol", 1e-8) +); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -73,7 +76,6 @@ void Foam::globalMeshData::initProcAddr() } processorPatches_.setSize(nNeighbours); - if (Pstream::parRun()) { // Send indices of my processor patches to my neighbours @@ -96,7 +98,7 @@ void Foam::globalMeshData::initProcAddr() forAll(processorPatches_, i) { label patchi = processorPatches_[i]; - + IPstream fromNeighbour ( Pstream::blocking, @@ -105,7 +107,7 @@ void Foam::globalMeshData::initProcAddr() mesh_.boundaryMesh()[patchi] ).neighbProcNo() ); - + fromNeighbour >> processorPatchNeighbours_[patchi]; } } @@ -210,8 +212,8 @@ void Foam::globalMeshData::calcSharedEdges() const { // Found edge which uses shared points. Probably shared. - // Construct the edge in shared points (or rather global indices - // of the shared points) + // Construct the edge in shared points (or rather global + // indices of the shared points) edge sharedEdge ( sharedPtAddr[e0Fnd()], @@ -628,7 +630,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const OPstream toMaster(Pstream::blocking, Pstream::masterNo()); toMaster - << sharedPointAddr_ + << sharedPointAddr_ << UIndirectList(mesh_.points(), sharedPointLabels_)(); } @@ -728,7 +730,7 @@ void Foam::globalMeshData::updateMesh() // Note: boundBox does reduce bb_ = boundBox(mesh_.points()); - scalar tolDim = matchTol_ * bb_.mag(); + scalar tolDim = matchTol_*bb_.mag(); if (debug) { @@ -747,6 +749,7 @@ void Foam::globalMeshData::updateMesh() sharedPointLabels_ = parallelPoints.sharedPointLabels(); sharedPointAddr_ = parallelPoints.sharedPointAddr(); } + //// Option 2. Geometric //{ // // Calculate all shared points. This does all the hard work. @@ -837,22 +840,32 @@ void Foam::globalMeshData::updateMesh() label patchI = processorPatches_[i]; const processorPolyPatch& procPatch = - refCast(mesh_.boundaryMesh()[patchI]); + refCast + ( + mesh_.boundaryMesh()[patchI] + ); OPstream toNeighbour(Pstream::blocking, procPatch.neighbProcNo()); toNeighbour << procPatch.localPoints(); } - // Receive patch local points and uncount if coincident (and not shared) + // Receive patch local points and uncount if coincident and not shared forAll(processorPatches_, i) { label patchI = processorPatches_[i]; const processorPolyPatch& procPatch = - refCast(mesh_.boundaryMesh()[patchI]); + refCast + ( + mesh_.boundaryMesh()[patchI] + ); - IPstream fromNeighbour(Pstream::blocking, procPatch.neighbProcNo()); + IPstream fromNeighbour + ( + Pstream::blocking, + procPatch.neighbProcNo() + ); pointField nbrPoints(fromNeighbour); @@ -876,8 +889,8 @@ void Foam::globalMeshData::updateMesh() if (stat == UNSET) { - // Mark point as visited so if point is on multiple proc - // patches it only gets uncounted once. + // Mark point as visited so if point is on multipl + // e processor patches it only gets uncounted once pointStatus.set(meshPointI, VISITED); if (pMap[patchPointI] != -1) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index 0eeadf1a1..595fa5342 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -64,10 +64,8 @@ Description your first call to one of the access functions synchronous amongst all processors! - SourceFiles globalMeshData.C - globalMeshDataMorph.C \*---------------------------------------------------------------------------*/ @@ -297,7 +295,7 @@ public: // Processor patch addressing (be careful when not running in parallel) - //- Return list of processor patch labels + //- Return list of processor patch labels // (size of list = number of processor patches) const labelList& processorPatches() const { @@ -360,7 +358,7 @@ public: pointField sharedPoints() const; //- Like sharedPoints but keeps cyclic points separate. - // (does geometric merging; uses matchTol_*bb as merging tolerance) + // (does geometric merging; uses matchTol_*bb as merge tolerance) // Use sharedPoints() instead. pointField geometricSharedPoints() const; diff --git a/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.H b/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.H index 29d8aabbb..f79df053b 100644 --- a/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.H +++ b/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/tetDecompositionMotionSolver/laplace/laplaceTetDecompositionMotionSolver.H @@ -54,7 +54,7 @@ namespace Foam class motionDiff; /*---------------------------------------------------------------------------*\ - Class laplaceTetDecompositionMotionSolver Declaration + Class laplaceTetDecompositionMotionSolver Declaration \*---------------------------------------------------------------------------*/ class laplaceTetDecompositionMotionSolver diff --git a/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/addParallelPointPatchCellDecomp.C b/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/addParallelPointPatchCellDecomp.C index e7e5cad5e..c5ee6336b 100644 --- a/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/addParallelPointPatchCellDecomp.C +++ b/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/addParallelPointPatchCellDecomp.C @@ -56,7 +56,7 @@ public: for ( - typename SLList::const_iterator myObjectsIter = + typename SLList::const_iterator myObjectsIter = myObjects.begin(); myObjectsIter != myObjects.end(); ++myObjectsIter @@ -68,7 +68,7 @@ public: for ( - typename SLList::iterator globalObjectsIter = + typename SLList::iterator globalObjectsIter = globalObjects.begin(); globalObjectsIter != globalObjects.end(); ++globalObjectsIter diff --git a/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshCellDecomp.C b/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshCellDecomp.C index 59ec3e0ff..3b0e0ff96 100644 --- a/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshCellDecomp.C +++ b/src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/tetPolyBoundaryMesh/tetPolyBoundaryMeshCellDecomp.C @@ -91,7 +91,10 @@ tetPolyBoundaryMeshCellDecomp::globalPatch() const { if (isType(patches[patchI])) { - return refCast(patches[patchI]); + return refCast + ( + patches[patchI] + ); } }