diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml
index 41b44048d9..123c736f54 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml
@@ -1,6 +1,6 @@
+ file_description="OpenFOAM Reader">
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files
index ba65793d66..0a5e64ddf1 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files
@@ -2,10 +2,8 @@ vtkPV3Foam.C
vtkPV3FoamAddVolumeMesh.C
vtkPV3FoamAddLagrangianMesh.C
vtkPV3FoamAddPatchMesh.C
-vtkPV3FoamAddFaceZoneMesh.C
-vtkPV3FoamAddPointZoneMesh.C
-vtkPV3FoamAddFaceSetMesh.C
-vtkPV3FoamAddPointSetMesh.C
+vtkPV3FoamAddZoneMesh.C
+vtkPV3FoamAddSetMesh.C
vtkPV3FoamUpdate.C
vtkPV3FoamUpdateInformation.C
vtkPV3FoamConvertMesh.C
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
index d62064dac3..a24eb02b76 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
@@ -52,7 +52,7 @@ defineTypeNameAndDebug(Foam::vtkPV3Foam, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-#include "vtkPV3FoamAddFields.H"
+#include "vtkPV3FoamAddToSelection.H"
#include "vtkPV3FoamUpdateInformationFields.H"
@@ -233,13 +233,13 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
- const label nRegions = arraySelection->GetNumberOfArrays();
+ const label nSelect = arraySelection->GetNumberOfArrays();
- selectedRegions_.setSize(nRegions);
- selectedRegionDatasetIds_.setSize(nRegions);
+ selectedRegions_.setSize(nSelect);
+ selectedRegionDatasetIds_.setSize(nSelect);
// Read the selected patches and add to the region list
- for (int regionId=0; regionId < nRegions; ++regionId)
+ forAll (selectedRegions_, regionId)
{
selectedRegions_[regionId] = arraySelection->GetArraySetting(regionId);
selectedRegionDatasetIds_[regionId] = -1;
@@ -269,7 +269,13 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug)
{
- Info<< "selections(";
+ Info<< "available(";
+ forAll (selections, elemI)
+ {
+ Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
+ }
+ Info<< " )\n"
+ << "selected(";
}
forAll (selections, elemI)
@@ -319,28 +325,40 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug)
{
- Info<< "selections(";
+ Info<< "available(";
+ for
+ (
+ int elemI = selector.start();
+ elemI < selector.end();
+ ++elemI
+ )
+ {
+ Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
+ }
+
+ Info<< " )\n"
+ << "selected(";
}
for
(
- int regionId = selector.start();
- regionId < selector.end();
- ++regionId
+ int elemI = selector.start();
+ elemI < selector.end();
+ ++elemI
)
{
- if (arraySelection->GetArraySetting(regionId))
+ if (arraySelection->GetArraySetting(elemI))
{
if (firstWord)
{
selections[nElem] = getFirstWord
(
- arraySelection->GetArrayName(regionId)
+ arraySelection->GetArrayName(elemI)
);
}
else
{
- selections[nElem] = arraySelection->GetArrayName(regionId);
+ selections[nElem] = arraySelection->GetArrayName(elemI);
}
if (debug)
@@ -400,10 +418,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
<< endl;
}
- arraySelection->EnableArray
- (
- arrayName.c_str()
- );
+ arraySelection->EnableArray(arrayName.c_str());
break;
}
}
@@ -523,25 +538,37 @@ void Foam::vtkPV3Foam::UpdateInformation()
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::UpdateInformation - "
- << "TimeStep = " << reader_->GetTimeStep() << endl;
+ Info<< " Foam::vtkPV3Foam::UpdateInformation"
+ << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] TimeStep="
+ << reader_->GetTimeStep() << endl;
}
resetCounters();
- // preserve the currently selected values
- const stringList selectedEntries = getSelectedArrayEntries
- (
- reader_->GetRegionSelection()
- );
+ vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
+
+ stringList selectedEntries;
+ // enable 'internalMesh' on the first call
+ if (arraySelection->GetNumberOfArrays() == 0)
+ {
+ selectedEntries.setSize(1);
+ selectedEntries[0] = "internalMesh";
+ }
+ else
+ {
+ // preserve the currently selected values
+ selectedEntries = getSelectedArrayEntries
+ (
+ arraySelection
+ );
+ }
+
// Clear current region list/array
- reader_->GetRegionSelection()->RemoveAllArrays();
+ arraySelection->RemoveAllArrays();
// Update region array
updateInformationInternalMesh();
-
updateInformationLagrangian();
-
updateInformationPatches();
if (reader_->GetIncludeSets())
@@ -554,10 +581,10 @@ void Foam::vtkPV3Foam::UpdateInformation()
updateInformationZones();
}
- // Update region selection with the data just read in
+ // restore the currently enabled values
setSelectedArrayEntries
(
- reader_->GetRegionSelection(),
+ arraySelection,
selectedEntries
);
@@ -610,9 +637,7 @@ void Foam::vtkPV3Foam::Update
// Convert meshes
convertMeshVolume(output);
-
convertMeshLagrangian(output);
-
convertMeshPatches(output);
if (reader_->GetIncludeZones())
@@ -624,16 +649,14 @@ void Foam::vtkPV3Foam::Update
if (reader_->GetIncludeSets())
{
- convertMeshCellSet(output);
- convertMeshFaceSet(output);
- convertMeshPointSet(output);
+ convertMeshCellSets(output);
+ convertMeshFaceSets(output);
+ convertMeshPointSets(output);
}
// Update fields
updateVolFields(output);
-
updatePointFields(output);
-
updateLagrangianFields(output);
if (debug)
@@ -724,8 +747,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
Info<< " Foam::vtkPV3Foam::addPatchNames" << endl;
}
- const fvMesh& mesh = *meshPtr_;
- const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
+ const polyBoundaryMesh& pbMesh = meshPtr_->boundaryMesh();
const selectionInfo& selector = selectInfoPatches_;
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H
index 8474798f7d..39f52c2f32 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H
@@ -29,18 +29,16 @@ Description
Provides a reader interface for OpenFOAM to VTK interaction.
SourceFiles
- interpolatePointToCell.C
- interpolatePointToCell.H
vtkPV3Foam.C
vtkPV3Foam.H
- vtkPV3FoamAddFaceSetMesh.C
- vtkPV3FoamAddFaceZoneMesh.C
- vtkPV3FoamAddFields.H
+ vtkPV3FoamI.H
vtkPV3FoamAddLagrangianMesh.C
vtkPV3FoamAddPatchMesh.C
- vtkPV3FoamAddPointSetMesh.C
- vtkPV3FoamAddPointZoneMesh.C
+ vtkPV3FoamAddSetMesh.C
+ vtkPV3FoamAddToSelection.H
vtkPV3FoamAddVolumeMesh.C
+ vtkPV3FoamAddZoneMesh.C
+ vtkPV3FoamConvertFaceField.H
vtkPV3FoamConvertLagrangianFields.H
vtkPV3FoamConvertMesh.C
vtkPV3FoamConvertPatchFaceField.H
@@ -52,7 +50,7 @@ SourceFiles
vtkPV3FoamUpdateInformation.C
vtkPV3FoamUpdateInformationFields.H
- // Needed by VTK?
+ // Needed by VTK:
vtkDataArrayTemplateImplicit.txx
\*---------------------------------------------------------------------------*/
@@ -64,6 +62,7 @@ SourceFiles
#include "fileName.H"
#include "volPointInterpolation.H"
#include "stringList.H"
+#include "wordList.H"
#include "primitivePatch.H"
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
@@ -304,9 +303,21 @@ private:
//- Set info
void updateInformationSets();
+ //- Read zone names for zoneType from file
+ wordList readZoneNames(const word& zoneType);
+
//- Zone info
void updateInformationZones();
+ //- Add to paraview array selection
+ template
+ label addToSelection
+ (
+ vtkDataArraySelection *arraySelection,
+ const IOobjectList&,
+ const string& suffix = ""
+ );
+
//- Field info
template class patchType, class meshType>
void updateInformationFields
@@ -347,20 +358,20 @@ private:
//- Cell zone meshes
void convertMeshCellZones(vtkMultiBlockDataSet* output);
- //- Cell zone meshes
+ //- Face zone meshes
void convertMeshFaceZones(vtkMultiBlockDataSet* output);
- //- Cell zone meshes
+ //- Point zone meshes
void convertMeshPointZones(vtkMultiBlockDataSet* output);
//- Cell set meshes
- void convertMeshCellSet(vtkMultiBlockDataSet* output);
+ void convertMeshCellSets(vtkMultiBlockDataSet* output);
//- Face set meshes
- void convertMeshFaceSet(vtkMultiBlockDataSet* output);
+ void convertMeshFaceSets(vtkMultiBlockDataSet* output);
//- Point set meshes
- void convertMeshPointSet(vtkMultiBlockDataSet* output);
+ void convertMeshPointSets(vtkMultiBlockDataSet* output);
// Add mesh functions
@@ -430,7 +441,7 @@ private:
//- Add the fields in the selected time directory to the selection
// lists
template
- label addFields
+ label addObjectsToSelection
(
vtkDataArraySelection* fieldSelection,
const IOobjectList& objects,
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointSetMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointSetMesh.C
deleted file mode 100644
index 4a19fab3d4..0000000000
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointSetMesh.C
+++ /dev/null
@@ -1,73 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
- \\/ M anipulation |
--------------------------------------------------------------------------------
-License
- This file is part of OpenFOAM.
-
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-Description
-
-\*---------------------------------------------------------------------------*/
-
-#include "vtkPV3Foam.H"
-
-// Foam includes
-#include "pointSet.H"
-#include "vtkPV3FoamInsertNextPoint.H"
-
-// VTK includes
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-void Foam::vtkPV3Foam::addPointSetMesh
-(
- const fvMesh& mesh,
- const pointSet& pSet,
- vtkPolyData* vtkmesh
-)
-{
- if (debug)
- {
- Info<< " Foam::vtkPV3Foam::addPointSetMesh" << endl;
- }
-
- const pointField& meshPoints = mesh.points();
-
- vtkPoints *vtkpoints = vtkPoints::New();
- vtkpoints->Allocate(pSet.size());
-
- forAllConstIter(pointSet, pSet, iter)
- {
- vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[iter.key()]);
- }
-
- vtkmesh->SetPoints(vtkpoints);
- vtkpoints->Delete();
-
- if (debug)
- {
- Info<< " Foam::vtkPV3Foam::addPointSetMesh" << endl;
- }
-}
-
-
-// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointZoneMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointZoneMesh.C
deleted file mode 100644
index f6369bfa23..0000000000
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddPointZoneMesh.C
+++ /dev/null
@@ -1,72 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
- \\/ M anipulation |
--------------------------------------------------------------------------------
-License
- This file is part of OpenFOAM.
-
- OpenFOAM is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License
- along with OpenFOAM; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-Description
-
-\*---------------------------------------------------------------------------*/
-
-#include "vtkPV3Foam.H"
-
-// Foam includes
-#include "vtkPV3FoamInsertNextPoint.H"
-
-// VTK includes
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-void Foam::vtkPV3Foam::addPointZoneMesh
-(
- const fvMesh& mesh,
- const labelList& pointLabels,
- vtkPolyData* vtkmesh
-)
-{
- if (debug)
- {
- Info<< " Foam::vtkPV3Foam::addPointZoneMesh" << endl;
- }
-
- const pointField& meshPoints = mesh.points();
-
- vtkPoints *vtkpoints = vtkPoints::New();
- vtkpoints->Allocate(pointLabels.size());
-
- forAll(pointLabels, pointI)
- {
- vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
- }
-
- vtkmesh->SetPoints(vtkpoints);
- vtkpoints->Delete();
-
- if (debug)
- {
- Info<< " Foam::vtkPV3Foam::addPointZoneMesh" << endl;
- }
-}
-
-
-// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceSetMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddSetMesh.C
similarity index 82%
rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceSetMesh.C
rename to applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddSetMesh.C
index 116f503a4d..8b17ace185 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceSetMesh.C
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddSetMesh.C
@@ -30,6 +30,7 @@ Description
// Foam includes
#include "faceSet.H"
+#include "pointSet.H"
#include "vtkPV3FoamInsertNextPoint.H"
// VTK includes
@@ -103,4 +104,36 @@ void Foam::vtkPV3Foam::addFaceSetMesh
}
}
+
+void Foam::vtkPV3Foam::addPointSetMesh
+(
+ const fvMesh& mesh,
+ const pointSet& pSet,
+ vtkPolyData* vtkmesh
+)
+{
+ if (debug)
+ {
+ Info<< " Foam::vtkPV3Foam::addPointSetMesh" << endl;
+ }
+
+ const pointField& meshPoints = mesh.points();
+
+ vtkPoints *vtkpoints = vtkPoints::New();
+ vtkpoints->Allocate(pSet.size());
+
+ forAllConstIter(pointSet, pSet, iter)
+ {
+ vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[iter.key()]);
+ }
+
+ vtkmesh->SetPoints(vtkpoints);
+ vtkpoints->Delete();
+
+ if (debug)
+ {
+ Info<< " Foam::vtkPV3Foam::addPointSetMesh" << endl;
+ }
+}
+
// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H
similarity index 70%
rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H
rename to applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H
index ff6c48bfe5..08a3162686 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H
@@ -22,13 +22,10 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-InClass
- vtkPV3Foam
-
\*---------------------------------------------------------------------------*/
-#ifndef vtkPV3FoamAddFields_H
-#define vtkPV3FoamAddFields_H
+#ifndef vtkPV3FoamAddToSelection_H
+#define vtkPV3FoamAddToSelection_H
// FOAM includes
#include "SortableList.H"
@@ -38,48 +35,48 @@ InClass
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-template
-Foam::label Foam::vtkPV3Foam::addFields
+template
+Foam::label Foam::vtkPV3Foam::addToSelection
(
- vtkDataArraySelection *fieldSelection,
- const IOobjectList& objects,
+ vtkDataArraySelection *arraySelection,
+ const IOobjectList& objectLst,
const string& suffix
)
{
- IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
+ IOobjectList objects(objectLst.lookupClass(Type::typeName));
- SortableList fields(fieldObjects.size());
+ SortableList objectNames(objects.size());
label count = 0;
- forAllConstIter(IOobjectList, fieldObjects, iter)
+ forAllConstIter(IOobjectList, objects, iter)
{
- fields[count++] = iter()->name();
+ objectNames[count++] = iter()->name();
}
if (count)
{
- fields.sort();
+ objectNames.sort();
- forAll(fields, fieldI)
+ forAll (objectNames, objI)
{
if (debug)
{
- Info<<" addField to GUI " << GeoField::typeName
- << ":" << fields[fieldI] << endl;
+ Info<<" addToSelection<" << Type::typeName << "> to GUI "
+ << ":" << objectNames[objI] << endl;
}
if (suffix.size())
{
- fieldSelection->AddArray
+ arraySelection->AddArray
(
- (fields[fieldI] + suffix).c_str()
+ (objectNames[objI] + suffix).c_str()
);
}
else
{
- fieldSelection->AddArray
+ arraySelection->AddArray
(
- fields[fieldI].c_str()
+ objectNames[objI].c_str()
);
}
}
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceZoneMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddZoneMesh.C
similarity index 82%
rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceZoneMesh.C
rename to applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddZoneMesh.C
index 044d4cedaf..b9c733eeed 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFaceZoneMesh.C
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddZoneMesh.C
@@ -38,6 +38,7 @@ Description
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
void Foam::vtkPV3Foam::addFaceZoneMesh
(
const fvMesh& mesh,
@@ -102,4 +103,36 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
}
+
+void Foam::vtkPV3Foam::addPointZoneMesh
+(
+ const fvMesh& mesh,
+ const labelList& pointLabels,
+ vtkPolyData* vtkmesh
+)
+{
+ if (debug)
+ {
+ Info<< " Foam::vtkPV3Foam::addPointZoneMesh" << endl;
+ }
+
+ const pointField& meshPoints = mesh.points();
+
+ vtkPoints *vtkpoints = vtkPoints::New();
+ vtkpoints->Allocate(pointLabels.size());
+
+ forAll(pointLabels, pointI)
+ {
+ vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
+ }
+
+ vtkmesh->SetPoints(vtkpoints);
+ vtkpoints->Delete();
+
+ if (debug)
+ {
+ Info<< " Foam::vtkPV3Foam::addPointZoneMesh" << endl;
+ }
+}
+
// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C
index 47239f02d7..432372d296 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C
@@ -76,7 +76,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
if (debug)
{
- Info<< "Creating VTK internal mesh" << endl;
+ Info<< "Creating VTK internalMesh" << endl;
}
const label datasetId = 0;
@@ -285,14 +285,14 @@ void Foam::vtkPV3Foam::convertMeshCellZones
}
-void Foam::vtkPV3Foam::convertMeshCellSet
+void Foam::vtkPV3Foam::convertMeshCellSets
(
vtkMultiBlockDataSet* output
)
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshCellSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshCellSets" << endl;
}
const selectionInfo& selector = selectInfoCellSets_;
@@ -359,10 +359,11 @@ void Foam::vtkPV3Foam::convertMeshCellSet
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshCellSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshCellSets" << endl;
}
}
+
void Foam::vtkPV3Foam::convertMeshFaceZones
(
vtkMultiBlockDataSet* output
@@ -417,7 +418,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
vtkmesh->Delete();
}
}
-
+
if (debug)
{
Info<< " Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
@@ -425,14 +426,14 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
}
-void Foam::vtkPV3Foam::convertMeshFaceSet
+void Foam::vtkPV3Foam::convertMeshFaceSets
(
vtkMultiBlockDataSet* output
)
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
}
const selectionInfo& selector = selectInfoFaceSets_;
@@ -487,10 +488,10 @@ void Foam::vtkPV3Foam::convertMeshFaceSet
vtkmesh->Delete();
}
}
-
+
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
}
}
@@ -549,7 +550,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
vtkmesh->Delete();
}
}
-
+
if (debug)
{
Info<< " Foam::vtkPV3Foam::convertMeshPointZones" << endl;
@@ -558,14 +559,14 @@ void Foam::vtkPV3Foam::convertMeshPointZones
-void Foam::vtkPV3Foam::convertMeshPointSet
+void Foam::vtkPV3Foam::convertMeshPointSets
(
vtkMultiBlockDataSet* output
)
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshPointSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshPointSets" << endl;
}
const selectionInfo& selector = selectInfoPointSets_;
@@ -620,10 +621,10 @@ void Foam::vtkPV3Foam::convertMeshPointSet
vtkmesh->Delete();
}
}
-
+
if (debug)
{
- Info<< " Foam::vtkPV3Foam::convertMeshPointSet" << endl;
+ Info<< " Foam::vtkPV3Foam::convertMeshPointSets" << endl;
}
}
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamI.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamI.H
index 37f9543c56..8f9f682cdc 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamI.H
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamI.H
@@ -28,7 +28,6 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-//- Extract up to the first non-word characters
inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
{
if (str)
@@ -46,32 +45,4 @@ inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
}
}
-
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformation.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformation.C
index 9c2d144dea..d47b7a191b 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformation.C
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformation.C
@@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-Description
-
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
@@ -31,9 +29,9 @@ Description
// Foam includes
#include "cellSet.H"
#include "faceSet.H"
+#include "pointSet.H"
#include "IOobjectList.H"
#include "IOPtrList.H"
-#include "pointSet.H"
#include "polyBoundaryMeshEntries.H"
#include "entry.H"
#include "vtkPV3FoamReader.h"
@@ -79,7 +77,7 @@ public:
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-#include "vtkPV3FoamAddFields.H"
+#include "vtkPV3FoamAddToSelection.H"
#include "vtkPV3FoamUpdateInformationFields.H"
void Foam::vtkPV3Foam::updateInformationInternalMesh()
@@ -103,6 +101,9 @@ void Foam::vtkPV3Foam::updateInformationInternalMesh()
if (debug)
{
+ // just for debug info
+ getSelectedArrayEntries(arraySelection);
+
Info<< " Foam::vtkPV3Foam::updateInformationInternalMesh" << endl;
}
@@ -132,7 +133,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
arraySelection->AddArray("lagrangian");
selectInfoLagrangian_ += 1;
- Info<<"added cloudDirs\n";
+ Info<< "... added cloudDirs\n";
if (cloudDirs.size() > 1)
{
@@ -149,13 +150,16 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
{
if (debug)
{
- Info<<"no clouds identified in " <timePath()/"lagrangian" << endl;
}
}
if (debug)
{
+ // just for debug info
+ getSelectedArrayEntries(arraySelection);
+
Info<< " Foam::vtkPV3Foam::updateInformationLagrangian" << endl;
}
}
@@ -165,7 +169,8 @@ void Foam::vtkPV3Foam::updateInformationPatches()
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::updateInformationPatches" << endl;
+ Info<< " Foam::vtkPV3Foam::updateInformationPatches"
+ << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
}
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
@@ -209,117 +214,130 @@ void Foam::vtkPV3Foam::updateInformationPatches()
if (debug)
{
+ // just for debug info
+ getSelectedArrayEntries(arraySelection);
+
Info<< " Foam::vtkPV3Foam::updateInformationPatches" << endl;
}
}
+Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
+{
+ wordList zoneNames;
+
+ // mesh not loaded - read from file
+ IOobject ioObj
+ (
+ zoneType,
+ dbPtr_().findInstance
+ (
+ polyMesh::meshSubDir,
+ zoneType,
+ IOobject::READ_IF_PRESENT
+ ),
+ polyMesh::meshSubDir,
+ dbPtr_(),
+ IOobject::READ_IF_PRESENT,
+ IOobject::NO_WRITE,
+ false
+ );
+
+ if (ioObj.headerOk())
+ {
+ zonesEntries zones(ioObj);
+
+ zoneNames.setSize(zones.size());
+ forAll (zones, zoneI)
+ {
+ zoneNames[zoneI] = zones[zoneI].keyword();
+ }
+ }
+
+ return zoneNames;
+}
+
+
void Foam::vtkPV3Foam::updateInformationZones()
{
if (debug)
{
- Info<< " Foam::vtkPV3Foam::updateInformationZones" << endl;
+ Info<< " Foam::vtkPV3Foam::updateInformationZones"
+ << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
}
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
- // Read cell zone information
+ wordList zoneNames;
+
+ //
+ // cellZones information
+ // ~~~~~~~~~~~~~~~~~~~~~
+ if (meshPtr_)
{
- zonesEntries zones
- (
- IOobject
- (
- "cellZones",
- dbPtr_().findInstance(polyMesh::meshSubDir, "cellZones"),
- polyMesh::meshSubDir,
- dbPtr_(),
- IOobject::READ_IF_PRESENT,
- IOobject::NO_WRITE,
- false
- )
- );
-
- selectInfoCellZones_ = arraySelection->GetNumberOfArrays();
- if (zones.headerOk())
- {
- forAll(zones, zoneI)
- {
- arraySelection->AddArray
- (
- (zones[zoneI].keyword() + " - cellZone").c_str()
- );
- }
- selectInfoCellZones_ += zones.size();
- }
-
- superCellZonesCells_.setSize(selectInfoCellZones_.size());
+ zoneNames = meshPtr_->cellZones().names();
+ }
+ else
+ {
+ zoneNames = readZoneNames("cellZones");
}
- // Read face zone information
+ selectInfoCellZones_ = arraySelection->GetNumberOfArrays();
+ forAll (zoneNames, zoneI)
{
- zonesEntries zones
- (
- IOobject
- (
- "faceZones",
- dbPtr_().findInstance(polyMesh::meshSubDir, "faceZones"),
- polyMesh::meshSubDir,
- dbPtr_(),
- IOobject::READ_IF_PRESENT,
- IOobject::NO_WRITE,
- false
- )
- );
+ arraySelection->AddArray((zoneNames[zoneI] + " - cellZone").c_str());
+ }
+ selectInfoCellZones_ += zoneNames.size();
+ superCellZonesCells_.setSize(selectInfoCellZones_.size());
- selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
- if (zones.headerOk())
- {
- forAll(zones, zoneI)
- {
- arraySelection->AddArray
- (
- (zones[zoneI].keyword() + " - faceZone").c_str()
- );
- }
- selectInfoFaceZones_ += zones.size();
- }
+
+ //
+ // faceZones information
+ // ~~~~~~~~~~~~~~~~~~~~~
+ if (meshPtr_)
+ {
+ zoneNames = meshPtr_->faceZones().names();
+ }
+ else
+ {
+ zoneNames = readZoneNames("faceZones");
}
- // Read point zone information
+ selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
+ forAll (zoneNames, zoneI)
{
- zonesEntries zones
- (
- IOobject
- (
- "pointZones",
- dbPtr_().findInstance(polyMesh::meshSubDir, "pointZones"),
- polyMesh::meshSubDir,
- dbPtr_(),
- IOobject::READ_IF_PRESENT,
- IOobject::NO_WRITE,
- false
- )
- );
-
- selectInfoPointZones_ = arraySelection->GetNumberOfArrays();
- if (zones.headerOk())
- {
- forAll(zones, zoneI)
- {
- arraySelection->AddArray
- (
- (zones[zoneI].keyword() + " - pointZone").c_str()
- );
- }
- selectInfoPointZones_ += zones.size();
- }
+ arraySelection->AddArray((zoneNames[zoneI] + " - faceZone").c_str());
}
+ selectInfoFaceZones_ += zoneNames.size();
+
+
+ //
+ // pointZones information
+ // ~~~~~~~~~~~~~~~~~~~~~~
+ if (meshPtr_)
+ {
+ zoneNames = meshPtr_->pointZones().names();
+ }
+ else
+ {
+ zoneNames = readZoneNames("pointZones");
+ }
+
+ selectInfoPointZones_ = arraySelection->GetNumberOfArrays();
+ forAll (zoneNames, zoneI)
+ {
+ arraySelection->AddArray((zoneNames[zoneI] + " - pointZone").c_str());
+ }
+ selectInfoPointZones_ += zoneNames.size();
+
if (debug)
{
+ // just for debug info
+ getSelectedArrayEntries(arraySelection);
+
Info<< " Foam::vtkPV3Foam::updateInformationZones" << endl;
}
-
}
@@ -332,7 +350,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
- // Add sets
+ // Add names of sets
IOobjectList objects
(
dbPtr_(),
@@ -342,7 +360,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
selectInfoCellSets_ = arraySelection->GetNumberOfArrays();
- selectInfoCellSets_ += addFields
+ selectInfoCellSets_ += addToSelection
(
arraySelection,
objects,
@@ -351,7 +369,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
superCellSetCells_.setSize(selectInfoCellSets_.size());
selectInfoFaceSets_ = arraySelection->GetNumberOfArrays();
- selectInfoFaceSets_ += addFields
+ selectInfoFaceSets_ += addToSelection
(
arraySelection,
objects,
@@ -359,7 +377,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
);
selectInfoPointSets_ = arraySelection->GetNumberOfArrays();
- selectInfoPointSets_ += addFields
+ selectInfoPointSets_ += addToSelection
(
arraySelection,
objects,
@@ -368,6 +386,9 @@ void Foam::vtkPV3Foam::updateInformationSets()
if (debug)
{
+ // just for debug info
+ getSelectedArrayEntries(arraySelection);
+
Info<< " Foam::vtkPV3Foam::updateInformationSets" << endl;
}
}
@@ -399,32 +420,32 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
"lagrangian"/cloudName_
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
@@ -444,5 +465,4 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
}
}
-
// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H
index 170ad74ed1..a5c110e3b9 100644
--- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H
+++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H
@@ -43,11 +43,23 @@ void Foam::vtkPV3Foam::updateInformationFields
Info<< " Foam::vtkPV3Foam::updateInformationFields" << endl;
}
- // preserve the currently selected values
- const stringList selectedEntries = getSelectedArrayEntries
- (
- arraySelection
- );
+ stringList selectedEntries;
+ // enable 'p' and 'U' on the first call
+ if (arraySelection->GetNumberOfArrays() == 0)
+ {
+ selectedEntries.setSize(2);
+ selectedEntries[0] = "p";
+ selectedEntries[1] = "U";
+ }
+ else
+ {
+ // preserve the currently selected values
+ selectedEntries = getSelectedArrayEntries
+ (
+ arraySelection
+ );
+ }
+
arraySelection->RemoveAllArrays();
// Search for list of objects for this time
@@ -56,33 +68,33 @@ void Foam::vtkPV3Foam::updateInformationFields
//- Add volume fields to GUI
/*
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
*/
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects
);
- addFields >
+ addToSelection >
(
arraySelection,
objects