Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
9509182d
Commit
9509182d
authored
Jan 30, 2013
by
Robert Maynard
Browse files
Algorithm doesn't apply ghost levels when not needed now.
Change-Id: I3e43d32e6e44b60702c8e3894c8080da4fbc3400
parent
7ceb52f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Filters/Parallel/vtkExtractPolyDataPiece.cxx
View file @
9509182d
...
...
@@ -337,9 +337,10 @@ void vtkExtractPolyDataPiece::AddGhostLevel(vtkPolyData *input,
const
vtkIdType
numNeighbors
=
neighborIds
->
GetNumberOfIds
();
for
(
vtkIdType
k
=
0
;
k
<
numNeighbors
;
++
k
)
{
if
(
cellTags
->
GetValue
(
neighborIds
->
GetId
(
k
))
==
-
1
)
const
vtkIdType
neighborCellId
=
neighborIds
->
GetId
(
k
);
if
(
cellTags
->
GetValue
(
neighborCellId
)
==
-
1
)
{
cellTags
->
SetValue
(
neighbor
Ids
->
GetId
(
k
)
,
level
);
cellTags
->
SetValue
(
neighbor
CellId
,
level
);
}
}
}
...
...
Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx
View file @
9509182d
...
...
@@ -86,8 +86,18 @@ void vtkExtractUnstructuredGridPiece::ComputeCellTags(vtkIntArray *tags,
}
// Brute force division.
//mark all as -1
for
(
idx
=
0
;
idx
<
numCells
;
++
idx
)
//mark all we own as zero and the rest as -1
const
vtkIdType
minCell
=
(
numCells
+
1
)
/
numPieces
*
piece
;
const
vtkIdType
maxCell
=
minCell
+
(
numCells
/
numPieces
);
for
(
idx
=
0
;
idx
<
minCell
;
++
idx
)
{
tags
->
SetValue
(
idx
,
-
1
);
}
for
(
idx
=
minCell
;
idx
<
maxCell
;
++
idx
)
{
tags
->
SetValue
(
idx
,
0
);
}
for
(
idx
=
maxCell
;
idx
<
numCells
;
++
idx
)
{
tags
->
SetValue
(
idx
,
-
1
);
}
...
...
@@ -96,12 +106,8 @@ void vtkExtractUnstructuredGridPiece::ComputeCellTags(vtkIntArray *tags,
vtkIdType
*
cellPointer
=
(
input
->
GetCells
()
?
input
->
GetCells
()
->
GetPointer
()
:
0
);
if
(
pointOwnership
&&
cellPointer
)
{
const
vtkIdType
minCell
=
(
numCells
+
1
)
/
numPieces
*
piece
;
const
vtkIdType
maxCell
=
minCell
+
(
numCells
/
numPieces
)
+
1
;
for
(
idx
=
minCell
;
idx
<
maxCell
;
++
idx
)
for
(
idx
=
0
;
idx
<
numCells
;
++
idx
)
{
tags
->
SetValue
(
idx
,
0
);
// Fill in point ownership mapping.
numCellPts
=
cellPointer
[
0
];
vtkIdType
*
ids
=
cellPointer
+
1
;
...
...
@@ -193,7 +199,7 @@ int vtkExtractUnstructuredGridPiece::RequestData(
if
(
this
->
CreateGhostCells
&&
ghostLevel
>
0
)
{
this
->
AddFirstGhostLevel
(
input
,
cellTags
,
piece
,
numPieces
);
for
(
i
=
2
;
i
<
ghostLevel
+
1
;
i
++
)
for
(
i
=
2
;
i
<
=
ghostLevel
;
i
++
)
{
this
->
AddGhostLevel
(
input
,
cellTags
,
i
);
}
...
...
@@ -341,7 +347,7 @@ void vtkExtractUnstructuredGridPiece::AddFirstGhostLevel(
//for level 1 we have an optimal implementation
//that can compute the subset of cells we need to check
const
vtkIdType
minCell
=
(
numCells
+
1
)
/
numPieces
*
piece
;
const
vtkIdType
maxCell
=
minCell
+
(
numCells
/
numPieces
)
+
1
;
const
vtkIdType
maxCell
=
minCell
+
(
numCells
/
numPieces
);
for
(
vtkIdType
idx
=
minCell
;
idx
<
maxCell
;
++
idx
)
{
input
->
GetCellPoints
(
idx
,
cellPointIds
.
GetPointer
());
...
...
@@ -351,11 +357,11 @@ void vtkExtractUnstructuredGridPiece::AddFirstGhostLevel(
const
vtkIdType
pointId
=
cellPointIds
->
GetId
(
j
);
input
->
GetPointCells
(
pointId
,
neighborIds
.
GetPointer
());
const
vtkIdType
numNeighbors
=
neighborIds
->
GetNumberOfIds
();
const
vtkIdType
numNeighbors
=
neighborIds
->
GetNumberOfIds
();
for
(
vtkIdType
k
=
0
;
k
<
numNeighbors
;
++
k
)
{
const
vtkIdType
neighborCellId
=
neighborIds
->
GetId
(
k
);
if
(
neighborCellId
<
minCell
||
neighborCellId
>=
maxCell
)
if
(
cellTags
->
GetValue
(
neighborCellId
)
==
-
1
)
{
cellTags
->
SetValue
(
neighborCellId
,
1
);
}
...
...
@@ -389,9 +395,10 @@ void vtkExtractUnstructuredGridPiece::AddGhostLevel(vtkUnstructuredGrid *input,
const
vtkIdType
numNeighbors
=
neighborIds
->
GetNumberOfIds
();
for
(
vtkIdType
k
=
0
;
k
<
numNeighbors
;
++
k
)
{
if
(
cellTags
->
GetValue
(
neighborIds
->
GetId
(
k
))
==
-
1
)
const
vtkIdType
neighborCellId
=
neighborIds
->
GetId
(
k
);
if
(
cellTags
->
GetValue
(
neighborCellId
)
==
-
1
)
{
cellTags
->
SetValue
(
neighbor
Ids
->
GetId
(
k
)
,
level
);
cellTags
->
SetValue
(
neighbor
CellId
,
level
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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