faceZone: Added new insert function to add elements from a Map<bool>

//- Insert given indices and corresponding face flips into zone
        void insert(const Map<bool>& newIndices);
This commit is contained in:
Henry Weller
2024-03-21 16:32:42 +00:00
parent d77d4a0e29
commit 09c8263d08
14 changed files with 128 additions and 156 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,6 +73,15 @@ int main(int argc, char *argv[])
Info<< "table4: " << table4 << nl
<< "toc: " << table4.toc() << endl;
HashTable<label, label, Hash<label>> table5
{
List<label>{3, 5, 7},
List<label>{10, 12, 16}
};
Info<< "table5: " << table5 << nl
<< "toc: " << table5.toc() << endl;
HashPtrTable<label, Foam::string> ptable1(0);
ptable1.insert("kjhkjh", new label(10));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,10 +45,7 @@ int main(int argc, char *argv[])
cpuTime timer;
// ie, a
// Map<label> map(2 * nSize);
// HashTable<label, label, Hash<label>> map(2 * nSize);
HashTable<label, label, Hash<label>> map(2 * nSize);
Map<label> map(2*nSize);
Info<< "Constructed map of size: " << nSize
<< " (size " << map.size() << " capacity " << map.capacity() << ") "
@ -62,12 +59,12 @@ int main(int argc, char *argv[])
<< " (size " << map.size() << " capacity " << map.capacity() << ") "
<< timer.cpuTimeIncrement() << " s\n";
label elemI = 0;
label elemi = 0;
for (label iLoop = 0; iLoop < nLoops; iLoop++)
{
for (label i = 0; i < nBase; i++)
{
map.erase(elemI++);
map.erase(elemi++);
}
map.shrink();