Commit e4b8d3b4 authored by BRAMAS Berenger's avatar BRAMAS Berenger
parents e120810c a4869a85
......@@ -30,6 +30,7 @@ class FTreeCoordinate;
// ==== CMAKE =====
// @FUSE_BLAS
// @FUSE_FFT
// ================
// for verbosity only!!!
......@@ -221,7 +222,7 @@ public:
// Target cell: local
const FReal localCellWidth(KernelBaseClass::BoxWidth / FReal(FMath::pow(2.0, localLevel)));
const FPoint localCellCenter(KernelBaseClass::getCellCenter(local->getCoordinate(),localLevel));
std::cout << " call P2L localLevel "<< localLevel << " localCellCenter "<< localCellCenter <<std::endl;
// std::cout << " call P2L localLevel "<< localLevel << " localCellCenter "<< localCellCenter <<std::endl;
// interpolation points of target (X) cell
FPoint X[nnodes];
FUnifTensor<order>::setRoots(localCellCenter, localCellWidth, X);
......@@ -458,7 +459,7 @@ public:
for(int idxContainer = 0 ; idxContainer < nbContainers ; ++idxContainer){
counterParticles += particles[idxContainer]->getNbParticles();
}
std::cout << " Part("<<counterParticles<< ") ";
// std::cout << " Part("<<counterParticles<< ") ";
return counterParticles >this->sminM;
}
};
......
// ===================================================================================
// 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.
//
......@@ -24,16 +24,16 @@
* To chose which operation has to be performed.
*/
enum FFmmOperations {
FFmmP2P = (1 << 0),
FFmmP2M = (1 << 1),
FFmmP2P = (1 << 0),
FFmmP2M = (1 << 1),
FFmmM2M = (1 << 2),
FFmmM2L = (1 << 3),
FFmmL2L = (1 << 4),
FFmmL2P = (1 << 5),
FFmmM2L = (1 << 3),
FFmmL2L = (1 << 4),
FFmmL2P = (1 << 5),
//
FFmmNearField = FFmmP2P,
FFmmFarField = (FFmmP2M|FFmmM2M|FFmmM2L|FFmmL2L|FFmmL2P),
//
FFmmNearAndFarFields = (FFmmNearField|FFmmFarField)
};
......@@ -52,12 +52,15 @@ protected:
int nbLevelsInTree;
void setNbLevelsInTree(const int inNbLevelsInTree){
nbLevelsInTree = inNbLevelsInTree;
nbLevelsInTree = inNbLevelsInTree;
lowerWorkingLevel = nbLevelsInTree;
}
void validateLevels() const {
std::cout << "upperWorkingLevel: "<< FAbstractAlgorithm::upperWorkingLevel << std::endl
<< "lowerWorkingLevel "<< FAbstractAlgorithm::lowerWorkingLevel << std::endl ;
FAssertLF(FAbstractAlgorithm::upperWorkingLevel <= FAbstractAlgorithm::lowerWorkingLevel);
std::cout << "End assert 1" << std::endl ;
FAssertLF(2 <= FAbstractAlgorithm::upperWorkingLevel);
}
......
......@@ -15,7 +15,6 @@
// ===================================================================================
// ==== CMAKE =====
// @FUSE_BLAS
// @FUSE_FFT
// ================
// Keep in private GIT
......@@ -30,9 +29,6 @@
#include "Utils/FTic.hpp"
#include "Containers/FOctree.hpp"
//#include "Containers/FVector.hpp"
//#include "Components/FSimpleLeaf.hpp"
#include "Utils/FPoint.hpp"
......@@ -102,15 +98,12 @@ int main(int argc, char ** argv){
// const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
//
// accuracy
const unsigned int P = 5 ;
const unsigned int P = 7 ;
const int sminM = FParameters::getValue(argc,argv,LocalOptionMinMultipoleThreshod.options, P*P*P);
const int sminL = FParameters::getValue(argc,argv,LocalOptionMinLocalThreshod.options, P*P*P);
// typedef FTestCell CellClass;
// typedef FAdaptiveTestKernel< CellClass, ContainerClass > KernelClass;
//
typedef FUnifCell<P> CellClass;
typedef FP2PParticleContainerIndexed<> ContainerClass;
typedef FSimpleIndexedLeaf<ContainerClass> LeafClass;
......@@ -191,8 +184,9 @@ int main(int argc, char ** argv){
std::cout << "Working on particles ..." << std::endl;
counter.tic();
const MatrixKernelClass MatrixKernel;
KernelWrapperClass kernels(TreeHeight, loader.getBoxWidth(), loader.getCenterOfBox(),&MatrixKernel,sminM,sminL); // FTestKernels FBasicKernels
FmmClass algo(&tree,&kernels); //FFmmAlgorithm FFmmAlgorithmThread
KernelWrapperClass *kernels = new KernelWrapperClass(TreeHeight, loader.getBoxWidth(),
loader.getCenterOfBox(),&MatrixKernel,sminM,sminL); // FTestKernels FBasicKernels
FmmClass algo(&tree,kernels); //FFmmAlgorithm FFmmAlgorithmThread
// For debug purpose
// Set Global id
......@@ -200,7 +194,7 @@ int main(int argc, char ** argv){
long int idCell = setGlobalID(tree);
//
algo.execute();
//
counter.tac();
std::cout << "Done " << "(@Algorithm = " << counter.elapsed() << " s)." << std::endl;
//
......
......@@ -166,8 +166,10 @@ class TestSphericalDirect : public FUTester<TestSphericalDirect> {
printf(" Energy DIRECT = %.12e\n",FMath::Abs(energyD));
// Assert
const FReal MaximumDiffPotential = FReal(9e-3);
const FReal MaximumDiffForces = FReal(9e-2);
double epsilon = 1.0/FMath::pow2(ORDER);
const FReal MaximumDiffPotential = FReal(epsilon);
const FReal MaximumDiffForces = FReal(10*epsilon);
printf(" Criteria error - Epsilon %e\n",epsilon);
Print("Test1 - Error Relative L2 norm Potential ");
uassert(potentialDiff.getRelativeL2Norm() < MaximumDiffPotential); //1
......@@ -328,12 +330,12 @@ class TestSphericalDirect : public FUTester<TestSphericalDirect> {
OctreeClass, FmmClass, 24>(true);
RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
OctreeClass, FmmClass, 26>(true);
RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
OctreeClass, FmmClass, 28>(true);
RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
OctreeClass, FmmClass, 30>(true);
RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
OctreeClass, FmmClass, 32>(true);
// RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
// OctreeClass, FmmClass, 28>(true);
// RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
// OctreeClass, FmmClass, 30>(true);
// RunTest< CellClass, ContainerClass, KernelClass, LeafClass,
// OctreeClass, FmmClass, 32>(true);
}
#endif
......
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