mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use sortedToc() instead of toc() followed by sort()
This commit is contained in:
@ -1049,8 +1049,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Grab the result from the hash list
|
// Grab the result from the hash list
|
||||||
globallySharedPoints_ = gSharedPoints.toc();
|
globallySharedPoints_ = gSharedPoints.sortedToc();
|
||||||
sort(globallySharedPoints_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -65,8 +65,7 @@ calcBdryPoints() const
|
|||||||
bp.insert(curEdge.end());
|
bp.insert(curEdge.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
boundaryPointsPtr_ = new labelList(bp.toc());
|
boundaryPointsPtr_ = new labelList(bp.sortedToc());
|
||||||
sort(*boundaryPointsPtr_);
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -247,22 +247,14 @@ void Foam::distribution::add(const label valueToAdd)
|
|||||||
|
|
||||||
void Foam::distribution::insertMissingKeys()
|
void Foam::distribution::insertMissingKeys()
|
||||||
{
|
{
|
||||||
iterator iter(this->begin());
|
List<label> keys = sortedToc();
|
||||||
|
|
||||||
List<label> keys = toc();
|
if (keys.size() > 2)
|
||||||
|
|
||||||
sort(keys);
|
|
||||||
|
|
||||||
if (keys.size())
|
|
||||||
{
|
{
|
||||||
for (label k = keys[0]; k < keys.last(); k++)
|
for (label k = keys[1]; k < keys.last(); k++)
|
||||||
{
|
{
|
||||||
iter = find(k);
|
// Insert 0, if the entry does not already exist
|
||||||
|
this->insert(k,0);
|
||||||
if (iter == this->end())
|
|
||||||
{
|
|
||||||
this->insert(k,0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -274,10 +266,7 @@ Foam::List<Foam::Pair<Foam::scalar>> Foam::distribution::normalised()
|
|||||||
|
|
||||||
insertMissingKeys();
|
insertMissingKeys();
|
||||||
|
|
||||||
List<label> keys = toc();
|
List<label> keys = sortedToc();
|
||||||
|
|
||||||
sort(keys);
|
|
||||||
|
|
||||||
List<Pair<scalar>> normDist(size());
|
List<Pair<scalar>> normDist(size());
|
||||||
|
|
||||||
forAll(keys,k)
|
forAll(keys,k)
|
||||||
@ -420,10 +409,7 @@ Foam::List<Foam::Pair<Foam::scalar>> Foam::distribution::raw()
|
|||||||
{
|
{
|
||||||
insertMissingKeys();
|
insertMissingKeys();
|
||||||
|
|
||||||
List<label> keys = toc();
|
List<label> keys = sortedToc();
|
||||||
|
|
||||||
sort(keys);
|
|
||||||
|
|
||||||
List<Pair<scalar>> rawDist(size());
|
List<Pair<scalar>> rawDist(size());
|
||||||
|
|
||||||
forAll(keys,k)
|
forAll(keys,k)
|
||||||
|
|||||||
@ -720,12 +720,9 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
|||||||
if (problemCells.size())
|
if (problemCells.size())
|
||||||
{
|
{
|
||||||
// This cycle has failed. Print out the problem cells
|
// This cycle has failed. Print out the problem cells
|
||||||
labelList toc(problemCells.toc());
|
|
||||||
sort(toc);
|
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Found " << problemCells.size() << " problem cells." << nl
|
<< "Found " << problemCells.size() << " problem cells." << nl
|
||||||
<< "Cells: " << toc
|
<< "Cells: " << problemCells.sortedToc()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user