// check the final time directory for the following: // 1. volume fields HashTable volumeFields; // 2. the fields for each cloud: HashTable> cloudFields; if (timeDirs.size()) { const fileName& cloudPrefix = regionPrefix/cloud::prefix; const word& lastTimeName = timeDirs.last().name(); IOobjectList objs(mesh, lastTimeName); forAllConstIter(IOobjectList, objs, fieldIter) { const IOobject& obj = *fieldIter(); const word& fieldName = obj.name(); const word& fieldType = obj.headerClassName(); if (fieldName.size() > 2 && fieldName(fieldName.size()-2, 2) == "_0") { // ignore _0 fields } else if (volFieldTypes.found(fieldType)) { // simply ignore types that we don't handle volumeFields.insert(fieldName, fieldType); } } // // now check for lagrangian/ // fileNameList cloudDirs; if (!noLagrangian) { cloudDirs = readDir ( runTime.path() / lastTimeName / cloudPrefix, fileName::DIRECTORY ); } forAll(cloudDirs, cloudI) { const word& cloudName = cloudDirs[cloudI]; // Create a new hash table for each cloud cloudFields.insert(cloudName, HashTable()); // Identify the new cloud within the hash table HashTable>::iterator cloudIter = cloudFields.find(cloudName); IOobjectList objs ( mesh, lastTimeName, cloudPrefix/cloudName ); bool hasPositions = false; forAllConstIter(IOobjectList, objs, fieldIter) { const IOobject obj = *fieldIter(); const word& fieldName = obj.name(); const word& fieldType = obj.headerClassName(); if (fieldName == "positions") { hasPositions = true; } else if (cloudFieldTypes.found(fieldType)) { // simply ignore types that we don't handle cloudIter().insert(fieldName, fieldType); } } // drop this cloud if it has no positions or is otherwise empty if (!hasPositions || cloudIter().empty()) { Info<< "removing cloud " << cloudName << endl; cloudFields.erase(cloudIter); } } // // verify that the variable is present for all times // for (label i=0; volumeFields.size() && i < timeDirs.size(); ++i) { const word& timeName = timeDirs[i].name(); // Everything is potentially missing, unless we discover otherwise wordHashSet missing(volumeFields); // Avoid -->> IOobjectList objs(mesh, timeName); <<-- // Too much overhead when done so frequently. fileNameList contents = readDir ( runTime.path() / timeName, fileName::FILE ); forAll(contents, fileI) { missing.erase(contents[fileI].name()); } volumeFields.erase(missing); } }