Commit 57f157c6 authored by berenger-bramas's avatar berenger-bramas
Browse files

Particule has been change to Particle EVERY WHERE

Because, Particule is French ! And most of the lib components are in english.
Sorry for the delay.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@43 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 296f8b6c
......@@ -12,7 +12,7 @@
* This class define the method that every cell class
* has to implement.
*
* In fact FOctree & FFMMAlgorithm need this function to be implemented.
* In fact FOctree & FFmmAlgorithm need this function to be implemented.
* But you cannot use this interface with the extension (as an example :
* because the compiler will faill to know if getMortonIndex is coming
* from this interface or from the extension)
......@@ -46,13 +46,13 @@ public:
/** Because the system can run in Tsm mode
* a cell has to express if it has sources
* @return true if there are sources particules inside
* @return true if there are sources particles inside
*/
virtual bool hasSourcesChild() const = 0;
/** Because the system can run in Tsm mode
* a cell has to express if it has targets
* @return true if there are targets particules inside
* @return true if there are targets particles inside
*/
virtual bool hasTargetsChild() const = 0;
......
......@@ -12,7 +12,7 @@
*
* If you want to create you own kernels you have to inherit from this class.
*/
template< class ParticuleClass, class CellClass, int TreeHeight>
template< class ParticleClass, class CellClass, int TreeHeight>
class FAbstractKernels{
public:
/** Default destructor */
......@@ -27,11 +27,11 @@ public:
/**
* P2M
* particules to multipole
* @param pole the multipole to fill using the particules
* @param particules the particules from the same spacial boxe
* particles to multipole
* @param pole the multipole to fill using the particles
* @param particles the particles from the same spacial boxe
*/
virtual void P2M(CellClass* const pole, const FList<ParticuleClass*>* const particules) = 0;
virtual void P2M(CellClass* const pole, const FList<ParticleClass*>* const particles) = 0;
/**
* M2M
......@@ -67,22 +67,22 @@ public:
/**
* L2P
* Local to particules
* Local to particles
* @param local the leaf element (smaller boxe local element)
* @param particules the list of particules inside this boxe
* @param particles the list of particles inside this boxe
*/
virtual void L2P(const CellClass* const local, FList<ParticuleClass*>* const particules) = 0;
virtual void L2P(const CellClass* const local, FList<ParticleClass*>* const particles) = 0;
/**
* P2P
* Particules to particules
* @param targets current boxe targets particules
* @param sources current boxe sources particules
* @param directNeighborsParticules the particules from direct neighbors (this is an array of list)
* @param size the number of direct neighbors (the size of the array directNeighborsParticules)
* Particles to particles
* @param targets current boxe targets particles
* @param sources current boxe sources particles
* @param directNeighborsParticles the particles from direct neighbors (this is an array of list)
* @param size the number of direct neighbors (the size of the array directNeighborsParticles)
*/
virtual void P2P(FList<ParticuleClass*>* const FRestrict targets, const FList<ParticuleClass*>* const FRestrict sources,
const FList<ParticuleClass*>*const FRestrict *const FRestrict directNeighborsParticules, const int size) = 0;
virtual void P2P(FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
const FList<ParticleClass*>*const FRestrict *const FRestrict directNeighborsParticles, const int size) = 0;
};
......
......@@ -8,10 +8,10 @@
* @class FAbstractLeaf
* @brief
* Please read the license
* This class is used to enable the use of typed particules
* This class is used to enable the use of typed particles
* (source XOR target) or simple system (source AND target)
*/
template< class ParticuleClass >
template< class ParticleClass >
class FAbstractLeaf {
public:
/** Default destructor */
......@@ -19,28 +19,28 @@ public:
}
/**
* To add a new particule in the leaf
* @param particule the new particule
* To add a new particle in the leaf
* @param particle the new particle
* Depending on the system to use the class that inherit
* this interface can sort the particule as they like.
* this interface can sort the particle as they like.
*/
virtual void push(ParticuleClass* const particule) = 0;
virtual void push(ParticleClass* const particle) = 0;
/**
* To get all the sources in a leaf
* @return a pointer to the list of particules that are sources
* @return a pointer to the list of particles that are sources
* Depending on the system to use the class that inherit
* this interface can sort the particule as they like.
* this interface can sort the particle as they like.
*/
virtual FList<ParticuleClass*>* getSources() = 0;
virtual FList<ParticleClass*>* getSources() = 0;
/**
* To get all the target in a leaf
* @return a pointer to the list of particules that are targets
* @return a pointer to the list of particles that are targets
* Depending on the system to use the class that inherit
* this interface can sort the particule as they like.
* this interface can sort the particle as they like.
*/
virtual FList<ParticuleClass*>* getTargets() = 0;
virtual FList<ParticleClass*>* getTargets() = 0;
};
......
#ifndef FABSTRACTPARTICULE_HPP
#define FABSTRACTPARTICULE_HPP
#ifndef FABSTRACTPARTICLE_HPP
#define FABSTRACTPARTICLE_HPP
// /!\ Please, you must read the license at the bottom of this page
/* forward declaration to avoid include */
......@@ -11,31 +11,31 @@ class F3DPosition;
* @brief
* Please read the license
*
* This class define the method that every particule class
* This class define the method that every particle class
* has to implement.
*
* In fact FOctree & FFMMAlgorithm need this function to be implemented.
* In fact FOctree & FFmmAlgorithm need this function to be implemented.
* But you cannot use this interface with the extension (as an example :
* because the compiler will faill to know if getPosition is coming
* from this interface or from the extension)
*
*
* @warning Inherite from this class when implement a specific particule type
* @warning Inherite from this class when implement a specific particle type
*/
class FAbstractParticule{
class FAbstractParticle{
public:
/** Default destructor */
virtual ~FAbstractParticule(){
virtual ~FAbstractParticle(){
}
/**
* Must be implemented by each user Particule class
* Must be implemented by each user Particle class
* @return the position of the current cell
*/
virtual F3DPosition getPosition() const = 0;
};
#endif //FABSTRACTPARTICULE_HPP
#endif //FABSTRACTPARTICLE_HPP
// [--LICENSE--]
......@@ -11,7 +11,7 @@
* Please read the license
*
* This class defines a basic cell used for examples. It extends
* the mininum, only what is needed by FOctree and FFMMAlgorithm
* the mininum, only what is needed by FOctree and FFmmAlgorithm
* to make the things working.
* By using this extension it will implement the FAbstractCell without
* inheriting from it.
......
......@@ -15,8 +15,8 @@
* This kernels simply shows the details of the information
* it receives (in debug)
*/
template< class ParticuleClass, class CellClass, int TreeHeight>
class FBasicKernels : public FAbstractKernels<ParticuleClass,CellClass,TreeHeight> {
template< class ParticleClass, class CellClass, int TreeHeight>
class FBasicKernels : public FAbstractKernels<ParticleClass,CellClass,TreeHeight> {
public:
/** Default destructor */
virtual ~FBasicKernels(){
......@@ -25,8 +25,8 @@ public:
/** When init the kernel */
virtual void init(){}
/** Print the number of particules */
virtual void P2M(CellClass* const , const FList<ParticuleClass*>* const ) {
/** Print the number of particles */
virtual void P2M(CellClass* const , const FList<ParticleClass*>* const ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
......@@ -49,15 +49,15 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particules */
virtual void L2P(const CellClass* const , FList<ParticuleClass*>* const ){
/** Print the number of particles */
virtual void L2P(const CellClass* const , FList<ParticleClass*>* const ){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
/** Print the number of particules */
virtual void P2P(FList<ParticuleClass*>* const FRestrict , const FList<ParticuleClass*>* const FRestrict ,
const FList<ParticuleClass*>* FRestrict const* FRestrict , const int ) {
/** Print the number of particles */
virtual void P2P(FList<ParticleClass*>* const FRestrict , const FList<ParticleClass*>* const FRestrict ,
const FList<ParticleClass*>* FRestrict const* FRestrict , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
......
#ifndef FBASICPARTICULE_HPP
#define FBASICPARTICULE_HPP
#ifndef FBASICPARTICLE_HPP
#define FBASICPARTICLE_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "../Extenssions/FExtendPosition.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FBasicParticule
* @class FBasicParticle
* Please read the license
*
* This class defines a basic particule used for examples. It extends
* the mininum, only what is needed by FOctree and FFMMAlgorithm
* This class defines a basic particle used for examples. It extends
* the mininum, only what is needed by FOctree and FFmmAlgorithm
* to make the things working.
* By using this extension it will implement the FAbstractParticule without
* By using this extension it will implement the FAbstractParticle without
* inheriting from it.
*/
class FBasicParticule : public FExtendPosition{
class FBasicParticle : public FExtendPosition{
public:
/** Default destructor */
virtual ~FBasicParticule(){
virtual ~FBasicParticle(){
}
};
#endif //FBASICPARTICULE_HPP
#endif //FBASICPARTICLE_HPP
// [--LICENSE--]
#ifndef FFMAPARTICULE_HPP
#define FFMAPARTICULE_HPP
#ifndef FFMAPARTICLE_HPP
#define FFMAPARTICLE_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "FBasicParticule.hpp"
#include "FBasicParticle.hpp"
#include "../Extenssions/FExtendPhysicalValue.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FFmaParticule
* @class FFmaParticle
* Please read the license
*
* This class defines a particule for FMA loader.
* As defined in FFmaLoader it needs {FBasicParticule,FExtendPhysicalValue}
* This class defines a particle for FMA loader.
* As defined in FFmaLoader it needs {FBasicParticle,FExtendPhysicalValue}
*/
class FFmaParticule : public FBasicParticule, public FExtendPhysicalValue {
class FFmaParticle : public FBasicParticle, public FExtendPhysicalValue {
public:
/** Default destructor */
virtual ~FFmaParticule(){
virtual ~FFmaParticle(){
}
};
#endif //FFMAPARTICULE_HPP
#endif //FFMAPARTICLE_HPP
// [--LICENSE--]
......@@ -11,11 +11,11 @@
* @brief
* Please read the license
* This class is used as a leaf in simple system (source AND target)
* here there is only one list that store all particules.
* here there is only one list that store all particles.
*/
template< class ParticuleClass >
class FSimpleLeaf : public FAbstractLeaf<ParticuleClass> {
FList<ParticuleClass*> particules;
template< class ParticleClass >
class FSimpleLeaf : public FAbstractLeaf<ParticleClass> {
FList<ParticleClass*> particles;
public:
/** Default destructor */
......@@ -23,27 +23,27 @@ public:
}
/**
* To add a new particule in the leaf
* @param particule the new particule
* To add a new particle in the leaf
* @param particle the new particle
*/
void push(ParticuleClass* const particule){
this->particules.pushFront(particule);
void push(ParticleClass* const particle){
this->particles.pushFront(particle);
}
/**
* To get all the sources in a leaf
* @return a pointer to the list of particules that are sources
* @return a pointer to the list of particles that are sources
*/
FList<ParticuleClass*>* getSources() {
return &this->particules;
FList<ParticleClass*>* getSources() {
return &this->particles;
}
/**
* To get all the target in a leaf
* @return a pointer to the list of particules that are targets
* @return a pointer to the list of particles that are targets
*/
FList<ParticuleClass*>* getTargets() {
return &this->particules;
FList<ParticleClass*>* getTargets() {
return &this->particles;
}
};
......
......@@ -17,21 +17,21 @@
* Please read the license
*
* This kernels is a virtual kernels to validate that the fmm algorithm is
* correctly done on particules.
* It used FTestCell and FTestParticule
* correctly done on particles.
* It used FTestCell and FTestParticle
*/
template< class ParticuleClass, class CellClass, int TreeHeight>
class FTestKernels : public FAbstractKernels<ParticuleClass,CellClass,TreeHeight> {
template< class ParticleClass, class CellClass, int TreeHeight>
class FTestKernels : public FAbstractKernels<ParticleClass,CellClass,TreeHeight> {
public:
/** Default destructor */
virtual ~FTestKernels(){
}
// Before upward
void P2M(CellClass* const pole, const FList<ParticuleClass*>* const particules) {
void P2M(CellClass* const pole, const FList<ParticleClass*>* const particles) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// the pole represents all particules under
pole->setDataUp(particules->getSize());
// the pole represents all particles under
pole->setDataUp(particles->getSize());
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// During upward
......@@ -66,10 +66,10 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// After Downward
void L2P(const CellClass* const local, FList<ParticuleClass*>*const particules){
void L2P(const CellClass* const local, FList<ParticleClass*>*const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The particules is impacted by the parent cell
typename FList<ParticuleClass*>::BasicIterator iter(*particules);
// The particles is impacted by the parent cell
typename FList<ParticleClass*>::BasicIterator iter(*particles);
while( iter.isValide() ){
iter.value()->setDataDown(iter.value()->getDataDown() + local->getDataDown());
iter.progress();
......@@ -77,10 +77,10 @@ public:
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
// After Downward
void P2P(FList<ParticuleClass*>* const FRestrict targets, const FList<ParticuleClass*>* const FRestrict sources,
const FList<ParticuleClass*>* FRestrict const* FRestrict directNeighbors, const int size) {
void P2P(FList<ParticleClass*>* const FRestrict targets, const FList<ParticleClass*>* const FRestrict sources,
const FList<ParticleClass*>* FRestrict const* FRestrict directNeighbors, const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// Each particules targeted is impacted by the particules sources
// Each particles targeted is impacted by the particles sources
long inc = sources->getSize();
if(targets == sources){
inc -= 1;
......@@ -89,7 +89,7 @@ public:
inc += directNeighbors[idx]->getSize();
}
typename FList<ParticuleClass*>::BasicIterator iter(*targets);
typename FList<ParticleClass*>::BasicIterator iter(*targets);
while( iter.isValide() ){
iter.value()->setDataDown(iter.value()->getDataDown() + inc);
iter.progress();
......@@ -103,12 +103,12 @@ public:
/** This function test the octree to be sure that the fmm algorithm
* has worked completly.
*/
template< class ParticuleClass, class CellClass, template<class ParticuleClass> class LeafClass, int TreeHeight, int SizeSubLevels>
void ValidateFMMAlgo(FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight , SizeSubLevels>* const tree){
template< class ParticleClass, class CellClass, template<class ParticleClass> class LeafClass, int TreeHeight, int SizeSubLevels>
void ValidateFMMAlgo(FOctree<ParticleClass, CellClass, LeafClass, TreeHeight , SizeSubLevels>* const tree){
std::cout << "Check Result\n";
int NbPart = 0;
{ // Check that each particule has been summed with all other
typename FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
{ // Check that each particle has been summed with all other
typename FOctree<ParticleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
do{
if(octreeIterator.getCurrentCell()->getDataUp() != octreeIterator.getCurrentListSources()->getSize() ){
......@@ -118,7 +118,7 @@ void ValidateFMMAlgo(FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight ,
} while(octreeIterator.moveRight());
}
{ // Ceck if there is number of NbPart summed at level 1
typename FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
typename FOctree<ParticleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
octreeIterator.moveDown();
long res = 0;
do{
......@@ -129,7 +129,7 @@ void ValidateFMMAlgo(FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight ,
}
}
{ // Ceck if there is number of NbPart summed at level 1
typename FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
typename FOctree<ParticleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
for(int idxLevel = TreeHeight - 1 ; idxLevel > 1 ; --idxLevel ){
long res = 0;
......@@ -143,16 +143,16 @@ void ValidateFMMAlgo(FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight ,
octreeIterator.gotoLeft();
}
}
{ // Check that each particule has been summed with all other
typename FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
{ // Check that each particle has been summed with all other
typename FOctree<ParticleClass, CellClass, LeafClass, TreeHeight, SizeSubLevels>::Iterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
do{
typename FList<ParticuleClass*>::BasicIterator iter(*octreeIterator.getCurrentListTargets());
typename FList<ParticleClass*>::BasicIterator iter(*octreeIterator.getCurrentListTargets());
const bool isUsingTsm = (octreeIterator.getCurrentListTargets() != octreeIterator.getCurrentListSources());
while( iter.isValide() ){
// If a particules has been impacted by less than NbPart - 1 (the current particule)
// If a particles has been impacted by less than NbPart - 1 (the current particle)
// there is a problem
if( (!isUsingTsm && iter.value()->getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.value()->getDataDown() != NbPart) ){
......
#ifndef FTESTPARTICULE_HPP
#define FTESTPARTICULE_HPP
#ifndef FTESTPARTICLE_HPP
#define FTESTPARTICLE_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "FBasicParticule.hpp"
#include "FBasicParticle.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FTestParticule
* @class FTestParticle
* Please read the license
*
* This class is used in the FTestKernels, please
* look at this class to know whit it is.
*/
class FTestParticule : public FBasicParticule {
class FTestParticle : public FBasicParticle {
protected:
// To store data during downard pass
long dataDown;
public:
FTestParticule(): dataDown(0){
FTestParticle(): dataDown(0){
}
/** Default destructor */
virtual ~FTestParticule(){
virtual ~FTestParticle(){
}
long getDataDown() const {
......@@ -34,6 +34,6 @@ public:
};
#endif //FTESTPARTICULE_HPP
#endif //FTESTPARTICLE_HPP
// [--LICENSE--]
......@@ -11,13 +11,13 @@
* @class FTypedLeaf
* @brief
* Please read the license
* This class is used to enable the use of typed particules
* This class is used to enable the use of typed particles
* (source XOR target) or simple system (source AND target)
*/
template< class ParticuleClass >
class FTypedLeaf : public FAbstractLeaf<ParticuleClass>, public FAssertable {
FList<ParticuleClass*> sources;
FList<ParticuleClass*> targets;
template< class ParticleClass >
class FTypedLeaf : public FAbstractLeaf<ParticleClass>, public FAssertable {
FList<ParticleClass*> sources;
FList<ParticleClass*> targets;
public:
/** Default destructor */
......@@ -25,28 +25,28 @@ public:
}
/**
* To add a new particule in the leaf
* @param particule the new particule
* To add a new particle in the leaf
* @param particle the new particle
*/
void push(ParticuleClass* const particule){
if(particule->isTarget()) this->targets.pushFront(particule);
else if(particule->isSource()) this->sources.pushFront(particule);
else assert(false, "Error particule has undefined type.", __LINE__, __FILE__);
void push(ParticleClass* const particle){
if(particle->isTarget()) this->targets.pushFront(particle);
else if(particle->isSource()) this->sources.pushFront(particle);
else assert(false, "Error particle has undefined type.", __LINE__, __FILE__);
}
/**
* To get all the sources in a leaf
* @return a pointer to the list of particules that are sources
* @return a pointer to the list of particles that are sources
*/
FList<ParticuleClass*>* getSources() {
FList<ParticleClass*>* getSources() {
return &this->sources;
}
/**
* To get all the target in a leaf
* @return a pointer to the list of particules that are targets
* @return a pointer to the list of particles that are targets
*/
FList<ParticuleClass*>* getTargets() {
FList<ParticleClass*>* getTargets() {
return &this->targets;
}
......
......@@ -21,17 +21,17 @@
* Please refere to testOctree.cpp to see an example.
* <code>
* // can be used as : <br>
* FOctree<TestParticule, TestCell, 10, 3> tree(1.0,F3DPosition(0.5,0.5,0.5));
* FOctree<TestParticle, TestCell, 10, 3> tree(1.0,F3DPosition(0.5,0.5,0.5));
* </code>
*
* Particules and cells has to respect the Abstract class definition.
* Particule must extend {FExtendPosition}
* Particles and cells has to respect the Abstract class definition.
* Particle must extend {FExtendPosition}
* Cell must extend extend {FExtendPosition,FExtendMortonIndex}
*/
template< class ParticuleClass, class CellClass, template <class ParticuleClass> class LeafClass, int OctreeHeight, int SubtreeHeight = 3>
template< class ParticleClass, class CellClass, template <class ParticleClass> class LeafClass, int OctreeHeight, int SubtreeHeight = 3>
class FOctree {
FReal boxWidthAtLevel[OctreeHeight]; //< to store the width of each boxs at all levels
FSubOctree< ParticuleClass, CellClass , LeafClass> root; //< root suboctree
FSubOctree< ParticleClass, CellClass , LeafClass> root; //< root suboctree
const F3DPosition boxCenter; //< the space system center
const F3DPosition boxCorner; //< the space system corner (used to compute morton index)
......@@ -56,7 +56,7 @@ class FOctree {