Commit 64b860e9 authored by COULAUD Olivier's avatar COULAUD Olivier

Pb with utestChebyshevDirect.cpp and ICL++

parent 986c21fe
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -60,9 +60,7 @@ public:
* precomputed and compressed M2L operators from a binary file (an
* runtime_error is thrown if the required file is not valid).
*/
FChebKernel(const int inTreeHeight,
const FReal inBoxWidth,
const FPoint& inBoxCenter,
FChebKernel(const int inTreeHeight, const FReal inBoxWidth, const FPoint& inBoxCenter,
const FReal Epsilon)
: FAbstractChebKernel< CellClass, ContainerClass, MatrixKernelClass, ORDER, NVALS>(inTreeHeight,
inBoxWidth,
......@@ -74,6 +72,11 @@ public:
M2LHandler->ComputeAndCompressAndSet();
}
FChebKernel(const int inTreeHeight, const FReal inBoxWidth, const FPoint& inBoxCenter)
: FChebKernel(inTreeHeight, inBoxWidth,inBoxCenter,FReal(1.0/FMath::pow(10,ORDER)))
{
}
void P2M(CellClass* const LeafCell,
const ContainerClass* const SourceParticles)
......
......@@ -488,12 +488,12 @@ static void precompute(const MatrixKernelClass *const MatrixKernel, const FReal
}
}
}
std::cout << "The approximation of the " << counter
<< " far-field interactions (overall rank " << overall_rank
<< " / " << 16*nnodes
<< " , sizeM2L= " << 2*overall_rank*nnodes*sizeof(FReal) << ""
<< " / " << 16*nnodes*nnodes*sizeof(FReal) << " B"
<< ") took " << overall_time << "s\n" << std::endl;
// std::cout << "The approximation of the " << counter
// << " far-field interactions (overall rank " << overall_rank
// << " / " << 16*nnodes
// << " , sizeM2L= " << 2*overall_rank*nnodes*sizeof(FReal) << ""
// << " / " << 16*nnodes*nnodes*sizeof(FReal) << " B"
// << ") took " << overall_time << "s\n" << std::endl;
delete [] U;
delete [] WORK;
delete [] VT;
......
......@@ -56,7 +56,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
template <class CellClass, class ContainerClass, class KernelClass, class MatrixKernelClass,
class LeafClass, class OctreeClass, class FmmClass>
void RunTest(const FReal epsilon) {
void RunTest() {
// Warning in make test the exec dir it Build/UTests
// Load particles
const char* const filename = (sizeof(FReal) == sizeof(float))?
......@@ -71,9 +71,8 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
Print("Number of particles:");
Print(loader.getNumberOfParticles());
const int NbLevels = 4;
const int NbLevels = 4;
const int SizeSubLevels = 2;
//const FReal epsilon = FReal(1e-5);
// Create octree
struct TestParticle{
......@@ -105,7 +104,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
// Run FMM
Print("Fmm...");
KernelClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(), epsilon);
KernelClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox());
FmmClass algo(&tree,&kernels);
algo.execute();
......@@ -167,7 +166,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
// Assert
const FReal MaximumDiffPotential = FReal(9e-5);
const FReal MaximumDiffForces = FReal(9e-3);
const FReal MaximumDiffForces = FReal(9e-3);
uassert(potentialDiff.getRelativeL2Norm() < MaximumDiffPotential);
uassert(potentialDiff.getRelativeInfNorm() < MaximumDiffPotential);
......@@ -199,8 +198,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
/** TestChebKernel */
void TestChebKernel(){
const unsigned int ORDER = 5;
const FReal epsilon = FReal(1e-5);
const unsigned int ORDER = 6;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleLeaf<ContainerClass> LeafClass;
typedef FInterpMatrixKernelR MatrixKernelClass;
......@@ -209,13 +207,12 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
typedef FChebKernel<CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// run test
RunTest<CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>(epsilon);
RunTest<CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>();
}
/** TestChebSymKernel */
void TestChebSymKernel(){
const unsigned int ORDER = 5;
const FReal epsilon = FReal(1e-5);
const unsigned int ORDER = 6;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleLeaf<ContainerClass> LeafClass;
typedef FInterpMatrixKernelR MatrixKernelClass;
......@@ -224,7 +221,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
typedef FChebSymKernel<CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FFmmAlgorithm<OctreeClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
// run test
RunTest<CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>(epsilon);
RunTest<CellClass,ContainerClass,KernelClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>();
}
......
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