mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: paraFoam: pointFields not on faceZones
This commit is contained in:
@ -446,13 +446,6 @@ class vtkPV3Foam
|
||||
template<class PatchType>
|
||||
vtkPolyData* patchVTKMesh(const word& name, const PatchType&);
|
||||
|
||||
//- Add face zone mesh
|
||||
vtkPolyData* faceZoneVTKMesh
|
||||
(
|
||||
const fvMesh&,
|
||||
const labelList& faceLabels
|
||||
);
|
||||
|
||||
//- Add point zone
|
||||
vtkPolyData* pointZoneVTKMesh
|
||||
(
|
||||
|
||||
@ -450,7 +450,8 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
|
||||
<< zoneName << endl;
|
||||
}
|
||||
|
||||
vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]);
|
||||
vtkPolyData* vtkmesh = patchVTKMesh(zoneName, zMesh[zoneId]());
|
||||
|
||||
if (vtkmesh)
|
||||
{
|
||||
AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,78 +35,6 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const labelList& faceLabels
|
||||
)
|
||||
{
|
||||
vtkPolyData* vtkmesh = vtkPolyData::New();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::faceZoneVTKMesh" << endl;
|
||||
printMemory();
|
||||
}
|
||||
|
||||
// Construct primitivePatch of faces in faceZone
|
||||
|
||||
const faceList& meshFaces = mesh.faces();
|
||||
faceList patchFaces(faceLabels.size());
|
||||
forAll(faceLabels, faceI)
|
||||
{
|
||||
patchFaces[faceI] = meshFaces[faceLabels[faceI]];
|
||||
}
|
||||
primitiveFacePatch p(patchFaces, mesh.points());
|
||||
|
||||
|
||||
// The balance of this routine should be identical to patchVTKMesh
|
||||
|
||||
// Convert OpenFOAM mesh vertices to VTK
|
||||
const pointField& points = p.localPoints();
|
||||
|
||||
vtkPoints* vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate(points.size());
|
||||
forAll(points, i)
|
||||
{
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
|
||||
// Add faces as polygons
|
||||
const faceList& faces = p.localFaces();
|
||||
|
||||
vtkCellArray* vtkcells = vtkCellArray::New();
|
||||
vtkcells->Allocate(faces.size());
|
||||
|
||||
forAll(faces, faceI)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
vtkIdType nodeIds[f.size()];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
nodeIds[fp] = f[fp];
|
||||
}
|
||||
vtkcells->InsertNextCell(f.size(), nodeIds);
|
||||
}
|
||||
|
||||
vtkmesh->SetPolys(vtkcells);
|
||||
vtkcells->Delete();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::faceZoneVTKMesh" << endl;
|
||||
printMemory();
|
||||
}
|
||||
|
||||
return vtkmesh;
|
||||
}
|
||||
|
||||
|
||||
vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -129,6 +129,42 @@ void Foam::vtkPV3Foam::convertPointFields
|
||||
datasetNo
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Convert faceZones - if activated
|
||||
//
|
||||
for
|
||||
(
|
||||
int partId = arrayRangeFaceZones_.start();
|
||||
partId < arrayRangeFaceZones_.end();
|
||||
++partId
|
||||
)
|
||||
{
|
||||
const word zoneName = getPartName(partId);
|
||||
const label datasetNo = partDataset_[partId];
|
||||
const label zoneId = mesh.faceZones().findZoneID(zoneName);
|
||||
|
||||
if (!partStatus_[partId] || datasetNo < 0 || zoneId < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Extract the field on the zone
|
||||
Field<Type> fld
|
||||
(
|
||||
ptf.internalField(),
|
||||
mesh.faceZones()[zoneId]().meshPoints()
|
||||
);
|
||||
|
||||
convertPatchPointField
|
||||
(
|
||||
fieldName,
|
||||
fld,
|
||||
output,
|
||||
arrayRangeFaceZones_,
|
||||
datasetNo
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user