Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
30ed1dc6
Commit
30ed1dc6
authored
Mar 25, 2016
by
Martin Khannouz
Committed by
Berenger Bramas
Mar 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change tree so it create block with size given as argument.
parent
a3624dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
Src/GroupTree/Core/FGroupTree.hpp
Src/GroupTree/Core/FGroupTree.hpp
+8
-9
No files found.
Src/GroupTree/Core/FGroupTree.hpp
View file @
30ed1dc6
...
...
@@ -626,7 +626,7 @@ public:
template
<
class
ParticleContainer
>
FGroupTree
(
const
int
inTreeHeight
,
const
FReal
inBoxWidth
,
const
FPoint
<
FReal
>&
inBoxCenter
,
const
int
inNbElementsPerBlock
,
ParticleContainer
*
inParticlesContainer
,
std
::
vector
<
std
::
vector
<
int
>>
group
SizeAtEachLevel
,
std
::
vector
<
std
::
vector
<
int
>>
&
block
SizeAtEachLevel
,
const
bool
particlesAreSorted
=
false
)
:
treeHeight
(
inTreeHeight
),
nbElementsPerBlock
(
inNbElementsPerBlock
),
cellBlocksPerLevel
(
nullptr
),
boxCenter
(
inBoxCenter
),
boxCorner
(
inBoxCenter
,
-
(
inBoxWidth
/
2
)),
boxWidth
(
inBoxWidth
),
...
...
@@ -670,6 +670,7 @@ public:
// Convert to block
const
int
idxLevel
=
(
treeHeight
-
1
);
int
idxBlock
=
0
;
FSize
*
nbParticlesPerLeaf
=
new
FSize
[
nbElementsPerBlock
];
FSize
firstParticle
=
0
;
// We need to proceed each group in sub level
...
...
@@ -677,7 +678,7 @@ public:
int
sizeOfBlock
=
0
;
FSize
lastParticle
=
firstParticle
;
// Count until end of sub group is reached or we have enough cells
while
(
sizeOfBlock
<
nbElementsPerBlock
&&
lastParticle
<
nbParticles
){
while
(
sizeOfBlock
<
blockSizeAtEachLevel
[
treeHeight
-
1
][
idxBlock
]
&&
lastParticle
<
nbParticles
){
if
(
sizeOfBlock
==
0
||
currentBlockIndexes
[
sizeOfBlock
-
1
]
!=
particlesToSort
[
lastParticle
].
mindex
){
currentBlockIndexes
[
sizeOfBlock
]
=
particlesToSort
[
lastParticle
].
mindex
;
nbParticlesPerLeaf
[
sizeOfBlock
]
=
1
;
...
...
@@ -731,6 +732,7 @@ public:
sizeOfBlock
=
0
;
firstParticle
=
lastParticle
;
++
idxBlock
;
}
delete
[]
nbParticlesPerLeaf
;
delete
[]
particlesToSort
;
...
...
@@ -743,10 +745,6 @@ public:
CellGroupConstIterator
iterChildCells
=
cellBlocksPerLevel
[
idxLevel
+
1
].
begin
();
const
CellGroupConstIterator
iterChildEndCells
=
cellBlocksPerLevel
[
idxLevel
+
1
].
end
();
// Skip blocks that do not respect limit
while
(
iterChildCells
!=
iterChildEndCells
)
++
iterChildCells
;
// If lower level is empty or all blocks skiped stop here
if
(
iterChildCells
==
iterChildEndCells
){
break
;
...
...
@@ -754,11 +752,11 @@ public:
MortonIndex
currentCellIndex
=
(
*
iterChildCells
)
->
getStartingIndex
();
int
sizeOfBlock
=
0
;
int
idxBlock
=
0
;
// We need to proceed each group in sub level
while
(
iterChildCells
!=
iterChildEndCells
){
// Count until end of sub group is reached or we have enough cells
while
(
sizeOfBlock
<
nbElementsPerBlock
&&
iterChildCells
!=
iterChildEndCells
){
while
(
sizeOfBlock
<
blockSizeAtEachLevel
[
idxLevel
][
idxBlock
]
&&
iterChildCells
!=
iterChildEndCells
){
if
((
sizeOfBlock
==
0
||
currentBlockIndexes
[
sizeOfBlock
-
1
]
!=
(
currentCellIndex
>>
3
))
&&
(
*
iterChildCells
)
->
exists
(
currentCellIndex
)){
currentBlockIndexes
[
sizeOfBlock
]
=
(
currentCellIndex
>>
3
);
...
...
@@ -779,7 +777,7 @@ public:
}
// If group is full
if
(
sizeOfBlock
==
nbElementsPerBlock
||
(
sizeOfBlock
&&
iterChildCells
==
iterChildEndCells
)){
if
(
sizeOfBlock
==
blockSizeAtEachLevel
[
idxLevel
][
idxBlock
]
||
(
sizeOfBlock
&&
iterChildCells
==
iterChildEndCells
)){
//NOTE la seconde partie va sûrement sauter, car la taille est pré-calculée
// Create a group
CellGroupClass
*
const
newBlock
=
new
CellGroupClass
(
currentBlockIndexes
[
0
],
currentBlockIndexes
[
sizeOfBlock
-
1
]
+
1
,
...
...
@@ -799,6 +797,7 @@ public:
cellBlocksPerLevel
[
idxLevel
].
push_back
(
newBlock
);
sizeOfBlock
=
0
;
++
idxBlock
;
}
}
}
...
...
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