mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: further refinement to edge methods
- more hash-like methods. Eg, insert/erase via lists, clear(), empty(),... - minVertex(), maxVertex() to return the smallest/largest label used - improved documentation, more clarification about where/how negative point labels are treated.
This commit is contained in:
@ -31,6 +31,7 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "edgeList.H"
|
||||
#include "edgeHashes.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -79,6 +80,28 @@ int main(int argc, char *argv[])
|
||||
printInfo(e4);
|
||||
}
|
||||
|
||||
e4.start() = e4.end() = -1;
|
||||
Info<< "insert from list\n";
|
||||
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
|
||||
e4.insert(newIndices.toc());
|
||||
printInfo(e4);
|
||||
|
||||
e4.start() = e4.end() = -1;
|
||||
Info<< "insert from list\n";
|
||||
e4.insert({0, 5, 2, -1, 2, 1, 4, 1, 2, 3});
|
||||
printInfo(e4);
|
||||
|
||||
FixedList<label, 8> otherIndices{12, 2, -1, 1, 4, 1, 2, 3};
|
||||
e4.start() = e4.end() = -1;
|
||||
Info<< "insert from list: " << otherIndices << nl;
|
||||
e4.insert(otherIndices);
|
||||
printInfo(e4);
|
||||
|
||||
e4.start() = e4.end();
|
||||
Info<< "erase from list: " << otherIndices << nl;
|
||||
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
|
||||
printInfo(e4);
|
||||
|
||||
for (label i : {-1, 0, 1, 3})
|
||||
{
|
||||
bool ok = e4.erase(i);
|
||||
|
||||
Reference in New Issue
Block a user