diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H index bd907d4458..29f15e2be3 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H @@ -360,14 +360,12 @@ class vtkPVFoam void updateInfoZones(vtkDataArraySelection*); //- Get non-empty zone names for zoneType from file - wordList getZoneNames(const word& zoneType) const; + template + wordList getZoneNames(const word& zonesName) const; //- Get non-empty zone names from mesh info - template - wordList getZoneNames - ( - const ZoneList& - ) const; + template + wordList getZoneNames(const ZonesType&) const; //- Add objects of Type to paraview array selection template diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C index 9364f188f0..45cd470c3d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C @@ -50,6 +50,7 @@ namespace Foam { //- A class for reading zone information without requiring a mesh +template class zonesEntries : public regIOobject, @@ -63,7 +64,7 @@ public: explicit zonesEntries(const IOobject& io) : regIOobject(io), - PtrList(readStream(word("regIOobject"))) + PtrList(readStream(ZonesType::typeName)) { close(); } @@ -81,20 +82,17 @@ public: // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template -Foam::wordList Foam::vtkPVFoam::getZoneNames -( - const ZoneList& zmesh -) const +template +Foam::wordList Foam::vtkPVFoam::getZoneNames(const ZonesType& zones) const { - wordList names(zmesh.size()); + wordList names(zones.size()); label nZone = 0; - forAll(zmesh, zoneI) + forAll(zones, zoneI) { - if (zmesh[zoneI].size()) + if (zones[zoneI].size()) { - names[nZone++] = zmesh[zoneI].name(); + names[nZone++] = zones[zoneI].name(); } } names.setSize(nZone); @@ -103,18 +101,19 @@ Foam::wordList Foam::vtkPVFoam::getZoneNames } -Foam::wordList Foam::vtkPVFoam::getZoneNames(const word& zoneType) const +template +Foam::wordList Foam::vtkPVFoam::getZoneNames(const word& zonesName) const { wordList names; // Mesh not loaded - read from file - IOobject ioObj + typeIOobject ioObj ( - zoneType, + zonesName, dbPtr_().findInstance ( meshDir_, - zoneType, + zonesName, IOobject::READ_IF_PRESENT ), meshDir_, @@ -126,7 +125,7 @@ Foam::wordList Foam::vtkPVFoam::getZoneNames(const word& zoneType) const if (ioObj.headerOk()) { - zonesEntries zones(ioObj); + const zonesEntries zones(ioObj); names.setSize(zones.size()); forAll(zones, zoneI) @@ -523,7 +522,7 @@ void Foam::vtkPVFoam::updateInfoZones } else { - namesLst = getZoneNames("cellZones"); + namesLst = getZoneNames("cellZones"); } arrayRangeCellZones_.reset(arraySelection->GetNumberOfArrays()); @@ -544,7 +543,7 @@ void Foam::vtkPVFoam::updateInfoZones } else { - namesLst = getZoneNames("faceZones"); + namesLst = getZoneNames("faceZones"); } arrayRangeFaceZones_.reset(arraySelection->GetNumberOfArrays()); @@ -565,7 +564,7 @@ void Foam::vtkPVFoam::updateInfoZones } else { - namesLst = getZoneNames("pointZones"); + namesLst = getZoneNames("pointZones"); } arrayRangePointZones_.reset(arraySelection->GetNumberOfArrays());