Commit d4c6e37b authored by berenger-bramas's avatar berenger-bramas
Browse files

FMB kernels

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@17 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 6caecf74
......@@ -130,8 +130,8 @@ public:
// Simply create particules and try the kernels
int main(int , char ** ){
const int NbLevels = 10;//10;
const int NbSubLevels = 3;//3
const long NbPart = 20000;//2E6;
const int SizeSubLevels = 3;//3
const long NbPart = 2000000;//2E6;
MyTestParticule* particules = new MyTestParticule[NbPart];
FTic counter;
......@@ -148,7 +148,7 @@ int main(int , char ** ){
std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl;
// -----------------------------------------------------
FOctree<MyTestParticule, MyTestCell, NbLevels, NbSubLevels> tree(1.0,F3DPosition(0.5,0.5,0.5));
FOctree<MyTestParticule, MyTestCell, NbLevels, SizeSubLevels> tree(1.0,F3DPosition(0.5,0.5,0.5));
// -----------------------------------------------------
std::cout << "Inserting particules ..." << std::endl;
......@@ -164,7 +164,7 @@ int main(int , char ** ){
counter.tic();
MyTestKernels<MyTestParticule, MyTestCell> kernels;
FFMMAlgorithm<MyTestParticule, MyTestCell, NbLevels, NbSubLevels> algo(&tree,&kernels);
FFMMAlgorithm<MyTestKernels, MyTestParticule, MyTestCell, NbLevels, SizeSubLevels> algo(&tree,&kernels);
algo.execute();
counter.tac();
......@@ -174,7 +174,7 @@ int main(int , char ** ){
std::cout << "Check Result\n";
{ // Check that each particule has been summed with all other
FOctree<MyTestParticule, MyTestCell, NbLevels, NbSubLevels>::Iterator octreeIterator(&tree);
FOctree<MyTestParticule, MyTestCell, NbLevels, SizeSubLevels>::Iterator octreeIterator(&tree);
octreeIterator.gotoBottomLeft();
do{
FList<MyTestParticule*>::BasicIterator iter(*octreeIterator.getCurrentList());
......@@ -189,7 +189,7 @@ int main(int , char ** ){
} while(octreeIterator.moveRight());
}
{ // Ceck if there is number of NbPart summed at level 1
FOctree<MyTestParticule, MyTestCell, NbLevels, NbSubLevels>::Iterator octreeIterator(&tree);
FOctree<MyTestParticule, MyTestCell, NbLevels, SizeSubLevels>::Iterator octreeIterator(&tree);
octreeIterator.moveDown();
long res = 0;
do{
......
......@@ -19,7 +19,9 @@
#include "../Sources/Core/FFMMAlgorithm.hpp"
#include "../Sources/Fmb/FFmbKernels.hpp"
#include "../Sources/Fmb/FFmbKernelsPotentialForces.hpp"
#include "../Sources/Fmb/FFmbKernelsForces.hpp"
#include "../Sources/Fmb/FFmbKernelsPotential.hpp"
#include "../Sources/Files/FFMALoader.hpp"
......@@ -50,9 +52,9 @@ public:
// Simply create particules and try the kernels
int main(int , char ** ){
const int NbLevels = 9;//10;
const int NbSubLevels = 3;//3
const int SizeSubLevels = 3;//3
FTic counter;
const char* const filename = "testLoaderFMA.fma";//testFMAlgorithm.fma";
const char* const filename = "testLoaderFMA.fma"; //"testLoaderFMA.fma" "testFMAlgorithm.fma"
FFMALoader<FmbParticule> loader(filename);
if(!loader.isValide()){
......@@ -62,7 +64,7 @@ int main(int , char ** ){
// -----------------------------------------------------
FOctree<FmbParticule, FmbCell, NbLevels, NbSubLevels> tree(loader.getBoxWidth(),loader.getCenterOfBox());
FOctree<FmbParticule, FmbCell, NbLevels, SizeSubLevels> tree(loader.getBoxWidth(),loader.getCenterOfBox());
// -----------------------------------------------------
......@@ -93,8 +95,8 @@ int main(int , char ** ){
std::cout << "Working on particules ..." << std::endl;
counter.tic();
FFmbKernels<FmbParticule, FmbCell> kernels(NbLevels,loader.getBoxWidth());
FFMMAlgorithm<FmbParticule, FmbCell, NbLevels, NbSubLevels> algo(&tree,&kernels);
FFmbKernelsPotentialForces<FmbParticule, FmbCell> kernels(NbLevels,loader.getBoxWidth());//FFmbKernelsPotentialForces FFmbKernelsForces FFmbKernelsPotential
FFMMAlgorithm<FFmbKernelsPotentialForces, FmbParticule, FmbCell, NbLevels, SizeSubLevels> algo(&tree,&kernels);
algo.execute();
counter.tac();
......
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