MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / warnDuplicates

Function warnDuplicates

src/conversion/meshReader/meshReaderAux.C:33–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31// * * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * //
32
33void Foam::meshReader::warnDuplicates
34(
35 const word& context,
36 const wordList& list
37)
38{
39 HashTable<label> hashed(list.size());
40 bool duplicates = false;
41
42 forAll(list, listI)
43 {
44 // check duplicate name
45 HashTable<label>::iterator iter = hashed.find(list[listI]);
46 if (iter != hashed.end())
47 {
48 (*iter)++;
49 duplicates = true;
50 }
51 else
52 {
53 hashed.insert(list[listI], 1);
54 }
55 }
56
57 // warn about duplicate names
58 if (duplicates)
59 {
60 Info<< nl << "WARNING: " << context << " with identical names:";
61 forAllConstIter(HashTable<label>, hashed, iter)
62 {
63 if (*iter > 1)
64 {
65 Info<< " " << iter.key();
66 }
67 }
68 Info<< nl << endl;
69 }
70}
71
72
73// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

Callers 3

addCellZonesFunction · 0.85
addFaceZonesFunction · 0.85
meshReader.CFile · 0.85

Calls 6

forAllFunction · 0.50
forAllConstIterFunction · 0.50
sizeMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected