Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
47847f4b
Commit
47847f4b
authored
Mar 13, 2017
by
PIACIBELLO Cyrille
Browse files
Remove warnings on various test from the CKernelApi
parent
836e76b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Addons/CKernelApi/Src/CScalfmmApi.h
View file @
47847f4b
...
...
@@ -61,12 +61,12 @@ typedef long long int FSize;
*/
typedef
enum
kernel_type
{
user_defined_kernel
=
0
,
/** Case if user provides a complete
* kernel, ie all the needed function to
* compute FMM */
* kernel, ie all the needed function to
* compute FMM */
chebyshev
=
1
,
/** Case if user uses ScalFMM's implementation of
* Chebyshev Interpolation */
* Chebyshev Interpolation */
lagrange
=
2
,
/** Case if user uses ScalFMM's implementation of
* Lagrange Interpolation*/
* Lagrange Interpolation*/
}
scalfmm_kernel_type
;
...
...
@@ -299,14 +299,14 @@ typedef enum particule_type{
*
* Example :
struct part{
double[3] position;
double charge;
double test; //not used
double coeff;
double[3] position;
double charge;
double test; //not used
double coeff;
};
Then nbAttributeToInsert will be 3+1+1
and strideForEachAtt will be : [0,1,2,3,5]
*/
*/
void
scalfmm_tree_abstract_insert
(
scalfmm_handle
Handle
,
int
NbPartToInsert
,
int
nbAttributeToInsert
,
int
*
strideForEachAtt
,
double
*
rawDatas
);
...
...
@@ -828,11 +828,26 @@ void scalfmm_get_timers(scalfmm_handle handle,double * Timers);
*/
void
scalfmm_set_upper_limit
(
scalfmm_handle
handle
,
int
upperLimit
);
/**
* @brief This function fill the childFullPosition[3] with [-1;1] to
* know the position of a child relatively to its position from its
* parent
*/
void
scalfmm_utils_parentChildPosition
(
int
childPosition
,
int
*
childFullPosition
);
/**
* @brief This function fill the childFullPosition[3] with [-3;3] to
* know the position of a interaction cell relatively to its position
* from the target
*/
void
scalfmm_utils_interactionPosition
(
int
interactionPosition
,
int
*
srcPosition
);
/////////////////////////////////////////////////////////////////////
/////////////// Distributed Version //////////////////
/////////////////////////////////////////////////////////////////////
#ifdef
SCALFMM_USE_MPI
#ifdef
MPI_VERSION //We check there if MPI is available
#warning "IS_THAT_REALLY_WORKING"
//YES
...
...
@@ -880,8 +895,7 @@ void scalfmm_generic_partition(scalfmm_handle handle, FSize nbThings, size_t siz
*/
void
scalfmm_call_delete
(
void
*
array
);
#endif
#endif //MPI_VERSION
#endif
Addons/CKernelApi/Tests/testDisplayKernel.c
View file @
47847f4b
...
...
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <omp.h>
//For timing monitoring
#include "Timers.h"
...
...
Addons/CKernelApi/Tests/testSphereElectro.c
View file @
47847f4b
...
...
@@ -2,9 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <omp.h>
//For timing monitoring
#include "Timers.h"
...
...
Addons/CKernelApi/Tests/testUserDefinedKernelApi.c
View file @
47847f4b
...
...
@@ -12,14 +12,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <omp.h>
/**
* In this file we implement a example kernel which is simply printing information
* about the cells and particles.
* It is recommanded to compile and execute this code in order to understand the behavior
* of the application.
* We mark some part with "JUST-PUT-HERE:" to give instruction to user to create its own kernel.
**/
* In this file we implement a example kernel which is simply printing information
* about the cells and particles.
* It is recommanded to compile and execute this code in order to understand the behavior
* of the application.
* We mark some part with "JUST-PUT-HERE:" to give instruction to user to create its own kernel.
**/
// Include the FMM API (should be in a different folder for you)
#include "../Src/CScalfmmApi.h"
...
...
@@ -108,7 +109,7 @@ void my_Callback_P2M(void* cellData, void * leafData, FSize nbParticlesInLeaf, c
for
(
idxPart
=
0
;
idxPart
<
nbParticlesInLeaf
;
++
idxPart
){
double
*
position
=
&
my_data
->
insertedPositions
[
particleIndexes
[
idxPart
]
*
3
];
VerbosePrint
(
"
\t
particle idx %lld position %e/%e%e
\n
"
,
particleIndexes
[
idxPart
],
position
[
0
],
position
[
1
],
position
[
2
]);
position
[
0
],
position
[
1
],
position
[
2
]);
// JUST-PUT-HERE:
// Your real P2M computation
}
...
...
@@ -127,8 +128,8 @@ void my_Callback_M2M(int level, void* cellData, int childPosition, void* childDa
scalfmm_utils_parentChildPosition
(
childPosition
,
childFullPosition
);
VerbosePrint
(
"Doing a M2M at level %d, between cells %lld and %lld (position %d/%d/%d)
\n
"
,
level
,
my_cell
->
mortonIndex
,
my_child
->
mortonIndex
,
childFullPosition
[
0
],
childFullPosition
[
1
],
childFullPosition
[
2
]);
level
,
my_cell
->
mortonIndex
,
my_child
->
mortonIndex
,
childFullPosition
[
0
],
childFullPosition
[
1
],
childFullPosition
[
2
]);
// JUST-PUT-HERE: your real M2M computation
}
...
...
@@ -145,8 +146,8 @@ void my_Callback_M2L(int level, void* cellData, int srcPosition, void* srcData,
scalfmm_utils_interactionPosition
(
srcPosition
,
interactionFullPosition
);
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
,
interactionFullPosition
[
0
],
interactionFullPosition
[
1
],
interactionFullPosition
[
2
]);
level
,
my_cell
->
mortonIndex
,
my_src_cell
->
mortonIndex
,
interactionFullPosition
[
0
],
interactionFullPosition
[
1
],
interactionFullPosition
[
2
]);
// JUST-PUT-HERE: Your M2L
}
...
...
@@ -178,8 +179,8 @@ void my_Callback_L2L(int level, void* cellData, int childPosition, void* childDa
scalfmm_utils_parentChildPosition
(
childPosition
,
childFullPosition
);
VerbosePrint
(
"Doing a L2L at level %d, between cells %lld and %lld (position %d/%d/%d)
\n
"
,
level
,
my_cell
->
mortonIndex
,
my_child
->
mortonIndex
,
childFullPosition
[
0
],
childFullPosition
[
1
],
childFullPosition
[
2
]);
level
,
my_cell
->
mortonIndex
,
my_child
->
mortonIndex
,
childFullPosition
[
0
],
childFullPosition
[
1
],
childFullPosition
[
2
]);
// JUST-PUT-HERE: Your L2L
}
...
...
@@ -198,7 +199,7 @@ void my_Callback_L2P(void* cellData, void * leafData, FSize nbParticlesInLeaf, c
//Store the number of cells that contribute to the far field of current cell.
my_data
->
arrayOfInfluence
[
particleIndexes
[
idxPart
]]
+=
my_cell
->
dataDown
;
VerbosePrint
(
"
\t
particle idx %lld position %e/%e%e
\n
"
,
particleIndexes
[
idxPart
],
position
[
0
],
position
[
1
],
position
[
2
]);
position
[
0
],
position
[
1
],
position
[
2
]);
// JUST-PUT-HERE: Your L2P
}
}
...
...
@@ -214,12 +215,12 @@ void my_Callback_P2P(void * targetLeaf, FSize nbParticlesInLeaf, const FSize* pa
double
*
position
=
&
my_data
->
insertedPositions
[
particleIndexes
[
idxPart
]
*
3
];
VerbosePrint
(
"
\t
Target >> particle idx %lld position %e/%e%e
\n
"
,
particleIndexes
[
idxPart
],
position
[
0
],
position
[
1
],
position
[
2
]);
position
[
0
],
position
[
1
],
position
[
2
]);
}
for
(
idxPart
=
0
;
idxPart
<
nbParticlesInSrc
;
++
idxPart
){
double
*
position
=
&
my_data
->
insertedPositions
[
particleIndexesSrc
[
idxPart
]
*
3
];
VerbosePrint
(
"
\t
Target >> Src idx %lld position %e/%e%e
\n
"
,
particleIndexesSrc
[
idxPart
],
position
[
0
],
position
[
1
],
position
[
2
]);
position
[
0
],
position
[
1
],
position
[
2
]);
}
for
(
idxPart
=
0
;
idxPart
<
nbParticlesInLeaf
;
++
idxPart
){
...
...
@@ -240,7 +241,7 @@ void my_Callback_P2PInner(void * targetLeaf, FSize nbParticlesInLeaf, const FSiz
my_data
->
arrayOfInfluence
[
particleIndexes
[
idxPart
]]
+=
nbParticlesInLeaf
-
1
;
double
*
position
=
&
my_data
->
insertedPositions
[
particleIndexes
[
idxPart
]
*
3
];
VerbosePrint
(
"
\t
particle idx %lld position %e/%e%e
\n
"
,
particleIndexes
[
idxPart
],
position
[
0
],
position
[
1
],
position
[
2
]);
position
[
0
],
position
[
1
],
position
[
2
]);
// JUST-PUT-HERE: another loop to have all particles interacting with
// the other from the same leaf
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment