Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
eeac186f
Commit
eeac186f
authored
Nov 14, 2012
by
mattijs
Browse files
BUG: paraFoam: pointFields not on faceZones
parent
d0c0fb9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H
View file @
eeac186f
...
...
@@ -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
(
...
...
applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C
View file @
eeac186f
...
...
@@ -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
);
...
...
applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C
View file @
eeac186f
...
...
@@ -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
,
...
...
applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H
View file @
eeac186f
...
...
@@ -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
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment