Commit 0b262de7 authored by BLANCHARD Pierre's avatar BLANCHARD Pierre

Fixed some tests failing after modif of interpolation kernel ctor + missing includes.

parent e4418fc8
......@@ -74,11 +74,11 @@ public:
// * runtime_error is thrown if the required file is not valid).
// */
FAdaptiveChebSymKernel(const int inTreeHeight, const FReal inBoxWidth,
const FPoint& inBoxCenter) : KernelBaseClass(inTreeHeight, inBoxWidth, inBoxCenter)
const FPoint& inBoxCenter, const MatrixKernelClass *const inMatrixKernel) : KernelBaseClass(inTreeHeight, inBoxWidth, inBoxCenter, inMatrixKernel)
{}
// /** Copy constructor */
FAdaptiveChebSymKernel(const FAdaptiveChebSymKernel& other)
: KernelBaseClass(other)
: KernelBaseClass(other)
{ }
//
......
......@@ -79,7 +79,7 @@ public:
// * runtime_error is thrown if the required file is not valid).
// */
FAdaptiveUnifKernel(const int inTreeHeight, const FReal inBoxWidth,
const FPoint& inBoxCenter) : KernelBaseClass(inTreeHeight, inBoxWidth, inBoxCenter), M2LHandler(KernelBaseClass::MatrixKernel.getPtr(), inTreeHeight, inBoxWidth)
const FPoint& inBoxCenter, const MatrixKernelClass *const inMatrixKernel) : KernelBaseClass(inTreeHeight, inBoxWidth, inBoxCenter, inMatrixKernel), M2LHandler(inMatrixKernel, inTreeHeight, inBoxWidth)
{}
// /** Copy constructor */
FAdaptiveUnifKernel(const FAdaptiveUnifKernel& other)
......
......@@ -168,6 +168,9 @@ int main(int argc, char* argv[])
// init oct-tree
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
// Create Matrix Kernel
const MatrixKernelClass MatrixKernel;
{ // -----------------------------------------------------
time.tic();
for(int idxPart = 0 ; idxPart < nbParticles; ++idxPart){
......@@ -180,7 +183,7 @@ int main(int argc, char* argv[])
{ // -----------------------------------------------------
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel);
FmmClass algorithm(&tree, &kernels);
algorithm.execute();
time.tac();
......@@ -239,6 +242,9 @@ int main(int argc, char* argv[])
// init oct-tree
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
// Create Matrix Kernel
const MatrixKernelClass MatrixKernel;
{ // -----------------------------------------------------
time.tic();
......@@ -253,7 +259,7 @@ int main(int argc, char* argv[])
{ // -----------------------------------------------------
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel);
FmmClass algorithm(&tree, &kernels);
algorithm.execute();
time.tac();
......@@ -459,6 +465,9 @@ int main(int argc, char* argv[])
// init oct-tree
OctreeClass tree(TreeHeight, SubTreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
// Create Matrix Kernel
const MatrixKernelClass MatrixKernel;
{ // -----------------------------------------------------
time.tic();
......@@ -473,7 +482,7 @@ int main(int argc, char* argv[])
{ // -----------------------------------------------------
time.tic();
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox());
KernelClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel);
FmmClass algorithm(&tree, &kernels);
algorithm.execute();
time.tac();
......
......@@ -34,6 +34,7 @@
#include "../../Src/Files/FRandomLoader.hpp"
#include "../../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
/** This program show an example of use of
* the fmm basic algo
......
......@@ -38,6 +38,7 @@
#include "../../Src/Components/FSimpleLeaf.hpp"
#include "../../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "../../Src/Kernels/Spherical/FSphericalKernel.hpp"
#include "../../Src/Kernels/Spherical/FSphericalCell.hpp"
......@@ -229,13 +230,15 @@ int main(int argc, char ** argv){
std::cout << "Create kernel & run simu ..." << std::endl;
counter.tic();
const FInterpMatrixKernelR MatrixKernel;
FTreeCoordinate min, max;
if( FParameters::existParameter(argc, argv, "-noper") ){
#ifndef ScalFMM_USE_BLAS
KernelClass kernels( DevP, NbLevels, loader->getBoxWidth(), loader->getCenterOfBox());
#else
KernelClass kernels( NbLevels, loader->getBoxWidth(), loader->getCenterOfBox());
KernelClass kernels( NbLevels, loader->getBoxWidth(), loader->getCenterOfBox(),&MatrixKernel);
#endif
FmmClassNoPer algo(&tree,&kernels);
algo.execute();
......@@ -248,7 +251,7 @@ int main(int argc, char ** argv){
#ifndef ScalFMM_USE_BLAS
KernelClass kernels( DevP, algo.extendedTreeHeight(), algo.extendedBoxWidth(),algo.extendedBoxCenter());
#else
KernelClass kernels(algo.extendedTreeHeight(), algo.extendedBoxWidth(),algo.extendedBoxCenter());
KernelClass kernels(algo.extendedTreeHeight(), algo.extendedBoxWidth(),algo.extendedBoxCenter(),&MatrixKernel);
#endif
algo.setKernel(&kernels);
algo.execute();
......@@ -279,8 +282,6 @@ int main(int argc, char ** argv){
particlesDirect = new EwalParticle[loader->getNumberOfParticles()];
const FInterpMatrixKernelR MatrixKernel;
FReal denergy = 0.0;
FMath::FAccurater dfx, dfy, dfz ;
//
......
......@@ -42,6 +42,7 @@
//
#include "../../Src/Components/FSimpleLeaf.hpp"
#include "../../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
/**
* This program compares two different kernels, eg., the Chebyshev kernel with
......
......@@ -74,32 +74,32 @@ int main(int argc, char* argv[])
// order 2
time.tic();
FChebM2LHandler<2,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-1));
FChebM2LHandler<2,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-2));
FChebM2LHandler<2,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-1));
FChebM2LHandler<2,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-2));
// order 3
FChebM2LHandler<3,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-2));
FChebM2LHandler<3,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-3));
FChebM2LHandler<3,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-2));
FChebM2LHandler<3,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-3));
// order 4
FChebM2LHandler<4,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-3));
FChebM2LHandler<4,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-4));
FChebM2LHandler<4,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-3));
FChebM2LHandler<4,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-4));
// order 5
FChebM2LHandler<5,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-4));
FChebM2LHandler<5,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-5));
FChebM2LHandler<5,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-4));
FChebM2LHandler<5,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-5));
// order 6
FChebM2LHandler<6,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-5));
FChebM2LHandler<6,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-6));
FChebM2LHandler<6,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-5));
FChebM2LHandler<6,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-6));
// order 7
FChebM2LHandler<7,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-6));
FChebM2LHandler<7,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-7));
FChebM2LHandler<7,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-6));
FChebM2LHandler<7,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-7));
// order 8
FChebM2LHandler<8,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-7));
FChebM2LHandler<8,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-8));
FChebM2LHandler<8,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-7));
FChebM2LHandler<8,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-8));
// order 9
FChebM2LHandler<9,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-8));
FChebM2LHandler<9,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-9));
FChebM2LHandler<9,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-8));
FChebM2LHandler<9,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-9));
// order 10
FChebM2LHandler<10,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-9));
FChebM2LHandler<10,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(FReal(1e-10));
FChebM2LHandler<10,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-9));
FChebM2LHandler<10,MatrixKernelClass>::ComputeAndCompressAndStoreInBinaryFile(&MatrixKernel,FReal(1e-10));
return 0;
......
......@@ -57,6 +57,7 @@ void applyl2l(FReal *const S, FReal *const F, const unsigned int n, FReal *const
int main(int argc, char* argv[])
{
FTic time;
const unsigned int ORDER = 10;
const unsigned int nnodes = TensorTraits<ORDER>::nnodes;
FPoint X[nnodes];
......
......@@ -49,6 +49,9 @@ int main(int argc, char* argv[])
const FReal epsilon = 1e-9;
const unsigned int nnodes = TensorTraits<ORDER>::nnodes;
// initialize timer
FTic time;
/*
//// width of cell X and Y
//FReal wx = FReal(2.);
......@@ -76,8 +79,6 @@ int main(int argc, char* argv[])
FChebTensor<ORDER>::setRoots(cy, wy, rootsY);
// initialize timer
FTic time;
// fully pivoted ACA ///////////////////////////
......@@ -185,7 +186,7 @@ int main(int argc, char* argv[])
// exclude near-field
if (FPoint(ccx-ccy).norm() > FReal(3.5)) {
FChebTensor<ORDER>::setRoots(ccy, cw, rootsY);
EntryComputer<MatrixKernelClass> Computer(nnodes, rootsX, nnodes, rootsY);
EntryComputer<MatrixKernelClass> Computer(&MatrixKernel,nnodes, rootsX, nnodes, rootsY);
pACA(Computer, nnodes, nnodes, epsilon, U, V, rank);
//std::cout << "- Compress " << ccy << "\tof width " << cw << " to rank " << rank << std::endl;
......@@ -209,7 +210,7 @@ int main(int argc, char* argv[])
// exclude near-field
if (FPoint(ccx-ccy).norm() > FReal(3.5)) {
FChebTensor<ORDER>::setRoots(ccy, cw, rootsY);
EntryComputer<MatrixKernelClass> Computer(nnodes, rootsX, nnodes, rootsY);
EntryComputer<MatrixKernelClass> Computer(&MatrixKernel,nnodes, rootsX, nnodes, rootsY);
pACA(Computer, nnodes, nnodes, epsilon, U, V, rank);
//std::cout << "- Compress " << ccy << "\tof width " << cw << " to rank " << rank << std::endl;
......@@ -225,7 +226,7 @@ int main(int argc, char* argv[])
// remaining far-field: source cells whose multipole expansion is taken from parent level
else {
FChebTensor<ORDER>::setRoots(cpy, pw, rootsY);
EntryComputer<MatrixKernelClass> Computer(nnodes, rootsX, nnodes, rootsY);
EntryComputer<MatrixKernelClass> Computer(&MatrixKernel,nnodes, rootsX, nnodes, rootsY);
pACA(Computer, nnodes, nnodes, epsilon, U, V, rank);
//std::cout << "- Compress " << cpy << "\tof width " << pw << " to rank " << rank << std::endl;
......
......@@ -160,8 +160,8 @@ int main(int argc, char ** argv){
std::cout << "Working on particles ..." << std::endl;
counter.tic();
KernelWrapperClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox());; // FTestKernels FBasicKernels
const MatrixKernelClass MatrixKernel;
KernelWrapperClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel); // FTestKernels FBasicKernels
FmmClass algo(&tree,&kernels); //FFmmAlgorithm FFmmAlgorithmThread
algo.execute();
......
......@@ -156,8 +156,8 @@ int main(int argc, char ** argv){
std::cout << "Working on particles ..." << std::endl;
counter.tic();
KernelWrapperClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox());; // FTestKernels FBasicKernels
const MatrixKernelClass MatrixKernel;
KernelWrapperClass kernels(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel); // FTestKernels FBasicKernels
FmmClass algo(&tree,&kernels); //FFmmAlgorithm FFmmAlgorithmThread
algo.execute();
......
......@@ -22,6 +22,7 @@
#include "../Src/Kernels/Spherical/FSphericalCell.hpp"
#include "../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Kernels/Spherical/FSphericalKernel.hpp"
......
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