Commit 4c045f2b authored by Quentin Khan's avatar Quentin Khan

FFmmAlgorithmBalanced : First fully functional version

testFmmAlgorithmBalanced : test file, checks that each FMM operator is called the right number of times.
parent 4d2821f0
......@@ -21,7 +21,6 @@
#include <string>
using FReal = double;
#include "Files/FFmaGenericLoader.hpp"
#include "Files/FRandomLoader.hpp"
#include "Containers/FOctree.hpp"
......@@ -54,13 +53,15 @@ using FReal = double;
#define ORDER 7
using FReal = double;
using CellClass = FCostCell<FTestCell>;
using ContainerClass = FTestParticleContainer<FReal>;
using LeafClass = FSimpleLeaf< FReal, ContainerClass >;
using OctreeClass = FOctree< FReal, CellClass, ContainerClass, LeafClass >;
using MatrixKernelClass = FInterpMatrixKernelR<FReal>;
using BalanceKernelClass= FChebBalanceSymKernel<CellClass, ContainerClass,
using BalanceKernelClass= FChebBalanceSymKernel<FReal, CellClass, ContainerClass,
MatrixKernelClass, ORDER,
OctreeClass>;
......@@ -102,20 +103,21 @@ int main(int argc, char** argv)
}
/**************************************************************************/
std::cerr << ("Running the costzones algorithm") << std::endl;
/* Run the costzone algorithm *********************************************/
CostZones<OctreeClass, CellClass> costzones(&tree, args.zoneCount());
FCostZones<OctreeClass, CellClass> costzones(&tree, args.zoneCount());
costzones.run();
writeZones(args, costzones);
/**************************************************************************/
std::cerr << ("Done") << std::endl;
/* Run the balanced algorithm *********************************************/
std::cout << "Running kernel" << std::endl;
KernelClass computeKernel;
FmmClass<FFmmAlgorithmThreadBalanced, KernelClass> fmmAlgo(&tree, &computeKernel, costzones.getZoneBounds());
FmmClass<FFmmAlgorithmThreadBalanced, KernelClass> fmmAlgo(&tree, &computeKernel, costzones.getZoneBounds(), costzones.getLeafZoneBounds());
//FmmClass<FFmmAlgorithm, KernelClass> fmmAlgo(&tree, &computeKernel);
fmmAlgo.execute();
......
......@@ -19,7 +19,7 @@
* \param costzones The CostZones object that was used get the tree balance.
*/
template<class OctreeClass, class CellClass>
void writeZones(const loadFMAAndRunFMMArgs& args, const CostZones <OctreeClass,CellClass>& costzones)
void writeZones(const loadFMAAndRunFMMArgs& args, const FCostZones <OctreeClass,CellClass>& costzones)
{
const std::string outFileBaseName = args.outFileName();
const std::string outFileExt = args.outFileExt();
......@@ -76,7 +76,7 @@ void writeZones(const loadFMAAndRunFMMArgs& args, const CostZones <OctreeClass,C
* \param tree The the to load into.
* \param loader The loader to load from.
*/
template <class OctreeClass>
template <typename FReal, class OctreeClass>
void loadTree(OctreeClass& tree, FFmaGenericLoader<FReal>& loader)
{
FReal physicalValue;
......@@ -89,7 +89,7 @@ void loadTree(OctreeClass& tree, FFmaGenericLoader<FReal>& loader)
}
template <class OctreeClass>
template <typename FReal, class OctreeClass>
void loadTree(OctreeClass& tree, FRandomLoader<FReal>& loader)
{
FPoint<FReal> particlePosition;
......
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