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
1d6268f2
Commit
1d6268f2
authored
Nov 03, 2009
by
mattijs
Browse files
better use of CompactListList
parent
69a4c76c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C
View file @
1d6268f2
...
...
@@ -488,9 +488,6 @@ void Foam::polyTopoChange::makeCellCells
// Neighbours per cell
labelList
nNbrs
(
cellMap_
.
size
(),
0
);
// Overall number of cellCells
label
nCellCells
=
0
;
// 1. Count neighbours (through internal faces) per cell
for
(
label
faceI
=
0
;
faceI
<
nActiveFaces
;
faceI
++
)
...
...
@@ -499,22 +496,12 @@ void Foam::polyTopoChange::makeCellCells
{
nNbrs
[
faceOwner_
[
faceI
]]
++
;
nNbrs
[
faceNeighbour_
[
faceI
]]
++
;
nCellCells
+=
2
;
}
}
cellCells
.
setSize
(
cellMap_
.
size
(),
nCellCells
);
// 2. Calculate offsets
labelList
&
offsets
=
cellCells
.
offsets
();
// 2. Construct csr
cellCells
.
setSize
(
nNbrs
);
label
sumSize
=
0
;
forAll
(
nNbrs
,
cellI
)
{
sumSize
+=
nNbrs
[
cellI
];
offsets
[
cellI
]
=
sumSize
;
}
// 3. Fill faces per cell
...
...
@@ -543,8 +530,6 @@ Foam::label Foam::polyTopoChange::getCellOrder
labelList
&
oldToNew
)
const
{
const
labelList
&
offsets
=
cellCellAddressing
.
offsets
();
labelList
newOrder
(
cellCellAddressing
.
size
());
// Fifo buffer for string of cells
...
...
@@ -560,7 +545,7 @@ Foam::label Foam::polyTopoChange::getCellOrder
forAll
(
visited
,
cellI
)
{
// find the first non-removed cell that has not been visited yet
if
(
!
cellRemoved
(
cellI
)
&&
visited
.
get
(
cellI
)
==
0
)
if
(
!
cellRemoved
(
cellI
)
&&
visited
[
cellI
]
==
0
)
{
// use this cell as a start
nextCell
.
append
(
cellI
);
...
...
@@ -574,23 +559,22 @@ Foam::label Foam::polyTopoChange::getCellOrder
{
label
currentCell
=
nextCell
.
removeHead
();
if
(
visited
.
get
(
currentCell
)
==
0
)
if
(
visited
[
currentCell
]
==
0
)
{
visited
.
set
(
currentCell
,
1
)
;
visited
[
currentCell
]
=
1
;
// add into cellOrder
newOrder
[
cellInOrder
]
=
currentCell
;
cellInOrder
++
;
// find if the neighbours have been visited
label
i0
=
(
currentCell
==
0
?
0
:
offsets
[
currentCell
-
1
]);
label
i1
=
offsets
[
currentCell
];
const
UList
<
label
>
cCells
=
cellCellAddressing
[
currentCell
];
for
(
label
i
=
i0
;
i
<
i1
;
i
++
)
for
All
(
cCells
,
i
)
{
label
nbr
=
c
ell
Cell
Addressing
.
m
()
[
i
];
label
nbr
=
cCell
s
[
i
];
if
(
!
cellRemoved
(
nbr
)
&&
visited
.
get
(
nbr
)
==
0
)
if
(
!
cellRemoved
(
nbr
)
&&
visited
[
nbr
]
==
0
)
{
// not visited, add to the list
nextCell
.
append
(
nbr
);
...
...
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