Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

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: ...@@ -127,6 +127,18 @@ public:
FSubOctreeWithLeafs<ParticuleClass,CellClass>* leafTree;//< To access to particules lists 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 * 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. * It simply stores an pointer on a suboctree and moves to right/left/up/down.
...@@ -147,7 +159,7 @@ public: ...@@ -147,7 +159,7 @@ public:
* It uses the left right limit on each suboctree and their morton index. * 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. * 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 SubOctreeTypes current; //< Current suboctree
int currentLocalLevel; //< Current level in the current suboctree int currentLocalLevel; //< Current level in the current suboctree
...@@ -184,7 +196,9 @@ public: ...@@ -184,7 +196,9 @@ public:
* @param other source iterator to copy * @param other source iterator to copy
*/ */
Iterator(const Iterator& other){ Iterator(const Iterator& other){
memcpy(this, &other, sizeof(Iterator)); this->current = other.current ;
this->currentLocalLevel = other.currentLocalLevel ;
this->currentLocalIndex = other.currentLocalIndex ;
} }
/** Copy operator /** Copy operator
...@@ -506,8 +520,8 @@ public: ...@@ -506,8 +520,8 @@ public:
* @return the cell if it exist or null (0) * @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 * This function starts from the root until it find a missing cell or the right cell
*/ */
CellClass* getCell(const MortonIndex inIndex, const int inLevel){ CellClass* getCell(const MortonIndex inIndex, const int inLevel) const{
SubOctreeTypes workingTree; SubOctreeTypesConst workingTree;
workingTree.tree = &this->root; workingTree.tree = &this->root;
const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() )); const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() ));
...@@ -536,7 +550,7 @@ public: ...@@ -536,7 +550,7 @@ public:
* @param inLevel the level of the element * @param inLevel the level of the element
* @return the number of neighbors * @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; FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel); center.setPositionFromMorton(inIndex, inLevel);
...@@ -581,8 +595,8 @@ public: ...@@ -581,8 +595,8 @@ public:
* @return the cell if it exist or null (0) * @return the cell if it exist or null (0)
* *
*/ */
CellClass** getCellPt(const MortonIndex inIndex, const int inLevel){ CellClass** getCellPt(const MortonIndex inIndex, const int inLevel) const{
SubOctreeTypes workingTree; SubOctreeTypesConst workingTree;
workingTree.tree = &this->root; workingTree.tree = &this->root;
const MortonIndex treeMiddleMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() )); const MortonIndex treeMiddleMask = ~(~0x00LL << (3 * workingTree.tree->getSubOctreeHeight() ));
...@@ -613,7 +627,7 @@ public: ...@@ -613,7 +627,7 @@ public:
* @param inLevel the level of the element * @param inLevel the level of the element
* @return the number of neighbors * @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 // Take the neighbors != brothers
CellClass* directNeighbors[26]; CellClass* directNeighbors[26];
const int nbDirectNeighbors = getNeighborsNoBrothers(directNeighbors,inIndex,inLevel); const int nbDirectNeighbors = getNeighborsNoBrothers(directNeighbors,inIndex,inLevel);
......
...@@ -192,7 +192,7 @@ public: ...@@ -192,7 +192,7 @@ public:
/** Return the array of cells at a specious index /** Return the array of cells at a specious index
* @param level the level to access cells array (must be < subOctreeHeight) * @param level the level to access cells array (must be < subOctreeHeight)
* @return cells[level] */ * @return cells[level] */
CellClass** cellsAt(const int level){ CellClass** cellsAt(const int level) const{
assert(level < subOctreeHeight, "Level out of memory", __LINE__, __FILE__); assert(level < subOctreeHeight, "Level out of memory", __LINE__, __FILE__);
return cells[level]; return cells[level];
} }
...@@ -388,7 +388,7 @@ public: ...@@ -388,7 +388,7 @@ public:
/** To get access to leafs elements (child suboctree) /** To get access to leafs elements (child suboctree)
* @param index the position of the leaf/child suboctree * @param index the position of the leaf/child suboctree
* @return child at this index */ * @return child at this index */
FAbstractSubOctree<ParticuleClass,CellClass>* leafs(const int index){ FAbstractSubOctree<ParticuleClass,CellClass>* leafs(const int index) const {
return this->subleafs[index]; return this->subleafs[index];
} }
}; };
......
...@@ -22,7 +22,7 @@ public: ...@@ -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 /** bodies_L2P
* expansion_L2P_add_to_force_vector * expansion_L2P_add_to_force_vector
...@@ -40,9 +40,10 @@ public: ...@@ -40,9 +40,10 @@ public:
harmonicInnerThetaDerivated( spherical, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y_theta_derivated); harmonicInnerThetaDerivated( spherical, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y, FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y_theta_derivated);
// The maximum degree used here will be P. // The maximum degree used here will be P.
FComplexe* p_Y_term = FAbstractFmbKernels<ParticuleClass,CellClass>::current_thread_Y+1; const 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; const 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_local_exp_term = local->getLocal()+1;
for (int j = 1 ; j <= FAbstractFmbKernels<ParticuleClass,CellClass>::FMB_Info_P ; ++j ){ for (int j = 1 ; j <= FAbstractFmbKernels<ParticuleClass,CellClass>::FMB_Info_P ; ++j ){
FComplexe exp_term_aux; FComplexe exp_term_aux;
......
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
enum FlushType{ enum FlushType{
Flush, Flush,
FlushWithLine, FlushWithLine
}; };
/** /**
......
...@@ -87,8 +87,8 @@ struct FMath{ ...@@ -87,8 +87,8 @@ struct FMath{
} }
}; };
const double FMath::FPi = 3.14159265358979323846; const double FMath::FPi = M_PI;
const double FMath::FPiDiv2 = 1.57079632679489661923; const double FMath::FPiDiv2 = M_PI_2;
#endif //FMATH_HPP #endif //FMATH_HPP
......
...@@ -73,6 +73,7 @@ public: ...@@ -73,6 +73,7 @@ public:
} }
} }
/** /**
* This function is used to create inThreadsNumber threads with Object::threadCallback as the callback. * 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) * @param inThreadsNumber the number of threads to create (default is DefaultThreadsNumber)
...@@ -93,7 +94,7 @@ public: ...@@ -93,7 +94,7 @@ public:
*/ */
virtual void threadCallback(const int inThreadId, const int inThreadNumbers){ virtual void threadCallback(const int inThreadId, const int inThreadNumbers){
FDEBUG( FDebug::Controller.writeFromLine("[W] You called executeThreads() but did not implement threadCallback", __LINE__, __FILE__); ) FDEBUG( FDebug::Controller.writeFromLine("[W] You called executeThreads() but did not implement threadCallback", __LINE__, __FILE__); )
}; }
protected: 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