Commit 38c4a6a2 authored by berenger-bramas's avatar berenger-bramas

Remove old kernels.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@366 2616d619-271b-44dc-8df4-d4a8f33a7222
parent e02515e5
// ===================================================================================
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, Bérenger Bramas.
// Propriétaires : INRIA.
// Copyright © 2011-2012, diffusé sous les termes et conditions d’une licence propriétaire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, Bérenger Bramas.
// Owners: INRIA.
// Copyright © 2011-2012, spread under the terms and conditions of a proprietary license.
// ===================================================================================
#ifndef FEXTENDFMBCELL_HPP
#define FEXTENDFMBCELL_HPP
#include <cstring>
#include "../Utils/FComplexe.hpp"
#include "FFmbKernels.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FExtendFmbCell
* Please read the license.
*
* This class is an extenssion.
* It is needed by the Fmb Kernels.
*/
class FExtendFmbCell {
public:
// FMB_Info_P is declared in FAbstractFmbKernels
static const int MultipoleSize = int(((FMB_Info_P)+1) * ((FMB_Info_P)+2) * 0.5); //< The size of the multipole
protected:
FComplexe multipole_exp[MultipoleSize]; //< For multipole extenssion
FComplexe local_exp[MultipoleSize]; //< For local extenssion
public:
/** Default constructor */
FExtendFmbCell() {
}
/** Constructor */
FExtendFmbCell(const FExtendFmbCell& other){
(*this) = other;
}
/** Default destructor */
virtual ~FExtendFmbCell(){
}
/** Copy constructor */
FExtendFmbCell& operator=(const FExtendFmbCell& other) {
memcpy(multipole_exp, other.multipole_exp, sizeof(FComplexe)*MultipoleSize);
memcpy(local_exp, other.local_exp, sizeof(FComplexe)*MultipoleSize);
return *this;
}
/** Get Multipole */
const FComplexe* getMultipole() const {
return this->multipole_exp;
}
/** Get Local */
const FComplexe* getLocal() const {
return this->local_exp;
}
/** Get Multipole */
FComplexe* getMultipole() {
return this->multipole_exp;
}
/** Get Local */
FComplexe* getLocal() {
return this->local_exp;
}
};
#endif //FEXTENDFMBCELL_HPP
// ===================================================================================
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, Bérenger Bramas.
// Propriétaires : INRIA.
// Copyright © 2011-2012, diffusé sous les termes et conditions d’une licence propriétaire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, Bérenger Bramas.
// Owners: INRIA.
// Copyright © 2011-2012, spread under the terms and conditions of a proprietary license.
// ===================================================================================
#ifndef FFMBCOMPONENTS_HPP
#define FFMBCOMPONENTS_HPP
#include "../Extensions/FExtendForces.hpp"
#include "../Extensions/FExtendPotential.hpp"
#include "../Extensions/FExtendParticleType.hpp"
#include "../Extensions/FExtendCellType.hpp"
#include "../Components/FFmaParticle.hpp"
#include "../Components/FBasicCell.hpp"
#include "../Components/FSimpleLeaf.hpp"
#include "../Components/FBasicKernels.hpp"
#include "../Utils/FAbstractSendable.hpp"
#include "FExtendFmbCell.hpp"
class FmbParticle : public FExtendForces, public FFmaParticle, public FExtendPotential {
public:
};
class FmbCell : public FBasicCell, public FExtendFmbCell {
public:
};
class FmbTypedParticle : public FmbParticle, public FExtendParticleType {
public:
};
class FmbTypedCell : public FmbCell, public FExtendCellType {
public:
};
class FmbSendableCell : public FmbCell , public FAbstractSendable {
public:
///////////////////////////////////////////////////////
// to extend FAbstractSendable
///////////////////////////////////////////////////////
static const int SerializedSizeUp = sizeof(FComplexe)*MultipoleSize + sizeof(FBasicCell);
void serializeUp(void* const buffer) const {
memcpy(buffer, (FBasicCell*)this, sizeof(FBasicCell));
memcpy((char*)(buffer) + sizeof(FBasicCell), multipole_exp, sizeof(FComplexe)*MultipoleSize );
}
void deserializeUp(const void* const buffer){
memcpy((FBasicCell*)this, buffer, sizeof(FBasicCell));
memcpy(multipole_exp, (char*)(buffer) + sizeof(FBasicCell), sizeof(FComplexe)*MultipoleSize );
}
static const int SerializedSizeDown = sizeof(FComplexe)*MultipoleSize + sizeof(FBasicCell);
void serializeDown(void* const buffer) const {
memcpy(buffer, (FBasicCell*)this, sizeof(FBasicCell));
memcpy((char*)(buffer) + sizeof(FBasicCell), local_exp, sizeof(FComplexe)*MultipoleSize );
}
void deserializeDown(const void* const buffer){
memcpy((FBasicCell*)this, buffer, sizeof(FBasicCell));
memcpy(local_exp, (char*)(buffer) + sizeof(FBasicCell), sizeof(FComplexe)*MultipoleSize );
}
};
#endif // FFMBCOMPONENTS_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,8 +28,10 @@
#include "../Src/Components/FTestCell.hpp"
#include "../Src/Components/FTestKernels.hpp"
#include "../Src/Fmb/FFmbKernels.hpp"
#include "../Src/Fmb/FFmbComponents.hpp"
#include "../Src/Kernels/FSphericalKernel.hpp"
#include "../Src/Kernels/FSphericalCell.hpp"
#include "../Src/Kernels/FSphericalParticle.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Core/FFmmAlgorithm.hpp"
......@@ -43,15 +45,15 @@ int main(int argc, char ** argv){
{
//typedef FTestParticle ParticleClass;
//typedef FTestCell CellClass;
typedef FmbParticle ParticleClass;
typedef FmbCell CellClass;
typedef FSphericalParticle ParticleClass;
typedef FSphericalCell CellClass;
typedef FVector<ParticleClass> ContainerClass;
typedef FSimpleLeaf<ParticleClass, ContainerClass > LeafClass;
typedef FOctree<ParticleClass, CellClass, ContainerClass , LeafClass > OctreeClass;
//typedef FTestKernels<ParticleClass, CellClass, ContainerClass > KernelClass;
typedef FFmbKernels<ParticleClass, CellClass, ContainerClass > KernelClass;
typedef FSphericalKernel<ParticleClass, CellClass, ContainerClass > KernelClass;
typedef FFmmAlgorithm<OctreeClass, ParticleClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass;
///////////////////////What we do/////////////////////////////
......@@ -61,6 +63,7 @@ int main(int argc, char ** argv){
const int NbLevels = FParameters::getValue(argc,argv,"-h", 5);
const int SizeSubLevels = FParameters::getValue(argc,argv,"-sh", 3);
const long NbPart = FParameters::getValue(argc,argv,"-nb", 2000000);
const long DevP = FParameters::getValue(argc,argv,"-p", 5);
const FReal FRandMax = FReal(RAND_MAX);
FTic counter;
......@@ -70,6 +73,7 @@ int main(int argc, char ** argv){
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
CellClass::Init(DevP);
const FReal boxWidth = 1.0;
OctreeClass tree(NbLevels, SizeSubLevels, boxWidth, F3DPosition(0.5,0.5,0.5));
......@@ -99,7 +103,7 @@ int main(int argc, char ** argv){
// FTestKernels FBasicKernels
//KernelClass kernels;
KernelClass kernels(NbLevels,boxWidth);
KernelClass kernels(DevP, NbLevels,boxWidth);
FmmClass algo(&tree,&kernels);
algo.execute();
......
......@@ -33,7 +33,6 @@
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Fmb/FFmbKernels.hpp"
#include "../Src/Utils/FGlobal.hpp"
#include "../Src/Utils/FParameters.hpp"
......
......@@ -25,14 +25,12 @@
#include "../Src/Extensions/FExtendPotential.hpp"
#include "../Src/Components/FBasicCell.hpp"
#include "../Src/Fmb/FExtendFmbCell.hpp"
#include "../Src/Core/FFmmAlgorithm.hpp"
#include "../Src/Core/FFmmAlgorithmThread.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
#include "../Src/Fmb/FFmbKernels.hpp"
#include "../Src/Utils/FMath.hpp"
......
......@@ -20,18 +20,18 @@
#include "../Src/Containers/FOctree.hpp"
#include "../Src/Containers/FVector.hpp"
#include "../Src/Fmb/FFmbKernels.hpp"
#include "../Src/Fmb/FFmbComponents.hpp"
#include "../Src/Files/FFmaLoader.hpp"
#include "../Src/Files/FTreeIO.hpp"
#include "../Src/Kernels/FSphericalCell.hpp"
#include "../Src/Kernels/FSphericalParticle.hpp"
#include "../Src/Components/FSimpleLeaf.hpp"
// Simply create particles and try the kernels
int main(int argc, char ** argv){
typedef FmbParticle ParticleClass;
typedef FmbCell CellClass;
typedef FSphericalParticle ParticleClass;
typedef FSphericalCell CellClass;
typedef FVector<ParticleClass> ContainerClass;
typedef FSimpleLeaf<ParticleClass, ContainerClass > LeafClass;
......
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