// =================================================================================== // 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 #include #include "Utils/FParameters.hpp" #include "Utils/FTic.hpp" #include "Containers/FOctree.hpp" //#include "Containers/FVector.hpp" //#include "Components/FSimpleLeaf.hpp" #include "Utils/FPoint.hpp" #include "Files/FFmaGenericLoader.hpp" #include "Files/FRandomLoader.hpp" #include "Components/FBasicKernels.hpp" #include "Components/FSimpleIndexedLeaf.hpp" #include "Kernels/P2P/FP2PParticleContainerIndexed.hpp" #include "Adaptative/FAdaptiveCell.hpp" #include "Adaptative/FAdaptiveKernelWrapper.hpp" #include "Adaptative/FAbstractAdaptiveKernel.hpp" // #include "Kernels/Interpolation/FInterpMatrixKernel.hpp" #include "Kernels/Uniform/FUnifCell.hpp" #include "AdaptiveTree/FAdaptUnifKernel.hpp" #include "AdaptiveTree/FAdaptTools.hpp" // // #include "Core/FFmmAlgorithm.hpp" //#include "Core/FFmmAlgorithmThread.hpp" //#include "Core/FFmmAlgorithmTask.hpp" /** This program show an example of use of the fmm basic algo * it also check that each particles is impacted each other particles */ void usage() { std::cout << "Driver to obtain statistics on the octree" << std::endl; std::cout << "Options "<< std::endl << " -help to see the parameters " << std::endl << " -depth the depth of the octree "<< std::endl << " -subdepth specifies the size of the sub octree " << std::endl << " -fin name specifies the name of the particle distribution" << std::endl << " -sM s_min^M threshold for Multipole (l+1)^2 for Spherical harmonics"< KernelClass; typedef FUnifCell

CellClass; typedef FP2PParticleContainerIndexed<> ContainerClass; typedef FSimpleIndexedLeaf LeafClass; typedef FInterpMatrixKernelR MatrixKernelClass; // typedef FAdaptiveUnifKernel KernelClass; // // typedef FAdaptiveCell< CellClass, ContainerClass > CellWrapperClass; typedef FAdaptiveKernelWrapper< KernelClass, CellClass, ContainerClass > KernelWrapperClass; typedef FOctree< CellWrapperClass, ContainerClass , LeafClass > OctreeClass; // FFmmAlgorithmTask FFmmAlgorithmThread typedef FFmmAlgorithm FmmClass; ///////////////////////What we do///////////////////////////// std::cout << ">> This executable has to be used to test the FMM algorithm.\n"; ////////////////////////////////////////////////////////////// // const int NbLevels = FParameters::getValue(argc,argv,"-depth", 7); const int SizeSubLevels = FParameters::getValue(argc,argv,"subdepth", 3); const int sminM = FParameters::getValue(argc,argv,"-sM", P*P*P); const int sminL = FParameters::getValue(argc,argv,"-sL", P*P*P); // FTic counter; ////////////////////////////////////////////////////////////////////////////////// // Not Random Loader ////////////////////////////////////////////////////////////////////////////////// const std::string fileName(FParameters::getStr(argc,argv,"-fin", "../Data/prolate50.fma")); FFmaGenericLoader loader(fileName); const long int NbPart = loader.getNumberOfParticles() ; // Random Loader //const int NbPart = FParameters::getValue(argc,argv,"-nb", 2000000); // FRandomLoader loader(NbPart, 1, FPoint(0.5,0.5,0.5), 1); ////////////////////////////////////////////////////////////////////////////////// OctreeClass tree(NbLevels, SizeSubLevels, loader.getBoxWidth(), loader.getCenterOfBox()); ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// std::cout << "Creating & Inserting " << NbPart << " particles ..." << std::endl; std::cout << "\tHeight : " << NbLevels << " \t sub-height : " << SizeSubLevels << std::endl; std::cout << " criteria SM: "<< sminM <getGlobalId( ) << " Nb particles "<< leaf->getSrc()->getNbParticles()<hasDevelopment()){ file <<"Cell id "<< octreeIterator.getCurrentCell()->getGlobalId( ) << " "<<*(octreeIterator.getCurrentCell())<< std::endl ; } } while(octreeIterator.moveRight()); octreeIterator.moveDown() ; octreeIterator.gotoLeft(); } std::cout << " END " << std::endl; // Check octreeIterator.gotoBottomLeft(); do { std::cout << " Level " <