Commit 950dd3ed authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files
parents ca4d9b44 74ab65ad
......@@ -179,10 +179,10 @@ public:
// TargetParticles);
// 2.c) apply Sx and Px (grad Sx)
AbstractBaseClass::Interpolator->applyL2PGradient(LeafCellCenter,
AbstractBaseClass::BoxWidthLeaf,
LeafCell->getLocal(),
TargetParticles);
AbstractBaseClass::Interpolator->applyL2PTotal(LeafCellCenter,
AbstractBaseClass::BoxWidthLeaf,
LeafCell->getLocal(),
TargetParticles);
}
};
......
......@@ -23,6 +23,8 @@
#include <cstdio>
#include <cstdlib>
#include <starpu.h>
#include "../../Src/Kernels/Chebyshev/FChebParticle.hpp"
#include "../../Src/Kernels/Chebyshev/FChebLeaf.hpp"
#include "../../Src/Kernels/Chebyshev/FChebCell.hpp"
......@@ -38,6 +40,7 @@
#include "../../Src/Core/FFmmAlgorithm.hpp"
#include "../../Src/Core/FFmmAlgorithmThread.hpp"
#include "../../Src/Core/FFmmAlgorithmStarpu.hpp"
/** This program show an example of use of
......@@ -81,8 +84,8 @@ int main(int argc, char* argv[])
{
const unsigned int ORDER = 3;
const FReal epsilon = FParameters::getValue(argc, argv, "-eps", FReal(1e-3));
const long NbPart = FParameters::getValue(argc, argv, "-num", 4000000);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 7);
const long NbPart = FParameters::getValue(argc, argv, "-num", 400000);
const unsigned int TreeHeight = FParameters::getValue(argc, argv, "-h", 6);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, "-sh", 2);
const unsigned int NbThreads = FParameters::getValue(argc, argv, "-t", 1);
......@@ -105,10 +108,23 @@ int main(int argc, char* argv[])
typedef FChebMatrixKernelR MatrixKernelClass;
typedef FChebCell<ORDER> CellClass;
typedef FOctree<ParticleClass,CellClass,ContainerClass,LeafClass> OctreeClass;
//typedef FChebKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FChebSymKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
//typedef FFmmAlgorithm<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
typedef FFmmAlgorithmThread<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
typedef FChebKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
//typedef FChebSymKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
//typedef FFmmAlgorithmThread<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// // typedefs for STARPU
// typedef FChebParticle ParticleClass;
// typedef StarVector<ParticleClass> ContainerClass;
// typedef DataVector<ParticleClass> RealContainerClass;
// typedef FChebLeaf<ParticleClass,ContainerClass> LeafClass;
// typedef FChebMatrixKernelR MatrixKernelClass;
// typedef FChebCell<ORDER> RealCellClass;
// typedef FStarCell<RealCellClass> CellClass;
// typedef FOctree<ParticleClass,CellClass,ContainerClass,LeafClass> OctreeClass;
// //typedef FChebKernel<ParticleClass,RealCellClass,RealContainerClass,MatrixKernelClass,ORDER> KernelClass;
// typedef FChebSymKernel<ParticleClass,RealCellClass,RealContainerClass,MatrixKernelClass,ORDER> KernelClass;
// typedef FFmmAlgorithmStarpu<OctreeClass,ParticleClass,CellClass,RealCellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// What we do //////////////////////////////////////////////////////
std::cout << ">> Testing the Chebyshev interpolation base FMM algorithm.\n";
......
......@@ -31,6 +31,7 @@
#include "../Src/Kernels/Chebyshev/FChebCell.hpp"
#include "../Src/Kernels/Chebyshev/FChebMatrixKernel.hpp"
#include "../Src/Kernels/Chebyshev/FChebKernel.hpp"
#include "../Src/Kernels/Chebyshev/FChebSymKernel.hpp"
/*
In this test we compare the spherical fmm results and the direct results.
......@@ -70,6 +71,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
typedef FChebCell<ORDER> CellClass;
typedef FOctree<ParticleClass,CellClass,ContainerClass,LeafClass> OctreeClass;
typedef FChebKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
//typedef FChebSymKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// Warning in make test the exec dir it Build/UTests
......@@ -110,17 +112,17 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
for(int idxOther = idxTarget + 1 ; idxOther < loader.getNumberOfParticles() ; ++idxOther){
//kernels.directInteractionMutual(&particles[idxTarget], &particles[idxOther]);
const FReal wt = particles[idxTarget].getPhysicalValue();
const FReal ws = particles[idxOther].getPhysicalValue();
const FReal ws = particles[idxOther ].getPhysicalValue();
const FReal one_over_r = MatrixKernel.evaluate(particles[idxTarget].getPosition(),
particles[idxOther].getPosition());
// potential
particles[idxTarget].incPotential(one_over_r * ws);
particles[idxOther].incPotential(one_over_r * wt);
particles[idxOther ].incPotential(one_over_r * wt);
// force
FPoint force(particles[idxTarget].getPosition() - particles[idxOther].getPosition());
F3DPosition force(particles[idxOther].getPosition() - particles[idxTarget].getPosition());
force *= ((ws*wt) * (one_over_r*one_over_r*one_over_r));
particles[idxTarget].incForces( force.getX(), force.getY(), force.getZ());
particles[idxOther].incForces( -force.getX(), -force.getY(), -force.getZ());
particles[idxTarget].incForces( force.getX(), force.getY(), force.getZ());
particles[idxOther ].incForces( -force.getX(), -force.getY(), -force.getZ());
}
}
......
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