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
Modules
Visualization
Commits
30aaa219
Commit
30aaa219
authored
Feb 24, 2010
by
Mark Olesen
Browse files
ENH: begin initial coding for using upcoming vtkPolyhedron
parent
cb36a393
Changes
24
Hide whitespace changes
Inline
Side-by-side
src/paraview-plugins/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml
View file @
30aaa219
...
...
@@ -82,6 +82,19 @@
</Documentation>
</IntVectorProperty>
<!-- Use VTK Polyhedron check-box -->
<IntVectorProperty
name=
"UseVTKPolyhedron"
command=
"SetUseVTKPolyhedron"
number_of_elements=
"1"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Use vtkPolyhedron instead of decomposing polyhedra
</Documentation>
</IntVectorProperty>
<!-- Include Sets check-box -->
<IntVectorProperty
name=
"UiIncludeSets"
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
9
-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
9
-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -83,6 +83,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
SkipZeroTime
=
0
;
ExtrapolatePatches
=
0
;
UseVTKPolyhedron
=
0
;
IncludeSets
=
0
;
IncludeZones
=
0
;
ShowPatchNames
=
0
;
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -102,6 +102,11 @@ public:
vtkSetMacro
(
ExtrapolatePatches
,
int
);
vtkGetMacro
(
ExtrapolatePatches
,
int
);
// Description:
// FOAM use vtkPolyhedron instead of decomposing polyhedra
vtkSetMacro
(
UseVTKPolyhedron
,
int
);
vtkGetMacro
(
UseVTKPolyhedron
,
int
);
// Description:
// FOAM read sets control
virtual
void
SetIncludeSets
(
int
);
...
...
@@ -217,6 +222,7 @@ private:
int
SkipZeroTime
;
int
ExtrapolatePatches
;
int
UseVTKPolyhedron
;
int
IncludeSets
;
int
IncludeZones
;
int
ShowPatchNames
;
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"vtkPV3Foam.H"
#include
"vtkPV3FoamReader.h"
// Foam includes
#include
"fvMesh.H"
...
...
@@ -33,6 +34,7 @@ License
// VTK includes
#include
"vtkCellArray.h"
#include
"vtkIdTypeArray.h"
#include
"vtkUnstructuredGrid.h"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
...
...
@@ -79,35 +81,40 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
{
Info
<<
"... scanning"
<<
endl
;
}
forAll
(
cellShapes
,
cellI
)
// count number of cells to decompose
if
(
!
reader_
->
GetUseVTKPolyhedron
())
{
const
cellModel
&
model
=
cellShapes
[
cellI
].
model
();
if
(
model
!=
hex
&&
model
!=
wedge
&&
model
!=
prism
&&
model
!=
pyr
&&
model
!=
tet
&&
model
!=
tetWedge
)
forAll
(
cellShapes
,
cellI
)
{
const
cell
&
cFaces
=
mesh
.
cells
()[
cellI
]
;
const
cell
Model
&
model
=
cellShapes
[
cellI
].
model
()
;
forAll
(
cFaces
,
cFaceI
)
if
(
model
!=
hex
&&
model
!=
wedge
&&
model
!=
prism
&&
model
!=
pyr
&&
model
!=
tet
&&
model
!=
tetWedge
)
{
const
face
&
f
=
mesh
.
faces
()[
cFaces
[
cFaceI
]
];
const
cell
&
cFaces
=
mesh
.
cells
()[
cellI
];
label
nFacePoints
=
f
.
size
();
forAll
(
cFaces
,
cFaceI
)
{
const
face
&
f
=
mesh
.
faces
()[
cFaces
[
cFaceI
]];
label
nQuads
=
(
nFacePoints
-
2
)
/
2
;
label
nTris
=
(
nFacePoints
-
2
)
%
2
;
nAddCells
+=
nQuads
+
nTris
;
}
label
nFacePoints
=
f
.
size
();
label
nQuads
=
(
nFacePoints
-
2
)
/
2
;
label
nTris
=
(
nFacePoints
-
2
)
%
2
;
nAddCells
+=
nQuads
+
nTris
;
}
nAddCells
--
;
nAddPoints
++
;
nAddCells
--
;
nAddPoints
++
;
}
}
}
...
...
@@ -155,7 +162,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Set counters for additional points and additional cells
label
addPointI
=
0
,
addCellI
=
0
;
// Create storage for points - needed for mapping from
Foam
to VTK
// Create storage for points - needed for mapping from
OpenFOAM
to VTK
// data types - max 'order' = hex = 8 points
vtkIdType
nodeIds
[
8
];
...
...
@@ -256,6 +263,80 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
nodeIds
);
}
else
if
(
reader_
->
GetUseVTKPolyhedron
())
{
// Polyhedral cell - use VTK_POLYHEDRON
const
labelList
&
cFaces
=
mesh
.
cells
()[
cellI
];
vtkIdType
nFaces
=
cFaces
.
size
();
vtkIdType
nodeCount
=
0
;
vtkIdType
nLabels
=
nFaces
;
// count size for face stream
forAll
(
cFaces
,
cFaceI
)
{
const
face
&
f
=
mesh
.
faces
()[
cFaces
[
cFaceI
]];
nLabels
+=
f
.
size
();
}
// unique node ids - approximately equal to the number of point ids
DynamicList
<
vtkIdType
>
uniqueNodeIds
(
nLabels
-
nFaces
);
// zero-based index into uniqueNodeIds
DynamicList
<
vtkIdType
>
faceLabels
(
nLabels
);
// localized point id within the cell
Map
<
label
>
mapLocalId
(
2
*
nLabels
);
// establish the unique point ids,
// record the local mapping ids,
// create new face list
forAll
(
cFaces
,
cFaceI
)
{
const
face
&
f
=
mesh
.
faces
()[
cFaces
[
cFaceI
]];
const
label
nFacePoints
=
f
.
size
();
// number of labels for this face
faceLabels
.
append
(
nFacePoints
);
forAll
(
f
,
fp
)
{
const
label
nodeId
=
f
[
fp
];
if
(
mapLocalId
.
insert
(
nodeId
,
nodeCount
))
{
// insertion was successful (node Id was unique)
uniqueNodeIds
.
append
(
nodeId
);
// map orig vertex id -> localized point label
faceLabels
.
append
(
nodeCount
);
++
nodeCount
;
}
else
{
// map orig vertex id -> localized point label
faceLabels
.
append
(
mapLocalId
[
nodeId
]);
}
}
}
#ifdef HAS_VTK_POLYHEDRON
vtkmesh
->
InsertNextCell
(
VTK_POLYHEDRON
,
nodeCount
,
uniqueNodeIds
.
data
(),
faceCount
,
faceLabels
.
data
()
);
#else
vtkmesh
->
InsertNextCell
(
VTK_CONVEX_POINT_SET
,
nodeCount
,
uniqueNodeIds
.
data
()
);
#endif
}
else
{
// Polyhedral cell. Decompose into tets + prisms.
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H
View file @
30aaa219
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
Prev
1
2
Next
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