1 // check the final time directory for the following:
4 HashTable<word> volumeFields;
6 // 2. the fields for each cloud:
7 HashTable< HashTable<word> > cloudFields;
11 IOobjectList objs(mesh, timeDirs[timeDirs.size()-1].name());
13 forAllConstIter(IOobjectList, objs, fieldIter)
15 const IOobject& obj = *fieldIter();
16 const word& fieldName = obj.name();
17 const word& fieldType = obj.headerClassName();
19 if (fieldName.size() > 2 && fieldName(fieldName.size()-2, 2) == "_0")
23 else if (volFieldTypes.found(fieldType))
25 // simply ignore types that we don't handle
26 volumeFields.insert(fieldName, fieldType);
32 // now check for lagrangian/<cloudName>
34 fileNameList cloudDirs = readDir
37 / timeDirs[timeDirs.size()-1].name()
43 forAll(cloudDirs, cloudI)
45 const word& cloudName = cloudDirs[cloudI];
47 // Create a new hash table for each cloud
48 cloudFields.insert(cloudName, HashTable<word>());
50 // Identify the new cloud within the hash table
51 HashTable<HashTable<word> >::iterator cloudIter =
52 cloudFields.find(cloudName);
57 timeDirs[timeDirs.size()-1].name(),
58 cloud::prefix/cloudName
61 bool hasPositions = false;
62 forAllConstIter(IOobjectList, objs, fieldIter)
64 const IOobject obj = *fieldIter();
65 const word& fieldName = obj.name();
66 const word& fieldType = obj.headerClassName();
68 if (fieldName == "positions")
72 else if (cloudFieldTypes.found(fieldType))
74 // simply ignore types that we don't handle
75 cloudIter().insert(fieldName, fieldType);
79 // drop this cloud if it has no positions or is otherwise empty
80 if (!hasPositions || cloudIter().empty())
82 Info<< "removing cloud " << cloudName << endl;
83 cloudFields.erase(cloudIter);
88 // verify that the variable is present for all times
90 for (label i=0; volumeFields.size() && i < timeDirs.size(); ++i)
92 IOobjectList objs(mesh, timeDirs[i].name());
94 forAllIter(HashTable<word>, volumeFields, fieldIter)
96 const word& fieldName = fieldIter.key();
98 if (!objs.found(fieldName))
100 volumeFields.erase(fieldIter);