Commit 7554df1d authored by BRAMAS Berenger's avatar BRAMAS Berenger

Code is uptodate for the rotation kernel, need a little improvment

parent ca884022
This diff is collapsed.
// ===================================================================================
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, Bérenger Bramas.
// Propriétaires : INRIA.
// Copyright © 2011-2012, diffusé sous les termes et conditions d’une licence propriétaire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, Bérenger Bramas.
// Owners: INRIA.
// Copyright © 2011-2012, spread under the terms and conditions of a proprietary license.
// ===================================================================================
#ifndef FROTATIONLPARTICLE_HPP
#define FROTATIONLPARTICLE_HPP
#include "../../Extensions/FExtendForces.hpp"
#include "../../Extensions/FExtendPotential.hpp"
#include "../../Extensions/FExtendParticleType.hpp"
#include "../../Components/FFmaParticle.hpp"
#include "../../Components/FAbstractSerializable.hpp"
class FRotationParticle : public FExtendForces, public FFmaParticle, public FExtendPotential {
public:
/** Save current object */
void save(FBufferWriter& buffer) const {
FExtendForces::save(buffer);
FFmaParticle::save(buffer);
FExtendPotential::save(buffer);
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
FExtendForces::restore(buffer);
FFmaParticle::restore(buffer);
FExtendPotential::restore(buffer);
}
};
class FTypedRotationParticle : public FRotationParticle, public FExtendParticleType {
public:
/** Save current object */
void save(FBufferWriter& buffer) const {
FRotationParticle::save(buffer);
FExtendParticleType::save(buffer);
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
FRotationParticle::restore(buffer);
FExtendParticleType::restore(buffer);
}
};
#endif // FROTATIONLPARTICLE_HPP
......@@ -20,11 +20,11 @@
#include "../../Src/Core/FFmmAlgorithm.hpp"
#include "../../Src/Kernels/Spherical/FSphericalParticle.hpp"
#include "../../Src/Kernels/Spherical/FSphericalKernel.hpp"
#include "../../Src/Kernels/Rotation/FRotationParticle.hpp"
//#include "../../Src/Kernels/Spherical/FSphericalKernel.hpp"
#include "../../Src/Kernels/Rotation/FRotationKernel.hpp"
#include "../../Src/Kernels/Rotation/FRotationOriginalKernel.hpp"
//#include "../../Src/Kernels/Rotation/FRotationOriginalKernel.hpp"
#include "../../Src/Kernels/Rotation/FRotationCell.hpp"
#include "../../Src/Utils/FMath.hpp"
......@@ -39,25 +39,11 @@
/** We need to know the position of the particle in the array */
class IndexedParticle : public FSphericalParticle {
int index;
public:
IndexedParticle(): index(-1){}
int getIndex() const{
return index;
}
void setIndex( const int inIndex ){
index = inIndex;
}
};
int main(int argc, char** argv){
static const int P = 8;
static const int P = 9;
typedef IndexedParticle ParticleClass;
typedef FRotationParticle ParticleClass;
typedef FRotationCell<P> CellClass;
typedef FVector<ParticleClass> ContainerClass;
......@@ -96,13 +82,7 @@ int main(int argc, char** argv){
std::cout << "\tHeight : " << NbLevels << " \t sub-height : " << SizeSubLevels << std::endl;
counter.tic();
//loader.fillTree(tree);
ParticleClass* const particles = new ParticleClass[loader.getNumberOfParticles()];
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(particles[idxPart]);
particles[idxPart].setIndex( idxPart );
tree.insert(particles[idxPart]);
}
loader.fillTree(tree);
counter.tac();
std::cout << "Done " << "(@Creating and Inserting Particles = " << counter.elapsed() << "s)." << std::endl;
......@@ -160,7 +140,7 @@ int main(int argc, char** argv){
}
// -----------------------------------------------------
/*
{
std::cout << "Compute direct interaction for all\n";
for(int idxTarget = 0 ; idxTarget < loader.getNumberOfParticles() ; ++idxTarget){
......@@ -299,7 +279,7 @@ int main(int argc, char** argv){
} while(octreeIterator.moveRight() && octreeIteratorValide.moveRight());
}
}
*/
return 0;
}
This diff is collapsed.
......@@ -16,7 +16,7 @@
#include "../Src/Containers/FVector.hpp"
#include "../Src/Kernels/Rotation/FRotationCell.hpp"
#include "../Src/Kernels/Spherical/FSphericalParticle.hpp"
#include "../Src/Kernels/Rotation/FRotationParticle.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Kernels/Rotation/FRotationKernel.hpp"
......@@ -34,7 +34,7 @@
*/
/** We need to know the position of the particle in the array */
class IndexedParticle : public FSphericalParticle {
class IndexedParticle : public FRotationParticle {
int index;
public:
IndexedParticle(): index(-1){}
......
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