mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
src/OpenFOAM: Moved function documentation comments into .H files and removed duplicates
This commit is contained in:
@ -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
|
||||
{
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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_;
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -729,9 +729,6 @@ Foam::dimensioned<Type> Foam::operator/
|
||||
}
|
||||
|
||||
|
||||
// Products
|
||||
// ~~~~~~~~
|
||||
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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==
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -225,7 +225,6 @@ void Foam::valuePointPatchField<Type>::operator=
|
||||
}
|
||||
|
||||
|
||||
// Force an assignment
|
||||
template<class Type>
|
||||
void Foam::valuePointPatchField<Type>::operator==
|
||||
(
|
||||
|
||||
@ -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_(),
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -105,7 +105,6 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::clearOut()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
template<class FromPatch, class ToPatch>
|
||||
PatchToPatchInterpolation<FromPatch, ToPatch>::PatchToPatchInterpolation
|
||||
(
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -49,7 +49,6 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Create single cell mesh
|
||||
Foam::autoPtr<Foam::lduPrimitiveMesh>
|
||||
Foam::procFacesGAMGProcAgglomeration::singleCellMesh
|
||||
(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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_;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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()),
|
||||
|
||||
@ -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()),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user