Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
28464609
Commit
28464609
authored
Apr 10, 2015
by
PIACIBELLO Cyrille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for chebInterface and hibox
parent
970a66a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
10 deletions
+55
-10
Addons/CKernelApi/Src/CScalfmmApi.h
Addons/CKernelApi/Src/CScalfmmApi.h
+12
-1
Addons/CKernelApi/Src/FInterEngine.hpp
Addons/CKernelApi/Src/FInterEngine.hpp
+2
-2
Addons/CKernelApi/Src/FScalFMMEngine.hpp
Addons/CKernelApi/Src/FScalFMMEngine.hpp
+9
-3
Addons/CKernelApi/Src/FScalfmmApiInit.cpp
Addons/CKernelApi/Src/FScalfmmApiInit.cpp
+8
-4
Addons/CKernelApi/Src/FUserKernelEngine.hpp
Addons/CKernelApi/Src/FUserKernelEngine.hpp
+22
-0
Src/Kernels/Chebyshev/FChebInterface.h
Src/Kernels/Chebyshev/FChebInterface.h
+2
-0
No files found.
Addons/CKernelApi/Src/CScalfmmApi.h
View file @
28464609
...
...
@@ -447,6 +447,17 @@ typedef void (*Callback_P2PFull)(FSize nbParticles, const FSize* particleIndexes
typedef
void
(
*
Callback_P2PInner
)(
FSize
nbParticles
,
const
FSize
*
particleIndexes
,
void
*
userData
);
/**
* @brief Function to be filled by user's method to reset a user's cell
* @param level level of the cell.
* @param morton_index morton index of the cell to be allocated.
* @param tree_position int[3] position inside the tree (number of boxes in
* each direction)
* @param spatial_position double[3] center of the cell
* @param usercell ptr to user's cell
*/
typedef
void
(
*
Callback_reset_cell
)(
int
level
,
long
long
morton_index
,
int
*
tree_position
,
double
*
spatial_position
,
void
*
userCell
);
/**
* @brief Structure containing callbacks to fill in order to define
...
...
@@ -522,7 +533,7 @@ void scalfmm_dealloc_handle(scalfmm_handle handle, Callback_free_cell cellDestro
* and local development, forces and potentials)
* @param Handle scalfmm_handle provided by scalfmm_init.
*/
void
scalfmm_reset_tree
(
scalfmm_handle
handle
);
void
scalfmm_reset_tree
(
scalfmm_handle
handle
,
Callback_reset_cell
cellReseter
);
/**
* @brief This function shouldn't be there !! display information
...
...
Addons/CKernelApi/Src/FInterEngine.hpp
View file @
28464609
...
...
@@ -359,7 +359,7 @@ public:
//get back the potentials
void
get_potentials
(
int
nbPotentials
,
double
*
potentialsToFill
){
octree
->
forEachLeaf
([
&
](
LeafClass
*
leaf
){
ContainerClass
*
sources
=
leaf
->
get
Src
();
ContainerClass
*
sources
=
leaf
->
get
Targets
();
const
FVector
<
FSize
>&
indexes
=
leaf
->
getTargets
()
->
getIndexes
();
FSize
nbPartThere
=
sources
->
getNbParticles
();
for
(
FSize
idxPart
=
0
;
idxPart
<
nbPartThere
;
++
idxPart
){
...
...
@@ -519,7 +519,7 @@ public:
}
//Simple call to FScalFMMEngine method with good template
void
reset_tree
(){
void
reset_tree
(
Callback_reset_cell
/*not used*/
){
generic_reset_tree
<
FReal
,
ContainerClass
,
InterCell
,
LeafClass
>
(
octree
);
}
...
...
Addons/CKernelApi/Src/FScalFMMEngine.hpp
View file @
28464609
...
...
@@ -202,7 +202,7 @@ public:
FAssertLF
(
0
,
"No tree instancied, exiting ...
\n
"
);
}
virtual
void
reset_tree
(){
virtual
void
reset_tree
(
Callback_reset_cell
cellReset
){
}
template
<
class
FReal
,
class
ContainerClass
,
class
CellClass
,
class
LeafClass
>
...
...
@@ -242,6 +242,8 @@ public:
FAssertLF
(
0
,
"No kernel set, cannot execute anything, exiting ...
\n
"
);
}
virtual
void
hibox_Rinflu_display
(
FSize
nbPartIn
,
double
*
Rinflu
){
}
};
...
...
@@ -441,8 +443,12 @@ extern "C" void scalfmm_utils_interactionPosition(int interactionPosition, int*
}
extern
"C"
void
scalfmm_reset_tree
(
scalfmm_handle
Handle
){
((
ScalFmmCoreHandle
*
)
Handle
)
->
engine
->
reset_tree
();
extern
"C"
void
scalfmm_reset_tree
(
scalfmm_handle
Handle
,
Callback_reset_cell
cellReseter
){
((
ScalFmmCoreHandle
*
)
Handle
)
->
engine
->
reset_tree
(
cellReseter
);
}
extern
"C"
void
scalfmm_hibox_Rinflu_display
(
scalfmm_handle
Handle
,
FSize
nbPart
,
double
*
Rinflu
){
((
ScalFmmCoreHandle
*
)
Handle
)
->
engine
->
hibox_Rinflu_display
(
nbPart
,
Rinflu
);
}
#endif
Addons/CKernelApi/Src/FScalfmmApiInit.cpp
View file @
28464609
...
...
@@ -250,7 +250,7 @@ extern "C" void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* p
forcesToFill
[
indexes
[
idxPart
]
*
3
+
0
]
+=
tempContainer
->
getForcesX
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
1
]
+=
tempContainer
->
getForcesY
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
2
]
+=
tempContainer
->
getForcesZ
()[
idxPart
];
potentialsToFill
[
indexes
[
idxPart
]]
=+
tempContainer
->
getPotentials
()[
idxPart
];
potentialsToFill
[
indexes
[
idxPart
]]
+=
tempContainer
->
getPotentials
()[
idxPart
];
}
delete
tempContainer
;
...
...
@@ -317,7 +317,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
forcesToFill
[
indexes
[
idxPart
]
*
3
+
0
]
+=
tempContTarget
->
getForcesX
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
1
]
+=
tempContTarget
->
getForcesY
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
2
]
+=
tempContTarget
->
getForcesZ
()[
idxPart
];
potentialsToFill
[
indexes
[
idxPart
]]
=+
tempContTarget
->
getPotentials
()[
idxPart
];
potentialsToFill
[
indexes
[
idxPart
]]
+=
tempContTarget
->
getPotentials
()[
idxPart
];
}
//Note that sources are also modified.
...
...
@@ -329,7 +329,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
forcesToFill
[
indexesSource
[
idxSourcePart
]
*
3
+
0
]
+=
tempContSources
[
idSource
]
->
getForcesX
()[
idxSourcePart
];
forcesToFill
[
indexesSource
[
idxSourcePart
]
*
3
+
1
]
+=
tempContSources
[
idSource
]
->
getForcesY
()[
idxSourcePart
];
forcesToFill
[
indexesSource
[
idxSourcePart
]
*
3
+
2
]
+=
tempContSources
[
idSource
]
->
getForcesZ
()[
idxSourcePart
];
potentialsToFill
[
indexesSource
[
idxSourcePart
]]
=+
tempContSources
[
idSource
]
->
getPotentials
()[
idxSourcePart
];
potentialsToFill
[
indexesSource
[
idxSourcePart
]]
+=
tempContSources
[
idSource
]
->
getPotentials
()[
idxSourcePart
];
}
}
...
...
@@ -340,6 +340,10 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
delete
tempContTarget
;
}
void
ChebCell_reset
(
int
level
,
long
long
morton_index
,
int
*
tree_position
,
double
*
spatial_position
,
void
*
userCell
){
ChebCellStruct
*
cellStruct
=
reinterpret_cast
<
ChebCellStruct
*>
(
userCell
);
FChebCell
<
double
,
7
>*
chebCell
=
cellStruct
->
cell
;
chebCell
->
resetToInitialState
();
}
#endif
Addons/CKernelApi/Src/FUserKernelEngine.hpp
View file @
28464609
...
...
@@ -492,6 +492,28 @@ public:
}
void
reset_tree
(
Callback_reset_cell
cellReset
){
double
boxwidth
=
octree
->
getBoxWidth
();
FPoint
<
FReal
>
BoxCenter
=
octree
->
getBoxCenter
();
double
boxCorner
[
3
];
boxCorner
[
0
]
=
BoxCenter
.
getX
()
-
boxwidth
/
2.0
;
boxCorner
[
1
]
=
BoxCenter
.
getY
()
-
boxwidth
/
2.0
;
boxCorner
[
2
]
=
BoxCenter
.
getZ
()
-
boxwidth
/
2.0
;
//apply user function reset on each user's cell
octree
->
forEachCellWithLevel
([
&
](
CoreCell
*
currCell
,
const
int
currLevel
){
if
(
currCell
->
getContainer
()){
FTreeCoordinate
currCoord
=
currCell
->
getCoordinate
();
int
arrayCoord
[
3
]
=
{
currCoord
.
getX
(),
currCoord
.
getY
(),
currCoord
.
getZ
()};
MortonIndex
currMorton
=
currCoord
.
getMortonIndex
(
currLevel
);
double
position
[
3
];
position
[
0
]
=
boxCorner
[
0
]
+
currCoord
.
getX
()
*
boxwidth
/
double
(
1
<<
currLevel
);
position
[
1
]
=
boxCorner
[
1
]
+
currCoord
.
getY
()
*
boxwidth
/
double
(
1
<<
currLevel
);
position
[
2
]
=
boxCorner
[
2
]
+
currCoord
.
getZ
()
*
boxwidth
/
double
(
1
<<
currLevel
);
cellReset
(
currLevel
,
currMorton
,
arrayCoord
,
position
,
currCell
->
getContainer
());
}
});
}
void
intern_dealloc_handle
(
Callback_free_cell
userDeallocator
){
free_cell
(
userDeallocator
);
}
...
...
Src/Kernels/Chebyshev/FChebInterface.h
View file @
28464609
...
...
@@ -56,6 +56,8 @@ void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* particleInde
void
ChebKernel_P2P
(
FSize
nbParticles
,
const
FSize
*
particleIndexes
,
const
FSize
*
sourceParticleIndexes
[
27
],
FSize
sourceNbPart
[
27
],
void
*
userData
);
void
ChebCell_reset
(
int
level
,
long
long
morton_index
,
int
*
tree_position
,
double
*
spatial_position
,
void
*
userCell
);
typedef
struct
myUserDatas
{
ChebKernelStruct
*
kernelStruct
;
double
*
insertedPositions
;
...
...
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