Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
ScalFMM
Commits
55f52f6e
Commit
55f52f6e
authored
11 years ago
by
BRAMAS Berenger
Browse files
Options
Downloads
Patches
Plain Diff
remove old commented code from block tree
parent
013fed02
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Src/GroupTree/FGroupTree.hpp
+0
-140
0 additions, 140 deletions
Src/GroupTree/FGroupTree.hpp
with
0 additions
and
140 deletions
Src/GroupTree/FGroupTree.hpp
+
0
−
140
View file @
55f52f6e
...
...
@@ -348,146 +348,6 @@ public:
}
////////////////////////////////////////////////////////////////////
// Can be deleted
////////////////////////////////////////////////////////////////////
/** @brief This private method take an array of Morton index to
* create the block and the cells, using the constructor of
* FGroupOfCells !!
*/
/*CellGroupClass * createBlockFromArray(MortonIndex head[]){
//Store the start and end
MortonIndex start = head[0];
MortonIndex end = start;
int count = 0;
// Find the number of cell to allocate in the blocks
for(int idxHead = 0 ; idxHead<nbElementsPerBlock ; idxHead++){
if (head[idxHead] != CellIsEmptyFlag){
count++;
end = head[idxHead];
}
// else{
// break;
// }
}
//allocation of memory
CellGroupClass * newBlock = new CellGroupClass(start,end+1,count);
//allocation of cells
for(int idx=0 ; idx<count ; idx++){
newBlock->newCell(head[idx], idx);
(newBlock->getCell(head[idx]))->setMortonIndex(head[idx]);
//(this->getCell(head[idx]))->setCoordinate();
}
return newBlock;
}*/
/** This constructor build the BlockOctree from an Octree, but only
* the cells at leaf level are read. The cells ares constructed with
* several walk through the leafs.
*/
/*template<class OctreeClass>
FGroupTree(const int inTreeHeight, const int inNbElementsPerBlock, OctreeClass*const inOctreeSrc, int FLAG):
treeHeight(inTreeHeight),nbElementsPerBlock(inNbElementsPerBlock),cellBlocksPerLevel(0)
{
cellBlocksPerLevel = new std::list<CellGroupClass*>[treeHeight];
int *nbCellPerLevel = new int[treeHeight];
inOctreeSrc->getNbCellsPerLevel(nbCellPerLevel);
int nbLeaf = nbCellPerLevel[treeHeight-1];
delete[] nbCellPerLevel;
//We get the Morton index of all the cells at leaf level and store
//them in order to build our blocks
MortonIndex *leafsIdx = new MortonIndex[nbLeaf];
int idxLeafs = 0;
//Iterator on source octree
typename OctreeClass::Iterator octreeIterator(inOctreeSrc);
octreeIterator.gotoBottomLeft();
do{
leafsIdx[idxLeafs] = octreeIterator.getCurrentGlobalIndex();
idxLeafs++;
}
while(octreeIterator.moveRight());
//Now the work start !!1!
idxLeafs = 0;
//Temporary Header, will be filled
MortonIndex * head = new MortonIndex[inNbElementsPerBlock];
memset(head,CellIsEmptyFlag,sizeof(MortonIndex)*inNbElementsPerBlock);
//Creation and addition of all the cells at leaf level
while(idxLeafs < nbLeaf){
//Initialisation of header
memset(head,CellIsEmptyFlag,sizeof(MortonIndex)*inNbElementsPerBlock);
memcpy(head,&leafsIdx[idxLeafs],FMath::Min(sizeof(MortonIndex)*inNbElementsPerBlock,sizeof(MortonIndex)*(nbLeaf-idxLeafs)));
idxLeafs += inNbElementsPerBlock;
//creation of the block and addition to the list
CellGroupClass * tempBlock = createBlockFromArray(head);
cellBlocksPerLevel[treeHeight-1].push_back(tempBlock);
}
delete[] leafsIdx;
//Creation of the cells at others level
//Loop over levels
for(int idxLevel = treeHeight-2 ; idxLevel >= 0 ; --idxLevel){
//Set the storing system (a simple array) to CellIsEmptyFlag
memset(head,CellIsEmptyFlag,sizeof(MortonIndex)*inNbElementsPerBlock);
int idxHead = -1;
MortonIndex previous = -1;
//Iterator over the list at a deeper level (READ)
typename std::list<CellGroupClass*>::const_iterator curBlockRead;
for(curBlockRead = cellBlocksPerLevel[idxLevel+1].begin() ; curBlockRead != cellBlocksPerLevel[idxLevel+1].end() ; ++curBlockRead){
//Loop over cells in READ list
for(MortonIndex idxCell = (*curBlockRead)->getStartingIndex() ; idxCell < (*curBlockRead)->getEndingIndex() ; ++idxCell){
MortonIndex newIdx(idxCell >> 3);
//printf("Lvl : %d Current Idx %lld, parent's one : %lld \n",idxLevel,idxCell,newIdx);
//For Head Increment, we need to know if this parent has
//already been created
if(newIdx != previous){
//test if (Read cell exists)
if((*curBlockRead)->exists(idxCell)){
idxHead++; //cell at deeper level exist, so we increment the count to store it
//Test if a new Block is necessary
if(idxHead < inNbElementsPerBlock){
//No need for a Block, just the cell is created
head[idxHead] = newIdx;
previous = newIdx;
}
else{
//Creation of the block from head, then reset head, and
//storage of new idx in new head
CellGroupClass * tempBlock = createBlockFromArray(head);
cellBlocksPerLevel[idxLevel].push_back(tempBlock);
//Need a new block
memset(head,CellIsEmptyFlag,sizeof(MortonIndex)*nbElementsPerBlock);
head[0] = newIdx;
idxHead = 0;
previous = newIdx;
}
}
}
}
}
//Before changing Level, need to close current Block
CellGroupClass * tempBlock = createBlockFromArray(head);
cellBlocksPerLevel[idxLevel].push_back(tempBlock);
}
printf("toto \n");
delete[] head;
}*/
////////////////////////////////////////////////////////////////////
// End of can be deleted
////////////////////////////////////////////////////////////////////
/** This function dealloc the tree by deleting each block */
~
FGroupTree
(){
for
(
int
idxLevel
=
0
;
idxLevel
<
treeHeight
;
++
idxLevel
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment