Commit 1acbddc5 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Changes relatives to template over FReal type

parent e8f3b15a
...@@ -38,21 +38,21 @@ ...@@ -38,21 +38,21 @@
* @class FInterEngine implements API for Interpolations kernels, its * @class FInterEngine implements API for Interpolations kernels, its
* templates can be ChebCell/ChebKernel or UnifCell/UnifKernel * templates can be ChebCell/ChebKernel or UnifCell/UnifKernel
*/ */
template<class InterCell,class InterKernel, template<class FReal, class InterCell,class InterKernel,
class ContainerClass = FP2PParticleContainerIndexed<FReal>, class ContainerClass = FP2PParticleContainerIndexed<FReal>,
class LeafClass = FSimpleLeaf<FReal, FP2PParticleContainerIndexed<FReal> >, class LeafClass = FSimpleLeaf<FReal, FP2PParticleContainerIndexed<FReal> >,
class MatrixKernelClass = FInterpMatrixKernelR> class MatrixKernelClass = FInterpMatrixKernelR<FReal> >
class FInterEngine : public FScalFMMEngine{ class FInterEngine : public FScalFMMEngine{
private: private:
//Typedef on the octree class, in order to clarify following code //Typedef on the octree class, in order to clarify following code
typedef FOctree<InterCell,ContainerClass,LeafClass> OctreeClass; typedef FOctree<FReal,InterCell,ContainerClass,LeafClass> OctreeClass;
//typedef FP2PLeafInterface<OctreeClass> LeafInterface; //typedef FP2PLeafInterface<OctreeClass> LeafInterface;
//Typedef on Octree Arranger, in order to clarify following code //Typedef on Octree Arranger, in order to clarify following code
typedef FBasicParticleContainerIndexedMover<OctreeClass, ContainerClass> MoverClass; typedef FBasicParticleContainerIndexedMover<FReal,OctreeClass, ContainerClass> MoverClass;
typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass; typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FArrangerPeriodic<OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic; typedef FArrangerPeriodic<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic;
//Pointer to the kernel to be executed //Pointer to the kernel to be executed
InterKernel * kernel; InterKernel * kernel;
......
This diff is collapsed.
...@@ -197,7 +197,7 @@ public: ...@@ -197,7 +197,7 @@ public:
}; };
template<class FReal>
class FUserKernelEngine : public FScalFMMEngine{ class FUserKernelEngine : public FScalFMMEngine{
private: private:
...@@ -205,13 +205,13 @@ private: ...@@ -205,13 +205,13 @@ private:
//Typedefs : //Typedefs :
typedef FP2PParticleContainerIndexed<FReal> ContainerClass; typedef FP2PParticleContainerIndexed<FReal> ContainerClass;
typedef FSimpleLeaf<FReal, ContainerClass> LeafClass; typedef FSimpleLeaf<FReal, ContainerClass> LeafClass;
typedef FOctree<CoreCell,ContainerClass,LeafClass> OctreeClass; typedef FOctree<FReal,CoreCell,ContainerClass,LeafClass> OctreeClass;
typedef CoreKernel<CoreCell,ContainerClass> CoreKernelClass; typedef CoreKernel<CoreCell,ContainerClass> CoreKernelClass;
//For arranger classes //For arranger classes
typedef FBasicParticleContainerIndexedMover<OctreeClass, ContainerClass> MoverClass; typedef FBasicParticleContainerIndexedMover<FReal, OctreeClass, ContainerClass> MoverClass;
typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass; typedef FOctreeArranger<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClass;
typedef FArrangerPeriodic<OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic; typedef FArrangerPeriodic<FReal,OctreeClass, ContainerClass, MoverClass> ArrangerClassPeriodic;
//Attributes //Attributes
......
...@@ -112,7 +112,7 @@ void my_Callback_M2M(int level, void* cellData, int childPosition, void* childDa ...@@ -112,7 +112,7 @@ void my_Callback_M2M(int level, void* cellData, int childPosition, void* childDa
struct MyCellDescriptor* my_child = (struct MyCellDescriptor*) childData; struct MyCellDescriptor* my_child = (struct MyCellDescriptor*) childData;
int childFullPosition[3]; int childFullPosition[3];
Scalfmm_utils_parentChildPosition(childPosition, childFullPosition); scalfmm_utils_parentChildPosition(childPosition, childFullPosition);
VerbosePrint("Doing a M2M at level %d, between cells %lld and %lld (position %d/%d/%d)\n", VerbosePrint("Doing a M2M at level %d, between cells %lld and %lld (position %d/%d/%d)\n",
level, my_cell->mortonIndex, my_child->mortonIndex, level, my_cell->mortonIndex, my_child->mortonIndex,
...@@ -128,7 +128,7 @@ void my_Callback_M2L(int level, void* cellData, int srcPosition, void* srcData, ...@@ -128,7 +128,7 @@ void my_Callback_M2L(int level, void* cellData, int srcPosition, void* srcData,
struct MyCellDescriptor* my_src_cell = (struct MyCellDescriptor*) srcData; struct MyCellDescriptor* my_src_cell = (struct MyCellDescriptor*) srcData;
int interactionFullPosition[3]; int interactionFullPosition[3];
Scalfmm_utils_interactionPosition(srcPosition, interactionFullPosition); scalfmm_utils_interactionPosition(srcPosition, interactionFullPosition);
VerbosePrint("Doing a M2L at level %d, between cells %lld and %lld (position %d/%d/%d)\n", VerbosePrint("Doing a M2L at level %d, between cells %lld and %lld (position %d/%d/%d)\n",
level, my_cell->mortonIndex, my_src_cell->mortonIndex, level, my_cell->mortonIndex, my_src_cell->mortonIndex,
...@@ -144,7 +144,7 @@ void my_Callback_L2L(int level, void* cellData, int childPosition, void* childDa ...@@ -144,7 +144,7 @@ void my_Callback_L2L(int level, void* cellData, int childPosition, void* childDa
struct MyCellDescriptor* my_child = (struct MyCellDescriptor*) childData; struct MyCellDescriptor* my_child = (struct MyCellDescriptor*) childData;
int childFullPosition[3]; int childFullPosition[3];
Scalfmm_utils_parentChildPosition(childPosition, childFullPosition); scalfmm_utils_parentChildPosition(childPosition, childFullPosition);
VerbosePrint("Doing a L2L at level %d, between cells %lld and %lld (position %d/%d/%d)\n", VerbosePrint("Doing a L2L at level %d, between cells %lld and %lld (position %d/%d/%d)\n",
level, my_cell->mortonIndex, my_child->mortonIndex, level, my_cell->mortonIndex, my_child->mortonIndex,
...@@ -246,6 +246,7 @@ int main(int argc, char ** argv){ ...@@ -246,6 +246,7 @@ int main(int argc, char ** argv){
// Insert particles // Insert particles
printf("Inserting particles...\n"); printf("Inserting particles...\n");
scalfmm_tree_insert_particles_xyz(handle, nbParticles, particleXYZ); scalfmm_tree_insert_particles_xyz(handle, nbParticles, particleXYZ);
printf("Particles Inserted ...\n");
// Init our callback struct // Init our callback struct
struct User_Scalfmm_Kernel_Descriptor kernel; struct User_Scalfmm_Kernel_Descriptor kernel;
...@@ -263,7 +264,7 @@ int main(int argc, char ** argv){ ...@@ -263,7 +264,7 @@ int main(int argc, char ** argv){
my_data.insertedPositions = particleXYZ; my_data.insertedPositions = particleXYZ;
//Set my datas before calling fmm (this will set as well the kernel) //Set my datas before calling fmm (this will set as well the kernel)
scalfmm_user_kernel_config(handle,kernel,&my_data); scalfmm_user_kernel_config(handle,kernel,&my_data);
printf("Kernel set ... \n");
//loop to multiples runs of the fmm //loop to multiples runs of the fmm
int nb_ite = 1; int nb_ite = 1;
int curr_ite = 0; int curr_ite = 0;
...@@ -272,8 +273,10 @@ int main(int argc, char ** argv){ ...@@ -272,8 +273,10 @@ int main(int argc, char ** argv){
memset(new_positions,0,3*nbParticles*sizeof(double)); memset(new_positions,0,3*nbParticles*sizeof(double));
while(curr_ite < nb_ite){ while(curr_ite < nb_ite){
printf("Start FMM number %d/%d ... \n", curr_ite,nb_ite);
// Execute the FMM // Execute the FMM
scalfmm_execute_fmm(handle/*, kernel, &my_data*/); scalfmm_execute_fmm(handle/*, kernel, &my_data*/);
printf("FMM finished ... \n");
scalfmm_get_positions_xyz(handle,nbParticles,new_positions); scalfmm_get_positions_xyz(handle,nbParticles,new_positions);
//Computation on those positions //Computation on those positions
//Here it's a random //Here it's a random
......
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