Commit ae13e9bb authored by BRAMAS Berenger's avatar BRAMAS Berenger

Remove warning by using int, add utest for adaptive chebyshev and remove a cout in kernel wrapper

parent 70e29391
......@@ -169,7 +169,7 @@ public:
const FReal*const physicalValues = particles->getPhysicalValues();
// apply P2L
for (unsigned int idxPart=0; idxPart<particles->getNbParticles(); ++idxPart){
for ( int idxPart=0; idxPart<particles->getNbParticles(); ++idxPart){
const FPoint y = FPoint(positionsX[idxPart],
positionsY[idxPart],
......@@ -240,11 +240,11 @@ public:
const FReal *const MultipoleExpansion = pole->getMultipole(idxRhs);
// apply M2P
for (unsigned int idxPart=0; idxPart<particles->getNbParticles(); ++idxPart){
for (int idxPart=0; idxPart<particles->getNbParticles(); ++idxPart){
const FPoint x = FPoint(positionsX[idxPart],positionsY[idxPart],positionsZ[idxPart]);
for (unsigned int n=0; n<nnodes; ++n){
for (int n=0; n<nnodes; ++n){
FReal Kxy[1];
FReal dKxy[3];
......
......@@ -88,8 +88,7 @@ public:
}
}
}
// We need to aggregate if there are only particles and if the kernel says so
std :: cout << " only Part ("<< std::boolalpha << onlyParticlesCells << " ) ";
// We need to aggregate if there are only particles and if the kernel says so
const bool continueToAgregate = (onlyParticlesCells && (kernel.preferP2M(inLevel, subLeaves.data(), subLeaves.getSize()) == false));
if(nbChild == 1){
// One child means that the cell is not Adaptive
......
......@@ -45,10 +45,10 @@
#include "Adaptive/FAdaptiveCell.hpp"
#include "Adaptive/FAdaptiveKernelWrapper.hpp"
#include "Adaptive/FAbstractAdaptiveKernel.hpp"
#include "Adaptive/FAdaptChebSymKernel.hpp"
//
#include "Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "Kernels/Chebyshev/FChebCell.hpp"
#include "Adaptive/FAdaptChebSymKernel.hpp"
#include "Adaptive/FAdaptTools.hpp"
//#include "AdaptiveTree/FAdaptChebSymKernel.hpp"
......@@ -121,7 +121,6 @@ int main(int argc, char ** argv){
// Not Random Loader
//////////////////////////////////////////////////////////////////////////////////
FFmaGenericLoader loader(fileName);
//FRandomLoader loader(FParameters::getValue(argc,argv,"-nb", 2000000), 1, FPoint(0.5,0.5,0.5), 1);
const long int NbPart = loader.getNumberOfParticles() ;
//////////////////////////////////////////////////////////////////////////////////
......
// ===================================================================================
// 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.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
// ==== CMAKE =====
// @FUSE_BLAS
// ================
#include "FUKernelTester.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Kernels/Chebyshev/FChebCell.hpp"
#include "../Src/Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "../Src/Kernels/Chebyshev/FChebKernel.hpp"
#include "../Src/Kernels/Chebyshev/FChebSymKernel.hpp"
#include "../Src/Kernels/P2P/FP2PParticleContainerIndexed.hpp"
#include "../Src/Adaptive/FAdaptiveCell.hpp"
#include "../Src/Adaptive/FAdaptiveKernelWrapper.hpp"
#include "../Src/Adaptive/FAbstractAdaptiveKernel.hpp"
#include "../Src/Adaptive/FAdaptChebSymKernel.hpp"
/*
In this test we compare the Chebyschev fmm results and the direct results.
*/
/** the test class
*
*/
class TestChebyshevDirect : public FUKernelTester<TestChebyshevDirect> {
///////////////////////////////////////////////////////////
// Set the tests!
///////////////////////////////////////////////////////////
/** TestChebKernel */
void TestChebKernel(){
const unsigned int ORDER = 6;
typedef FChebCell<ORDER> CellClass;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleLeaf<ContainerClass> LeafClass;
typedef FInterpMatrixKernelR MatrixKernelClass;
typedef FAdaptiveChebSymKernel<CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef FAdaptiveCell< CellClass, ContainerClass > CellWrapperClass;
typedef FAdaptiveKernelWrapper< KernelClass, CellClass, ContainerClass > KernelWrapperClass;
typedef FOctree< CellWrapperClass, ContainerClass , LeafClass > OctreeClass;
// FFmmAlgorithmTask FFmmAlgorithmThread
typedef FFmmAlgorithm<OctreeClass, CellWrapperClass, ContainerClass, KernelWrapperClass, LeafClass > FmmClass;
// run test
RunTest<CellClass,ContainerClass,KernelWrapperClass,MatrixKernelClass,LeafClass,OctreeClass,FmmClass>(
[&](int NbLevels, FReal boxWidth, FPoint centerOfBox, const MatrixKernelClass *const MatrixKernel){
return std::unique_ptr<KernelWrapperClass>(new KernelWrapperClass(NbLevels, boxWidth, centerOfBox, MatrixKernel, 4, 4));
});
}
///////////////////////////////////////////////////////////
// Set the tests!
///////////////////////////////////////////////////////////
/** set test */
void SetTests(){
AddTest(&TestChebyshevDirect::TestChebKernel,"Test Chebyshev Kernel with one big SVD");
}
};
// You must do this
TestClass(TestChebyshevDirect)
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