Commit 04764947 authored by Quentin Khan's avatar Quentin Khan

Update test to recent dev

parent d153ff9a
......@@ -4,13 +4,13 @@
// 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.
//
// 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.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
......@@ -27,8 +27,6 @@
#include "Containers/FOctree.hpp"
// Cell
//#include "Components/FBasicCell.hpp"
//#include "Kernels/Chebyshev/FChebCell.hpp"
#include "Components/FTestCell.hpp"
// Particle Container
......@@ -40,7 +38,8 @@
// Kernel
//#include "Kernels/Chebyshev/FChebSymKernel.hpp"
#include "Components/FTestKernels.hpp"
//#include "Components/FTestKernels.hpp"
#include "Adaptive/FCountKernel.hpp"
#include "BalanceTree/FChebSymCostKernel.hpp"
#include "BalanceTree/FDumbCostKernel.hpp"
......@@ -57,8 +56,11 @@
using FReal = double;
using CellClass = FCostCell<FTestCell>;
using ContainerClass = FTestParticleContainer<FReal>;
using CellClass = FCostCell<TestCountNodeData>; /// Particle type
using ParticleClass = TestCountParticle<FReal, 3>;
/// Particle container type
using ContainerClass = FVariadicParticleContainer<ParticleClass>;
using LeafClass = FSimpleLeaf< FReal, ContainerClass >;
using OctreeClass = FOctree< FReal, CellClass, ContainerClass, LeafClass >;
......@@ -69,7 +71,7 @@ using MatrixKernelClass = FInterpMatrixKernelR<FReal>;
using CostKernelClass = FDumbCostKernel<FReal, CellClass, ContainerClass,
OctreeClass>;
using KernelClass = FTestKernels< CellClass, ContainerClass>;
using KernelClass = FCountKernel< CellClass, ContainerClass>;
const FReal epsilon = 1e-4;
......@@ -108,29 +110,33 @@ int main(int argc, char** argv)
/* Run the costzone algorithm *********************************************/
FCostZones<OctreeClass, CellClass> costzones(&tree, args.zoneCount());
costzones.run();
/**************************************************************************/
std::cerr << "Done" << std::endl;
/**************************************************************************/
/* Run the balanced algorithm *********************************************/
std::cout << "Running kernel" << std::endl;
KernelClass computeKernel;
FFmmAlgorithmThreadBalanced<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass >
fmmAlgo(&tree, &computeKernel, costzones.getZoneBounds(), costzones.getLeafZoneBounds());
//FFmmAlgorithm<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass >
// fmmAlgo(&tree, &computeKernel);
fmmAlgo.execute();
/**************************************************************************/
/* Check the results ******************************************************/
ValidateFMMAlgo<OctreeClass, CellClass, ContainerClass, LeafClass>(&tree);
//ValidateFMMAlgo<OctreeClass, CellClass, ContainerClass, LeafClass>(&tree);
std::size_t particle_count = 0;
tree.forEachCellLeaf([&particle_count](CellClass* cell, LeafClass* leaf){
if(cell->getMultipoleData().up != leaf->getSrc()->getNbParticles() ){
std::cout << "Problem P2M : " << cell->getMultipoleData().up <<
" (should be " << leaf->getSrc()->getNbParticles() << ")\n";
}
particle_count += leaf->getSrc()->getNbParticles();
});
return EXIT_SUCCESS;
}
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