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
@ -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()],
@ -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
\*---------------------------------------------------------------------------*/
@ -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

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