Commit bc705723 authored by COULAUD Olivier's avatar COULAUD Olivier

Add comments and fix typos

parent 39f08646
......@@ -54,10 +54,9 @@
*/
template<class FReal, class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass = FBasicBlockAllocator<CellClass> /*FListBlockAllocator<CellClass, 15>*/ >
class FOctree : public FNoCopyable {
typedef FOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> OctreeType;
typedef FOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> OctreeType;
typedef FSubOctreeWithLeafs<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> SubOctreeWithLeaves;
typedef FSubOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> SubOctree;
typedef FSubOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> SubOctree;
FAbstractSubOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass>* root; //< root suboctree
FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels
......@@ -388,12 +387,12 @@ public:
* if needed we go on another suboctree but we stay on at the same level
* the Algorithm is :
* go to top
* go downard until we are a the same level
* go downward until we are a the same level
*/
void gotoRight(){
// Function variables
const int currentLevel = level();
// Goto root sutoctree
// Goto root suboctree
while( this->current.tree->hasParent() ){
this->current.tree = this->current.tree->getParent();
}
......@@ -476,7 +475,7 @@ public:
}
}
// if wokring tree != current tree => working tree leafs level ; else current level
// if working tree != current tree => working tree leafs level ; else current level
const int objectiveLevel = (countUpward ? workingTree.tree->getSubOctreeHeight() - 1 : this->currentLocalLevel );
// We need to go down as left as possible
......@@ -691,7 +690,7 @@ public:
/** This function return a cell (if it exists) from a morton index and a level
* @param inIndex the index of the desired cell
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
* This function starts from the root until it find a missing cell or the right cell
*/
......@@ -766,10 +765,10 @@ public:
}
/** This function return an adresse of cell array from a morton index and a level
/** This function return an address of cell array from a morton index and a level
*
* @param inIndex the index of the desired cell array has to contains
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
*
*/
......@@ -865,7 +864,7 @@ public:
}
/** This function fills an array with all the neighbors of a cell,
* i.e. childs of parent's neighbors, direct neighbors and cell itself.
* i.e. Child of parent's neighbors, direct neighbors and cell itself.
* This is called for instance when the nearfield also needs to be approximated
* in that cas we only call this function at the leaf level.
* @param inNeighbors the array to store the elements
......@@ -1033,7 +1032,7 @@ public:
/** This function return a cell (if it exists) from a morton index and a level
* @param inIndex the index of the desired cell
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
*
*/
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -324,6 +324,7 @@ protected:
octreeIterator.gotoBottomLeft();
// for each leafs
// Coloring all the cells
do{
const FTreeCoordinate& coord = octreeIterator.getCurrentGlobalCoordinate();
const int shapePosition = (coord.getX()%3)*9 + (coord.getY()%3)*3 + (coord.getZ()%3);
......@@ -338,7 +339,8 @@ protected:
const FSize nbLeaf = shapes[idxShape].getSize();
for(int iterLeaf = 0 ; iterLeaf < nbLeaf ; ++iterLeaf ){
typename OctreeClass::Iterator toWork = shapes[idxShape][iterLeaf];
#pragma omp task firstprivate(neighbors, toWork)
// ToDO increase the granularity of the task
#pragma omp task firstprivate(neighbors,toWork)
{
const int counter = tree->getLeafsNeighbors(neighbors, toWork.getCurrentGlobalCoordinate(),heightMinusOne);
kernels[omp_get_thread_num()]->P2P(toWork.getCurrentGlobalCoordinate(), toWork.getCurrentListTargets(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment