Commit a5d338ba authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Add ellipsoid and plummer in testBlockedChebysheyv.

parent 3afd673c
......@@ -24,6 +24,7 @@
#include "../../Src/Files/FRandomLoader.hpp"
#include "../../Src/Files/FFmaGenericLoader.hpp"
#include "../../Src/Files/FGenerateDistribution.hpp"
#include "../../Src/GroupTree/Core/FGroupSeqAlgorithm.hpp"
#include "../../Src/GroupTree/Core/FGroupTaskAlgorithm.hpp"
......@@ -46,6 +47,8 @@
int main(int argc, char* argv[]){
const FParameterNames LocalOptionBlocSize { {"-bs"}, "The size of the block of the blocked tree"};
const FParameterNames LocalOptionNoValidate { {"-no-validation"}, "To avoid comparing with direct computation"};
const FParameterNames LocalOptionEllipsoid = {{"-ellipsoid"} , " non uniform distribution on an ellipsoid of aspect ratio given by a=0.5 b=0.25 c=0.125"};
const FParameterNames LocalOptionPlummer = {{"-plummer"} , " (Highly non uniform) plummer distribution (astrophysics)"};
FHelpDescribeAndExit(argc, argv, "Test the blocked tree by counting the particles.",
......@@ -53,7 +56,7 @@ int main(int argc, char* argv[]){
LocalOptionBlocSize, LocalOptionNoValidate);
LocalOptionBlocSize, LocalOptionNoValidate, LocalOptionEllipsoid, LocalOptionPlummer);
// Initialize the types
typedef double FReal;
......@@ -95,18 +98,36 @@ int main(int argc, char* argv[]){
FTic timer;
FReal * tmpParticles = new FReal[4*loader.getNumberOfParticles()];
if(FParameters::existParameter(argc, argv, "-ellipsoid")) {
nonunifRandonPointsOnElipsoid(loader.getNumberOfParticles(), loader.getBoxWidth()/2, loader.getBoxWidth()/4, loader.getBoxWidth()/8, tmpParticles);
else if(FParameters::existParameter(argc, argv, "-plummer")) {
//The M argument is not used in the algorithm of the plummer distribution
unifRandonPlummer(loader.getNumberOfParticles(), loader.getBoxWidth()/2, 0.0, tmpParticles) ;
else { //Uniform cube
unifRandonPointsOnCube(loader.getNumberOfParticles(), loader.getBoxWidth()/2, loader.getBoxWidth()/2, loader.getBoxWidth()/2, tmpParticles);
FP2PParticleContainer<FReal> allParticles;
for(FSize idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
FPoint<FReal> particlePosition;
FReal physicalValue;
physicalValue = 0.10;
particlePosition.setPosition(tmpParticles[idxPart*4], tmpParticles[idxPart*4+1], tmpParticles[idxPart*4+2]);
loader.fillParticle(&particlePosition, &physicalValue);
allParticles.push(particlePosition, physicalValue);
delete[] tmpParticles;
std::cout << "Particles loaded in " << timer.tacAndElapsed() << "s\n";
// Put the data into the tree
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