diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C index c38bdfa81460e34272015938303cd5672159e954..043ea1558d4098b31e5e92e3bce6469b24420c82 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C @@ -33,11 +33,8 @@ License template<class Type> Foam::scalar Foam::dynamicIndexedOctree<Type>::perturbTol_ = 10*SMALL; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Does bb intersect a sphere around sample? Or is any corner point of bb -// closer than nearestDistSqr to sample. template<class Type> bool Foam::dynamicIndexedOctree<Type>::overlaps ( @@ -80,8 +77,6 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps } -// Does bb intersect a sphere around sample? Or is any corner point of bb -// closer than nearestDistSqr to sample. template<class Type> bool Foam::dynamicIndexedOctree<Type>::overlaps ( @@ -139,12 +134,6 @@ bool Foam::dynamicIndexedOctree<Type>::overlaps } -// -// Construction helper routines -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// - -// Split list of indices into 8 bins template<class Type> void Foam::dynamicIndexedOctree<Type>::divide ( @@ -186,7 +175,6 @@ void Foam::dynamicIndexedOctree<Type>::divide } -// Subdivide the (content) node. template<class Type> typename Foam::dynamicIndexedOctree<Type>::node Foam::dynamicIndexedOctree<Type>::divide @@ -330,15 +318,16 @@ void Foam::dynamicIndexedOctree<Type>::recursiveSubDivision } -// Pre-calculates wherever possible the volume status per node/subnode. -// Recurses to determine status of lowest level boxes. Level above is -// combination of octants below. template<class Type> Foam::volumeType Foam::dynamicIndexedOctree<Type>::calcVolumeType ( const label nodeI ) const { + // Pre-calculates wherever possible the volume status per node/subnode. + // Recurses to determine status of lowest level boxes. Level above is + // combination of octants below. + const node& nod = nodes_[nodeI]; volumeType myType = volumeType::UNKNOWN; @@ -477,12 +466,6 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getSide } -// -// Query routines -// ~~~~~~~~~~~~~~ -// - -// Find nearest point starting from nodeI template<class Type> void Foam::dynamicIndexedOctree<Type>::findNearest ( @@ -554,7 +537,6 @@ void Foam::dynamicIndexedOctree<Type>::findNearest } -// Find nearest point to line. template<class Type> void Foam::dynamicIndexedOctree<Type>::findNearest ( @@ -645,8 +627,6 @@ Foam::treeBoundBox Foam::dynamicIndexedOctree<Type>::subBbox } -// Takes a bb and a point on/close to the edge of the bb and pushes the point -// inside by a small fraction. template<class Type> Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint ( @@ -655,6 +635,9 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint const bool pushInside ) { + // Takes a bb and a point on/close to the edge of the bb and pushes the + // point inside by a small fraction. + // Get local length scale. const vector perturbVec = perturbTol_*bb.span(); @@ -716,8 +699,6 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint } -// Takes a bb and a point on the edge of the bb and pushes the point -// outside by a small fraction. template<class Type> Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint ( @@ -727,6 +708,9 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint const bool pushInside ) { + // Takes a bb and a point on the edge of the bb and pushes the point + // outside by a small fraction. + // Get local length scale. const vector perturbVec = perturbTol_*bb.span(); @@ -828,9 +812,6 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint } -// Guarantees that if pt is on a face it gets perturbed so it is away -// from the face edges. -// If pt is not on a face does nothing. template<class Type> Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace ( @@ -988,205 +969,6 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace } -//// Takes a bb and a point on the outside of the bb. Checks if on multiple -// faces -//// and if so perturbs point so it is only on one face. -//template<class Type> -//void Foam::dynamicIndexedOctree<Type>::checkMultipleFaces -//( -// const treeBoundBox& bb, -// const vector& dir, // end-start -// pointIndexHit& faceHitInfo, -// direction& faceID -//) -//{ -// // Do the quick elimination of no or one face. -// if -// ( -// (faceID == 0) -// || (faceID == treeBoundBox::LEFTBIT) -// || (faceID == treeBoundBox::RIGHTBIT) -// || (faceID == treeBoundBox::BOTTOMBIT) -// || (faceID == treeBoundBox::TOPBIT) -// || (faceID == treeBoundBox::BACKBIT) -// || (faceID == treeBoundBox::FRONTBIT) -// ) -// { -// return; -// } -// -// -// // Check the direction of vector w.r.t. faces being intersected. -// FixedList<scalar, 6> inproducts(-GREAT); -// -// direction nFaces = 0; -// -// if (faceID & treeBoundBox::LEFTBIT) -// { -// inproducts[treeBoundBox::LEFT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::LEFT] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::RIGHTBIT) -// { -// inproducts[treeBoundBox::RIGHT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::RIGHT] -// & dir -// ); -// nFaces++; -// } -// -// if (faceID & treeBoundBox::BOTTOMBIT) -// { -// inproducts[treeBoundBox::BOTTOM] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::BOTTOM] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::TOPBIT) -// { -// inproducts[treeBoundBox::TOP] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::TOP] -// & dir -// ); -// nFaces++; -// } -// -// if (faceID & treeBoundBox::BACKBIT) -// { -// inproducts[treeBoundBox::BACK] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::BACK] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::FRONTBIT) -// { -// inproducts[treeBoundBox::FRONT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::FRONT] -// & dir -// ); -// nFaces++; -// } -// -// if (nFaces == 0 || nFaces == 1 || nFaces > 3) -// { -// FatalErrorInFunction -// << "Problem : nFaces:" << nFaces << abort(FatalError); -// } -// -// // Keep point on most perpendicular face; shift it away from the aligned -// // ones. -// // E.g. line hits top and left face: -// // a -// // ----+----+ -// // | | -// // | | -// // +----+ -// // Shift point down (away from top): -// // -// // a+----+ -// // ----| | -// // | | -// // +----+ -// -// label maxIndex = -1; -// scalar maxInproduct = -GREAT; -// -// for (direction i = 0; i < 6; i++) -// { -// if (inproducts[i] > maxInproduct) -// { -// maxInproduct = inproducts[i]; -// maxIndex = i; -// } -// } -// -// if (maxIndex == -1) -// { -// FatalErrorInFunction -// << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts -// << abort(FatalError); -// } -// -// const point oldPoint(faceHitInfo.rawPoint()); -// const direction oldFaceID = faceID; -// -// // 1. Push point into bb, away from all corners -// -// faceHitInfo.rawPoint() = pushPoint(bb, oldFaceID, oldPoint, true); -// -// // 2. Snap it back onto the preferred face -// -// if (maxIndex == treeBoundBox::LEFT) -// { -// faceHitInfo.rawPoint().x() = bb.min().x(); -// faceID = treeBoundBox::LEFTBIT; -// } -// else if (maxIndex == treeBoundBox::RIGHT) -// { -// faceHitInfo.rawPoint().x() = bb.max().x(); -// faceID = treeBoundBox::RIGHTBIT; -// } -// else if (maxIndex == treeBoundBox::BOTTOM) -// { -// faceHitInfo.rawPoint().y() = bb.min().y(); -// faceID = treeBoundBox::BOTTOMBIT; -// } -// else if (maxIndex == treeBoundBox::TOP) -// { -// faceHitInfo.rawPoint().y() = bb.max().y(); -// faceID = treeBoundBox::TOPBIT; -// } -// else if (maxIndex == treeBoundBox::BACK) -// { -// faceHitInfo.rawPoint().z() = bb.min().z(); -// faceID = treeBoundBox::BACKBIT; -// } -// else if (maxIndex == treeBoundBox::FRONT) -// { -// faceHitInfo.rawPoint().z() = bb.max().z(); -// faceID = treeBoundBox::FRONTBIT; -// } -// -// Pout<< "From ray:" << dir -// << " from point:" << oldPoint -// << " on faces:" << faceString(oldFaceID) -// << " of bb:" << bb -// << " with inprods:" << inproducts -// << " maxIndex:" << maxIndex << endl -// << "perturbed to point:" << faceHitInfo.rawPoint() -// << " on face:" << faceString(faceID) -// << endl; -// -// -// if (debug) -// { -// if (faceID != bb.faceBits(faceHitInfo.rawPoint())) -// { -// FatalErrorInFunction -// << "Pushed point from " << oldPoint -// << " on face:" << oldFaceID << " of bb:" << bb << endl -// << "onto " << faceHitInfo.rawPoint() -// << " on face:" << faceID -// << " which is not consistent with geometric face " -// << bb.faceBits(faceHitInfo.rawPoint()) -// << abort(FatalError); -// } -// } -//} - - -// Get parent node and octant. Return false if top of tree reached. template<class Type> bool Foam::dynamicIndexedOctree<Type>::walkToParent ( @@ -1233,10 +1015,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToParent } -// Walk tree to neighbouring node. Gets current position as -// node and octant in this node and walks in the direction given by -// the facePointBits (combination of treeBoundBox::LEFTBIT, TOPBIT etc.) -// Returns false if edge of tree hit. + template<class Type> bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour ( @@ -1246,6 +1025,11 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour direction& octant ) const { + // Walk tree to neighbouring node. Gets current position as node and octant + // in this node and walks in the direction given by the facePointBits + // (combination of treeBoundBox::LEFTBIT, TOPBIT etc.) Returns false if + // edge of tree hit. + label oldNodeI = nodeI; direction oldOctant = octant; @@ -1521,12 +1305,6 @@ Foam::word Foam::dynamicIndexedOctree<Type>::faceString } -// Traverse a node. If intersects a triangle return first intersection point: -// hitInfo.index = index of shape -// hitInfo.point = point on shape -// Else return a miss and the bounding box face hit: -// hitInfo.point = coordinate of intersection of ray with bounding box -// hitBits = posbits of point on bounding box template<class Type> void Foam::dynamicIndexedOctree<Type>::traverseNode ( @@ -1689,7 +1467,6 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode } -// Find first intersection template<class Type> Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine ( @@ -1877,7 +1654,6 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine } -// Find first intersection template<class Type> Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine ( @@ -2218,7 +1994,6 @@ void Foam::dynamicIndexedOctree<Type>::findNear } -// Number of elements in node. template<class Type> Foam::label Foam::dynamicIndexedOctree<Type>::countElements ( @@ -2406,7 +2181,6 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findNearest } -// Find nearest intersection template<class Type> Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine ( @@ -2418,7 +2192,6 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine } -// Find nearest intersection template<class Type> Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLineAny ( @@ -2467,7 +2240,6 @@ Foam::labelList Foam::dynamicIndexedOctree<Type>::findSphere } -// Find node (as parent+octant) containing point template<class Type> Foam::labelBits Foam::dynamicIndexedOctree<Type>::findNode ( @@ -2571,7 +2343,6 @@ const Foam::labelList& Foam::dynamicIndexedOctree<Type>::findIndices } -// Determine type (inside/outside/mixed) per node. template<class Type> Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType ( @@ -2885,7 +2656,6 @@ Foam::label Foam::dynamicIndexedOctree<Type>::removeIndex } -// Print contents of nodeI template<class Type> void Foam::dynamicIndexedOctree<Type>::print ( @@ -2985,7 +2755,6 @@ void Foam::dynamicIndexedOctree<Type>::writeTreeInfo() const } -// Print contents of nodeI template<class Type> bool Foam::dynamicIndexedOctree<Type>::write(Ostream& os) const { diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H index c54493d5ef9c15c3e6a7d0cf78b6f046ecb35ea1..8017a943fb5945fd81a4ea992e4ba48647d0024b 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H @@ -206,17 +206,6 @@ private: label& nLevels ); -// static label compactContents -// ( -// DynamicList<node>& nodes, -// DynamicList<labelList>& contents, -// const label compactLevel, -// const label nodeI, -// const label level, -// List<labelList>& compactedContents, -// label& compactI -// ); - //- Determine inside/outside per node (mixed if cannot be // determined). Only valid for closed shapes. volumeType calcVolumeType(const label nodeI) const; @@ -266,7 +255,7 @@ private: ); //- Helper: take point on face(s) of bb and push it away from - // edges of face. + // edges of face. If pt is not on a face does nothing. static point pushPointIntoFace ( const treeBoundBox& bb, @@ -274,16 +263,8 @@ private: const point& pt ); - ////- Push point on multiple faces away from any corner/edge. - //static void checkMultipleFaces - //( - // const treeBoundBox& bb, - // const vector& dir, // end-start - // pointIndexHit& faceHitInfo, - // direction& faceID - //); - //- Walk to parent of node+octant. + // Return false if top of tree reached. bool walkToParent ( const label nodeI, diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C index 4eca98a81359179a1b41e759d978addbe31c50b7..94f1b6f02e1f1574adf651f703274d65d5d00d92 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C @@ -65,7 +65,6 @@ Foam::volumeType Foam::dynamicTreeDataPoint::getVolumeType } -// Check if any point on shape is inside cubeBb. bool Foam::dynamicTreeDataPoint::overlaps ( const label index, @@ -76,7 +75,6 @@ bool Foam::dynamicTreeDataPoint::overlaps } -// Check if any point on shape is inside sphere. bool Foam::dynamicTreeDataPoint::overlaps ( const label index, @@ -97,8 +95,6 @@ bool Foam::dynamicTreeDataPoint::overlaps } -// Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex, -// nearestPoint. void Foam::dynamicTreeDataPoint::findNearest ( const labelUList& indices, diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 3e2968117a7dac73640d7956664c94137cd28a22..4d79eef6951006cb8fc2d667b2eb8ea53e063e24 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -37,8 +37,6 @@ Foam::scalar Foam::indexedOctree<Type>::perturbTol_ = 10*SMALL; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Does bb intersect a sphere around sample? Or is any corner point of bb -// closer than nearestDistSqr to sample. template<class Type> bool Foam::indexedOctree<Type>::overlaps ( @@ -54,8 +52,6 @@ bool Foam::indexedOctree<Type>::overlaps } -// Does bb intersect a sphere around sample? Or is any corner point of bb -// closer than nearestDistSqr to sample. template<class Type> bool Foam::indexedOctree<Type>::overlaps ( @@ -113,12 +109,6 @@ bool Foam::indexedOctree<Type>::overlaps } -// -// Construction helper routines -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// - -// Split list of indices into 8 bins template<class Type> void Foam::indexedOctree<Type>::divide ( @@ -161,7 +151,6 @@ void Foam::indexedOctree<Type>::divide } -// Subdivide the (content) node. template<class Type> typename Foam::indexedOctree<Type>::node Foam::indexedOctree<Type>::divide @@ -231,7 +220,6 @@ Foam::indexedOctree<Type>::divide } -// Split any contents node with more than minSize elements. template<class Type> void Foam::indexedOctree<Type>::splitNodes ( @@ -284,8 +272,6 @@ void Foam::indexedOctree<Type>::splitNodes } -// Reorder contents to be in same order as nodes. Returns number of nodes on -// the compactLevel. template<class Type> Foam::label Foam::indexedOctree<Type>::compactContents ( @@ -353,15 +339,16 @@ Foam::label Foam::indexedOctree<Type>::compactContents } -// Pre-calculates wherever possible the volume status per node/subnode. -// Recurses to determine status of lowest level boxes. Level above is -// combination of octants below. template<class Type> Foam::volumeType Foam::indexedOctree<Type>::calcVolumeType ( const label nodeI ) const { + // Pre-calculates wherever possible the volume status per node/subnode. + // Recurses to determine status of lowest level boxes. Level above is + // combination of octants below. + const node& nod = nodes_[nodeI]; volumeType myType = volumeType::UNKNOWN; @@ -497,13 +484,6 @@ Foam::volumeType Foam::indexedOctree<Type>::getSide } -// -// Query routines -// ~~~~~~~~~~~~~~ -// - - -// Find nearest point starting from nodeI template<class Type> template<class FindNearestOp> void Foam::indexedOctree<Type>::findNearest @@ -580,7 +560,6 @@ void Foam::indexedOctree<Type>::findNearest } -// Find nearest point to line. template<class Type> template<class FindNearestOp> void Foam::indexedOctree<Type>::findNearest @@ -676,8 +655,6 @@ Foam::treeBoundBox Foam::indexedOctree<Type>::subBbox } -// Takes a bb and a point on/close to the edge of the bb and pushes the point -// inside by a small fraction. template<class Type> Foam::point Foam::indexedOctree<Type>::pushPoint ( @@ -747,8 +724,6 @@ Foam::point Foam::indexedOctree<Type>::pushPoint } -// Takes a bb and a point on the edge of the bb and pushes the point -// outside by a small fraction. template<class Type> Foam::point Foam::indexedOctree<Type>::pushPoint ( @@ -859,9 +834,6 @@ Foam::point Foam::indexedOctree<Type>::pushPoint } -// Guarantees that if pt is on a face it gets perturbed so it is away -// from the face edges. -// If pt is not on a face does nothing. template<class Type> Foam::point Foam::indexedOctree<Type>::pushPointIntoFace ( @@ -1019,205 +991,6 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace } -//// Takes a bb and a point on the outside of the bb. Checks if on multiple -// faces -//// and if so perturbs point so it is only on one face. -//template<class Type> -//void Foam::indexedOctree<Type>::checkMultipleFaces -//( -// const treeBoundBox& bb, -// const vector& dir, // end-start -// pointIndexHit& faceHitInfo, -// direction& faceID -//) -//{ -// // Do the quick elimination of no or one face. -// if -// ( -// (faceID == 0) -// || (faceID == treeBoundBox::LEFTBIT) -// || (faceID == treeBoundBox::RIGHTBIT) -// || (faceID == treeBoundBox::BOTTOMBIT) -// || (faceID == treeBoundBox::TOPBIT) -// || (faceID == treeBoundBox::BACKBIT) -// || (faceID == treeBoundBox::FRONTBIT) -// ) -// { -// return; -// } -// -// -// // Check the direction of vector w.r.t. faces being intersected. -// FixedList<scalar, 6> inproducts(-GREAT); -// -// direction nFaces = 0; -// -// if (faceID & treeBoundBox::LEFTBIT) -// { -// inproducts[treeBoundBox::LEFT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::LEFT] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::RIGHTBIT) -// { -// inproducts[treeBoundBox::RIGHT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::RIGHT] -// & dir -// ); -// nFaces++; -// } -// -// if (faceID & treeBoundBox::BOTTOMBIT) -// { -// inproducts[treeBoundBox::BOTTOM] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::BOTTOM] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::TOPBIT) -// { -// inproducts[treeBoundBox::TOP] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::TOP] -// & dir -// ); -// nFaces++; -// } -// -// if (faceID & treeBoundBox::BACKBIT) -// { -// inproducts[treeBoundBox::BACK] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::BACK] -// & dir -// ); -// nFaces++; -// } -// if (faceID & treeBoundBox::FRONTBIT) -// { -// inproducts[treeBoundBox::FRONT] = mag -// ( -// treeBoundBox::faceNormals[treeBoundBox::FRONT] -// & dir -// ); -// nFaces++; -// } -// -// if (nFaces == 0 || nFaces == 1 || nFaces > 3) -// { -// FatalErrorInFunction -// << "Problem : nFaces:" << nFaces << abort(FatalError); -// } -// -// // Keep point on most perpendicular face; shift it away from the aligned -// // ones. -// // E.g. line hits top and left face: -// // a -// // ----+----+ -// // | | -// // | | -// // +----+ -// // Shift point down (away from top): -// // -// // a+----+ -// // ----| | -// // | | -// // +----+ -// -// label maxIndex = -1; -// scalar maxInproduct = -GREAT; -// -// for (direction i = 0; i < 6; i++) -// { -// if (inproducts[i] > maxInproduct) -// { -// maxInproduct = inproducts[i]; -// maxIndex = i; -// } -// } -// -// if (maxIndex == -1) -// { -// FatalErrorInFunction -// << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts -// << abort(FatalError); -// } -// -// const point oldPoint(faceHitInfo.rawPoint()); -// const direction oldFaceID = faceID; -// -// // 1. Push point into bb, away from all corners -// -// faceHitInfo.rawPoint() = pushPoint(bb, oldFaceID, oldPoint, true); -// -// // 2. Snap it back onto the preferred face -// -// if (maxIndex == treeBoundBox::LEFT) -// { -// faceHitInfo.rawPoint().x() = bb.min().x(); -// faceID = treeBoundBox::LEFTBIT; -// } -// else if (maxIndex == treeBoundBox::RIGHT) -// { -// faceHitInfo.rawPoint().x() = bb.max().x(); -// faceID = treeBoundBox::RIGHTBIT; -// } -// else if (maxIndex == treeBoundBox::BOTTOM) -// { -// faceHitInfo.rawPoint().y() = bb.min().y(); -// faceID = treeBoundBox::BOTTOMBIT; -// } -// else if (maxIndex == treeBoundBox::TOP) -// { -// faceHitInfo.rawPoint().y() = bb.max().y(); -// faceID = treeBoundBox::TOPBIT; -// } -// else if (maxIndex == treeBoundBox::BACK) -// { -// faceHitInfo.rawPoint().z() = bb.min().z(); -// faceID = treeBoundBox::BACKBIT; -// } -// else if (maxIndex == treeBoundBox::FRONT) -// { -// faceHitInfo.rawPoint().z() = bb.max().z(); -// faceID = treeBoundBox::FRONTBIT; -// } -// -// Pout<< "From ray:" << dir -// << " from point:" << oldPoint -// << " on faces:" << faceString(oldFaceID) -// << " of bb:" << bb -// << " with inprods:" << inproducts -// << " maxIndex:" << maxIndex << endl -// << "perturbed to point:" << faceHitInfo.rawPoint() -// << " on face:" << faceString(faceID) -// << endl; -// -// -// if (debug) -// { -// if (faceID != bb.faceBits(faceHitInfo.rawPoint())) -// { -// FatalErrorInFunction -// << "Pushed point from " << oldPoint -// << " on face:" << oldFaceID << " of bb:" << bb << endl -// << "onto " << faceHitInfo.rawPoint() -// << " on face:" << faceID -// << " which is not consistent with geometric face " -// << bb.faceBits(faceHitInfo.rawPoint()) -// << abort(FatalError); -// } -// } -//} - - -// Get parent node and octant. Return false if top of tree reached. template<class Type> bool Foam::indexedOctree<Type>::walkToParent ( @@ -1264,10 +1037,6 @@ bool Foam::indexedOctree<Type>::walkToParent } -// Walk tree to neighbouring node. Gets current position as -// node and octant in this node and walks in the direction given by -// the facePointBits (combination of treeBoundBox::LEFTBIT, TOPBIT etc.) -// Returns false if edge of tree hit. template<class Type> bool Foam::indexedOctree<Type>::walkToNeighbour ( @@ -1277,6 +1046,10 @@ bool Foam::indexedOctree<Type>::walkToNeighbour direction& octant ) const { + // Gets current position as node and octant in this node and walks in the + // direction given by the facePointBits (combination of + // treeBoundBox::LEFTBIT, TOPBIT etc.) Returns false if edge of tree hit. + label oldNodeI = nodeI; direction oldOctant = octant; @@ -1552,12 +1325,6 @@ Foam::word Foam::indexedOctree<Type>::faceString } -// Traverse a node. If intersects a triangle return first intersection point: -// hitInfo.index = index of shape -// hitInfo.point = point on shape -// Else return a miss and the bounding box face hit: -// hitInfo.point = coordinate of intersection of ray with bounding box -// hitBits = posbits of point on bounding box template<class Type> template<class FindIntersectOp> void Foam::indexedOctree<Type>::traverseNode @@ -1577,6 +1344,14 @@ void Foam::indexedOctree<Type>::traverseNode const FindIntersectOp& fiOp ) const { + // Traverse a node. If intersects a triangle return first intersection + // point: + // hitInfo.index = index of shape + // hitInfo.point = point on shape + // Else return a miss and the bounding box face hit: + // hitInfo.point = coordinate of intersection of ray with bounding box + // hitBits = posbits of point on bounding box + if (debug) { const treeBoundBox octantBb(subBbox(nodeI, octant)); @@ -1718,7 +1493,6 @@ void Foam::indexedOctree<Type>::traverseNode } -// Find first intersection template<class Type> template<class FindIntersectOp> Foam::pointIndexHit Foam::indexedOctree<Type>::findLine @@ -1911,7 +1685,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine } -// Find first intersection template<class Type> template<class FindIntersectOp> Foam::pointIndexHit Foam::indexedOctree<Type>::findLine @@ -2255,7 +2028,6 @@ void Foam::indexedOctree<Type>::findNear } -// Number of elements in node. template<class Type> Foam::label Foam::indexedOctree<Type>::countElements ( @@ -2550,27 +2322,6 @@ Foam::scalar& Foam::indexedOctree<Type>::perturbTol() } -//template<class Type> -//bool Foam::indexedOctree<Type>::findAnyOverlap -//( -// const point& sample, -// const scalar startDistSqr -//) const -//{ -// if (nodes_.size()) -// { -// return findAnyOverlap -// ( -// 0, -// sample, -// startDistSqr -// ); -// } -// -// return false; -//} - - template<class Type> Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest ( @@ -2672,7 +2423,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest } -// Find nearest intersection template<class Type> Foam::pointIndexHit Foam::indexedOctree<Type>::findLine ( @@ -2690,7 +2440,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine } -// Find nearest intersection template<class Type> Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny ( @@ -2708,7 +2457,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny } -// Find nearest intersection template<class Type> template<class FindIntersectOp> Foam::pointIndexHit Foam::indexedOctree<Type>::findLine @@ -2722,7 +2470,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine } -// Find nearest intersection template<class Type> template<class FindIntersectOp> Foam::pointIndexHit Foam::indexedOctree<Type>::findLineAny @@ -2773,7 +2520,6 @@ Foam::labelList Foam::indexedOctree<Type>::findSphere } -// Find node (as parent+octant) containing point template<class Type> Foam::labelBits Foam::indexedOctree<Type>::findNode ( @@ -2874,7 +2620,6 @@ const Foam::labelList& Foam::indexedOctree<Type>::findIndices } -// Determine type (inside/outside/mixed) per node. template<class Type> Foam::volumeType Foam::indexedOctree<Type>::getVolumeType ( @@ -2886,13 +2631,6 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType return volumeType::UNKNOWN; } -// // If the sample is not within the octree, then have to query shapes -// // directly -// if (!nodes_[0].bb_.contains(sample)) -// { -// return volumeType(shapes_.getVolumeType(*this, sample)); -// } - if (nodeTypes_.size() != 8*nodes_.size()) { // Calculate type for every octant of node. @@ -2975,7 +2713,6 @@ void Foam::indexedOctree<Type>::findNear } -// Print contents of nodeI template<class Type> void Foam::indexedOctree<Type>::print ( @@ -3049,7 +2786,6 @@ void Foam::indexedOctree<Type>::print } -// Print contents of nodeI template<class Type> bool Foam::indexedOctree<Type>::write(Ostream& os) const { diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H index e0ead6cf009629d7ed2adacbaa1f817704ad4518..0fb024f2d182688ce4ffab7c6e3b8d23e9e4a2a1 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H @@ -181,6 +181,8 @@ private: DynamicList<labelList>& contents ) const; + //- Reorder contents to be in same order as nodes. + // Returns number of nodes on the compactLevel. static label compactContents ( DynamicList<node>& nodes, @@ -245,6 +247,9 @@ private: //- Helper: take point on face(s) of bb and push it away from // edges of face. + // Guarantees that if pt is on a face it gets perturbed + // so it is away from the face edges. + // If pt is not on a face does nothing. static point pushPointIntoFace ( const treeBoundBox& bb, @@ -252,15 +257,6 @@ private: const point& pt ); - ////- Push point on multiple faces away from any corner/edge. - //static void checkMultipleFaces - //( - // const treeBoundBox& bb, - // const vector& dir, // end-start - // pointIndexHit& faceHitInfo, - // direction& faceID - //); - //- Walk to parent of node+octant. bool walkToParent ( diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H index 6f32f291a6237ce20662d1154ad537f27761e338..c9f6aefe814e23ce23af811787c0c67a8f3e92d4 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,6 +64,8 @@ class IOdictionary // Private Member Functions //- Read dictionary from file + // Parallel aware reading, using non-virtual type information + // (typeName instead of type()) because of use in constructor. void readFile(const bool); diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C index d18a0e29342d0b46926698453f11ef0db1dcb218..99204510075356de769f1c3755bb68e2c3c5d39f 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,8 +28,6 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Parallel aware reading, using non-virtual type information (typeName instead -// of type()) because of use in constructor. void Foam::IOdictionary::readFile(const bool masterOnly) { if (Pstream::master() || !masterOnly) diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Istream.C b/src/OpenFOAM/db/IOstreams/IOstreams/Istream.C index 06dcc9200e849085f6cf296d40f955bdb9bcadb2..25ee28e005574b0cfc9dfa2b531fca4f34c3185b 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Istream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Istream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,8 +83,6 @@ bool Foam::Istream::peekBack(token& t) } -// Functions for reading object delimiters ( ... ) - Foam::Istream& Foam::Istream::readBegin(const char* funcName) { token delimiter(*this); @@ -126,8 +124,6 @@ Foam::Istream& Foam::Istream::readEndBegin(const char* funcName) } -// Functions for reading List delimiters ( ... ) or { ... } - char Foam::Istream::readBeginList(const char* funcName) { token delimiter(*this); diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C index 26515263364c6a88351098aa16285f2f0bcf7ac3..ab95c8c19f5a6789afff1e5480b53c18d4da2926 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,6 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Decrement the indent level void Foam::Ostream::decrIndent() { if (indentLevel_ == 0) @@ -46,16 +45,12 @@ void Foam::Ostream::decrIndent() } -// Write keyType -// write regular expression as quoted string -// write plain word as word (unquoted) Foam::Ostream& Foam::Ostream::write(const keyType& kw) { return writeQuoted(kw, kw.isPattern()); } -// Write the keyword followed by appropriate indentation Foam::Ostream& Foam::Ostream::writeKeyword(const keyType& kw) { indent(); diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H index bf808f25783d5f52a4930b19ac81209bb8153cb3..aada0b4f9a1b5784c9428528a7ed19cda83fb363 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,6 +109,8 @@ public: virtual Ostream& write(const word&) = 0; //- Write keyType + // write regular expression as quoted string + // write plain word as word (unquoted) virtual Ostream& write(const keyType&); //- Write string diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index 6a332a1f4edd8db7a3ea96e269a752c8d13462af..af61a05dec36e80eee4b61577d46c79a25a8e3b0 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -115,7 +115,6 @@ Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::calcLinearComm } -// Append my children (and my children children etc.) to allReceives. void Foam::UPstream::collectReceives ( const label procID, @@ -123,6 +122,8 @@ void Foam::UPstream::collectReceives DynamicList<label>& allReceives ) { + // Append my children (and my children children etc.) to allReceives. + const DynamicList<label>& myChildren = receives[procID]; forAll(myChildren, childI) @@ -133,37 +134,38 @@ void Foam::UPstream::collectReceives } -// Tree like schedule. For 8 procs: -// (level 0) -// 0 receives from 1 -// 2 receives from 3 -// 4 receives from 5 -// 6 receives from 7 -// (level 1) -// 0 receives from 2 -// 4 receives from 6 -// (level 2) -// 0 receives from 4 -// -// The sends/receives for all levels are collected per processor (one send per -// processor; multiple receives possible) creating a table: -// -// So per processor: -// proc receives from sends to -// ---- ------------- -------- -// 0 1,2,4 - -// 1 - 0 -// 2 3 0 -// 3 - 2 -// 4 5 0 -// 5 - 4 -// 6 7 4 -// 7 - 6 Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::calcTreeComm ( label nProcs ) { + // Tree like schedule. For 8 procs: + // (level 0) + // 0 receives from 1 + // 2 receives from 3 + // 4 receives from 5 + // 6 receives from 7 + // (level 1) + // 0 receives from 2 + // 4 receives from 6 + // (level 2) + // 0 receives from 4 + // + // The sends/receives for all levels are collected per processor + // (one send per processor; multiple receives possible) creating a table: + // + // So per processor: + // proc receives from sends to + // ---- ------------- -------- + // 0 1,2,4 - + // 1 - 0 + // 2 3 0 + // 3 - 2 + // 4 5 0 + // 5 - 4 + // 6 7 4 + // 7 - 6 + label nLevels = 1; while ((1 << nLevels) < nProcs) { @@ -378,29 +380,22 @@ Foam::label Foam::UPstream::procNo // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -// By default this is not a parallel run bool Foam::UPstream::parRun_(false); -// Free communicators Foam::LIFOStack<Foam::label> Foam::UPstream::freeComms_; -// My processor number Foam::DynamicList<int> Foam::UPstream::myProcNo_(10); -// List of process IDs Foam::DynamicList<Foam::List<int>> Foam::UPstream::procIDs_(10); -// Parent communicator Foam::DynamicList<Foam::label> Foam::UPstream::parentCommunicator_(10); -// Standard transfer message type int Foam::UPstream::msgType_(1); -// Linear communication schedule + Foam::DynamicList<Foam::List<Foam::UPstream::commsStruct>> Foam::UPstream::linearCommunication_(10); -// Multi level communication schedule Foam::DynamicList<Foam::List<Foam::UPstream::commsStruct>> Foam::UPstream::treeCommunication_(10); @@ -415,10 +410,6 @@ Foam::UPstream::communicator serialComm ); - -// Should compact transfer be used in which floats replace doubles -// reducing the bandwidth requirement at the expense of some loss -// in accuracy bool Foam::UPstream::floatTransfer ( Foam::debug::optimisationSwitch("floatTransfer", 0) @@ -430,8 +421,6 @@ registerOptSwitch Foam::UPstream::floatTransfer ); -// Number of processors at which the reduce algorithm changes from linear to -// tree int Foam::UPstream::nProcsSimpleSum ( Foam::debug::optimisationSwitch("nProcsSimpleSum", 16) @@ -443,7 +432,6 @@ registerOptSwitch Foam::UPstream::nProcsSimpleSum ); -// Default commsType Foam::UPstream::commsTypes Foam::UPstream::defaultCommsType ( commsTypeNames.read(Foam::debug::optimisationSwitches().lookup("commsType")) @@ -483,15 +471,10 @@ namespace Foam addcommsTypeToOpt addcommsTypeToOpt_("commsType"); } -// Default communicator Foam::label Foam::UPstream::worldComm(0); - -// Warn for use of any communicator Foam::label Foam::UPstream::warnComm(-1); - -// Number of polling cycles in processor updates int Foam::UPstream::nPollProcInterfaces ( Foam::debug::optimisationSwitch("nPollProcInterfaces", 0) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 615f9a6fb5c0f10a08fed14c27db080091a0bc25..67450666d262a29403b18bebd8a8ebbd63049c7c 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -181,17 +181,30 @@ private: // Private data + //- By default this is not a parallel run static bool parRun_; + + //- Standard transfer message type static int msgType_; // Communicator specific data + //- Free communicators static LIFOStack<label> freeComms_; + + //- My processor number static DynamicList<int> myProcNo_; + + //- List of process IDs static DynamicList<List<int>> procIDs_; + + //- Parent communicator static DynamicList<label> parentCommunicator_; + //- Linear communication schedule static DynamicList<List<commsStruct>> linearCommunication_; + + //- Multi level communication schedule static DynamicList<List<commsStruct>> treeCommunication_; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C b/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C index 48036e7c522a64084c08533fc81284125660be17..323dc8d3c3d1fde75913057fa6f1d2ecf3aca4ba 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,15 +38,10 @@ Description #include "IOstreams.H" #include "contiguous.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class T, class CombineOp> -void Pstream::combineGather +void Foam::Pstream::combineGather ( const List<UPstream::commsStruct>& comms, T& Value, @@ -140,7 +135,7 @@ void Pstream::combineGather template <class T, class CombineOp> -void Pstream::combineGather +void Foam::Pstream::combineGather ( T& Value, const CombineOp& cop, @@ -174,7 +169,7 @@ void Pstream::combineGather template<class T> -void Pstream::combineScatter +void Foam::Pstream::combineScatter ( const List<UPstream::commsStruct>& comms, T& Value, @@ -255,7 +250,7 @@ void Pstream::combineScatter template <class T> -void Pstream::combineScatter +void Foam::Pstream::combineScatter ( T& Value, const int tag, @@ -273,12 +268,8 @@ void Pstream::combineScatter } -// Same thing but for whole list at a time -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - template<class T, class CombineOp> -void Pstream::listCombineGather +void Foam::Pstream::listCombineGather ( const List<UPstream::commsStruct>& comms, List<T>& Values, @@ -379,7 +370,7 @@ void Pstream::listCombineGather template<class T, class CombineOp> -void Pstream::listCombineGather +void Foam::Pstream::listCombineGather ( List<T>& Values, const CombineOp& cop, @@ -413,7 +404,7 @@ void Pstream::listCombineGather template<class T> -void Pstream::listCombineScatter +void Foam::Pstream::listCombineScatter ( const List<UPstream::commsStruct>& comms, List<T>& Values, @@ -494,7 +485,7 @@ void Pstream::listCombineScatter template <class T> -void Pstream::listCombineScatter +void Foam::Pstream::listCombineScatter ( List<T>& Values, const int tag, @@ -524,14 +515,8 @@ void Pstream::listCombineScatter } - - -// Same thing but for sparse list (map) -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - template<class Container, class CombineOp> -void Pstream::mapCombineGather +void Foam::Pstream::mapCombineGather ( const List<UPstream::commsStruct>& comms, Container& Values, @@ -598,7 +583,7 @@ void Pstream::mapCombineGather template<class Container, class CombineOp> -void Pstream::mapCombineGather +void Foam::Pstream::mapCombineGather ( Container& Values, const CombineOp& cop, @@ -632,7 +617,7 @@ void Pstream::mapCombineGather template<class Container> -void Pstream::mapCombineScatter +void Foam::Pstream::mapCombineScatter ( const List<UPstream::commsStruct>& comms, Container& Values, @@ -683,7 +668,7 @@ void Pstream::mapCombineScatter template <class Container> -void Pstream::mapCombineScatter +void Foam::Pstream::mapCombineScatter ( Container& Values, const int tag, @@ -713,8 +698,4 @@ void Pstream::mapCombineScatter } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index 1cfabe128c10b0beabda496bbf2866c23e26d73e..94cf60f4fb25151d105b00ea6d5ef085c3a2ab07 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -579,7 +579,6 @@ Foam::Istream& Foam::ISstream::read(string& str) } -// Special handling of '{' in variables Foam::Istream& Foam::ISstream::readVariable(string& str) { static const int maxLen = 1024; diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C index 2d35ae119394817ba332724d30f7baa7d6e6e4c2..0feb8353408fcdd80c6f71b98ec9da6ea0d333dc 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,7 +249,6 @@ void Foam::OSstream::flush() } -// Add carriage return and flush stream void Foam::OSstream::endl() { write('\n'); @@ -257,14 +256,12 @@ void Foam::OSstream::endl() } -// Get flags of output stream std::ios_base::fmtflags Foam::OSstream::flags() const { return os_.flags(); } -// Set flags of output stream std::ios_base::fmtflags Foam::OSstream::flags(const ios_base::fmtflags f) { return os_.flags(f); @@ -273,26 +270,24 @@ std::ios_base::fmtflags Foam::OSstream::flags(const ios_base::fmtflags f) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Get width of output field int Foam::OSstream::width() const { return os_.width(); } -// Set width of output field (and return old width) + int Foam::OSstream::width(const int w) { return os_.width(w); } -// Get precision of output field + int Foam::OSstream::precision() const { return os_.precision(); } -// Set precision of output field (and return old precision) + int Foam::OSstream::precision(const int p) { return os_.precision(p); diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index da9a9807c376d7f5efea7246e151fe60ac4fadf2..b0b147465bd6f212a9eac18705b60f7a88574f72 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -754,7 +754,6 @@ Foam::word Foam::Time::timeName() const } -// Search the construction path for times Foam::instantList Foam::Time::times() const { return findTimes(path(), constant()); @@ -795,7 +794,7 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const { instantList timeDirs = findTimes(path(), constant()); - // there is only one time (likely "constant") so return it + // There is only one time (likely "constant") so return it if (timeDirs.size() == 1) { return timeDirs[0]; @@ -827,16 +826,6 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const } -// This should work too, -// if we don't worry about checking "constant" explicitly -// -// Foam::instant Foam::Time::findClosestTime(const scalar t) const -// { -// instantList timeDirs = findTimes(path(), constant()); -// label timeIndex = min(findClosestTimeIndex(timeDirs, t), 0, constant()); -// return timeDirs[timeIndex]; -// } - Foam::label Foam::Time::findClosestTimeIndex ( const instantList& timeDirs, diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C index 90d196ac6ef6736d5fb977baa1c4b97993138553..7ca86cc7aab991c5dc4fd773c4a9dc9aa8f2b77d 100644 --- a/src/OpenFOAM/db/error/messageStream.C +++ b/src/OpenFOAM/db/error/messageStream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,6 @@ License int Foam::messageStream::level(Foam::debug::debugSwitch("level", 2)); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Foam::messageStream::messageStream @@ -239,7 +238,6 @@ Foam::messageStream::operator Foam::OSstream&() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Global messageStream definitions Foam::messageStream Foam::SeriousError ( diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 5a239f5642d06cdace7f3cb16d918cd55e66eaa7..b2447447d14f6c4eae498f3b78f430059a0ab5ce 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -63,7 +63,6 @@ registerOptSwitch const Foam::NamedEnum<Foam::regIOobject::fileCheckTypes, 4> Foam::regIOobject::fileCheckTypesNames; -// Default fileCheck type Foam::regIOobject::fileCheckTypes Foam::regIOobject::fileModificationChecking ( fileCheckTypesNames.read @@ -117,7 +116,6 @@ bool Foam::regIOobject::masterOnlyReading = false; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from IOobject Foam::regIOobject::regIOobject(const IOobject& io, const bool isTime) : IOobject(io), @@ -140,7 +138,6 @@ Foam::regIOobject::regIOobject(const IOobject& io, const bool isTime) } -// Construct as copy Foam::regIOobject::regIOobject(const regIOobject& rio) : IOobject(rio), @@ -154,8 +151,6 @@ Foam::regIOobject::regIOobject(const regIOobject& rio) } -// Construct as copy, and transfering objectRegistry registration to copy -// if registerCopy is true Foam::regIOobject::regIOobject(const regIOobject& rio, bool registerCopy) : IOobject(rio), @@ -216,7 +211,6 @@ Foam::regIOobject::regIOobject // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -// Delete read stream, checkout from objectRegistry and destroy Foam::regIOobject::~regIOobject() { if (objectRegistry::debug) diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C index 69a2ecb50aae60455658a9e25dfd4b5fd91541c3..220b7256c678745e90a1f44e55766d2da6d538bb 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C @@ -729,9 +729,6 @@ Foam::dimensioned<Type> Foam::operator/ } -// Products -// ~~~~~~~~ - #define PRODUCT_OPERATOR(product, op, opFunc) \ \ template<class Type1, class Type2> \ diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 4739e3fa3cfc03aaf9dd1286d92a0f9373758f62..4a7569bc019b0739690bfb0301d66c394f329602 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -229,7 +229,6 @@ Foam::Field<Type>::Field(const UList<Type>& list) {} -// Construct as copy of tmp<Field> #ifndef NoConstructFromTmp template<class Type> Foam::Field<Type>::Field(const tmp<Field<Type>>& tf) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 88fc8b81d2b5d2e6ca35a8442b5e9522d82c4fec..717f7d609f3166b083cc2600e9fb2f32b5ff1ee7 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -359,11 +359,6 @@ GeometricBoundaryField } -// Construct as copy -// Dangerous because Field may be set to a field which gets deleted. -// Need new type of GeometricBoundaryField, one which IS part of a geometric -// field for which snGrad etc. may be called and a free standing -// GeometricBoundaryField for which such operations are unavailable. template<class Type, template<class> class PatchField, class GeoMesh> Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField:: GeometricBoundaryField @@ -631,7 +626,6 @@ operator= } -// Forced assignments template<class Type, template<class> class PatchField, class GeoMesh> void Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField:: operator== diff --git a/src/OpenFOAM/fields/ReadFields/ReadFields.C b/src/OpenFOAM/fields/ReadFields/ReadFields.C index ab7779f28a46bcb5967d8594886a30327b3a20a5..a76ca79a8ecd42d62702779811f4683882b959ca 100644 --- a/src/OpenFOAM/fields/ReadFields/ReadFields.C +++ b/src/OpenFOAM/fields/ReadFields/ReadFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,8 +30,6 @@ License // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // -// Read all fields of type. Returns names of fields read. Guarantees all -// processors to read fields in same order. template<class GeoField, class Mesh> Foam::wordList Foam::ReadFields ( diff --git a/src/OpenFOAM/fields/ReadFields/ReadFields.H b/src/OpenFOAM/fields/ReadFields/ReadFields.H index 5d6e9db570efa21ead746ff27bb93e159745ba4f..eb246701bddea7b3686e507c7ff0adfd0e04e2a0 100644 --- a/src/OpenFOAM/fields/ReadFields/ReadFields.H +++ b/src/OpenFOAM/fields/ReadFields/ReadFields.H @@ -46,6 +46,8 @@ namespace Foam class IOobjectList; //- Helper routine to read fields +// Reads all fields of type. Returns names of fields read. Guarantees all +// processors to read fields in same order. template<class GeoField, class Mesh> wordList ReadFields ( diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C index d72d22b81af25743259c0649ce82be8aa26a266e..c22c91f79df3f3e16c31068cb530d83b1f8c08ca 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C @@ -225,7 +225,6 @@ void Foam::valuePointPatchField<Type>::operator= } -// Force an assignment template<class Type> void Foam::valuePointPatchField<Type>::operator== ( diff --git a/src/OpenFOAM/global/JobInfo/JobInfo.C b/src/OpenFOAM/global/JobInfo/JobInfo.C index a37ae7613af49aabf713aff20372f98fe8d9227b..7d17218841fc67b5226a97c7c1bd17264a0d7953 100644 --- a/src/OpenFOAM/global/JobInfo/JobInfo.C +++ b/src/OpenFOAM/global/JobInfo/JobInfo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,6 @@ Foam::JobInfo Foam::jobInfo; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Null constructor Foam::JobInfo::JobInfo() : runningJobPath_(), diff --git a/src/OpenFOAM/graph/curve/curve.C b/src/OpenFOAM/graph/curve/curve.C index 738179a77792937704d9843125f163773c95c2a8..aadff19fce167ec6241625446f8015d5bb444fc4 100644 --- a/src/OpenFOAM/graph/curve/curve.C +++ b/src/OpenFOAM/graph/curve/curve.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,76 +24,11 @@ License \*---------------------------------------------------------------------------*/ #include "curve.H" -//#include "curveTools.H" #include "Ostream.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// construct as interpolation -/* -curve::curve(const curve& Curve, const label nFacets) -: - Name("Interpolated" + Curve.Name), - Style(Curve.Style), - X(2*nFacets), - Y(2*nFacets) -{ - // Calculate curve length - scalar curveLength=0; - label i; - for (i=0; i<Curve.size()-1; i++) - { - curveLength += distance(Curve[i], Curve[i+1]); - } - - scalar stepLength = curveLength/nFacets; - label nPoints = 0; - label previous=0, next=1; - bool endOfCurve; - vector presentPoint=Curve[0], nextPoint; - - do - { - endOfCurve = - stepForwardsToNextPoint - ( - presentPoint, - nextPoint, - previous, - next, - stepLength, - Curve - ); - - if (!endOfCurve) - { - if (nPoints >= size()-1) - { - setSize(label(1.5*size())); - } - - presentPoint = nextPoint; - - x()[nPoints] = nextPoint.x(); - y()[nPoints] = nextPoint.y(); - - nPoints++; - } - - } while (!endOfCurve); - - setSize(nPoints); -} -*/ - - -// construct given name, style and size -curve::curve +Foam::curve::curve ( const string& name, const curveStyle& style, @@ -106,8 +41,7 @@ curve::curve {} -// construct from the bits -curve::curve +Foam::curve::curve ( const string& name, const curveStyle& style, @@ -120,45 +54,9 @@ curve::curve {} -// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // - -// Gradient operation -/* -curve grad(const curve& Curve) -{ - curve gradCurve(Curve); - - label i; - for (i=1; i<Curve.size()-1; i++) - { - scalar deltaIm1 = Curve[i].x() - Curve[i-1].x(); - scalar deltaI = Curve[i+1].x() - Curve[i].x(); - - scalar deltaAv = 1.0/deltaIm1 + 1.0/deltaI; - - gradCurve.y()[i] = - ( - (Curve[i+1].y() - Curve[i].y())/sqr(deltaI) - + (Curve[i].y() - Curve[i-1].y())/sqr(deltaIm1) - )/deltaAv; - } - - gradCurve.y()[0] = - (Curve[1].y() - Curve[0].y())/(Curve[1].x() - Curve[0].x()); - - label n = Curve.size()-1; - - gradCurve.y()[n] = - (Curve[n].y() - Curve[n-1].y())/(Curve[n].x() - Curve[n-1].x()); - - return gradCurve; -} -*/ - - // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // -Ostream& operator<<(Ostream& os, const curve& c) +Foam::Ostream& Foam::operator<<(Ostream& os, const curve& c) { os << nl << c.name_ << nl @@ -171,8 +69,4 @@ Ostream& operator<<(Ostream& os, const curve& c) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C index 3f5d9baba144045640f66598e34e14a0566c7cd2..3324e9af3cd9fe3beddcd21f13628fac651c486b 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C @@ -105,7 +105,6 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::clearOut() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template<class FromPatch, class ToPatch> PatchToPatchInterpolation<FromPatch, ToPatch>::PatchToPatchInterpolation ( diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C index ec6aba8a09ab772e658b7cbc40b3775169c4c1f1..3937f9cb1ed18a96c9614d7952290b60884673c2 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.C +++ b/src/OpenFOAM/matrices/Matrix/Matrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -194,7 +194,6 @@ void Foam::Matrix<Form, Type>::operator=(const Type& t) } -// Assignment operator. Takes linear time. template<class Form, class Type> void Foam::Matrix<Form, Type>::operator=(const Matrix<Form, Type>& a) { diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C index b7cb0153c501424666d66e5bb7765e5dfcebfeb2..091b6b2695d3927ba11d97aba8e9b198f494fa2a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -215,7 +215,6 @@ const Foam::labelUList& Foam::lduAddressing::losortStartAddr() const } -// Return edge index given owner and neighbour label Foam::label Foam::lduAddressing::triIndex(const label a, const label b) const { label own = min(a, b); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/procFacesGAMGProcAgglomeration/procFacesGAMGProcAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/procFacesGAMGProcAgglomeration/procFacesGAMGProcAgglomeration.C index 31eb6fdc88df885d53b7322a7dbf639212907d05..ddd79ad6ab003b4d5d18c3a6aa2a77cab7442d1a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/procFacesGAMGProcAgglomeration/procFacesGAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/procFacesGAMGProcAgglomeration/procFacesGAMGProcAgglomeration.C @@ -49,7 +49,6 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Create single cell mesh Foam::autoPtr<Foam::lduPrimitiveMesh> Foam::procFacesGAMGProcAgglomeration::singleCellMesh ( diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C index e12be87d61dd3395018d5d65a3fdf49ea8b09932..d472b98deda52d74e254183c1ed7b617e323e774 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C @@ -193,7 +193,6 @@ void Foam::GAMGSolver::agglomerateMatrix } -// Agglomerate only the interface coefficients. void Foam::GAMGSolver::agglomerateInterfaceCoefficients ( const label fineLevelIndex, @@ -279,8 +278,6 @@ void Foam::GAMGSolver::agglomerateInterfaceCoefficients } -// Gather matrices. -// Note: matrices get constructed with dummy mesh void Foam::GAMGSolver::gatherMatrices ( const labelList& procIDs, diff --git a/src/OpenFOAM/meshes/ProcessorTopology/ProcessorTopology.C b/src/OpenFOAM/meshes/ProcessorTopology/ProcessorTopology.C index b6f3824543fd4f0fa7e991caf45ad1ed01a1a05c..678194dd24327bdb6e17d670bfafc6e5801540bd 100644 --- a/src/OpenFOAM/meshes/ProcessorTopology/ProcessorTopology.C +++ b/src/OpenFOAM/meshes/ProcessorTopology/ProcessorTopology.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,7 +103,6 @@ Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components template<class Container, class ProcPatch> Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology ( diff --git a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C index c7992b78236f415d89d57b97390637000beddd50..67911ea21d734d107c729d9329a4814a4c7aa78a 100644 --- a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C +++ b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C @@ -35,7 +35,7 @@ License namespace Foam { -defineTypeNameAndDebug(commSchedule, 0); + defineTypeNameAndDebug(commSchedule, 0); } @@ -62,7 +62,6 @@ Foam::label Foam::commSchedule::outstandingComms // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from separate addressing Foam::commSchedule::commSchedule ( const label nProcs, diff --git a/src/OpenFOAM/meshes/bandCompression/bandCompression.C b/src/OpenFOAM/meshes/bandCompression/bandCompression.C index 6a74fdf58a45b367fc0f5c73fae8e48bdde55d28..339938fb7c03ed2d9743ca9a36ffba956b08b913 100644 --- a/src/OpenFOAM/meshes/bandCompression/bandCompression.C +++ b/src/OpenFOAM/meshes/bandCompression/bandCompression.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,6 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Constructor from components Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing) { labelList newOrder(cellCellAddressing.size()); diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C index 5d7ff59ba897d448404b3099191debe0cef8d70b..5a048dc0e345869d14a235e33e746a9ff82c5b60 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,6 @@ Foam::cellMatcher::cellMatcher // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Create localFaces_ , pointMap_ , faceMap_ Foam::label Foam::cellMatcher::calcLocalFaces ( const faceList& faces, @@ -136,7 +135,6 @@ Foam::label Foam::cellMatcher::calcLocalFaces } -// Create edgeFaces_ : map from edge to two localFaces for single cell. void Foam::cellMatcher::calcEdgeAddressing(const label numVert) { edgeFaces_ = -1; @@ -186,7 +184,6 @@ void Foam::cellMatcher::calcEdgeAddressing(const label numVert) } -// Create pointFaceIndex_ : map from vertI, faceI to index of vertI on faceI. void Foam::cellMatcher::calcPointFaceIndex() { // Fill pointFaceIndex_ with -1 @@ -215,7 +212,6 @@ void Foam::cellMatcher::calcPointFaceIndex() } -// Given edge(v0,v1) and (local)faceI return the other face Foam::label Foam::cellMatcher::otherFace ( const label numVert, diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/pyrMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/pyrMatcher.C index 55bf92e7c083f5cc176ae3628aa177a0bd906d9f..68278af08b9e41aaa84e5b2d38e6c0762cb7a4b1 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/pyrMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/pyrMatcher.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,6 @@ const Foam::label Foam::pyrMatcher::maxVertPerFace = 4; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct null Foam::pyrMatcher::pyrMatcher() : cellMatcher @@ -49,14 +48,15 @@ Foam::pyrMatcher::pyrMatcher() maxVertPerFace, "pyr" ) -{ -} +{} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::pyrMatcher::~pyrMatcher() {} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::pyrMatcher::matchShape diff --git a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C index c43aa0abaf6b2679ec28670266f457dda0440a61..1cfd988d7f6bfb1e0e75d6132664984173fee6d9 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C +++ b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,9 +85,6 @@ Foam::cellModeller::~cellModeller() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -// Returns a pointer to a model which matches the string symbol -// supplied. A null pointer is returned if there is no suitable match. - const Foam::cellModel* Foam::cellModeller::lookup(const word& name) { HashTable<const cellModel*>::iterator iter = modelDictionary_.find(name); @@ -102,7 +99,5 @@ const Foam::cellModel* Foam::cellModeller::lookup(const word& name) } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/cellModeller/globalCellModeller.C b/src/OpenFOAM/meshes/meshShapes/cellModeller/globalCellModeller.C index 02787472f6c8810ef310a395421ea6f5b283a34b..04652de8883ab989c4f5bfb47e02022698870b38 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModeller/globalCellModeller.C +++ b/src/OpenFOAM/meshes/meshShapes/cellModeller/globalCellModeller.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,30 +32,23 @@ Description // * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * * // - -// PtrList of models Foam::PtrList<Foam::cellModel> Foam::cellModeller::models_ ( IFstream(findEtcFile("cellModels", true))() ); -// List of model pointers Foam::List<Foam::cellModel*> Foam::cellModeller::modelPtrs_; -// HashTable of model pointers Foam::HashTable<const Foam::cellModel*> Foam::cellModeller::modelDictionary_; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Construct a dummy cellModeller which reads the models and fills -// the above tables -cellModeller globalCellModeller_; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + // Construct a dummy cellModeller which reads the models and fills + // the above tables + cellModeller globalCellModeller_; +} // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.C b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.C index 45165056fdc51b88cf3f485e312cb44970394b3c..cb328fe9838f9448ba6a84542e118be4f273898b 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.C +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Remove duplicate vertices and reset correct cell model void Foam::cellShape::collapse() { operator=(degenerateMatcher::match(*this)); diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 4e9abeb033779395d716d1cf1a99592ec861870f..d4bf604b5ce51a6f29e1ffac73b69837fe6a5f46 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -819,7 +819,6 @@ int Foam::face::edgeDirection(const edge& e) const } -// Number of triangles directly known from number of vertices Foam::label Foam::face::nTriangles(const pointField&) const { return nTriangles(); diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C b/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C index 504feb5cf274bf37afaed8e8eeba36c68501f978..b49ad74fe10aa14fc65d170c427e146be02a7903 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,15 +29,16 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Calculate area in contact given displacement of vertices relative to -// the face plane. Positive displacement is above the face (no contact); -// negative is in contact Foam::scalar Foam::face::areaInContact ( const pointField& meshPoints, const scalarField& v ) const { + // Calculate area in contact given displacement of vertices relative to + // the face plane. Positive displacement is above the face (no contact); + // negative is in contact + // Assemble the vertex values const labelList& labels = *this; diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C index cb850491429c070de2b88dd9c9ddcc0bbfe065f3..eb730e70b24b022763c9ac2320a856b6f3daafb6 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,15 +30,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Return potential intersection with face with a ray starting -// at p, direction n (does not need to be normalized) -// Does face-center decomposition and returns triangle intersection -// point closest to p. - -// In case of miss the point is the nearest point intersection of the -// face plane and the ray and the distance is the distance between the -// intersection point and the nearest point on the face - Foam::pointHit Foam::face::ray ( const point& p, @@ -48,6 +39,15 @@ Foam::pointHit Foam::face::ray const intersection::direction dir ) const { + // Return potential intersection with face with a ray starting + // at p, direction n (does not need to be normalized) + // Does face-center decomposition and returns triangle intersection + // point closest to p. + + // In case of miss the point is the nearest point intersection of the + // face plane and the ray and the distance is the distance between the + // intersection point and the nearest point on the face + // If the face is a triangle, do a direct calculation if (size() == 3) { diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C index 51eaab0d25b37429af4e25a84a635ed5e5fb8e7f..2610376a34fc3b91c1c7851fa43ba66daa7c5509 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,9 +28,6 @@ License #include "pointMesh.H" #include "mapPolyMesh.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::pointMapper::calcAddressing() const @@ -161,7 +158,6 @@ void Foam::pointMapper::clearOut() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm) : pMesh_(pMesh), diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C index 1732a7ba0c043abd7cf7e3db69ea8dfa026a287d..b157ecbc2d2c035f6c0efa2639148ea025964e38 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,7 +109,6 @@ void Foam::pointPatchMapper::clearOut() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::pointPatchMapper::pointPatchMapper ( const pointPatch& patch, diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C index 2700e7fea93c845d2376f08c3218f33d30ff03a2..3a2200aa96dd258c752bdf7ad4c2e7568ddb419d 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,6 @@ namespace Foam defineTypeNameAndDebug(cyclicSlipPointPatch, 0); -// Add the patch constructor functions to the hash tables addToRunTimeSelectionTable ( facePointPatch, diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C index 085df988048288779f630b664d6f1844060cf6c0..3979ef17c0b1afc461a4046f17c93cc9f72dfb47 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,6 @@ namespace Foam defineTypeNameAndDebug(nonuniformTransformCyclicPointPatch, 0); -// Add the patch constructor functions to the hash tables addToRunTimeSelectionTable ( facePointPatch, diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/wall/wallPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/wall/wallPointPatch.C index 285e355931a8ec90b5fd82b7ebb6c3c579b70698..332e93837de948425766e03f949687ff6815cdad 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/wall/wallPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/wall/wallPointPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,6 @@ namespace Foam defineTypeNameAndDebug(wallPointPatch, 0); -// Add the patch constructor functions to the hash tables addToRunTimeSelectionTable ( facePointPatch, diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 59705a16e1cf06cd127e11f69610fd3559edfc67..26e369cff8f0532d15327970628a88b2efde2d9b 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -45,7 +45,6 @@ namespace Foam { defineTypeNameAndDebug(globalMeshData, 0); -// Geometric matching tolerance. Factor of mesh bounding box. const scalar globalMeshData::matchTol_ = 1e-8; template<> @@ -63,7 +62,6 @@ public: // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Collect processor patch addressing. void Foam::globalMeshData::initProcAddr() { processorPatchIndices_.setSize(mesh_.boundaryMesh().size()); @@ -251,7 +249,6 @@ void Foam::globalMeshData::calcSharedPoints() const } -// Given information about locally used edges allocate global shared edges. void Foam::globalMeshData::countSharedEdges ( const EdgeMap<labelList>& procSharedEdges, @@ -294,12 +291,13 @@ void Foam::globalMeshData::countSharedEdges } -// Shared edges are shared between multiple processors. By their nature both -// of their endpoints are shared points. (but not all edges using two shared -// points are shared edges! There might e.g. be an edge between two unrelated -// clusters of shared points) void Foam::globalMeshData::calcSharedEdges() const { + // Shared edges are shared between multiple processors. By their nature both + // of their endpoints are shared points. (but not all edges using two shared + // points are shared edges! There might e.g. be an edge between two + // unrelated clusters of shared points) + if ( nGlobalEdges_ != -1 @@ -806,8 +804,6 @@ void Foam::globalMeshData::calcGlobalPointEdges } -// Find transformation to take remotePoint to localPoint. Use info to find -// the transforms. Foam::label Foam::globalMeshData::findTransform ( const labelPairList& info, @@ -1199,8 +1195,6 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const } -// Calculate uncoupled boundary faces (without calculating -// primitiveMesh::pointFaces()) void Foam::globalMeshData::calcPointBoundaryFaces ( labelListList& pointBoundaryFaces @@ -1737,7 +1731,6 @@ void Foam::globalMeshData::calcGlobalCoPointSlaves() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from polyMesh Foam::globalMeshData::globalMeshData(const polyMesh& mesh) : processorTopology(mesh.boundaryMesh(), UPstream::worldComm), @@ -1820,7 +1813,6 @@ void Foam::globalMeshData::clearOut() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Return shared point global labels. const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const { if (!sharedPointGlobalLabelsPtr_.valid()) @@ -1871,7 +1863,6 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const } -// Collect coordinates of shared points. (does parallel communication!) Foam::pointField Foam::globalMeshData::sharedPoints() const { // Get all processors to send their shared points to master. @@ -1954,7 +1945,6 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const } -// Collect coordinates of shared points. (does parallel communication!) Foam::pointField Foam::globalMeshData::geometricSharedPoints() const { // Get coords of my shared points @@ -2728,7 +2718,6 @@ void Foam::globalMeshData::movePoints(const pointField& newPoints) } -// Update all data after morph void Foam::globalMeshData::updateMesh() { // Clear out old data diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index 53399ca8d2f49289d6035465e593bfceeaba3d4e..fa753427ec33826c63abc91e60d8ac9466b80d76 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -33,14 +33,12 @@ License namespace Foam { -defineTypeNameAndDebug(globalPoints, 0); + defineTypeNameAndDebug(globalPoints, 0); } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Total number of points on coupled patches. Is upper limit for number -// of shared points Foam::label Foam::globalPoints::countPatchPoints ( const polyBoundaryMesh& patches @@ -125,9 +123,6 @@ Foam::labelPairList Foam::globalPoints::addSendTransform } -// Collect all topological information about a point on a patch. -// (this information is the patch faces using the point and the relative -// position of the point in the face) void Foam::globalPoints::addToSend ( const polyPatch& pp, @@ -139,6 +134,10 @@ void Foam::globalPoints::addToSend DynamicList<labelPairList>& allInfo ) const { + // Collect all topological information about a point on a patch. (this + // information is the patch faces using the point and the relative position + // of the point in the face) + label meshPointI = pp.meshPoints()[patchPointI]; // Add all faces using the point so we are sure we find it on the @@ -160,8 +159,6 @@ void Foam::globalPoints::addToSend } -// Add nbrInfo to myInfo. Return true if anything changed. -// nbrInfo is for a point a list of all the global points using it bool Foam::globalPoints::mergeInfo ( const labelPairList& nbrInfo, @@ -169,6 +166,9 @@ bool Foam::globalPoints::mergeInfo labelPairList& myInfo ) const { + // Add nbrInfo to myInfo. Return true if anything changed. nbrInfo is for a + // point a list of all the global points using it + bool anyChanged = false; // Extend to make space for the nbrInfo (trimmed later) @@ -267,14 +267,15 @@ Foam::label Foam::globalPoints::localToMeshPoint } -// Updates database of current information on meshpoints with nbrInfo. -// Uses mergeInfo above. Returns true if data kept for meshPointI changed. bool Foam::globalPoints::mergeInfo ( const labelPairList& nbrInfo, const label localPointI ) { + // Updates database of current information on meshpoints with nbrInfo. Uses + // mergeInfo above. Returns true if data kept for meshPointI changed. + label infoChanged = false; // Get the index into the procPoints list. @@ -315,14 +316,15 @@ bool Foam::globalPoints::mergeInfo } -// Updates database of current information on meshpoints with nbrInfo. -// Uses mergeInfo above. Returns true if data kept for meshPointI changed. bool Foam::globalPoints::storeInitialInfo ( const labelPairList& nbrInfo, const label localPointI ) { + // Updates database of current information on meshpoints with nbrInfo. Uses + // mergeInfo above. Returns true if data kept for meshPointI changed. + label infoChanged = false; // Get the index into the procPoints list. @@ -387,7 +389,6 @@ void Foam::globalPoints::printProcPoints } -// Insert my own points into structure and mark as changed. void Foam::globalPoints::initOwnPoints ( const Map<label>& meshToPatchPoint, @@ -475,7 +476,6 @@ void Foam::globalPoints::initOwnPoints } -// Send all my info on changedPoints_ to my neighbours. void Foam::globalPoints::sendPatchPoints ( const bool mergeSeparated, @@ -563,11 +563,6 @@ void Foam::globalPoints::sendPatchPoints } -// Receive all my neighbours' information and merge with mine. -// After finishing will have updated -// - procPoints_ : all neighbour information merged in. -// - meshToProcPoint_ -// - changedPoints: all points for which something changed. void Foam::globalPoints::receivePatchPoints ( const bool mergeSeparated, @@ -577,6 +572,12 @@ void Foam::globalPoints::receivePatchPoints labelHashSet& changedPoints ) { + // Receive all my neighbours' information and merge with mine. + // After finishing will have updated + // - procPoints_ : all neighbour information merged in. + // - meshToProcPoint_ + // - changedPoints: all points for which something changed. + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const labelPairList& patchInfo = globalTransforms_.patchTransformSign(); @@ -721,14 +722,15 @@ void Foam::globalPoints::receivePatchPoints } -// Remove entries which are handled by normal face-face communication. I.e. -// those points where the equivalence list is only me and my (face)neighbour void Foam::globalPoints::remove ( const labelList& patchToMeshPoint, const Map<label>& directNeighbours ) { + // Remove entries which are handled by normal face-face communication. I.e. + // those points where the equivalence list is only me and my (face)neighbour + // Save old ones. Map<label> oldMeshToProcPoint(meshToProcPoint_.xfer()); meshToProcPoint_.resize(oldMeshToProcPoint.size()); @@ -1087,7 +1089,6 @@ void Foam::globalPoints::calculateSharedPoints // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from mesh Foam::globalPoints::globalPoints ( const polyMesh& mesh, @@ -1116,7 +1117,6 @@ Foam::globalPoints::globalPoints } -// Construct from mesh and patch of coupled faces Foam::globalPoints::globalPoints ( const polyMesh& mesh, diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C index ed8f78c259c4fa453d376518a70f782c56b045d5..d43410ec9d661f742942aa91c7bac2ba320ebe15 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -286,7 +286,6 @@ void Foam::cellMapper::clearOut() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::cellMapper::cellMapper(const mapPolyMesh& mpm) : mesh_(mpm.mesh()), diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C index 71ca27fa85168c758122075c17f7916cc03177b3..aa80be4c36a2e93b89a7f0d9d1efeea98f157d99 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,7 +201,6 @@ void Foam::faceMapper::clearOut() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceMapper::faceMapper(const mapPolyMesh& mpm) : mesh_(mpm.mesh()), diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapAddedPolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapAddedPolyMesh.C index 07ee3f874cc80c886103635d1c93fce706bd33dc..202eaeceb0d483cbc936ad18d2a01fc0975a9de6 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapAddedPolyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapAddedPolyMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,6 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::mapAddedPolyMesh::mapAddedPolyMesh ( const label nOldPoints, diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index 2624d9a6968c2547c4fa985b60123689234f5232..bbb4c0ceb88132a7fc25868a2d8474416727ef35 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -358,9 +358,6 @@ void Foam::mapDistribute::printLayout(Ostream& os) const } -// Construct per processor compact addressing of the global elements -// needed. The ones from the local processor are not included since -// these are always all needed. void Foam::mapDistribute::calcCompactAddressing ( const globalIndex& globalNumbering, diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index f209610e0f7607c6decfc79cfb238c0952c04996..072fe3f6c8bfa518638e9d3bca1a64733d2f1578 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -186,12 +186,16 @@ class mapDistribute const label receivedSize ); + //- Construct per processor compact addressing of the global elements + // needed. The ones from the local processor are not included since + // these are always all needed. void calcCompactAddressing ( const globalIndex& globalNumbering, const labelList& elements, List<Map<label>>& compactMap ) const; + void calcCompactAddressing ( const globalIndex& globalNumbering,