Commit 26a3f673 authored by BRAMAS Berenger's avatar BRAMAS Berenger
parents 53a0afb5 b2b63e05
......@@ -297,7 +297,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
else()
message(WARNING "BLAS has not been found, SCALFMM will continue to compile but some applications will be disabled.")
message(WARNING "If you have BLAS set BLAS_LIBDIR, BLAS_INCDIR or BLAS_DIR (CMake variables using -D or environment variables).")
set(SCALFMM_USE_FFT OFF)
set(SCALFMM_USE_BLAS OFF)
endif()
endif(SCALFMM_USE_BLAS)
......
......@@ -32,7 +32,7 @@ PROJECT_NAME = ScalFmm
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = @ScalFMM_MAJOR_VERSION@.@ScalFMM_MINOR_VERSION@
PROJECT_NUMBER = @SCALFMM_MAJOR_VERSION@.@SCALFMM_MINOR_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
......
......@@ -73,7 +73,7 @@ int main(int argc, char* argv[])
FParameterDefinitions::NbThreads);
const std::string defaultFile(/*SCALFMMDataPath+*/"Data/unitCubeXYZQ100.bfma" );
const std::string defaultFile(SCALFMMDataPath+"unitCubeXYZQ100.bfma" );
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
......@@ -258,7 +258,14 @@ int main(int argc, char* argv[])
writer.writeArrayOfReal(particles, 8 , NbPoints);
delete[] particles;
//
std::string name1( "output.fma");
//
FFmaGenericWriter<FReal> writer1(name1) ;
writer1.writeDistributionOfParticlesFromOctree(&tree,NbPoints) ;
}
return 0;
}
......@@ -233,7 +233,7 @@ protected:
* \brief Main costzone algorithm.
*
* Moves through the tree in-order and assigns each cell to a zone. When a
* zone's cumulative cost is too high, the new cells are insterted in the
* zone's cumulative cost is too high, the new cells are inserted in the
* next one.
*/
void costzones() {
......@@ -374,7 +374,7 @@ protected:
/**
* \brief Computes and stores the leaves' total cost.
*
* The tree itertor (#_it) is moved to the bottom level of the
* The tree iterator (#_it) is moved to the bottom level of the
* tree by this method. After the method returns, the iterator is left at
* the rightmost leaf.
*/
......@@ -397,7 +397,7 @@ protected:
* \brief Computes and stores the internal cells' total cost.
* \warning This method makes use of
*
* The tree itertor (#_it) is moved to the bottom level of the
* The tree iterator (#_it) is moved to the bottom level of the
* tree by this method. After the method returns, the iterator is left at
* the rightmost leaf.
*/
......
......@@ -91,6 +91,7 @@ class FFmmAlgorithmThreadBalanced : public FAbstractAlgorithm, public FAlgorithm
/// The vector containing the internal costzones
const std::vector<std::vector<ZoneBoundClass>>& costzones;
/// The vector containing the leaf level costzones
const std::vector<std::vector<ZoneBoundClass>>& leafcostzones;
......@@ -160,7 +161,7 @@ protected:
/**
* \brief Runs the complete algorithm.
*
* \param operationsToProceed A flag combinaison to specifiy the operators
* \param operationsToProceed A flag combinaison to specify the operators
* to use. See FFmmOperations in FCoreCommon.hpp.
*/
void executeCore(const unsigned operationsToProceed) override {
......@@ -216,7 +217,7 @@ protected:
The zones are calculated sequentially, we use the same iterator and
save it's position when we change zone.
*/
for( std::vector<ZoneBoundClass> zone : leafcostzones ) {
for( std::vector<ZoneBoundClass> zone : costzones ) {
int nbCells = 0;
for( ZoneBoundClass bounds : zone ) {
nbCells += bounds.second;
......@@ -225,8 +226,8 @@ protected:
iterVector.push_back(
std::pair<TreeIterator,int>(
octreeIterator, // Iterator to the current cell
nbCells)); // Cell count in zone
nbCells) // Cell count in zone
);
// Move iterator to end of zone (which is the first of the next zone)
for( int idx = 0; idx < nbCells; idx++) {
octreeIterator.moveRight();
......@@ -240,15 +241,15 @@ protected:
const int threadIdx = omp_get_thread_num();
KernelClass * const myThreadkernels = kernels[threadIdx];
TreeIterator zoneIterator = iterVector.at(threadIdx).first;
int zoneCellCount = iterVector[threadIdx].second;
int zoneCellCount = iterVector[threadIdx].second;
// Call P2M on cells
while ( zoneCellCount-- > 0 ) {
myThreadkernels->P2M(zoneIterator.getCurrentCell(), // Cell
zoneIterator.getCurrentListSrc()); // Particles
zoneIterator.getCurrentListSrc()); // Particles
zoneIterator.moveRight();
}
}
} // barrier
FLOG( computationCounter.tac() );
......@@ -536,10 +537,8 @@ protected:
const MortonIndex startIdx = leafcostzones[threadIdx][colourIdx].first;
int zoneCellCount = leafcostzones[threadIdx][colourIdx].second;
if( 0 < zoneCellCount) {
while(startIdx != it.getCurrentGlobalIndex()) {
it.moveRight();
}
if( 0 < zoneCellCount) {
while(startIdx != it.getCurrentGlobalIndex() && it.moveRight());
}
LeafData leafdata;
......
......@@ -22,7 +22,7 @@
#include "FTreeCoordinate.hpp"
#include "FBlockAllocator.hpp"
#include "../Utils/FLog.hpp"
#include "Utils/FLog.hpp"
#include "../Utils/FGlobal.hpp"
#include "../Utils/FGlobalPeriodic.hpp"
#include "../Utils/FPoint.hpp"
......@@ -58,7 +58,7 @@ public:
using FRealType = FReal;
using CellClassType = CellClass;
using ContainerClassType = ContainerClass;
using LeafClassType = LeafClass;
using LeafClassType = LeafClass; //< The type of the Leaf used in the Octree
protected:
typedef FOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> OctreeType;
......@@ -80,7 +80,7 @@ protected:
/**
* Get morton index from a position for the leaf leavel
* Get morton index from a position for the leaf level
* @param inPosition position to compute
* @return the morton index
*/
......@@ -182,7 +182,7 @@ public:
* algorithm is :
* Compute morton index for the particle
* ask node to insert this particle
* @param inParticle the particle to insert (must inherite from FAbstractParticle)
* @param inParticle the particle to insert (must inherit from FAbstractParticle)
*/
template<typename... Args>
void insert(const FPoint<FReal>& inParticlePosition, Args... args){
......@@ -256,7 +256,7 @@ public:
/**
* This has to be used to iterate on an octree
* It simply stores an pointer on a suboctree and moves to right/left/up/down.
* Please refere to testOctreeIter file to see how it works.
* Please refer to testOctreeIter file to see how it works.
*
* @code
* FOctree<TestParticle, TestCell, NbLevels, NbSubLevels>::Iterator octreeIterator(&tree); <br>
......@@ -369,7 +369,7 @@ public:
* if needed we go on another suboctree but we stay on at the same level
* the Algorithm is :
* go to top
* go downard until we are a the same level
* go downward until we are a the same level
*/
void gotoLeft(){
// Function variables
......@@ -395,7 +395,7 @@ public:
* if needed we go on another suboctree but we stay on at the same level
* the Algorithm is :
* go to top
* go downard until we are a the same level
* go downward until we are a the same level
*/
void gotoRight(){
// Function variables
......@@ -433,7 +433,7 @@ public:
* until : the current level if we did not have change the current suboctree
* or : the leaf level
*
* In the second case, it meanse we need to change octree downward
* In the second case, it means we need to change octree downward
* but it is easy because we can use the left limit!
*
* @return true if we succeed to go to the right, else false
......@@ -636,7 +636,7 @@ public:
/** Gets the children of the current cell.
*
* This function return an array of 8 CellClass. To konw whether
* This function return an array of 8 CellClass. To know whether
* a child cell exists or not, the pointer must be checked.
*
* @return the 8-child array.
......@@ -654,7 +654,7 @@ public:
/** Gets the children of the current cell.
*
* This function return an array of 8 CellClass. To konw whether
* This function return an array of 8 CellClass. To know whether
* a child cell exists or not, the pointer must be checked.
*
* @return the 8-child array.
......@@ -698,7 +698,7 @@ public:
/** This function return a cell (if it exists) from a morton index and a level
* @param inIndex the index of the desired cell
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
* This function starts from the root until it find a missing cell or the right cell
*/
......@@ -773,10 +773,10 @@ public:
}
/** This function return an adresse of cell array from a morton index and a level
/** This function return an address of cell array from a morton index and a level
*
* @param inIndex the index of the desired cell array has to contains
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
*
*/
......@@ -872,7 +872,7 @@ public:
}
/** This function fills an array with all the neighbors of a cell,
* i.e. childs of parent's neighbors, direct neighbors and cell itself.
* i.e. Child of parent's neighbors, direct neighbors and cell itself.
* This is called for instance when the nearfield also needs to be approximated
* in that cas we only call this function at the leaf level.
* @param inNeighbors the array to store the elements
......@@ -1040,7 +1040,7 @@ public:
/** This function return a cell (if it exists) from a morton index and a level
* @param inIndex the index of the desired cell
* @param inLevel the level of the desired cell (cannot be infered from the index)
* @param inLevel the level of the desired cell (cannot be inferred from the index)
* @return the cell if it exist or null (0)
*
*/
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// 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.
//
......@@ -98,10 +98,9 @@ protected:
* Call this function to run the complete algorithm
*/
void executeCore(const unsigned operationsToProceed) override {
Timers[P2MTimer].tic();
#pragma omp parallel
{
Timers[P2MTimer].tic();
#pragma omp sections
{
#pragma omp section
......@@ -122,15 +121,15 @@ protected:
Timers[P2PTimer].tac();
}
}
Timers[P2MTimer].tac();
Timers[NearTimer].tic();
#pragma omp single
//Timers[NearTimer].tic();
#pragma omp single
{
if(operationsToProceed & FFmmL2P) L2PPass();
}
Timers[NearTimer].tac();
//Timers[NearTimer].tac();
}
Timers[P2MTimer].tac();
}
/////////////////////////////////////////////////////////////////////////////
......@@ -324,6 +323,7 @@ protected:
octreeIterator.gotoBottomLeft();
// for each leafs
// Coloring all the cells
do{
const FTreeCoordinate& coord = octreeIterator.getCurrentGlobalCoordinate();
const int shapePosition = (coord.getX()%3)*9 + (coord.getY()%3)*3 + (coord.getZ()%3);
......@@ -338,7 +338,8 @@ protected:
const FSize nbLeaf = shapes[idxShape].getSize();
for(int iterLeaf = 0 ; iterLeaf < nbLeaf ; ++iterLeaf ){
typename OctreeClass::Iterator toWork = shapes[idxShape][iterLeaf];
#pragma omp task firstprivate(neighbors, toWork)
// ToDO increase the granularity of the task
#pragma omp task firstprivate(neighbors,toWork)
{
const int counter = tree->getLeafsNeighbors(neighbors, toWork.getCurrentGlobalCoordinate(),heightMinusOne);
kernels[omp_get_thread_num()]->P2P(toWork.getCurrentGlobalCoordinate(), toWork.getCurrentListTargets(),
......
......@@ -30,6 +30,7 @@
#include "FAbstractLoader.hpp"
#include "Utils/FPoint.hpp"
#include "Containers/FOctree.hpp"
/** \brief Particle class used in FMA loader and writer.
......@@ -775,6 +776,55 @@ public:
}
}
/**
* Write all particles inside the octree
*
* @param tree Octree that contains the particles in the leaves
* @param N number of particles
*
* example
* \code
* OctreeClass tree(TreeHeight, SubTreeHeight, BoxWidth, CenterOfBox);
* ...
* FFmaGenericWriter<FReal> writer(filenameOut) ;
* Fwriter.writeHeader(Centre,BoxWith, nbParticles,*particles) ;
* Fwriter.writeDistributionOfParticlesFromOctree(&tree, nbParticles);
* \endcode
*/
template <class Toctree>
void writeDistributionOfParticlesFromOctree( Toctree *tree, const FSize N){
//
this->writeHeader(tree->getBoxCenter(),tree->getBoxWidth(), N, sizeof(FReal), 4 );
FReal * particles ;
FSize nbMaxParticlesInLeaf = 0 ;
tree->forEachLeaf([&]( typename Toctree::LeafClassType* leaf){
//
// Input
const FReal*const posX = leaf->getTargets()->getPositions()[0];
const FReal*const posY = leaf->getTargets()->getPositions()[1];
const FReal*const posZ = leaf->getTargets()->getPositions()[2];
const FReal*const physicalValues = leaf->getTargets()->getPhysicalValues();
//
const FSize nbParticlesInLeaf = leaf->getTargets()->getNbParticles();
if (nbParticlesInLeaf > nbMaxParticlesInLeaf ) {
nbMaxParticlesInLeaf = nbParticlesInLeaf ;
particles = new FReal[4*nbMaxParticlesInLeaf] ;
}
//
for(FSize idxPart = 0 , j = 0; idxPart < nbParticlesInLeaf ; ++idxPart, j+=4){
particles[j] = posX[idxPart] ;
particles[j+1] = posY[idxPart] ;
particles[j+2] = posZ[idxPart] ;
particles[j+3] = physicalValues[idxPart] ;
}
this-> writeArrayOfReal(particles, 4, nbParticlesInLeaf) ;
});
delete [] particles ;
}
private:
void writerAscciHeader( const FPoint<FReal> &centerOfBox,const FReal &boxWidth,
const FSize &nbParticles, const unsigned int *typeFReal) {
......@@ -803,107 +853,6 @@ private:
//$ \class FmaR4W4Particle
//$
//$ \brief Basic Particle class used in FMA loader and writer
//$
//$ Here we consider only the position and the physical value in the structure
//$ We read (R4) and write (W4) the four values: the position, the physical value.
//$ This class is used in the generateDistributions example.
//$
// class FmaR4W4Particle {
// public:
// FPoint<FReal> position; ///< position of the particle
// FReal physicalValue; ///< its physical value
// /**
// * return a pointer on the first value of the structure
// */
// FReal * getPtrFirstData()
// {return position.getDataValue() ;}
// const FReal * getPtrFirstData() const
// {return position.getDataValue() ;}
// /**
// * return The number of data to read. it is used in FMAGenericLoader (here 4)
// */
// FSize getReadDataNumber()
// { return 4;}
// /**
// * return The number of data to write. it is used in FMAGenericWriter (here 4)
// */
// FSize getWriteDataNumber() const
// { return 4;}
// /**
// * return size in byte of the structure. it is used in FMAGenericWriter
// */
// FSize getWriteDataSize() const
// { return sizeof(FmaR4W4Particle);}
// };
//$ \class FmaR4W8Particle
//$
//$ \brief The Particle class used in FMA loader and writer
//$
//$ In this class we consider the position, the physical value, the potential and the force in the structure
//$ but we read (R4) only the four first values: the position and the physical value and we write (W8) all the data (8 values) in a file.
//$ This class can be used if you read a file generated by generateDistributions and you want to store the result of a direct computations or a FFM one..
//$
// class FmaR4W8Particle {
// public:
// FPoint<FReal> position; ///< position of the particle
// FReal physicalValue; ///< its physical value (mass or charge
// FReal potential; ///< the potential
// FReal forces[3]; ///<the force
// /**
// * return a pointer on the first value of the structure
// */
// FReal * getPtrFirstData()
// {return position.getDataValue() ;}
// const FReal * getPtrFirstData() const
// {return position.getDataValue() ;}
// /**
// * return The number of data to read. it is used in FMAGenericLoader (here 4)
// */
// FSize getReadDataNumber()
// { return 4;}
// /**
// * return The number of data to write. it is used in FMAGenericWriter (here 8)
// */
// FSize getWriteDataNumber() const
// { return 8;}
// /**
// * return size in byte of the structure. it is used in FMAGenericWriter
// */
// FSize getWriteDataSize() const
// { return sizeof(FmaR4W8Particle);}
// };
//
//$ \class FmaR8W8Particle
//$
//$ \brief The Particle class used in FMA loader and writer
//$
//$ Same as FmaR4W8Particle class but here we want to read (R8) all the data (8 values) and want to store also all the data.
//$ This class is used if you create an array of particles from a file generate by a previous computation (directComputation or a FMM computation)
//$ and you want to compare your result with the read values .
// class FmaR8W8Particle : public FmaR4W8Particle {
// public:
// /**
// * return The number of data to read. it is used in FMAGenericLoader (here 8)
// * Useful to read the result of the output of DirectComputation and to compare the potential and the force
// * with the FMM computation
// */
// FSize getReadDataNumber()
// { return 8;}
// };
//\typedef FmaBasicParticle an alias of FmaR4W4Particle
// Particle contains 4 values of type FReal and we read and write the four values
//
#endif //FFmaGenericLoader_HPP
......@@ -49,7 +49,7 @@ class FUnifInterpolator : FNoCopyable
nLhs = MatrixKernelClass::NLHS,
nPV = MatrixKernelClass::NPV,
nVals = NVALS};
typedef FUnifRoots<FReal, ORDER> BasisType;
typedef FUnifRoots<FReal, ORDER> BasisType;
typedef FUnifTensor<FReal, ORDER> TensorType;
unsigned int node_ids[nnodes][3];
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// 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.
//
......@@ -383,5 +383,4 @@ struct FUnifRootsCore<16>{
}
};
#endif
......@@ -278,7 +278,7 @@ inline void PrintGivenParams(int argc, const char* const * const argv){
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__};\
FParameterDefinitions::PrintUsedOptions(optionsvec);\
return 0;\
exit(0); \
} \
if(FParameterDefinitions::CheckValidParameters(argc, argv, {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__}) == false){ \
......@@ -305,7 +305,7 @@ inline void PrintGivenParams(int argc, const char* const * const argv){
const std::vector<FParameterNames> optionsvec = {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__}; \
FParameterDefinitions::PrintUsedOptions(optionsvec); \
return 0; \
exit(0); \
} \
if(FParameterDefinitions::CheckValidParameters(argc, argv, {FParameterDefinitions::Compile, FParameterDefinitions::DateHost, \
FParameterDefinitions::UserParams, __VA_ARGS__}) == false){ \
......
......@@ -34,9 +34,9 @@
#endif
/** @author Berenger Bramas (berenger.bramas@inria.fr)
* This class is a easy to use time counter
* With it you can very easyli estimate elapsed time between two moments
/** \author Berenger Bramas (berenger.bramas@inria.fr)
* \brief This class implements a time counter
*
* <code>
* FTic counter;<br>
* counter.tic();<br>
......@@ -60,10 +60,15 @@ public:
tic();
}
/** Copy constructor */
FTic(const FTic& other) : start(other.start), end(other.end), cumulate(other.cumulate) {}
FTic(FTic&& other) : start(other.start), end(other.end), cumulate(other.cumulate) {}
/** Move constructor */
FTic(FTic&& other) : start(other.start), end(other.end), cumulate(other.cumulate) {
other.reset();
}
/** \brief Copies an other timer */
FTic& operator=(const FTic& other) {
start = other.start;
end = other.end;
......@@ -71,6 +76,7 @@ public:
return *this;
}
/** \brief Adds two timers and returns a new one */
const FTic operator+(const FTic& other) const {
FTic res(*this);
res.start = start < other.start ? start : other.start;
......@@ -80,13 +86,31 @@ public:
return res;
}
/**
* \brief Resets cumulated time to 0
* \warning You must retic to restart measuring time.
*/
void reset() {
start = 0;
end = 0;
cumulate = 0;
}
/** Tic : start <= current time */
/**
* \brief Start measuring time.
*
* Tic : start <= current time
*/
void tic(){
this->start = FTic::GetTime();
}
/** Tac : end <= current time */
/**
* \brief Stop measuring time and add to cumulative time.
*
*
* Tac : end <= current time
*/
void tac(){
this->end = FTic::GetTime();
cumulate += elapsed();
......
......@@ -63,11 +63,11 @@ void runperf(FPerfTestParams& params)
<< "height:" << params.treeHeight << " "
<< "subheight:" << params.subTreeHeight << " "
<< algoLoader.getRunInfoString()
<< "P2M:" << algo.getTime(FAlgorithmTimers::P2MTimer) << " "
<< "M2M:" << algo.getTime(FAlgorithmTimers::M2MTimer) << " "
<< "M2L:" << algo.getTime(FAlgorithmTimers::M2LTimer) << " "
<< "L2L:" << algo.getTime(FAlgorithmTimers::L2LTimer) << " "
<< "P2PL2P:" << algo.getTime(FAlgorithmTimers::NearTimer) << " "
<< "P2M:" << algo.getCumulatedTime(FAlgorithmTimers::P2MTimer) << " "
<< "M2M:" << algo.getCumulatedTime(FAlgorithmTimers::M2MTimer) << " "
<< "M2L:" << algo.getCumulatedTime(FAlgorithmTimers::M2LTimer) << " "
<< "L2L:" << algo.getCumulatedTime(FAlgorithmTimers::L2LTimer) << " "
<< "P2PL2P:" << algo.getCumulatedTime(FAlgorithmTimers::NearTimer) << " "
<< std::endl;
}
......
......@@ -43,7 +43,7 @@
#include "BalanceTree/FChebSymCostKernel.hpp"
// Algorithm
#include "Core/FFmmAlgorithm.hpp"
#include "Core/FFmmAlgorithmThread.hpp"
#include "BalanceTree/FFmmAlgorithmThreadBalanced.hpp"
// Other
......@@ -78,7 +78,7 @@ int main(int argc, char** argv)
{
// Handle arguments
loadFMAAndRunFMMArgs args(argc, argv);
omp_set_num_threads(args.zoneCount());
/* Creating tree and insterting particles *********************************/
FFmaGenericLoader<FReal> loader(args.inFileName().c_str());
......@@ -94,7 +94,7 @@ int main(int argc, char** argv)
/* Compute the cost of each tree cell *************************************/
BalanceKernelClass balanceKernel(&tree, epsilon);
FmmClass<FFmmAlgorithm, BalanceKernelClass> costAlgo(&tree, &balanceKernel);
FmmClass<FFmmAlgorithmThread, BalanceKernelClass> costAlgo(&tree, &balanceKernel);
costAlgo.execute();
......@@ -108,10 +108,10 @@ int main(int argc, char** argv)
FCostZones<OctreeClass, CellClass> costzones(&tree, args.zoneCount());
costzones.run();
writeZones(args, costzones);
if (args.verboseLevel() == -1) {
//writeZones(args, costzones);
//if (args.verboseLevel() == -1) {
printZonesCosts(tree, costzones);
}
//}
/**************************************************************************/
std::cerr << "Done" << std::endl;
......
......@@ -9,8 +9,11 @@
#include <memory>
#include <assert.h>
#include <array>
#include <vector>
/**
* \brief Saves the costzones to files.
* \brief Saves the far-field costzones to files.
*
* One file is created per level, one particle is stored per line in the form :
* x,y,z,zone.
......@@ -89,6 +92,11 @@ void loadTree(OctreeClass& tree, FFmaGenericLoader<FReal>& loader)
}
/**
* \brief Loads a tree from a loader.
* \param tree The the to load into.
* \param loader The loader to load from.
*/
template <typename FReal, class OctreeClass>
void loadTree(OctreeClass& tree, FRandomLoader<FReal>& loader)
{
......@@ -100,7 +108,12 @@ void loadTree(OctreeClass& tree, FRandomLoader<FReal>& loader)
}
}
/**
* \brief Prints the costzones costs.
*
* This function prints the far-field and near-field costzones costs to stdout.
*
*/
template <typename OctreeClass, typename CellClass>
void printZonesCosts(OctreeClass& tree, FCostZones<OctreeClass, CellClass>& costzones)
{
......@@ -118,6 +131,9 @@ void printZonesCosts(OctreeClass& tree, FCostZones<OctreeClass, CellClass>& cost