Commit 40f46768 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Change FComplexe to FComplex in all files and name of files

parent 077ce97b
......@@ -24,7 +24,7 @@
#include "../../Components/FBasicCell.hpp"
#include "../../Extensions/FExtendCellType.hpp"
#include "../../Utils/FComplexe.hpp"
#include "../../Utils/FComplex.hpp"
/**
* @author Pierre Blanchard (pierre.blanchard@inria.fr)
......@@ -51,17 +51,17 @@ class FInterpCell : public FBasicCell
FReal multipole_exp[NRHS * NVALS * VectorSize]; //< Multipole expansion
FReal local_exp[NLHS * NVALS * VectorSize]; //< Local expansion
// PB: Store multipole and local expansion in Fourier space
FComplexe transformed_multipole_exp[NRHS * NVALS * TransformedVectorSize];
FComplexe transformed_local_exp[NLHS * NVALS * TransformedVectorSize];
FComplex transformed_multipole_exp[NRHS * NVALS * TransformedVectorSize];
FComplex transformed_local_exp[NLHS * NVALS * TransformedVectorSize];
public:
FInterpCell(){
memset(multipole_exp, 0, sizeof(FReal) * NRHS * NVALS * VectorSize);
memset(local_exp, 0, sizeof(FReal) * NLHS * NVALS * VectorSize);
memset(transformed_multipole_exp, 0,
sizeof(FComplexe) * NRHS * NVALS * TransformedVectorSize);
sizeof(FComplex) * NRHS * NVALS * TransformedVectorSize);
memset(transformed_local_exp, 0,
sizeof(FComplexe) * NLHS * NVALS * TransformedVectorSize);
sizeof(FComplex) * NLHS * NVALS * TransformedVectorSize);
}
~FInterpCell() {}
......@@ -90,20 +90,20 @@ public:
}
/** Get Transformed Multipole */
const FComplexe* getTransformedMultipole(const int inRhs) const{
const FComplex* getTransformedMultipole(const int inRhs) const{
return this->transformed_multipole_exp + inRhs*TransformedVectorSize;
}
/** Get Transformed Local */
const FComplexe* getTransformedLocal(const int inRhs) const{
const FComplex* getTransformedLocal(const int inRhs) const{
return this->transformed_local_exp + inRhs*TransformedVectorSize;
}
/** Get Transformed Multipole */
FComplexe* getTransformedMultipole(const int inRhs){
FComplex* getTransformedMultipole(const int inRhs){
return this->transformed_multipole_exp + inRhs*TransformedVectorSize;
}
/** Get Transformed Local */
FComplexe* getTransformedLocal(const int inRhs){
FComplex* getTransformedLocal(const int inRhs){
return this->transformed_local_exp + inRhs*TransformedVectorSize;
}
......@@ -117,9 +117,9 @@ public:
memset(multipole_exp, 0, sizeof(FReal) * NRHS * NVALS * VectorSize);
memset(local_exp, 0, sizeof(FReal) * NLHS * NVALS * VectorSize);
memset(transformed_multipole_exp, 0,
sizeof(FComplexe) * NRHS * NVALS * TransformedVectorSize);
sizeof(FComplex) * NRHS * NVALS * TransformedVectorSize);
memset(transformed_local_exp, 0,
sizeof(FComplexe) * NLHS * NVALS * TransformedVectorSize);
sizeof(FComplex) * NLHS * NVALS * TransformedVectorSize);
}
///////////////////////////////////////////////////////
......@@ -171,7 +171,7 @@ public:
}
static constexpr int GetSize(){
return (NRHS+NLHS)*NVALS*VectorSize * (int) sizeof(FReal) + (NRHS+NLHS)*NVALS*TransformedVectorSize * (int) sizeof(FComplexe);
return (NRHS+NLHS)*NVALS*VectorSize * (int) sizeof(FReal) + (NRHS+NLHS)*NVALS*TransformedVectorSize * (int) sizeof(FComplex);
}
......
......@@ -822,7 +822,7 @@ inline void MutualParticlesRIJK(const FReal sourceX,const FReal sourceY,const FR
#ifdef ScalFMM_USE_SSE
#include "FP2PSse.hpp"
#elif defined(ScalFMM_USE_AVX)
#include "FP2PAvx.hpp"
#include "FP2PAvx.h"
#else
#include "FP2PClassic.hpp"
#endif //Includes
......
......@@ -16,7 +16,7 @@
#ifndef FROTATIONCELL_HPP
#define FROTATIONCELL_HPP
#include "../../Utils/FComplexe.hpp"
#include "../../Utils/FComplex.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Extensions/FExtendCellType.hpp"
......@@ -43,9 +43,9 @@ protected:
static const int LocalSize = ((P+2)*(P+1))/2; // Artimethique suite (n+1)*n/2
//< Multipole vector (static memory)
FComplexe multipole_exp[MultipoleSize]; //< For multipole extenssion
FComplex multipole_exp[MultipoleSize]; //< For multipole extenssion
//< Local vector (static memory)
FComplexe local_exp[LocalSize]; //< For local extenssion
FComplex local_exp[LocalSize]; //< For local extenssion
public:
/** Default constructor
......@@ -75,20 +75,20 @@ public:
}
/** Get Multipole array */
const FComplexe* getMultipole() const {
const FComplex* getMultipole() const {
return multipole_exp;
}
/** Get Local array */
const FComplexe* getLocal() const {
const FComplex* getLocal() const {
return local_exp;
}
/** Get Multipole array */
FComplexe* getMultipole() {
FComplex* getMultipole() {
return multipole_exp;
}
/** Get Local array */
FComplexe* getLocal() {
FComplex* getLocal() {
return local_exp;
}
......@@ -145,7 +145,7 @@ public:
buffer.fillArray(local_exp, LocalSize);
}
static constexpr int GetSize(){
return ((int) sizeof(FComplexe)) * (MultipoleSize + LocalSize);
return ((int) sizeof(FComplex)) * (MultipoleSize + LocalSize);
}
};
......
......@@ -18,7 +18,7 @@
#include "Components/FAbstractKernels.hpp"
#include "Utils/FSmartPointer.hpp"
#include "Utils/FComplexe.hpp"
#include "Utils/FComplex.hpp"
#include "Utils/FMemUtils.hpp"
#include "Utils/FSpherical.hpp"
#include "Utils/FMath.hpp"
......@@ -71,11 +71,11 @@ class FRotationKernel : public FAbstractKernels<CellClass,ContainerClass> {
FSmartPointer<FReal[P+1]> L2LTranslationCoef; //< This contains some precalculated values for L2L translation
///////////// Rotation /////////////////////////////
FComplexe rotationExpMinusImPhi[8][SizeArray]; //< This is the vector use for the rotation around z for the M2M (multipole)
FComplexe rotationExpImPhi[8][SizeArray]; //< This is the vector use for the rotation around z for the L2L (taylor)
FComplex rotationExpMinusImPhi[8][SizeArray]; //< This is the vector use for the rotation around z for the M2M (multipole)
FComplex rotationExpImPhi[8][SizeArray]; //< This is the vector use for the rotation around z for the L2L (taylor)
FComplexe rotationM2LExpMinusImPhi[343][SizeArray]; //< This is the vector use for the rotation around z for the M2L (multipole)
FComplexe rotationM2LExpImPhi[343][SizeArray]; //< This is the vector use for the rotation around z for the M2L (taylor)
FComplex rotationM2LExpMinusImPhi[343][SizeArray]; //< This is the vector use for the rotation around z for the M2L (multipole)
FComplex rotationM2LExpImPhi[343][SizeArray]; //< This is the vector use for the rotation around z for the M2L (taylor)
///////////// Rotation /////////////////////////////
// First we compute the size of the d{l,m,k} matrix.
......@@ -802,11 +802,11 @@ class FRotationKernel : public FAbstractKernels<CellClass,ContainerClass> {
* multipole or local vector.
* The result is copyed in vec.
* Please see the structure of dlmk to understand this function.
* Warning we cast the vec FComplexe array into a FReal array
* Warning we cast the vec FComplex array into a FReal array
*/
static void RotationYWithDlmk(FComplexe vec[], const FReal* dlmkCoef){
static void RotationYWithDlmk(FComplex vec[], const FReal* dlmkCoef){
FReal originalVec[2*SizeArray];
FMemUtils::copyall((FComplexe*)originalVec,vec,SizeArray);
FMemUtils::copyall((FComplex*)originalVec,vec,SizeArray);
// index_lm == atLm(l,m) but progress iteratively to write the result
int index_lm = 0;
for(int l = 0 ; l <= P ; ++l){
......@@ -834,12 +834,12 @@ class FRotationKernel : public FAbstractKernels<CellClass,ContainerClass> {
}
/** This function is computing dest[:] *= src[:]
* it computes inSize FComplexe multiplication
* it computes inSize FComplex multiplication
* to do so we first proceed per 4 and the the inSize%4 rest
*/
static void RotationZVectorsMul(FComplexe* FRestrict dest, const FComplexe* FRestrict src, const int inSize = SizeArray){
const FComplexe*const FRestrict lastElement = dest + inSize;
const FComplexe*const FRestrict intermediateLastElement = dest + (inSize & ~0x3);
static void RotationZVectorsMul(FComplex* FRestrict dest, const FComplex* FRestrict src, const int inSize = SizeArray){
const FComplex*const FRestrict lastElement = dest + inSize;
const FComplex*const FRestrict intermediateLastElement = dest + (inSize & ~0x3);
// first the inSize - inSize%4 elements
for(; dest != intermediateLastElement ;) {
(*dest++) *= (*src++);
......@@ -911,7 +911,7 @@ public:
void P2M(CellClass* const inPole, const ContainerClass* const inParticles ) {
const FReal i_pow_m[4] = {0, FMath::FPiDiv2, FMath::FPi, -FMath::FPiDiv2};
// w is the multipole moment
FComplexe* FRestrict const w = inPole->getMultipole();
FComplex* FRestrict const w = inPole->getMultipole();
// Copying the position is faster than using cell position
const FPoint cellPosition = getLeafCenter(inPole->getCoordinate());
......@@ -975,7 +975,7 @@ public:
// Get the translation coef for this level (same for all child)
const FReal*const coef = M2MTranslationCoef[inLevel];
// A buffer to copy the source w allocated once
FComplexe source_w[SizeArray];
FComplex source_w[SizeArray];
// For all children
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
// if child exists
......@@ -988,7 +988,7 @@ public:
RotationYWithDlmk(source_w,DlmkCoefOTheta[idxChild]);
// Translate it
FComplexe target_w[SizeArray];
FComplex target_w[SizeArray];
int index_lm = 0;
for(int l = 0 ; l <= P ; ++l ){
for(int m = 0 ; m <= l ; ++m, ++index_lm ){
......@@ -1029,7 +1029,7 @@ public:
*/
void M2L(CellClass* const FRestrict inLocal, const CellClass* inInteractions[], const int /*inSize*/, const int inLevel) {
// To copy the multipole data allocated once
FComplexe source_w[SizeArray];
FComplex source_w[SizeArray];
// For all children
for(int idxNeigh = 0 ; idxNeigh < 343 ; ++idxNeigh){
// if interaction exits
......@@ -1043,7 +1043,7 @@ public:
RotationYWithDlmk(source_w,DlmkCoefM2LOTheta[idxNeigh]);
// Transfer to u
FComplexe target_u[SizeArray];
FComplex target_u[SizeArray];
int index_lm = 0;
for(int l = 0 ; l <= P ; ++l ){
FReal minus_1_pow_m = 1.0;
......@@ -1089,7 +1089,7 @@ public:
// Get the translation coef for this level (same for all chidl)
const FReal*const coef = L2LTranslationCoef[inLevel];
// To copy the source local allocated once
FComplexe source_u[SizeArray];
FComplex source_u[SizeArray];
// For all children
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
// if child exists
......@@ -1102,7 +1102,7 @@ public:
RotationYWithDlmk(source_u,DlmkCoefMTheta[idxChild]);
// Translate
FComplexe target_u[SizeArray];
FComplex target_u[SizeArray];
for(int l = 0 ; l <= P ; ++l ){
for(int m = 0 ; m <= l ; ++m ){
// u{l,m}(r-b) = sum(j=0:P, b^(j-l)/(j-l)! u{j,m}(r);
......@@ -1150,7 +1150,7 @@ public:
void L2P(const CellClass* const inLocal, ContainerClass* const inParticles){
const FReal i_pow_m[4] = {0, FMath::FPiDiv2, FMath::FPi, -FMath::FPiDiv2};
// Take the local value from the cell
const FComplexe* FRestrict const u = inLocal->getLocal();
const FComplex* FRestrict const u = inLocal->getLocal();
// Copying the position is faster than using cell position
const FPoint cellPosition = getLeafCenter(inLocal->getCoordinate());
......
......@@ -18,7 +18,7 @@
#include "../../Components/FAbstractKernels.hpp"
#include "../../Utils/FSmartPointer.hpp"
#include "../../Utils/FComplexe.hpp"
#include "../../Utils/FComplex.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Utils/FSpherical.hpp"
......@@ -192,12 +192,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* The computation is simply a multiplication per a complex number \f$ e^{-i \phi m} \f$
* Phi should be in [0,2pi]
*/
void rotateMultipoleAroundZ(FComplexe vec[], const FReal phi){
FComplexe cell_rotate[SizeArray];
void rotateMultipoleAroundZ(FComplex vec[], const FReal phi){
FComplex cell_rotate[SizeArray];
for(int l = 0 ; l <= P ; ++l){
for(int m = 0 ; m <= l ; ++m ){
// O_{l,m}( \alpha, \beta + \phi ) = e^{-i \phi m} O_{l,m}( \alpha, \beta )
const FComplexe exp_minus_imphi(FMath::Cos(-phi * FReal(m)), FMath::Sin(-phi * FReal(m)));
const FComplex exp_minus_imphi(FMath::Cos(-phi * FReal(m)), FMath::Sin(-phi * FReal(m)));
cell_rotate[atLm(l,m)].equalMul(exp_minus_imphi , vec[atLm(l,m)]);
}
}
......@@ -214,12 +214,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* The computation is simply a multiplication per a complex number \f$ e^{i \phi m} \f$
* Phi should be in [0,2pi]
*/
void rotateTaylorAroundZ(FComplexe vec[], const FReal phi){
FComplexe cell_rotate[SizeArray];
void rotateTaylorAroundZ(FComplex vec[], const FReal phi){
FComplex cell_rotate[SizeArray];
for(int l = 0 ; l <= P ; ++l){
for(int m = 0 ; m <= l ; ++m ){
// M_{l,m}( \alpha, \beta + \phi ) = e^{i \phi m} M_{l,m}( \alpha, \beta )
const FComplexe exp_imphi(FMath::Cos(phi * FReal(m)), FMath::Sin(phi * FReal(m)));
const FComplex exp_imphi(FMath::Cos(phi * FReal(m)), FMath::Sin(phi * FReal(m)));
cell_rotate[atLm(l,m)].equalMul(exp_imphi , vec[atLm(l,m)]);
}
}
......@@ -238,8 +238,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* \f$ O_{l,-m} = \bar{ O_{l,m} } (-1)^m \f$
* Theta should be in [0,pi]
*/
void rotateMultipoleAroundY(FComplexe vec[], const FReal theta){
FComplexe cell_rotate[SizeArray];
void rotateMultipoleAroundY(FComplex vec[], const FReal theta){
FComplex cell_rotate[SizeArray];
for(int l = 0 ; l <= P ; ++l){
for(int m = 0 ; m <= l ; ++m ){
FReal w_lkm_real = 0.0;
......@@ -278,8 +278,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* \f$ M_{l,-m} = \bar{ M_{l,m} } (-1)^m \f$
* Theta should be in [0,pi]
*/
void rotateTaylorAroundY(FComplexe vec[], const FReal theta){
FComplexe cell_rotate[SizeArray];
void rotateTaylorAroundY(FComplex vec[], const FReal theta){
FComplex cell_rotate[SizeArray];
for(int l = 0 ; l <= P ; ++l){
for(int m = 0 ; m <= l ; ++m ){
FReal w_lkm_real = 0.0;
......@@ -313,7 +313,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
* Rotation are not commutative so we have to do it in the right order
*/
void rotateMultipole(FComplexe vec[], const FReal azimuth, const FReal inclination){
void rotateMultipole(FComplex vec[], const FReal azimuth, const FReal inclination){
rotateMultipoleAroundZ(vec,(FMath::FPiDiv2 + azimuth));
rotateMultipoleAroundY(vec,inclination);
}
......@@ -324,7 +324,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
* Rotation are not commutative so we have to do it in the right order
*/
void deRotateMultipole(FComplexe vec[], const FReal azimuth, const FReal inclination){
void deRotateMultipole(FComplex vec[], const FReal azimuth, const FReal inclination){
rotateMultipoleAroundY(vec,-inclination);
rotateMultipoleAroundZ(vec,-(FMath::FPiDiv2 + azimuth));
}
......@@ -336,7 +336,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
* Rotation are not commutative so we have to do it in the right order
*/
void rotateTaylor(FComplexe vec[], const FReal azimuth, const FReal inclination){
void rotateTaylor(FComplex vec[], const FReal azimuth, const FReal inclination){
rotateTaylorAroundZ(vec,(FMath::FPiDiv2 + azimuth));
rotateTaylorAroundY(vec,inclination);
}
......@@ -347,7 +347,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
* Rotation are not commutative so we have to do it in the right order
*/
void deRotateTaylor(FComplexe vec[], const FReal azimuth, const FReal inclination){
void deRotateTaylor(FComplex vec[], const FReal azimuth, const FReal inclination){
rotateTaylorAroundY(vec,-inclination);
rotateTaylorAroundZ(vec,-(FMath::FPiDiv2 + azimuth));
}
......@@ -446,7 +446,7 @@ public:
void P2M(CellClass* const inPole, const ContainerClass* const inParticles ) {
const FReal i_pow_m[4] = {0, FMath::FPiDiv2, FMath::FPi, -FMath::FPiDiv2};
// w is the multipole moment
FComplexe* FRestrict const w = inPole->getMultipole();
FComplex* FRestrict const w = inPole->getMultipole();
// Copying the position is faster than using cell position
const FPoint cellPosition = getLeafCenter(inPole->getCoordinate());
......@@ -498,7 +498,7 @@ public:
*/
void M2M(CellClass* const FRestrict inPole, const CellClass*const FRestrict *const FRestrict inChildren, const int inLevel) {
// A buffer to copy the source w allocated once
FComplexe source_w[SizeArray];
FComplex source_w[SizeArray];
// For all children
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
// if child exists
......@@ -512,7 +512,7 @@ public:
const FReal b = -sph.getR();
// Translate it
FComplexe target_w[SizeArray];
FComplex target_w[SizeArray];
for(int l = 0 ; l <= P ; ++l ){
for(int m = 0 ; m <= l ; ++m ){
// w{l,m}(a+b) = sum(j=m:l, b^(l-j)/(l-j)! w{j,m}(a)
......@@ -549,7 +549,7 @@ public:
*/
void M2L(CellClass* const FRestrict inLocal, const CellClass* inInteractions[], const int /*inSize*/, const int inLevel) {
// To copy the multipole data allocated once
FComplexe source_w[SizeArray];
FComplex source_w[SizeArray];
// For all children
for(int idxNeigh = 0 ; idxNeigh < 343 ; ++idxNeigh){
// if interaction exits
......@@ -563,7 +563,7 @@ public:
const FReal b = sph.getR();
// Transfer to u
FComplexe target_u[SizeArray];
FComplex target_u[SizeArray];
for(int l = 0 ; l <= P ; ++l ){
for(int m = 0 ; m <= l ; ++m ){
// u{l,m}(a-b) = sum(j=|m|:P-l, (j+l)!/b^(j+l+1) w{j,-m}(a)
......@@ -601,7 +601,7 @@ public:
*/
void L2L(const CellClass* const FRestrict inLocal, CellClass* FRestrict *const FRestrict inChildren, const int inLevel) {
// To copy the source local allocated once
FComplexe source_u[SizeArray];
FComplex source_u[SizeArray];
// For all children
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
// if child exists
......@@ -615,7 +615,7 @@ public:
const FReal b = sph.getR();
// Translate
FComplexe target_u[SizeArray];
FComplex target_u[SizeArray];
for(int l = 0 ; l <= P ; ++l ){
for(int m = 0 ; m <= l ; ++m ){
// u{l,m}(r-b) = sum(j=0:P, b^(j-l)/(j-l)! u{j,m}(r);
......@@ -660,7 +660,7 @@ public:
void L2P(const CellClass* const inLocal, ContainerClass* const inParticles){
const FReal i_pow_m[4] = {0, FMath::FPiDiv2, FMath::FPi, -FMath::FPiDiv2};
// Take the local value from the cell
const FComplexe* FRestrict const u = inLocal->getLocal();
const FComplex* FRestrict const u = inLocal->getLocal();
// Copying the position is faster than using cell position
const FPoint cellPosition = getLeafCenter(inLocal->getCoordinate());
......
......@@ -50,21 +50,21 @@ protected:
FHarmonic harmonic; //< The harmonic computation class
// For normal computation
FSmartPointer<FComplexe*> preL2LTransitions; //< The pre-computation for the L2L based on the level
FSmartPointer<FComplexe*> preM2MTransitions; //< The pre-computation for the M2M based on the level
FSmartPointer<FComplex*> preL2LTransitions; //< The pre-computation for the L2L based on the level
FSmartPointer<FComplex*> preM2MTransitions; //< The pre-computation for the M2M based on the level
/** Alloc and init pre-vectors*/
void allocAndInit(){
preL2LTransitions = new FComplexe*[treeHeight ];
memset(preL2LTransitions.getPtr(), 0, (treeHeight) * sizeof(FComplexe*));
preM2MTransitions = new FComplexe*[treeHeight];
memset(preM2MTransitions.getPtr(), 0, (treeHeight) * sizeof(FComplexe*));
preL2LTransitions = new FComplex*[treeHeight ];
memset(preL2LTransitions.getPtr(), 0, (treeHeight) * sizeof(FComplex*));
preM2MTransitions = new FComplex*[treeHeight];
memset(preM2MTransitions.getPtr(), 0, (treeHeight) * sizeof(FComplex*));
FReal treeWidthAtLevel = (boxWidth)/2;
for(int idxLevel = 0 ; idxLevel < treeHeight - 1 ; ++idxLevel ){
preL2LTransitions[idxLevel] = new FComplexe[ 8 * harmonic.getExpSize()];
preM2MTransitions[idxLevel] = new FComplexe[ 8 * harmonic.getExpSize()];
preL2LTransitions[idxLevel] = new FComplex[ 8 * harmonic.getExpSize()];
preM2MTransitions[idxLevel] = new FComplex[ 8 * harmonic.getExpSize()];
const FPoint father(treeWidthAtLevel,treeWidthAtLevel,treeWidthAtLevel);
treeWidthAtLevel /= 2;
......@@ -80,7 +80,7 @@ protected:
);
harmonic.computeInner(FSpherical(M2MVector));
FMemUtils::copyall<FComplexe>(&preM2MTransitions[idxLevel][harmonic.getExpSize() * idxChild], harmonic.result(), harmonic.getExpSize());
FMemUtils::copyall<FComplex>(&preM2MTransitions[idxLevel][harmonic.getExpSize() * idxChild], harmonic.result(), harmonic.getExpSize());
const FPoint L2LVector (
(treeWidthAtLevel * FReal(1 + (childBox.getX() * 2))) - father.getX(),
......@@ -89,7 +89,7 @@ protected:
);
harmonic.computeInner(FSpherical(L2LVector));
FMemUtils::copyall<FComplexe>(&preL2LTransitions[idxLevel][harmonic.getExpSize() * idxChild], harmonic.result(), harmonic.getExpSize());
FMemUtils::copyall<FComplex>(&preL2LTransitions[idxLevel][harmonic.getExpSize() * idxChild], harmonic.result(), harmonic.getExpSize());
}
}
}
......@@ -145,7 +145,7 @@ public:
/** P2M with a cell and all its particles */
void P2M(CellClass* const inPole, const ContainerClass* const inParticles) {
FComplexe* FRestrict const cellMultiPole = inPole->getMultipole();
FComplex* FRestrict const cellMultiPole = inPole->getMultipole();
// Copying the position is faster than using cell position
const FPoint polePosition = getLeafCenter(inPole->getCoordinate());
// For all particles in the leaf box
......@@ -163,9 +163,9 @@ public:
/** M2M with a cell and all its child */
void M2M(CellClass* const FRestrict inPole, const CellClass *const FRestrict *const FRestrict inChild, const int inLevel) {
FComplexe* FRestrict const multipole_exp_target = inPole->getMultipole();
FComplex* FRestrict const multipole_exp_target = inPole->getMultipole();
// iter on each child and process M2M
const FComplexe* FRestrict const preM2MTransitionsAtLevel = preM2MTransitions[inLevel];
const FComplex* FRestrict const preM2MTransitionsAtLevel = preM2MTransitions[inLevel];
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(inChild[idxChild]){
multipoleToMultipole(multipole_exp_target, inChild[idxChild]->getMultipole(), &preM2MTransitionsAtLevel[idxChild * harmonic.getExpSize()]);
......@@ -180,7 +180,7 @@ public:
/** L2L with a cell and all its child */
void L2L(const CellClass* const FRestrict pole, CellClass* FRestrict *const FRestrict child, const int inLevel) {
// iter on each child and process L2L
const FComplexe* FRestrict const preL2LTransitionsAtLevel = preL2LTransitions[inLevel];
const FComplex* FRestrict const preL2LTransitionsAtLevel = preL2LTransitions[inLevel];
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(child[idxChild]){
localToLocal(child[idxChild]->getLocal(), pole->getLocal(), &preL2LTransitionsAtLevel[idxChild * harmonic.getExpSize()]);
......@@ -190,7 +190,7 @@ public:
/** L2P with a cell and all its particles */
void L2P(const CellClass* const local, ContainerClass* const inParticles){
const FComplexe* const cellLocal = local->getLocal();
const FComplex* const cellLocal = local->getLocal();
// Copying the position is faster than using cell position
const FPoint localPosition = getLeafCenter(local->getCoordinate());
// For all particles in the leaf box
......@@ -265,7 +265,7 @@ private:
* Phi(x) = sum_{n=0}^{+} sum_{m=-n}^{n} M_n^m O_n^{-m} (x - *p_center)
*
*/
void particleToMultiPole(FComplexe* const cellMultiPole, const FPoint& inPolePosition ,
void particleToMultiPole(FComplex* const cellMultiPole, const FPoint& inPolePosition ,
const FPoint& particlePosition, const FReal particlePhysicalValue){
// Inner of Qi - Z0 => harmonic.result
......@@ -304,9 +304,9 @@ private:
*
* Warning: if j-n < |k-l| we do nothing.
*/
void multipoleToMultipole(FComplexe* const FRestrict multipole_exp_target,
const FComplexe* const FRestrict multipole_exp_src,
const FComplexe* const FRestrict M2M_Inner_transfer){
void multipoleToMultipole(FComplex* const FRestrict multipole_exp_target,
const FComplex* const FRestrict multipole_exp_src,
const FComplex* const FRestrict M2M_Inner_transfer){
// n from 0 to P
for(int n = 0 ; n <= devP ; ++n ){
......@@ -318,7 +318,7 @@ private:
// l from -n to <0
for(int l = -n ; l < 0 ; ++l){
const FComplexe M_n__n_l = multipole_exp_src[index_n -l];
const FComplex M_n__n_l = multipole_exp_src[index_n -l];
// j from n to P
for(int j = n ; j <= devP ; ++j ){
......@@ -329,7 +329,7 @@ private:
// since n-j+l<0
for(int k = 0 ; k <= (j-n+l) ; ++k ){ // l<0 && k>=0 => k-l>0
const FComplexe I_j_n__k_l = M2M_Inner_transfer[index_j_n + k - l];
const FComplex I_j_n__k_l = M2M_Inner_transfer[index_j_n + k - l];
multipole_exp_target[index_j + k].incReal( pow_of_minus_1_for_l *
((M_n__n_l.getReal() * I_j_n__k_l.getReal()) +
......@@ -346,7 +346,7 @@ private:
// l from 0 to n
for(int l = 0 ; l <= n ; ++l){
const FComplexe M_n__n_l = multipole_exp_src[index_n + l];
const FComplex M_n__n_l = multipole_exp_src[index_n + l];
// j from n to P
for( int j = n ; j <= devP ; ++j ){
......@@ -360,7 +360,7 @@ private:
int k = first_k;
for(; k <= (j-n+l) && k < l ; ++k){ /* l>=0 && k-l<0 */
const FComplexe I_j_n__l_k = M2M_Inner_transfer[index_j_n + l - k];
const FComplex I_j_n__l_k = M2M_Inner_transfer[index_j_n + l - k];
multipole_exp_target[index_j + k].incReal( pow_of_minus_1_for_k * pow_of_minus_1_for_l *
((M_n__n_l.getReal() * I_j_n__l_k.getReal()) +
......@@ -373,7 +373,7 @@ private:
} // for k
for(/* k = l */; k <= (j - n + l) ; ++k){ // l>=0 && k-l>=0
const FComplexe I_j_n__k_l = M2M_Inner_transfer[index_j_n + k - l];
const FComplex I_j_n__k_l = M2M_Inner_transfer[index_j_n + k - l];
multipole_exp_target[index_j + k].incReal(
(M_n__n_l.getReal() * I_j_n__k_l.getReal()) -
......@@ -408,8 +408,8 @@ private:
*
*Warning: if |l-k| > n-j, we do nothing.
*/
void localToLocal(FComplexe* const FRestrict local_exp_target, const FComplexe* const FRestrict local_exp_src,
const FComplexe* const FRestrict L2L_tranfer){
void localToLocal(FComplex* const FRestrict local_exp_target, const FComplex* const FRestrict local_exp_src,
const FComplex* const FRestrict L2L_tranfer){
// L_j^k
int index_j_k = 0;
......@@ -418,7 +418,7 @@ private:
FReal pow_of_minus_1_for_k = 1.0;
for (int k = 0 ; k <= j ; ++k, ++index_j_k ){
FComplexe L_j_k = local_exp_target[index_j_k];
FComplex L_j_k = local_exp_target[index_j_k];
for (int n=j; n <= devP;++n){
// O_n^l : here points on the source multipole expansion term of degree n and order |l|
......@@ -429,8 +429,8 @@ private:
const int index_n_j = harmonic.getPreExpRedirJ(n-j);
for(/*l = n - j + k*/ ; l-k > 0 ; --l){ /* l>0 && l-k>0 */
const FComplexe L_j_l = local_exp_src[index_n + l];
const FComplexe I_l_j__l_k = L2L_tranfer[index_n_j + l - k];
const FComplex L_j_l = local_exp_src[index_n + l];
const FComplex I_l_j__l_k = L2L_tranfer[index_n_j + l - k];
L_j_k.incReal( (L_j_l.getReal() * I_l_j__l_k.getReal()) -
(L_j_l.getImag() * I_l_j__l_k.getImag()));
......@@ -442,8 +442,8 @@ private:
// (-1)^l
FReal pow_of_minus_1_for_l = ((l&1) ? FReal(-1.0) : FReal(1.0));