Commit 5293efde authored by berenger-bramas's avatar berenger-bramas
Browse files

Comments + Variables names (that's all)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@18 2616d619-271b-44dc-8df4-d4a8f33a7222
parent d4c6e37b
......@@ -127,6 +127,18 @@ public:
FSubOctreeWithLeafs<ParticuleClass,CellClass>* leafTree;//< To access to particules lists
};
/**
* The class works on suboctree. Most of the resources needed
* are avaiblable by using FAbstractSubOctree. But when accessing
* to the leaf we have to use FSubOctree or FSubOctreeWithLeafs
* depending if we are working on the bottom of the tree.
*/
union SubOctreeTypesConst {
const FAbstractSubOctree<ParticuleClass,CellClass>* tree; //< Usual pointer to work
const FSubOctree<ParticuleClass,CellClass>* middleTree; //< To access to sub-octree under
const FSubOctreeWithLeafs<ParticuleClass,CellClass>* leafTree;//< To access to particules lists
};
/**
* This has to be used to iterate on an octree
* It simply stores an pointer on a suboctree and moves to right/left/up/down.
......@@ -147,7 +159,7 @@ public:
* It uses the left right limit on each suboctree and their morton index.
* Please have a look to the move functions to understand how the system is working.
*/
class Iterator : public FAssertable {
class Iterator : protected FAssertable {
SubOctreeTypes current; //< Current suboctree
int currentLocalLevel; //< Current level in the current suboctree
......@@ -184,7 +196,9 @@ public:
* @param other source iterator to copy
*/
Iterator(const Iterator& other){
memcpy(this, &other, sizeof(Iterator));
this->current = other.current ;
this->currentLocalLevel = other.currentLocalLevel ;
this->currentLocalIndex = other.currentLocalIndex ;
}
/** Copy operator
......@@ -506,8 +520,8 @@ public:
* @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
*/
CellClass* getCell(const MortonIndex inIndex, const int inLevel){
SubOctreeTypes workingTree;
CellClass* getCell(const MortonIndex inIndex, const int inLevel) const{
SubOctreeTypesConst workingTree;
workingTree.tree = &this->root;
const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() ));
......@@ -536,7 +550,7 @@ public:
* @param inLevel the level of the element
* @return the number of neighbors
*/
int getNeighborsNoBrothers(CellClass* inNeighbors[26], const MortonIndex inIndex, const int inLevel){
int getNeighborsNoBrothers(CellClass* inNeighbors[26], const MortonIndex inIndex, const int inLevel) const {
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
......@@ -581,8 +595,8 @@ public:
* @return the cell if it exist or null (0)
*
*/
CellClass** getCellPt(const MortonIndex inIndex, const int inLevel){
SubOctreeTypes workingTree;
CellClass** getCellPt(const MortonIndex inIndex, const int inLevel) const{
SubOctreeTypesConst workingTree;
workingTree.tree = &this->root;
const MortonIndex treeMiddleMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() ));
......@@ -613,7 +627,7 @@ public:
* @param inLevel the level of the element
* @return the number of neighbors
*/
int getDistantNeighbors(CellClass* inNeighbors[208], const MortonIndex inIndex, const int inLevel){
int getDistantNeighbors(CellClass* inNeighbors[208], const MortonIndex inIndex, const int inLevel) const{
// Take the neighbors != brothers
CellClass* directNeighbors[26];
const int nbDirectNeighbors = getNeighborsNoBrothers(directNeighbors,inIndex,inLevel);
......
......@@ -192,7 +192,7 @@ public:
/** Return the array of cells at a specious index
* @param level the level to access cells array (must be < subOctreeHeight)
* @return cells[level] */
CellClass** cellsAt(const int level){
CellClass** cellsAt(const int level) const{
assert(level < subOctreeHeight, "Level out of memory", __LINE__, __FILE__);
return cells[level];
}
......@@ -388,7 +388,7 @@ public:
/** To get access to leafs elements (child suboctree)
* @param index the position of the leaf/child suboctree
* @return child at this index */
FAbstractSubOctree<ParticuleClass,CellClass>* leafs(const int index){
FAbstractSubOctree<ParticuleClass,CellClass>* leafs(const int index) const {
return this->subleafs[index];
}
};
......
......@@ -22,7 +22,7 @@ public:
}
void changeProgression(int*const start_for_j , FComplexe** const p_target_exp_term){}
void changeProgression(int*const , FComplexe** const ){}
/** bodies_L2P
* expansion_L2P_add_to_force_vector
......@@ -40,9 +40,10 @@ public:
harmonicInnerThetaDerivated( spherical, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y_theta_derivated);
// The maximum degree used here will be P.
FComplexe* p_Y_term = FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y+1;
FComplexe* p_Y_theta_derivated_term = FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y_theta_derivated+1;
FComplexe* p_local_exp_term = local->getLocal()+1;
const FComplexe* p_Y_term = FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y+1;
const FComplexe* p_Y_theta_derivated_term = FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y_theta_derivated+1;
const FComplexe* p_local_exp_term = local->getLocal()+1;
for (int j = 1 ; j <= FAbstractFmbKernels<ParticuleClass,CellClass>::FMB_Info_P ; ++j ){
FComplexe exp_term_aux;
......
......@@ -125,7 +125,7 @@ public:
enum FlushType{
Flush,
FlushWithLine,
FlushWithLine
};
/**
......
......@@ -87,8 +87,8 @@ struct FMath{
}
};
const double FMath::FPi = 3.14159265358979323846;
const double FMath::FPiDiv2 = 1.57079632679489661923;
const double FMath::FPi = M_PI;
const double FMath::FPiDiv2 = M_PI_2;
#endif //FMATH_HPP
......
......@@ -73,6 +73,7 @@ public:
}
}
/**
* This function is used to create inThreadsNumber threads with Object::threadCallback as the callback.
* @param inThreadsNumber the number of threads to create (default is DefaultThreadsNumber)
......@@ -93,7 +94,7 @@ public:
*/
virtual void threadCallback(const int inThreadId, const int inThreadNumbers){
FDEBUG( FDebug::Controller.writeFromLine("[W] You called executeThreads() but did not implement threadCallback", __LINE__, __FILE__); )
};
}
protected:
/**
......
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