From c2c1c1148d7baa0c20cdeb038b92d736d2c72efd Mon Sep 17 00:00:00 2001
From: berenger-bramas <berenger-bramas@2616d619-271b-44dc-8df4-d4a8f33a7222>
Date: Tue, 30 Aug 2011 13:01:27 +0000
Subject: [PATCH] Update the comments.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@182 2616d619-271b-44dc-8df4-d4a8f33a7222
---
 Src/Components/FBasicKernels.hpp | 13 +++++++------
 Src/Components/FTestCell.hpp     |  8 +++++++-
 Src/Components/FTestKernels.hpp  | 14 +++++++-------
 Src/Components/FTestParticle.hpp |  2 ++
 Src/Core/FFmmAlgorithm.hpp       |  1 +
 Src/Files/FMpiTreeBuilder.hpp    | 26 ++++++++++++++++++++++++--
 6 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/Src/Components/FBasicKernels.hpp b/Src/Components/FBasicKernels.hpp
index dff4b5c0e..b062fe8b1 100644
--- a/Src/Components/FBasicKernels.hpp
+++ b/Src/Components/FBasicKernels.hpp
@@ -23,43 +23,44 @@ public:
     virtual ~FBasicKernels(){
     }
 
-    /** Print the number of particles */
+    /** Do nothing */
     virtual void P2M(CellClass* const , const ContainerClass* const ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    /** Print the morton index */
+    /** Do nothing */
     virtual void M2M(CellClass* const FRestrict , const CellClass*const FRestrict *const FRestrict , const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    /** Print the morton index */
+    /** Do nothing */
     virtual void M2L(CellClass* const FRestrict , const CellClass* [], const int , const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    /** Print the morton index */
+    /** Do nothing */
     virtual void L2L(const CellClass* const FRestrict , CellClass* FRestrict *const FRestrict  , const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    /** Print the number of particles */
+    /** Do nothing */
     virtual void L2P(const CellClass* const , ContainerClass* const ){
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    /** Print the number of particles */
+    /** Do nothing */
     virtual void P2P(ContainerClass* const FRestrict , const ContainerClass* const FRestrict ,
                      const ContainerClass* const [26], const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
+    /** Do nothing */
     virtual void P2P(const MortonIndex ,
                      ContainerClass* const FRestrict , const ContainerClass* const FRestrict ,
                      ContainerClass* const [26], const MortonIndex [26], const int ){
diff --git a/Src/Components/FTestCell.hpp b/Src/Components/FTestCell.hpp
index b2942dc0d..52dbf28f4 100644
--- a/Src/Components/FTestCell.hpp
+++ b/Src/Components/FTestCell.hpp
@@ -10,7 +10,9 @@
 * Please read the license
 *
 * This class is used in the FTestKernels, please
-* look at this class to know whit it is.
+* look at this class to know what it is.
+*
+* This cell simply store the data when up/down
 */
 class FTestCell : public FBasicCell  {
 protected:
@@ -22,15 +24,19 @@ public:
     /** Default destructor */
     virtual ~FTestCell(){
     }
+    /** When doing the upward pass */
     long getDataUp() const {
         return this->dataUp;
     }
+    /** When doing the upward pass */
     void setDataUp(const long inData){
         this->dataUp = inData;
     }
+    /** When doing the downard pass */
     long getDataDown() const {
         return this->dataDown;
     }
+    /** When doing the downard pass */
     void setDataDown(const long inData){
         this->dataDown = inData;
     }
diff --git a/Src/Components/FTestKernels.hpp b/Src/Components/FTestKernels.hpp
index 6ec3512af..d254b1c23 100644
--- a/Src/Components/FTestKernels.hpp
+++ b/Src/Components/FTestKernels.hpp
@@ -26,7 +26,7 @@ public:
     virtual ~FTestKernels(){
     }
 
-    // Before upward
+    /** Before upward */
     void P2M(CellClass* const pole, const ContainerClass* const particles) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         // the pole represents all particles under
@@ -34,7 +34,7 @@ public:
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    // During upward
+    /** During upward */
     void M2M(CellClass* const FRestrict pole, const CellClass *const FRestrict *const FRestrict child, const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         // A parent represents the sum of the child
@@ -46,7 +46,7 @@ public:
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    // Before Downward
+    /** Before Downward */
     void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208], const int size, const int ) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         // The pole is impacted by what represent other poles
@@ -56,7 +56,7 @@ public:
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    // During Downward
+    /** During Downward */
     void L2L(const CellClass*const FRestrict local, CellClass* FRestrict *const FRestrict child, const int) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         // Each child is impacted by the father
@@ -68,7 +68,7 @@ public:
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    // After Downward
+    /** After Downward */
     void L2P(const CellClass* const  local, ContainerClass*const particles){
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
         // The particles is impacted by the parent cell
@@ -80,7 +80,7 @@ public:
         FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
     }
 
-    // After Downward
+    /** After Downward */
     void P2P(ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
              const ContainerClass* const directNeighborsParticles[26], const int size) {
         FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
@@ -102,7 +102,7 @@ public:
     }
 
 
-    // After Downward
+    /** After Downward */
     void P2P(const MortonIndex ,
              ContainerClass* const FRestrict targets, const ContainerClass* const FRestrict sources,
              ContainerClass* const directNeighborsParticles[26], const MortonIndex [26], const int size) {
diff --git a/Src/Components/FTestParticle.hpp b/Src/Components/FTestParticle.hpp
index fdbed622a..b37919bfe 100644
--- a/Src/Components/FTestParticle.hpp
+++ b/Src/Components/FTestParticle.hpp
@@ -11,6 +11,8 @@
 *
 * This class is used in the FTestKernels, please
 * look at this class to know whit it is.
+*
+* Particles just need the data down.
 */
 class FTestParticle : public FBasicParticle {
 protected:
diff --git a/Src/Core/FFmmAlgorithm.hpp b/Src/Core/FFmmAlgorithm.hpp
index 1efcb1686..dd791bb7a 100644
--- a/Src/Core/FFmmAlgorithm.hpp
+++ b/Src/Core/FFmmAlgorithm.hpp
@@ -58,6 +58,7 @@ public:
         FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
 
         bottomPass();
+
         upwardPass();
 
         downardPass();
diff --git a/Src/Files/FMpiTreeBuilder.hpp b/Src/Files/FMpiTreeBuilder.hpp
index 5f301d9b7..983584621 100644
--- a/Src/Files/FMpiTreeBuilder.hpp
+++ b/Src/Files/FMpiTreeBuilder.hpp
@@ -4,8 +4,17 @@
 
 #include "../Utils/FQuickSort.hpp"
 
+
+/** This class manage the loading of particles
+  * for the mpi version.
+  * It use a BinLoader and then sort the data
+  * with a parallel quick sort.
+  */
 template<class ParticleClass>
 class FMpiTreeBuilder{
+    /** This method has been tacken from the octree
+      * it computes a tree coordinate (x or y or z) from real position
+      */
     static long getTreeCoordinate(const FReal inRelativePosition, const FReal boxWidthAtLeafLevel) {
             const FReal indexFReal = inRelativePosition / boxWidthAtLeafLevel;
             const long index = FMath::dfloor(indexFReal);
@@ -29,6 +38,7 @@ class FMpiTreeBuilder{
         return nb;
     }
 
+    /** receive data from a tag function */
     static void receiveDataFromTag(const int inSize, const int inTag, void* const inData, int* const inSource = 0, int* const inFilledSize = 0){
         MPI_Status status;
         MPI_Recv(inData, inSize, MPI_CHAR, MPI_ANY_SOURCE, inTag, MPI_COMM_WORLD, &status);
@@ -58,6 +68,9 @@ class FMpiTreeBuilder{
         else return res;
     }
 
+    /** This struct is used to represent a particles group to
+      * sort them easily
+      */
     struct ParticlesGroup {
         int number;
         int positionInArray;
@@ -68,6 +81,10 @@ class FMpiTreeBuilder{
     };
 
 
+    /** A particle may not have a MortonIndex Method
+      * but they are sorted on their morton index
+      * so this struct store a particle and its index
+      */
     struct IndexedParticle{
         MortonIndex index;
         ParticleClass particle;
@@ -77,22 +94,26 @@ class FMpiTreeBuilder{
         }
     };
 
-    IndexedParticle* intervals;
-    int nbLeavesInIntervals;
+    IndexedParticle* intervals; //< Current intervals
+    int nbLeavesInIntervals;    //< Nb intervals
 
 private:
+    // Forbid copy
     FMpiTreeBuilder(const FMpiTreeBuilder&){}
     FMpiTreeBuilder& operator=(const FMpiTreeBuilder&){return *this;}
 
 public:
+    /** Constructor */
     FMpiTreeBuilder()
         :  intervals(0), nbLeavesInIntervals(0) {
     }
 
+    /** Destructor */
     virtual ~FMpiTreeBuilder(){
         delete [] intervals;
     }
 
+    /** Split and sort the file */
     template <class LoaderClass>
     bool splitAndSortFile(LoaderClass& loader, const int NbLevels){
         const int rank = MpiGetRank();
@@ -236,6 +257,7 @@ public:
         return true;
     }
 
+    /** Put the interval into a tree */
     template <class OctreeClass>
     bool intervalsToTree(OctreeClass& realTree){
         const int rank = MpiGetRank();
-- 
GitLab