Minor clean-up and documentation comments
This commit is contained in:
parent
079b436c58
commit
49cd83ac5d
25 changed files with 134 additions and 92 deletions
|
@ -52,7 +52,7 @@ Foam::IPstream::IPstream
|
|||
|
||||
MPI_Status status;
|
||||
|
||||
// If the buffer size is not specified, probe the incomming message
|
||||
// If the buffer size is not specified, probe the incoming message
|
||||
// and set it
|
||||
if (!bufSize)
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ Foam::label Foam::IPstream::read
|
|||
(
|
||||
"IPstream::read"
|
||||
"(const int fromProcNo, char* buf, std::streamsize bufSize)"
|
||||
) << "MPI_Recv cannot receive incomming message"
|
||||
) << "MPI_Recv cannot receive incoming message"
|
||||
<< Foam::abort(FatalError);
|
||||
|
||||
return 0;
|
||||
|
@ -127,7 +127,7 @@ Foam::label Foam::IPstream::read
|
|||
"IPstream::read"
|
||||
"(const int fromProcNo, char* buf, std::streamsize bufSize)"
|
||||
) << "buffer (" << label(bufSize)
|
||||
<< ") not large enough for incomming message ("
|
||||
<< ") not large enough for incoming message ("
|
||||
<< messageSize << ')'
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
@ -232,6 +232,4 @@ bool Foam::IPstream::finishedRequest(const label i)
|
|||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -172,6 +172,4 @@ bool Foam::OPstream::finishedRequest(const label i)
|
|||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -175,7 +175,8 @@ private:
|
|||
mutable labelList* slavePointPointHitsPtr_;
|
||||
|
||||
//- Slave edge hit. The index of master edge hit by the
|
||||
// slave point in projection. For point or no edge hit, set to -1
|
||||
// slave point in projection.
|
||||
// For point or no edge hit, set to -1
|
||||
mutable labelList* slavePointEdgeHitsPtr_;
|
||||
|
||||
//- Slave face hit. The index of master face hit by the
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
//- Bounding box of this node
|
||||
treeBoundBox bb_;
|
||||
|
||||
//- parent node (index into nodes_ of tree)
|
||||
//- Parent node (index into nodes_ of tree)
|
||||
label parent_;
|
||||
|
||||
//- IDs of the 8 nodes on all sides of the mid point
|
||||
|
@ -165,8 +165,8 @@ private:
|
|||
|
||||
// Construction
|
||||
|
||||
//- Split list of indices into 8 bins according to where they are in
|
||||
// relation to mid.
|
||||
//- Split list of indices into 8 bins according to where they are
|
||||
// in relation to mid.
|
||||
void divide
|
||||
(
|
||||
const labelList& indices,
|
||||
|
@ -376,6 +376,8 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
// Static functions
|
||||
|
||||
//- Get the perturbation tolerance
|
||||
static scalar& perturbTol();
|
||||
|
||||
|
|
|
@ -25,11 +25,12 @@ Class
|
|||
Foam::PointIndexHit
|
||||
|
||||
Description
|
||||
This class describes the interaction of (usually) a face and a point.
|
||||
This class describes the interaction of a shape (edge, face, cell)
|
||||
and a point.
|
||||
It carries the info of a successful hit and (if successful),
|
||||
returns the interaction point.
|
||||
|
||||
like pointHit but carries face (or cell, edge etc.) index
|
||||
Works like pointHit but carries face (or cell, edge etc.) index
|
||||
|
||||
SourceFiles
|
||||
|
||||
|
|
|
@ -140,7 +140,8 @@ class octree
|
|||
const treeBoundBox octreeBb_;
|
||||
|
||||
//- Refinement crit: size of leaves. Average number of entries per
|
||||
// leaf. Should be fine enough for efficient searching at lowest level.
|
||||
// leaf. Should be fine enough for efficient searching
|
||||
// at lowest level.
|
||||
const scalar maxLeafRatio_;
|
||||
|
||||
//- Refinement crit: multiplicity of entries (so in how many leaves
|
||||
|
@ -165,7 +166,8 @@ class octree
|
|||
|
||||
|
||||
// Static data members
|
||||
//- Refinement crit: max number of level
|
||||
|
||||
//- Refinement criterion max number of level
|
||||
static const label maxNLevels = 20;
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,10 @@ class IPstream
|
|||
{
|
||||
// Private data
|
||||
|
||||
//- ID of sending processor
|
||||
int fromProcNo_;
|
||||
|
||||
//- Message size
|
||||
label messageSize_;
|
||||
|
||||
|
||||
|
@ -76,7 +79,7 @@ public:
|
|||
|
||||
// Constructors
|
||||
|
||||
//- Construct given process index to read from and optional buffer size,
|
||||
//- Construct given process index to read from, optional buffer size,
|
||||
// read format and IO version
|
||||
IPstream
|
||||
(
|
||||
|
|
|
@ -55,6 +55,7 @@ class OPstream
|
|||
{
|
||||
// Private data
|
||||
|
||||
// ID of receiving processor
|
||||
int toProcNo_;
|
||||
|
||||
|
||||
|
@ -68,7 +69,12 @@ class OPstream
|
|||
inline void writeToBuffer(const char&);
|
||||
|
||||
//- Write data to the transfer buffer
|
||||
inline void writeToBuffer(const void* data, size_t count, size_t align);
|
||||
inline void writeToBuffer
|
||||
(
|
||||
const void* data,
|
||||
size_t count,
|
||||
size_t align
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
@ -269,9 +269,9 @@ const Foam::debug::optimisationSwitch
|
|||
Foam::Pstream::defaultCommsType
|
||||
(
|
||||
"commsType",
|
||||
"nonBlocking",
|
||||
// "nonBlocking",
|
||||
// "scheduled",
|
||||
// "blocking",
|
||||
"blocking",
|
||||
"blocking, nonBlocking, scheduled"
|
||||
);
|
||||
|
||||
|
|
|
@ -373,7 +373,8 @@ public:
|
|||
template <class T, class BinaryOp>
|
||||
static void gather(T& Value, const BinaryOp& bop);
|
||||
|
||||
//- Scatter data. Distribute without modification. Reverse of gather
|
||||
//- Scatter data. Distribute without modification.
|
||||
// Reverse of gather
|
||||
template <class T>
|
||||
static void scatter(const List<commsStruct>& comms, T& Value);
|
||||
|
||||
|
@ -421,7 +422,11 @@ public:
|
|||
|
||||
//- Like above but switches between linear/tree communication
|
||||
template <class T, class CombineOp>
|
||||
static void listCombineGather(List<T>& Value, const CombineOp& cop);
|
||||
static void listCombineGather
|
||||
(
|
||||
List<T>& Value,
|
||||
const CombineOp& cop
|
||||
);
|
||||
|
||||
//- Scatter data. Reverse of combineGather
|
||||
template <class T>
|
||||
|
|
|
@ -547,8 +547,6 @@ void Pstream::mapCombineScatter(Container& Values)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
|
|
@ -99,7 +99,7 @@ void Pstream::gatherList
|
|||
IPstream fromBelow(Pstream::scheduled, belowID);
|
||||
fromBelow >> Values[belowID];
|
||||
|
||||
if (debug & 2)
|
||||
if (debug > 1)
|
||||
{
|
||||
Pout<< " received through "
|
||||
<< belowID << " data from:" << belowID
|
||||
|
@ -112,7 +112,7 @@ void Pstream::gatherList
|
|||
label leafID = belowLeaves[leafI];
|
||||
fromBelow >> Values[leafID];
|
||||
|
||||
if (debug & 2)
|
||||
if (debug > 1)
|
||||
{
|
||||
Pout<< " received through "
|
||||
<< belowID << " data from:" << leafID
|
||||
|
@ -129,10 +129,10 @@ void Pstream::gatherList
|
|||
{
|
||||
const labelList& belowLeaves = myComm.allBelow();
|
||||
|
||||
if (debug & 2)
|
||||
if (debug > 1)
|
||||
{
|
||||
Pout<< " sending to " << myComm.above()
|
||||
<< " data from me:" << Pstream::myProcNo()
|
||||
<< " data from: " << Pstream::myProcNo()
|
||||
<< " data: " << Values[Pstream::myProcNo()] << endl;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ void Pstream::gatherList
|
|||
{
|
||||
label leafID = belowLeaves[leafI];
|
||||
|
||||
if (debug & 2)
|
||||
if (debug > 1)
|
||||
{
|
||||
Pout<< " sending to "
|
||||
<< myComm.above() << " data from: " << leafID
|
||||
|
|
|
@ -69,7 +69,6 @@ class error
|
|||
public std::exception,
|
||||
public messageStream
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
@ -83,6 +82,7 @@ protected:
|
|||
bool throwExceptions_;
|
||||
OStringStream* messageStreamPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
|
|
@ -38,6 +38,7 @@ Foam::regIOobject::fileModificationSkew
|
|||
30
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from IOobject
|
||||
|
|
|
@ -32,6 +32,7 @@ Description
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "foamVersion.H"
|
||||
|
||||
const char* const Foam::FOAMversion = "VERSION_STRING";
|
||||
|
|
|
@ -1248,7 +1248,10 @@ void Foam::immersedBoundaryFvPatch::makeIbCellCells() const
|
|||
labelList procIbCells = procIbCellsSet.toc();
|
||||
sort(procIbCells);
|
||||
|
||||
// Send and receive num of immersed boundary cells
|
||||
// Note: consider more sophisticated gather-scatter
|
||||
// HJ, 18/Jun/2015
|
||||
|
||||
// Send and receive number of immersed boundary cells
|
||||
// next to processor boundaries
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
{
|
||||
|
|
|
@ -97,7 +97,10 @@ bool Foam::meshSearch::findNearer
|
|||
|
||||
|
||||
// tree based searching
|
||||
Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
|
||||
Foam::label Foam::meshSearch::findNearestCellTree
|
||||
(
|
||||
const point& location
|
||||
) const
|
||||
{
|
||||
const indexedOctree<treeDataPoint>& tree = cellCentreTree();
|
||||
|
||||
|
@ -109,12 +112,17 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
|
|||
{
|
||||
info = tree.findNearest(location, Foam::sqr(GREAT));
|
||||
}
|
||||
|
||||
return info.index();
|
||||
}
|
||||
|
||||
|
||||
// linear searching
|
||||
Foam::label Foam::meshSearch::findNearestCellLinear(const point& location) const
|
||||
Foam::label
|
||||
Foam::meshSearch::findNearestCellLinear
|
||||
(
|
||||
const point& location
|
||||
) const
|
||||
{
|
||||
const vectorField& centres = mesh_.cellCentres();
|
||||
|
||||
|
|
|
@ -269,7 +269,10 @@ public:
|
|||
|
||||
//- WIP. From a set of hits (points and
|
||||
// indices) get the specified field. Misses do not get set.
|
||||
virtual void getField(const List<pointIndexHit>&, labelList&) const;
|
||||
virtual void getField
|
||||
(
|
||||
const List<pointIndexHit>&, labelList&
|
||||
) const;
|
||||
|
||||
|
||||
// regIOobject implementation
|
||||
|
@ -277,6 +280,7 @@ public:
|
|||
bool writeData(Ostream&) const
|
||||
{
|
||||
notImplemented("triSurfaceMesh::writeData(Ostream&) const");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -287,7 +291,6 @@ public:
|
|||
IOstream::versionNumber ver,
|
||||
IOstream::compressionType cmp
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -68,13 +68,13 @@ class triSurfaceSearch
|
|||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
triSurfaceSearch(const triSurfaceSearch&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const triSurfaceSearch&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
@ -86,8 +86,7 @@ public:
|
|||
// Constructors
|
||||
|
||||
//- Construct from surface. Holds reference to surface!
|
||||
triSurfaceSearch(const triSurface&);
|
||||
|
||||
explicit triSurfaceSearch(const triSurface&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
|
|
@ -32,6 +32,11 @@ License
|
|||
#include "HashTable.H"
|
||||
#include "word.H"
|
||||
|
||||
template<>
|
||||
Foam::surfaceWriter<bool>::wordConstructorTable*
|
||||
Foam::surfaceWriter<bool>::wordConstructorTablePtr_;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
|
|
@ -52,6 +52,7 @@ class labelledTri
|
|||
{
|
||||
// Private data
|
||||
|
||||
//- Region ID
|
||||
label region_;
|
||||
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@ Foam::fileName Foam::triSurface::triSurfInstance(const Time& d)
|
|||
<< "reading " << foamName
|
||||
<< " from constant/" << endl;
|
||||
}
|
||||
return "constant";
|
||||
|
||||
return d.constant();
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,8 +160,7 @@ void Foam::triSurface::printTriangle
|
|||
const pointField& points
|
||||
)
|
||||
{
|
||||
os
|
||||
<< pre.c_str() << "vertex numbers:"
|
||||
os << pre.c_str() << "vertex numbers:"
|
||||
<< f[0] << ' ' << f[1] << ' ' << f[2] << endl
|
||||
<< pre.c_str() << "vertex coords :"
|
||||
<< points[f[0]] << ' ' << points[f[1]] << ' ' << points[f[2]]
|
||||
|
@ -240,7 +240,7 @@ void Foam::triSurface::checkTriangles(const bool verbose)
|
|||
}
|
||||
else
|
||||
{
|
||||
// duplicate triangle check
|
||||
// Duplicate triangle check
|
||||
const labelList& neighbours = fFaces[faceI];
|
||||
|
||||
// Check if faceNeighbours use same points as this face.
|
||||
|
@ -551,7 +551,11 @@ Foam::surfacePatchList Foam::triSurface::calcPatches(labelList& faceMap) const
|
|||
|
||||
|
||||
// Take over any information from existing patches
|
||||
if ((oldPatchI < patches_.size()) && (patches_[oldPatchI].name() != ""))
|
||||
if
|
||||
(
|
||||
(oldPatchI < patches_.size())
|
||||
&& (patches_[oldPatchI].name() != "")
|
||||
)
|
||||
{
|
||||
newPatch.name() = patches_[oldPatchI].name();
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ class triSurface
|
|||
const label defaultRegion = 0
|
||||
);
|
||||
|
||||
//- helper function to print triangle info
|
||||
//- Helper function to print triangle info
|
||||
static void printTriangle
|
||||
(
|
||||
Ostream&,
|
||||
|
@ -282,15 +282,16 @@ public:
|
|||
triSurface(const triSurface&);
|
||||
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~triSurface();
|
||||
|
||||
//- Clear all data
|
||||
void clearOut();
|
||||
|
||||
//- Clear topology
|
||||
void clearTopology();
|
||||
|
||||
//- Clear patch addressing
|
||||
void clearPatchMeshAddr();
|
||||
|
||||
|
||||
|
@ -320,6 +321,7 @@ public:
|
|||
// If >2 neighbours: undetermined.
|
||||
const labelList& edgeOwner() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Move points
|
||||
|
@ -329,13 +331,13 @@ public:
|
|||
virtual void scalePoints(const scalar&);
|
||||
|
||||
//- Check/remove duplicate/degenerate triangles
|
||||
void checkTriangles(const bool verbose);
|
||||
void checkTriangles(const bool verbose = false);
|
||||
|
||||
//- Check triply (or more) connected edges.
|
||||
void checkEdges(const bool verbose);
|
||||
void checkEdges(const bool verbose = false);
|
||||
|
||||
//- Remove non-valid triangles
|
||||
void cleanup(const bool verbose);
|
||||
void cleanup(const bool verbose = false);
|
||||
|
||||
//- Fill faceZone with currentZone for every face reachable
|
||||
// from faceI without crossing edge marked in borderEdge.
|
||||
|
@ -377,6 +379,7 @@ public:
|
|||
labelList& faceMap
|
||||
) const;
|
||||
|
||||
|
||||
// Write
|
||||
|
||||
//- Write to Ostream in simple FOAM format
|
||||
|
|
Reference in a new issue