Commit 550d3cff authored by BRAMAS Berenger's avatar BRAMAS Berenger

Make it compile for the new FREal

parent 2533757d
......@@ -51,7 +51,7 @@ private:
//Typedef on Octree Arranger, in order to clarify following code
typedef FBasicParticleContainerIndexedMover<OctreeClass, ContainerClass> MoverClass;
typedef FOctreeArranger<OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FArrangerPeriodic<OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic;
//Pointer to the kernel to be executed
......@@ -553,7 +553,7 @@ public:
}
case 2:
{
typedef FFmmAlgorithmPeriodic<OctreeClass,InterCell,ContainerClass,InterKernel,LeafClass> AlgoClassPeriodic;
typedef FFmmAlgorithmPeriodic<FReal,OctreeClass,InterCell,ContainerClass,InterKernel,LeafClass> AlgoClassPeriodic;
AlgoClassPeriodic algoPeriod(octree,2);
algoPeriod.setKernel(kernel);
algoPeriod.execute();
......
......@@ -210,7 +210,7 @@ private:
//For arranger classes
typedef FBasicParticleContainerIndexedMover<OctreeClass, ContainerClass> MoverClass;
typedef FOctreeArranger<OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FArrangerPeriodic<OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic;
......@@ -479,7 +479,7 @@ public:
}
case 2:
{
typedef FFmmAlgorithmPeriodic<OctreeClass,CoreCell,ContainerClass,CoreKernelClass,LeafClass> AlgoClassPeriodic;
typedef FFmmAlgorithmPeriodic<FReal,OctreeClass,CoreCell,ContainerClass,CoreKernelClass,LeafClass> AlgoClassPeriodic;
AlgoClassPeriodic algoPeriod(octree,2);
algoPeriod.setKernel(kernel);
algoPeriod.execute();
......
......@@ -98,11 +98,11 @@ int main(int argc, char* argv[])
// open particle file
////////////////////////////////////////////////////////////////////
//
typedef double FReal;
FFmaGenericLoader<FReal> loader(filename);
//
////////////////////////////////////////////////////////////////////
// begin Lagrange kernel
typedef double FReal;
// accuracy
const unsigned int ORDER = 7;
// typedefs
......@@ -216,7 +216,7 @@ int main(int argc, char* argv[])
// -----------------------------------------------------
if(FParameters::existParameter(argc, argv, FParameterDefinitions::OutputFile.options)){
std::string name(FParameters::getStr(argc,argv,FParameterDefinitions::OutputFile.options, "output.fma"));
FFmaGenericWriter writer(name) ;
FFmaGenericWriter<FReal> writer(name) ;
//
int NbPoints = loader.getNumberOfParticles();
FReal * particles ;
......
......@@ -169,7 +169,7 @@ void adaptiveTreeBuildLists(OctreeClass & tree) {
}
};
/////////////////////////////////////////////////////////////////////////////////////////
//! \fn setGlobalID(FOctree< FAdaptCell, FBasicParticleContainer<0> , FSimpleLeaf<FReal, FBasicParticleContainer<0>> > & tree) {
//! \fn setGlobalID(FOctree< FAdaptCell, FBasicParticleContainer<FReal,0,FReal> , FSimpleLeaf<FReal, FBasicParticleContainer<FReal,0,FReal>> > & tree) {
/////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -135,10 +135,10 @@ public:
//
// // set child info
// FPoint<FReal> ChildRoots[nnodes], localChildRoots[nnodes];
// FUnifTensor<ORDER>::setRoots(subCellCenter, subCellWidth, ChildRoots);
// FUnifTensor<FReal,ORDER>::setRoots(subCellCenter, subCellWidth, ChildRoots);
//
// // map global position of roots to local position in parent cell
// const map_glob_loc map(poleCellCenter, poleCellWidth);
// const map_glob_loc<FReal> map(poleCellCenter, poleCellWidth);
// for (unsigned int n=0; n<nnodes; ++n)
// map(ChildRoots[n], localChildRoots[n]);
//
......@@ -151,11 +151,11 @@ public:
// Set sub-child coords
FReal globalChildCoords[3][ORDER];
FUnifTensor<order>::setPolynomialsRoots(subCellCenter, subCellWidth, globalChildCoords);
FUnifTensor<FReal,order>::setPolynomialsRoots(subCellCenter, subCellWidth, globalChildCoords);
// Map global position of sub-child nodes to [-1,1]
FReal localChildCoords[3][ORDER];
const map_glob_loc map(poleCellCenter, poleCellWidth);
const map_glob_loc<FReal> map(poleCellCenter, poleCellWidth);
FPoint<FReal> localChildPoints;
for (unsigned int n=0; n<ORDER; ++n) {
map(FPoint<FReal>(globalChildCoords[0][n],globalChildCoords[1][n],globalChildCoords[2][n]), localChildPoints);
......@@ -225,7 +225,7 @@ public:
// std::cout << " call P2L localLevel "<< localLevel << " localCellCenter "<< localCellCenter <<std::endl;
// interpolation points of target (X) cell
FPoint<FReal> X[nnodes];
FUnifTensor<order>::setRoots(localCellCenter, localCellWidth, X);
FUnifTensor<FReal,order>::setRoots(localCellCenter, localCellWidth, X);
// read positions
const FReal*const positionsX = particles->getPositions()[0];
......@@ -265,8 +265,8 @@ public:
// interpolation points of source (Y) and target (X) cell
FPoint<FReal> X[nnodes], Y[nnodes];
FUnifTensor<order>::setRoots(poleCellCenter, poleCellWidth, Y);
FUnifTensor<order>::setRoots(localCellCenter, localCellWidth, X);
FUnifTensor<FReal,order>::setRoots(poleCellCenter, poleCellWidth, Y);
FUnifTensor<FReal,order>::setRoots(localCellCenter, localCellWidth, X);
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
......@@ -290,7 +290,7 @@ public:
// interpolation points of source (Y) cell
FPoint<FReal> Y[nnodes];
FUnifTensor<order>::setRoots(poleCellCenter, poleCellWidth, Y);
FUnifTensor<FReal,order>::setRoots(poleCellCenter, poleCellWidth, Y);
// read positions
const FReal*const positionsX = particles->getPositions()[0];
......@@ -347,10 +347,10 @@ public:
//
// // set child info
// FPoint<FReal> ChildRoots[nnodes], localChildRoots[nnodes];
// FUnifTensor<ORDER>::setRoots(subCellCenter, subCellWidth, ChildRoots);
// FUnifTensor<FReal,ORDER>::setRoots(subCellCenter, subCellWidth, ChildRoots);
//
// // map global position of roots to local position in parent cell
// const map_glob_loc map(localCenter, localWidth);
// const map_glob_loc<FReal> map(localCenter, localWidth);
// for (unsigned int n=0; n<nnodes; ++n)
// map(ChildRoots[n], localChildRoots[n]);
//
......@@ -361,11 +361,11 @@ public:
/// p^4 version
// Set sub-child coords
FReal globalChildCoords[3][ORDER];
FUnifTensor<order>::setPolynomialsRoots(subCellCenter, subCellWidth, globalChildCoords);
FUnifTensor<FReal,order>::setPolynomialsRoots(subCellCenter, subCellWidth, globalChildCoords);
// Map global position of sub-child nodes to [-1,1]
FReal localChildCoords[3][ORDER];
const map_glob_loc map(localCenter, localWidth);
const map_glob_loc<FReal> map(localCenter, localWidth);
FPoint<FReal> localChildPoints;
for (unsigned int n=0; n<ORDER; ++n) {
map(FPoint<FReal>(globalChildCoords[0][n],globalChildCoords[1][n],globalChildCoords[2][n]), localChildPoints);
......@@ -448,7 +448,7 @@ public:
void P2P(ContainerClass* target, const ContainerClass* sources) override {
ContainerClass* sourcesArray[27] = { const_cast<ContainerClass*> (sources) };
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::template P2PRemote(target,sourcesArray,1,MatrixKernel);
DirectInteractionComputer<FReal,MatrixKernelClass::NCMP, NVALS>::template P2PRemote(target,sourcesArray,1,MatrixKernel);
}
bool preferP2M(const ContainerClass* const particles) override {
......
......@@ -16,7 +16,7 @@
#ifndef FABSTRACTLEAFINTERFACE_HPP
#define FABSTRACTLEAFINTERFACE_HPP
template<class OctreeClass,class ParticleClass>
template<class FReal,class OctreeClass,class ParticleClass>
class FAbstractMover{
public:
virtual void getParticlePosition(ParticleClass* lf, const int idxPart, FPoint<FReal>* particlePos) = 0;
......
......@@ -21,7 +21,7 @@
#include "Arranger/FOctreeArranger.hpp"
template <class FReal, class OctreeClass, class ContainerClass, class LeafInterface >
class FArrangerPeriodic : public FOctreeArranger<OctreeClass,ContainerClass,LeafInterface>{
class FArrangerPeriodic : public FOctreeArranger<FReal,OctreeClass,ContainerClass,LeafInterface>{
FReal getPeriodicPos(FReal pos, PeriodicCondition periodicPlus, PeriodicCondition periodicMinus,FReal maxDir,FReal minDir,const int dir){
FReal res = pos;
......@@ -41,7 +41,7 @@ class FArrangerPeriodic : public FOctreeArranger<OctreeClass,ContainerClass,Leaf
public:
FArrangerPeriodic(OctreeClass * octree) : FOctreeArranger<OctreeClass,ContainerClass,LeafInterface>(octree){
FArrangerPeriodic(OctreeClass * octree) : FOctreeArranger<FReal,OctreeClass,ContainerClass,LeafInterface>(octree){
}
// To put in inhereed class
......
......@@ -7,8 +7,8 @@
* This class should be use with the octree arrange to move particles
* that are stored in a FBasicParticleContainer
*/
template<class OctreeClass, class ContainerClass >
class FBasicParticleContainerIndexedMover : public FAbstractMover<OctreeClass, ContainerClass>{
template<class FReal, class OctreeClass, class ContainerClass >
class FBasicParticleContainerIndexedMover : public FAbstractMover<FReal,OctreeClass, ContainerClass>{
private:
ContainerClass toStoreRemovedParts;
......
......@@ -8,8 +8,8 @@
* This class should be use with the octree arrange to move particles
* that are typed (src/tgt) and stored in a FBasicParticleContainer
*/
template<class OctreeClass, class ContainerClass >
class FParticleTypedIndexedMover : public FAbstractMover<OctreeClass, ContainerClass>{
template<class FReal, class OctreeClass, class ContainerClass >
class FParticleTypedIndexedMover : public FAbstractMover<FReal, OctreeClass, ContainerClass>{
private:
ContainerClass toStoreRemovedSourceParts;
ContainerClass toStoreRemovedTargetParts;
......
......@@ -15,7 +15,7 @@ namespace FParForEachOctree {
* @brief forEachLeaf iterate on the leaf and apply the function
* @param function
*/
template< template< class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
template< class FReal, template<class FReal, class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass,
class FunctionTemplate>
void forEachLeaf(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocatorClass>* tree, FunctionTemplate function){
......@@ -43,7 +43,7 @@ void forEachLeaf(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocator
* @brief forEachLeaf iterate on the cell and apply the function
* @param function
*/
template< template< class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
template< class FReal, template<class FReal, class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass,
class FunctionTemplate>
void forEachCell(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocatorClass>* tree, FunctionTemplate function){
......@@ -77,7 +77,7 @@ void forEachCell(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocator
* @brief forEachLeaf iterate on the cell and apply the function
* @param function
*/
template< template< class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
template< class FReal, template<class FReal, class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass,
class FunctionTemplate>
void forEachCellWithLevel(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocatorClass>* tree, FunctionTemplate function){
......@@ -111,7 +111,7 @@ void forEachCellWithLevel(FOctree<FReal, CellClass,ContainerClass,LeafClass,Cell
* @brief forEachLeaf iterate on the cell and apply the function
* @param function
*/
template< template< class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
template< class FReal, template<class FReal, class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass > class FOctree,
class CellClass, class ContainerClass, class LeafClass, class CellAllocatorClass,
class FunctionTemplate>
void forEachCellLeaf(FOctree<FReal, CellClass,ContainerClass,LeafClass,CellAllocatorClass>* tree, FunctionTemplate function){
......
......@@ -91,7 +91,7 @@ public:
return new FFmmAlgorithmThreadProc<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(FMpi::FComm(mpiComm), tree, kernel);
}
else{
auto algo = new FFmmAlgorithmThreadProcPeriodic<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(FMpi::FComm(mpiComm), tree, periodicUpperlevel);
auto algo = new FFmmAlgorithmThreadProcPeriodic<FReal, OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(FMpi::FComm(mpiComm), tree, periodicUpperlevel);
algo->setKernel(kernel);
return algo;
}
......@@ -100,7 +100,7 @@ public:
return new FFmmAlgorithmThread<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(tree, kernel);
}
else{
auto algo = new FFmmAlgorithmPeriodic<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(tree, periodicUpperlevel);
auto algo = new FFmmAlgorithmPeriodic<FReal,OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass>(tree, periodicUpperlevel);
algo->setKernel(kernel);
return algo;
}
......
......@@ -50,7 +50,7 @@
* @endcode
*/
template <class FReal>
class FBasicLoader : public FAbstractLoader {
class FBasicLoader : public FAbstractLoader<FReal> {
protected:
std::ifstream file; //< The file to read
FPoint<FReal> centerOfBox; //< The center of box read from file
......
......@@ -511,7 +511,7 @@ private:
*
* \code
* // Instanciate the writer with a binary fma file (extension .bfma).
* FFmaGenericWriter writer ("data.bfma");
* FFmaGenericWriter<FReal> writer ("data.bfma");
*
* // Write the header of the file.
* writer.writeHeader(loader.getCenterOfBox(), loader.getBoxWidth(), NbPoints, sizeof(FReal), nbData);
......@@ -678,7 +678,7 @@ public:
* FmaRParticle * particles = new FmaRParticle[nbParticles];
* memset(particles, 0, sizeof(FmaRParticle) * nbParticles) ;
* ...
* FFmaGenericWriter writer(filenameOut) ;
* FFmaGenericWriter<FReal> writer(filenameOut) ;
* Fwriter.writeHeader(Centre,BoxWith, nbParticles,*particles) ;
* Fwriter.writeArrayOfParticles(particles, nbParticles);
* \endcode
......@@ -689,7 +689,7 @@ public:
* memset(particles, 0, sizeof(FmaRParticle) * nbParticles) ;
* ...
* FmaBasicParticle *ppart = (FmaBasicParticle*)(&particles[0]);
* FFmaGenericWriter writer(filenameOut) ;
* FFmaGenericWriter<FReal> writer(filenameOut) ;
* writer.writeHeader(Centre,BoxWith, nbParticles,*particles) ;
* writer.writeArrayOfParticles(particles, nbParticles);
* \endcode
......@@ -748,7 +748,7 @@ public:
* FmaRParticle * const particles = new FmaRParticle[nbParticles];
* memset(particles, 0, sizeof(FmaRParticle) * nbParticles) ;
* ...
* FFmaGenericWriter writer(filenameOut) ;
* FFmaGenericWriter<FReal> writer(filenameOut) ;
* Fwriter.writeHeader(Centre,BoxWith, nbParticles,*particles) ;
* Fwriter.writeArrayOfReal(particles, nbParticles);
* \endcode
......
......@@ -83,7 +83,7 @@ public:
/** Should be used to insert a FBasicParticleContainer class */
template < unsigned NbAttributes, class AttributeClass>
static void BuildTreeFromArray(OctreeClass*const tree, const FBasicParticleContainer<NbAttributes, AttributeClass>& particlesContainers,
static void BuildTreeFromArray(OctreeClass*const tree, const FBasicParticleContainer<FReal, NbAttributes, AttributeClass>& particlesContainers,
bool isAlreadySorted=false){
const FSize numberOfParticle = particlesContainers.getNbParticles();
// If the parts are already sorted, no need to sort again
......
......@@ -8,7 +8,7 @@
#include "../../Kernels/Uniform//FUnifTensor.hpp"
#include "../../Utils/FComplex.hpp"
typedef FBasicCellPOD FTestCellPODCore;
typedef FBasicCellPOD FUnifCellPODCore;
template <class FReal, int ORDER, int NRHS = 1, int NLHS = 1, int NVALS = 1>
struct alignas(FStarPUDefaultAlign::StructAlign) FUnifCellPODPole {
......
......@@ -279,11 +279,11 @@ public:
* Handler to deal with all symmetries: Stores permutation indices and vectors
* to reduce 343 different interactions to 16 only.
*/
template < class CellClass,
template <class FReal, class CellClass,
class ContainerClass,
class MatrixKernelClass,
int ORDER>
struct FChebFlopsSymKernel<CellClass, ContainerClass, MatrixKernelClass, ORDER>
struct FChebFlopsSymKernel<FReal, CellClass, ContainerClass, MatrixKernelClass, ORDER>
::SymmetryHandler
{
// M2L operators
......
......@@ -1632,7 +1632,7 @@ inline void FChebInterpolator<FReal, ORDER,MatrixKernelClass,NVALS>::applyL2PTot
//FReal T_of_y[ORDER * (ORDER-1)];
//for (unsigned int o=1; o<ORDER; ++o)
// for (unsigned int j=0; j<ORDER; ++j)
// T_of_y[(o-1)*ORDER + j] = FReal(FChebRoots<ORDER>::T(o, FReal(FChebRoots<ORDER>::roots[j])));
// T_of_y[(o-1)*ORDER + j] = FReal(FChebRoots<FReal,ORDER>::T(o, FReal(FChebRoots<FReal,ORDER>::roots[j])));
//struct SumP2M {
// unsigned int f2[3][nnodes], f4[3][nnodes];
......
......@@ -229,14 +229,14 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<FReal, MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<FReal, MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -194,8 +194,8 @@ public:
};
template <int ORDER, class MatrixKernelClass>
class FChebTensorialM2LHandler<ORDER,MatrixKernelClass,NON_HOMOGENEOUS> : FNoCopyable
template <class FReal, int ORDER, class MatrixKernelClass>
class FChebTensorialM2LHandler<FReal,ORDER,MatrixKernelClass,NON_HOMOGENEOUS> : FNoCopyable
{
enum {order = ORDER,
nnodes = TensorTraits<ORDER>::nnodes,
......@@ -264,7 +264,7 @@ public:
rank[0]=rank[1]=0;
for (unsigned int l=2; l<TreeHeight; ++l) {
// compute m2l operator on extended cell
rank[l] = ComputeAndCompress<order>(MatrixKernel, CellWidth, CellWidthExtension, epsilon, U[l], C[l], B[l]);
rank[l] = ComputeAndCompress<FReal, order>(MatrixKernel, CellWidth, CellWidthExtension, epsilon, U[l], C[l], B[l]);
// update cell width
CellWidth /= FReal(2.); // at level l+1
}
......@@ -351,7 +351,7 @@ public:
template <int ORDER, class MatrixKernelClass>
template <class FReal, int ORDER, class MatrixKernelClass>
unsigned int ComputeAndCompress(const MatrixKernelClass *const MatrixKernel,
const FReal CellWidth,
const FReal CellWidthExtension,
......
......@@ -800,7 +800,7 @@ public:
void P2P(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
FP2PRT<FReal>::FullMutual<ContainerClass>(inTargets,inNeighbors,14);
FP2PRT<FReal>::template FullMutual<ContainerClass>(inTargets,inNeighbors,14);
}
......@@ -808,7 +808,7 @@ public:
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
FP2PRT<FReal>::FullRemote<ContainerClass>(inTargets,inNeighbors,27);
FP2PRT<FReal>::template FullRemote<ContainerClass>(inTargets,inNeighbors,27);
}
};
......
......@@ -68,7 +68,7 @@ public:
}
/** Constructor */
FSphericalCell(const FSphericalCell& other)
FSphericalCell(const FSphericalCell<FReal>& other)
: multipole_exp(nullptr), local_exp(nullptr){
multipole_exp = new FComplex<FReal>[PoleSize];
local_exp = new FComplex<FReal>[LocalSize];
......@@ -82,7 +82,7 @@ public:
}
/** Copy constructor */
FSphericalCell& operator=(const FSphericalCell& other) {
FSphericalCell<FReal>& operator=(const FSphericalCell<FReal>& other) {
FMemUtils::copyall(multipole_exp, other.multipole_exp, PoleSize);
FMemUtils::copyall(local_exp, other.local_exp, LocalSize);
return *this;
......
......@@ -24,9 +24,9 @@
* This class is the rotation spherical harmonic kernel
*/
template< class FReal, class CellClass, class ContainerClass>
class FSphericalRotationKernel : public FAbstractSphericalKernel<CellClass,ContainerClass> {
class FSphericalRotationKernel : public FAbstractSphericalKernel<FReal, CellClass,ContainerClass> {
protected:
typedef FAbstractSphericalKernel<CellClass,ContainerClass> Parent;
typedef FAbstractSphericalKernel<FReal, CellClass,ContainerClass> Parent;
/** This class define some information to use rotation computation
*/
......
This diff is collapsed.
......@@ -180,7 +180,7 @@ public:
}
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FUnifCell<ORDER, NRHS, NLHS, NVALS>& cell){
friend StreamClass& operator<<(StreamClass& output, const FUnifCell<FReal,ORDER, NRHS, NLHS, NVALS>& cell){
output <<" Multipole exp NRHS " << NRHS <<" NVALS " <<NVALS << " VectorSize " << cell.getVectorSize() << std::endl;
for (int rhs= 0 ; rhs < NRHS ; ++rhs) {
const FReal* pole = cell.getMultipole(rhs);
......@@ -197,21 +197,21 @@ public:
};
template <int ORDER, int NRHS = 1, int NLHS = 1, int NVALS = 1>
class FTypedUnifCell : public FUnifCell<ORDER,NRHS,NLHS,NVALS>, public FExtendCellType {
template <class FReal, int ORDER, int NRHS = 1, int NLHS = 1, int NVALS = 1>
class FTypedUnifCell : public FUnifCell<FReal,ORDER,NRHS,NLHS,NVALS>, public FExtendCellType {
public:
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const{
FUnifCell<ORDER,NRHS,NLHS,NVALS>::save(buffer);
FUnifCell<FReal,ORDER,NRHS,NLHS,NVALS>::save(buffer);
FExtendCellType::save(buffer);
}
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer){
FUnifCell<ORDER,NRHS,NLHS,NVALS>::restore(buffer);
FUnifCell<FReal,ORDER,NRHS,NLHS,NVALS>::restore(buffer);
FExtendCellType::restore(buffer);
}
void resetToInitialState(){
FUnifCell<ORDER,NRHS,NLHS,NVALS>::resetToInitialState();
FUnifCell<FReal,ORDER,NRHS,NLHS,NVALS>::resetToInitialState();
FExtendCellType::resetToInitialState();
}
};
......
......@@ -73,7 +73,7 @@ public:
const FReal inBoxWidth,
const FPoint<FReal>& inBoxCenter,
const MatrixKernelClass *const inMatrixKernel)
: FAbstractUnifKernel< CellClass, ContainerClass, MatrixKernelClass, ORDER, NVALS>(inTreeHeight,inBoxWidth,inBoxCenter),
: FAbstractUnifKernel< FReal, CellClass, ContainerClass, MatrixKernelClass, ORDER, NVALS>(inTreeHeight,inBoxWidth,inBoxCenter),
MatrixKernel(inMatrixKernel),
M2LHandler(MatrixKernel,
inTreeHeight,
......@@ -116,14 +116,14 @@ public:
// interpolation points of source (Y) and target (X) cell
FPoint<FReal> X[AbstractBaseClass::nnodes], Y[AbstractBaseClass::nnodes];
FUnifTensor<ORDER>::setRoots(AbstractBaseClass::getCellCenter(TargetCell->getCoordinate(),TreeLevel), CellWidth, X);
FUnifTensor<FReal,ORDER>::setRoots(AbstractBaseClass::getCellCenter(TargetCell->getCoordinate(),TreeLevel), CellWidth, X);
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
for (int idx=0; idx<343; ++idx){
if (SourceCells[idx]){
FUnifTensor<ORDER>::setRoots(AbstractBaseClass::getCellCenter(SourceCells[idx]->getCoordinate(),TreeLevel), CellWidth, Y);
FUnifTensor<FReal,ORDER>::setRoots(AbstractBaseClass::getCellCenter(SourceCells[idx]->getCoordinate(),TreeLevel), CellWidth, Y);
for (unsigned int m=0; m<AbstractBaseClass::nnodes; ++m)
for (unsigned int n=0; n<AbstractBaseClass::nnodes; ++n){
......@@ -174,7 +174,7 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<FReal,MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
......@@ -182,7 +182,7 @@ public:
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/)
{
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<FReal,MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -85,7 +85,7 @@ class FUnifInterpolator : FNoCopyable
FPoint<FReal> ParentRoots[nnodes], ChildRoots[nnodes];
const FReal ParentWidth(2.);
const FPoint<FReal> ParentCenter(0., 0., 0.);
FUnifTensor<ORDER>::setRoots(ParentCenter, ParentWidth, ParentRoots);
FUnifTensor<FReal,ORDER>::setRoots(ParentCenter, ParentWidth, ParentRoots);
FPoint<FReal> ChildCenter;
const FReal ChildWidth(1.);
......@@ -97,8 +97,8 @@ class FUnifInterpolator : FNoCopyable
ChildParentInterpolator[child] = new FReal [nnodes * nnodes];
// set child info
FUnifTensor<ORDER>::setRelativeChildCenter(child, ChildCenter);
FUnifTensor<ORDER>::setRoots(ChildCenter, ChildWidth, ChildRoots);
FUnifTensor<FReal,ORDER>::setRelativeChildCenter(child, ChildCenter);
FUnifTensor<FReal,ORDER>::setRoots(ChildCenter, ChildWidth, ChildRoots);
// assemble child - parent - interpolator
assembleInterpolator(nnodes, ChildRoots, ChildParentInterpolator[child]);
......
......@@ -71,7 +71,7 @@ public:
const FReal inBoxWidth,
const FPoint<FReal>& inBoxCenter,
const MatrixKernelClass *const inMatrixKernel)
: FAbstractUnifKernel< CellClass, ContainerClass, MatrixKernelClass, ORDER, NVALS>(inTreeHeight,inBoxWidth,inBoxCenter),
: FAbstractUnifKernel< FReal, CellClass, ContainerClass, MatrixKernelClass, ORDER, NVALS>(inTreeHeight,inBoxWidth,inBoxCenter),
MatrixKernel(inMatrixKernel),
M2LHandler(MatrixKernel,
inTreeHeight,
......@@ -186,7 +186,7 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<FReal,MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
......@@ -194,7 +194,7 @@ public:
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/)
{
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<FReal,MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -46,7 +46,7 @@ static void Compute(const MatrixKernelClass *const MatrixKernel, const FReal Cel
const unsigned int order = ORDER;
const unsigned int nnodes = TensorTraits<ORDER>::nnodes;
const unsigned int ninteractions = 316;
typedef FUnifTensor<ORDER> TensorType;
typedef FUnifTensor<FReal,ORDER> TensorType;
// interpolation points of source (Y) and target (X) cell
FPoint<FReal> X[nnodes], Y[nnodes];
......@@ -68,7 +68,7 @@ static void Compute(const MatrixKernelClass *const MatrixKernel, const FReal Cel
// init Discrete Fourier Transformator
const int dimfft = 1; // unidim FFT since fully circulant embedding
const int steps[dimfft] = {rc};
FFft<dimfft> Dft;
FFft<FReal,dimfft> Dft;
Dft.buildDFT(steps);
// get first column of K via permutation
unsigned int perm[rc];
......@@ -81,7 +81,7 @@ static void Compute(const MatrixKernelClass *const MatrixKernel, const FReal Cel
if (abs(i)>1 || abs(j)>1 || abs(k)>1) {
// set roots of source cell (Y)
const FPoint<FReal> cy(CellWidth*FReal(i), CellWidth*FReal(j), CellWidth*FReal(k));
FUnifTensor<order>::setRoots(cy, CellWidth, Y);
FUnifTensor<FReal,order>::setRoots(cy, CellWidth, Y);
// evaluate m2l operator
unsigned int ido=0;
for(unsigned int l=0; l<2*order-1; ++l)
......@@ -173,12 +173,12 @@ class FUnifM2LHandler<FReal, ORDER,HOMOGENEOUS>
FSmartPointer< FComplex<FReal>,FSmartArrayMemory> FC;
/// Utils
typedef FUnifTensor<ORDER> TensorType;
typedef FUnifTensor<FReal,ORDER> TensorType;
unsigned int node_diff[nnodes*nnodes];
/// DFT specific
static const int dimfft = 1; // unidim FFT since fully circulant embedding
typedef FFft<dimfft> DftClass; // Fast Discrete Fourier Transformator
typedef FFft<FReal,dimfft> DftClass; // Fast Discrete Fourier Transformator
DftClass Dft;
const unsigned int opt_rc; // specific to real valued kernel
......@@ -239,7 +239,7 @@ public:
// Compute matrix of interactions
const FReal ReferenceCellWidth = FReal(2.);
FComplex<FReal>* pFC = NULL;
Compute<order>(MatrixKernel,ReferenceCellWidth,pFC);
Compute<FReal,order>(MatrixKernel,ReferenceCellWidth,pFC);
FC.assign(pFC);
// Compute memory usage
......@@ -319,8 +319,8 @@ public:
/*! Specialization for non-homogeneous kernel functions */
template <int ORDER>
class FUnifM2LHandler<ORDER,NON_HOMOGENEOUS>
template <class FReal, int ORDER>
class FUnifM2LHandler<FReal,ORDER,NON_HOMOGENEOUS>
{
enum {order = ORDER,
nnodes = TensorTraits<ORDER>::nnodes,
......@@ -333,11 +333,11 @@ class FUnifM2LHandler<ORDER,NON_HOMOGENEOUS>
const unsigned int TreeHeight;
const FReal RootCellWidth;
/// Utils
typedef FUnifTensor<ORDER> TensorType;
typedef FUnifTensor<FReal,ORDER> TensorType;
unsigned int node_diff[nnodes*nnodes];
/// DFT specific
static const int dimfft = 1; // unidim FFT since fully circulant embedding