Commit 90e8f721 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Use FSize when it is related to particles

parent e8f3b15a
......@@ -48,7 +48,7 @@ void Scalfmm_dealloc_handle(Scalfmm_Handle handle, Callback_free_cell cellDestro
//< The indexes are the one used on the particles operator
//< The position of the particles should be composed of one triple per particle:
//< xyzxyzxyz...
void Scalfmm_insert_array_of_particles(Scalfmm_Handle handle, int nbParticles, int* particleIndexes, double* particleXYZ);
void Scalfmm_insert_array_of_particles(Scalfmm_Handle handle, FSize nbParticles, int* particleIndexes, double* particleXYZ);
//< To insert one particle only
void Scalfmm_one_particle(Scalfmm_Handle handle, int particleIndexe, double x, double y, double z);
......@@ -62,13 +62,13 @@ void Scalfmm_init_cell(Scalfmm_Handle handle, Callback_init_cell cellInitializer
///////////////////////////////////////////////////////////////////////////
//< These function are the callbacks of the FMM operators
typedef void (*Callback_P2M)(void* leafCell, int nbParticles, const int* particleIndexes, void* userData);
typedef void (*Callback_P2M)(void* leafCell, FSize nbParticles, const int* particleIndexes, void* userData);
typedef void (*Callback_M2M)(int level, void* parentCell, int childPosition, void* childCell, void* userData);
typedef void (*Callback_M2L)(int level, void* targetCell, int sourceCellPosition, void* sourceCell, void* userData);
typedef void (*Callback_L2L)(int level, void* parentCell, int childPosition, void* childCell, void* userData);
typedef void (*Callback_L2P)(void* leafCell, int nbParticles, int* particleIndexes, void* userData);
typedef void (*Callback_P2P)(int nbParticles, const int* particleIndexes, int nbSourceParticles, const int* sourceParticleIndexes, void* userData);
typedef void (*Callback_P2PInner)(int nbParticles, int* particleIndexes, void* userData);
typedef void (*Callback_L2P)(void* leafCell, FSize nbParticles, int* particleIndexes, void* userData);
typedef void (*Callback_P2P)(FSize nbParticles, const int* particleIndexes, int nbSourceParticles, const int* sourceParticleIndexes, void* userData);
typedef void (*Callback_P2PInner)(FSize nbParticles, int* particleIndexes, void* userData);
//< This structure should be filled (or filled with null) to call the FMM
struct Scalfmm_Kernel_Descriptor {
......
......@@ -362,7 +362,7 @@ void scalfmm_algorithm_config(scalfmm_handle Handle,scalfmm_algorithm config);
* @param particleIndexes indexes of particles currently computed
* @param userData datas specific to the user's kernel
*/
typedef void (*Callback_P2M)(void* leafCell, int nbParticles, const int* particleIndexes, void* userData);
typedef void (*Callback_P2M)(void* leafCell, FSize nbParticles, const int* particleIndexes, void* userData);
/**
* @brief Function to be filled by user's M2M
......@@ -411,7 +411,7 @@ typedef void (*Callback_L2L)(int level, void* parentCell, int childPosition, voi
* @param particleIndexes indexes of particles currently computed
* @param userData datas specific to the user's kernel
*/
typedef void (*Callback_L2P)(void* leafCell, int nbParticles,const int* particleIndexes, void* userData);
typedef void (*Callback_L2P)(void* leafCell, FSize nbParticles,const int* particleIndexes, void* userData);
/**
* @brief Function to be filled by user's P2P
......@@ -421,7 +421,7 @@ typedef void (*Callback_L2P)(void* leafCell, int nbParticles,const int* particle
* @param sourceParticleIndexes indexes of cource particles currently computed
* @param userData datas specific to the user's kernel
*/
typedef void (*Callback_P2P)(int nbParticles, const int* particleIndexes, int nbSourceParticles, const int* sourceParticleIndexes, void* userData);
typedef void (*Callback_P2P)(FSize nbParticles, const int* particleIndexes, int nbSourceParticles, const int* sourceParticleIndexes, void* userData);
/**
* @brief Function to be filled by user's P2P
......@@ -432,7 +432,7 @@ typedef void (*Callback_P2P)(int nbParticles, const int* particleIndexes, int nb
* @param sourceNbPart array containing the number of part in each neighbors
* @param userData datas specific to the user's kernel
*/
typedef void (*Callback_P2PFull)(int nbParticles, const int* particleIndexes,
typedef void (*Callback_P2PFull)(FSize nbParticles, const int* particleIndexes,
const int * sourceParticleIndexes[27],int sourceNbPart[27], void* userData);
......@@ -442,7 +442,7 @@ typedef void (*Callback_P2PFull)(int nbParticles, const int* particleIndexes,
* @param particleIndexes indexes of particles currently computed
* @param userData datas specific to the user's kernel
*/
typedef void (*Callback_P2PInner)(int nbParticles, const int* particleIndexes, void* userData);
typedef void (*Callback_P2PInner)(FSize nbParticles, const int* particleIndexes, void* userData);
......
......@@ -112,9 +112,9 @@ public:
void set_physical_values(int nbPhysicalValues,double * physicalValues){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getPhysicalValues()[idxPart] = physicalValues[indexes[idxPart]];
}
});
......@@ -126,9 +126,9 @@ public:
void set_physical_values_npart( int nbPhysicalValues, int* idxOfParticles, double * physicalValues){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbPhysicalValues && notFoundYet){
......@@ -148,9 +148,9 @@ public:
void get_physical_values( int nbPhysicalValues, double * physicalValues){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
physicalValues[indexes[idxPart]] = sources->getPhysicalValues()[idxPart];
}
});
......@@ -160,9 +160,9 @@ public:
void get_physical_values_npart( int nbPhysicalValues, int* idxOfParticles, double * physicalValues){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbPhysicalValues && notFoundYet){
......@@ -181,9 +181,9 @@ public:
void get_forces_xyz( int nbParts, double * forcesToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
forcesToFill[indexes[idxPart]*3+0] = sources->getForcesX()[idxPart];
forcesToFill[indexes[idxPart]*3+1] = sources->getForcesY()[idxPart];
forcesToFill[indexes[idxPart]*3+2] = sources->getForcesZ()[idxPart];
......@@ -194,9 +194,9 @@ public:
void get_forces_xyz_npart(int nbParts, int* idxOfParticles , double * forcesToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbParts && notFoundYet){
......@@ -217,9 +217,9 @@ public:
void get_forces( int nbParts, double * fX, double* fY, double* fZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
fX[indexes[idxPart]] = sources->getForcesX()[idxPart];
fY[indexes[idxPart]] = sources->getForcesY()[idxPart];
fZ[indexes[idxPart]] = sources->getForcesZ()[idxPart];
......@@ -230,9 +230,9 @@ public:
void get_forces_npart(int nbParts, int* idxOfParticles ,double * fX, double* fY, double* fZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbParts && notFoundYet){
......@@ -254,9 +254,9 @@ public:
void set_forces_xyz( int nbParts, double * forcesToRead){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getForcesX()[idxPart] = forcesToRead[indexes[idxPart]*3+0];
sources->getForcesY()[idxPart] = forcesToRead[indexes[idxPart]*3+1];
sources->getForcesZ()[idxPart] = forcesToRead[indexes[idxPart]*3+2];
......@@ -266,9 +266,9 @@ public:
void set_forces_xyz_npart( int nbParts, int* idxOfParticles, double * forcesToRead){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbParts && notFoundYet){
......@@ -288,9 +288,9 @@ public:
void set_forces( int nbParts, double * fX, double* fY, double* fZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getForcesX()[idxPart] = fX[indexes[idxPart]];
sources->getForcesY()[idxPart] = fY[indexes[idxPart]];
sources->getForcesZ()[idxPart] = fZ[indexes[idxPart]];
......@@ -300,9 +300,9 @@ public:
void set_forces_npart( int nbParts, int* idxOfParticles, double * fX, double* fY, double* fZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbParts && notFoundYet){
......@@ -324,9 +324,9 @@ public:
void set_potentials(int nbPotentials,double * potentialsToRead){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getPotentials()[idxPart] = potentialsToRead[indexes[idxPart]];
}
});
......@@ -338,9 +338,9 @@ public:
void set_potentials_npart( int nbPotentials, int* idxOfParticles, double * potentialsToRead){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbPotentials && notFoundYet){
......@@ -360,9 +360,9 @@ public:
void get_potentials( int nbPotentials, double * potentialsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
potentialsToFill[indexes[idxPart]] = sources->getPotentials()[idxPart];
}
});
......@@ -372,9 +372,9 @@ public:
void get_potentials_npart( int nbPotentials, int* idxOfParticles, double * potentialsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < nbPotentials && notFoundYet){
......@@ -393,9 +393,9 @@ public:
void get_positions_xyz(int NbPositions, double * positionsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
positionsToFill[indexes[idxPart]*3+0] = sources->getPositions()[0][idxPart];
positionsToFill[indexes[idxPart]*3+1] = sources->getPositions()[1][idxPart];
positionsToFill[indexes[idxPart]*3+2] = sources->getPositions()[2][idxPart];
......@@ -406,9 +406,9 @@ public:
void get_positions_xyz_npart(int NbPositions, int * idxOfParticles, double * positionsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < NbPositions && notFoundYet){
......@@ -429,9 +429,9 @@ public:
void get_positions( int NbPositions, double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
X[indexes[idxPart]] = sources->getPositions()[0][idxPart];
Y[indexes[idxPart]] = sources->getPositions()[1][idxPart];
Z[indexes[idxPart]] = sources->getPositions()[2][idxPart];
......@@ -442,9 +442,9 @@ public:
void get_positions_npart(int NbPositions, int * idxOfParticles,double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < NbPositions && notFoundYet){
......@@ -468,9 +468,9 @@ public:
void add_to_positions_xyz(int NbPositions,double * updatedXYZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] += updatedXYZ[indexes[idxPart]*3+0];
sources->getWPositions()[1][idxPart] += updatedXYZ[indexes[idxPart]*3+1];
sources->getWPositions()[2][idxPart] += updatedXYZ[indexes[idxPart]*3+2];
......@@ -481,9 +481,9 @@ public:
void add_to_positions(int NbPositions,double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] += X[indexes[idxPart]];
sources->getWPositions()[1][idxPart] += Y[indexes[idxPart]];
sources->getWPositions()[2][idxPart] += Z[indexes[idxPart]];
......@@ -495,9 +495,9 @@ public:
void set_positions_xyz(int NbPositions, double * updatedXYZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] = updatedXYZ[indexes[idxPart]*3+0];
sources->getWPositions()[1][idxPart] = updatedXYZ[indexes[idxPart]*3+1];
sources->getWPositions()[2][idxPart] = updatedXYZ[indexes[idxPart]*3+2];
......@@ -508,9 +508,9 @@ public:
void set_positions(int NbPositions, double * X, double * Y, double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] = X[indexes[idxPart]];
sources->getWPositions()[1][idxPart] = Y[indexes[idxPart]];
sources->getWPositions()[2][idxPart] = Z[indexes[idxPart]];
......
......@@ -126,7 +126,7 @@ extern "C" void ChebKernelStruct_free(void *inKernel){
}
extern "C" void ChebKernel_P2M(void * leafCell, int nbParticles, const int *particleIndexes, void * inKernel){
extern "C" void ChebKernel_P2M(void * leafCell, FSize nbParticles, const int *particleIndexes, void * inKernel){
//make temporary array of parts
FP2PParticleContainerIndexed<FReal>* tempContainer = new FP2PParticleContainerIndexed<FReal>();
tempContainer->reserve(nbParticles);
......@@ -215,7 +215,7 @@ extern "C" void ChebKernel_L2L(int level, void* parentCell, int childPosition, v
childChebCell->getLocal(0));
}
extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* particleIndexes, void* inKernel){
extern "C" void ChebKernel_L2P(void* leafCell, FSize nbParticles, const int* particleIndexes, void* inKernel){
//Create temporary FSimpleLeaf
FP2PParticleContainerIndexed<FReal>* tempContainer = new FP2PParticleContainerIndexed<FReal>();
tempContainer->reserve(nbParticles);
......@@ -242,8 +242,8 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
//Then retrieve the results
double * forcesToFill = reinterpret_cast<UserData *>(inKernel)->forcesComputed[id_thread];
const FVector<int>& indexes = tempContainer->getIndexes();
for(int idxPart = 0 ; idxPart<nbParticles ; ++idxPart){
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
for(FSize idxPart = 0 ; idxPart<nbParticles ; ++idxPart){
forcesToFill[indexes[idxPart]*3+0] += tempContainer->getForcesX()[idxPart];
forcesToFill[indexes[idxPart]*3+1] += tempContainer->getForcesY()[idxPart];
forcesToFill[indexes[idxPart]*3+2] += tempContainer->getForcesZ()[idxPart];
......@@ -254,7 +254,7 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
}
void ChebKernel_P2P(int nbParticles, const int* particleIndexes,
void ChebKernel_P2P(FSize nbParticles, const int* particleIndexes,
const int * sourceParticleIndexes[27],int sourceNbPart[27],void* inKernel){
//Create temporary FSimpleLeaf for target
......@@ -306,8 +306,8 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
//get back forces
double * forcesToFill = reinterpret_cast<UserData *>(inKernel)->forcesComputed[id_thread];
const FVector<int>& indexes = tempContTarget->getIndexes();
for(int idxPart = 0 ; idxPart<nbParticles ; ++idxPart){
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
for(FSize idxPart = 0 ; idxPart<nbParticles ; ++idxPart){
forcesToFill[indexes[idxPart]*3+0] += tempContTarget->getForcesX()[idxPart];
forcesToFill[indexes[idxPart]*3+1] += tempContTarget->getForcesY()[idxPart];
forcesToFill[indexes[idxPart]*3+2] += tempContTarget->getForcesZ()[idxPart];
......@@ -316,7 +316,7 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
//Note that sources are also modified.
//get back sources forces
for(int idSource = 0 ; idSource < 27 ; ++idSource){
const FVector<int>& indexes = tempContSources[idSource]->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
const int nbPartInSource = sourceNbPart[idSource];
for(int idxSourcePart = 0; idxSourcePart < nbPartInSource ; ++idxSourcePart){
forcesToFill[indexes[idxSourcePart]*3+0] += tempContSources[idSource]->getForcesX()[idxSourcePart];
......
......@@ -276,9 +276,9 @@ public:
void get_positions_xyz(int NbPositions, double * positionsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
positionsToFill[indexes[idxPart]*3+0] = sources->getPositions()[0][idxPart];
positionsToFill[indexes[idxPart]*3+1] = sources->getPositions()[1][idxPart];
positionsToFill[indexes[idxPart]*3+2] = sources->getPositions()[2][idxPart];
......@@ -289,9 +289,9 @@ public:
void get_positions_xyz_npart(int NbPositions, int * idxOfParticles, double * positionsToFill){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < NbPositions && notFoundYet){
......@@ -312,9 +312,9 @@ public:
void get_positions( int NbPositions, double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
X[indexes[idxPart]] = sources->getPositions()[0][idxPart];
Y[indexes[idxPart]] = sources->getPositions()[1][idxPart];
Z[indexes[idxPart]] = sources->getPositions()[2][idxPart];
......@@ -325,9 +325,9 @@ public:
void get_positions_npart(int NbPositions, int * idxOfParticles,double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
int iterPart = 0;
bool notFoundYet = true;
while(iterPart < NbPositions && notFoundYet){
......@@ -352,9 +352,9 @@ public:
void add_to_positions_xyz(int NbPositions,double * updatedXYZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] += updatedXYZ[indexes[idxPart]*3+0];
sources->getWPositions()[1][idxPart] += updatedXYZ[indexes[idxPart]*3+1];
sources->getWPositions()[2][idxPart] += updatedXYZ[indexes[idxPart]*3+2];
......@@ -365,9 +365,9 @@ public:
void add_to_positions(int NbPositions,double * X, double * Y , double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] += X[indexes[idxPart]];
sources->getWPositions()[1][idxPart] += Y[indexes[idxPart]];
sources->getWPositions()[2][idxPart] += Z[indexes[idxPart]];
......@@ -379,9 +379,9 @@ public:
void set_positions_xyz(int NbPositions, double * updatedXYZ){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();
for(int idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
sources->getWPositions()[0][idxPart] = updatedXYZ[indexes[idxPart]*3+0];
sources->getWPositions()[1][idxPart] = updatedXYZ[indexes[idxPart]*3+1];
sources->getWPositions()[2][idxPart] = updatedXYZ[indexes[idxPart]*3+2];
......@@ -392,9 +392,9 @@ public:
void set_positions(int NbPositions, double * X, double * Y, double * Z){
octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc();
const FVector<int>& indexes = sources->getIndexes();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
int nbPartThere = sources->getNbParticles();