Minor clean-up

This commit is contained in:
Hrvoje Jasak 2011-07-08 12:06:08 +01:00
parent 4ec36faa5e
commit bd4854d15e
5 changed files with 36 additions and 22 deletions

View file

@ -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<point>(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<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
refCast<const processorPolyPatch>
(
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<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
refCast<const processorPolyPatch>
(
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)

View file

@ -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;

View file

@ -54,7 +54,7 @@ namespace Foam
class motionDiff;
/*---------------------------------------------------------------------------*\
Class laplaceTetDecompositionMotionSolver Declaration
Class laplaceTetDecompositionMotionSolver Declaration
\*---------------------------------------------------------------------------*/
class laplaceTetDecompositionMotionSolver

View file

@ -56,7 +56,7 @@ public:
for
(
typename SLList<Type>::const_iterator myObjectsIter =
typename SLList<Type>::const_iterator myObjectsIter =
myObjects.begin();
myObjectsIter != myObjects.end();
++myObjectsIter
@ -68,7 +68,7 @@ public:
for
(
typename SLList<Type>::iterator globalObjectsIter =
typename SLList<Type>::iterator globalObjectsIter =
globalObjects.begin();
globalObjectsIter != globalObjects.end();
++globalObjectsIter

View file

@ -91,7 +91,10 @@ tetPolyBoundaryMeshCellDecomp::globalPatch() const
{
if (isType<globalTetPolyPatchCellDecomp>(patches[patchI]))
{
return refCast<const globalTetPolyPatchCellDecomp>(patches[patchI]);
return refCast<const globalTetPolyPatchCellDecomp>
(
patches[patchI]
);
}
}