Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
ScalFMM
Commits
e96d276b
Commit
e96d276b
authored
12 years ago
by
PIACIBELLO Cyrille
Browse files
Options
Downloads
Patches
Plain Diff
Taylor Kernel for 1/R compile
parent
43de4712
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Src/Kernels/Taylor/FTaylorKernel.hpp
+24
-25
24 additions, 25 deletions
Src/Kernels/Taylor/FTaylorKernel.hpp
Tests/Kernels/testTaylorKernel.cpp
+52
-0
52 additions, 0 deletions
Tests/Kernels/testTaylorKernel.cpp
with
76 additions
and
25 deletions
Src/Kernels/Taylor/FTaylorKernel.hpp
+
24
−
25
View file @
e96d276b
...
...
@@ -175,7 +175,7 @@ private:
FReal
*
yetComputed
)
{
int
idx
=
powerToIdx
(
a
,
b
,
c
);
if
(
yetComputed
[
idx
]
=!
0
)
if
(
(
yetComputed
[
idx
]
=!
0
)
)
{
return
yetComputed
[
idx
];}
else
{
...
...
@@ -188,29 +188,29 @@ private:
int
idxt
;
if
(
a
>
0
){
idxt
=
powerToIdx
(
a
-
1
,
b
,
c
);
temp_value
+=
(
2
*
(
a
+
b
+
c
)
-
1
)
*
dx
*
yetComputed
[
idxt
]
*
a
/
fct
;
temp_value
+=
((
FReal
)
(
2
*
(
a
+
b
+
c
)
-
1
)
)
*
dx
*
yetComputed
[
idxt
]
*
FReal
(
a
)
/
fct
;
if
(
a
>
1
){
idxt
=
powerToIdx
(
a
-
2
,
b
,
c
);
temp_value
-=
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
a
*
(
a
-
1
)
/
fct
;
temp_value
-=
FReal
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
FReal
(
a
*
(
a
-
1
)
)
/
fct
;
}
}
if
(
b
>
0
){
idxt
=
powerToIdx
(
a
,
b
-
1
,
c
);
temp_value
+=
(
2
*
(
a
+
b
+
c
)
-
1
)
*
dy
*
yetComputed
[
idxt
]
*
b
/
fct
;
temp_value
+=
FReal
(
2
*
(
a
+
b
+
c
)
-
1
)
*
dy
*
yetComputed
[
idxt
]
*
FReal
(
b
)
/
fct
;
if
(
b
>
1
){
idxt
=
powerToIdx
(
a
,
b
-
2
,
c
);
temp_value
-=
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
b
*
(
b
-
1
)
/
fct
;
temp_value
-=
FReal
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
FReal
(
b
*
(
b
-
1
)
)
/
fct
;
}
}
if
(
c
>
0
){
idxt
=
powerToIdx
(
a
,
b
,
c
-
1
);
temp_value
+=
(
2
*
(
a
+
b
+
c
)
-
1
)
*
dz
*
yetComputed
[
idxt
]
*
c
/
fct
;
temp_value
+=
FReal
(
2
*
(
a
+
b
+
c
)
-
1
)
*
dz
*
yetComputed
[
idxt
]
*
FReal
(
c
)
/
fct
;
if
(
c
>
1
){
idxt
=
powerToIdx
(
a
,
b
,
c
-
2
);
temp_value
-=
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
c
*
(
c
-
1
)
/
fct
;
temp_value
-=
FReal
(
a
+
b
+
c
-
1
)
*
yetComputed
[
idxt
]
*
FReal
(
c
*
(
c
-
1
)
)
/
fct
;
}
}
FReal
coeff
=
(
a
+
b
+
c
)
*
dist
/
fct
;
FReal
coeff
=
FReal
(
a
+
b
+
c
)
*
dist
/
fct
;
temp_value
=
temp_value
/
coeff
;
yetComputed
[
idx
]
=
temp_value
;
return
temp_value
;
...
...
@@ -276,13 +276,13 @@ public:
coeff
=
fact
(
a
+
b
+
c
)
/
(
facto
*
facto
);
//Iterating over Particles
for
(
int
i
=
0
;
i
<
nbPart
;
i
++
){
for
(
int
i
dPart
=
0
;
i
dPart
<
nbPart
;
i
dPart
++
){
FReal
dx
=
cellCenter
.
getX
()
-
posX
[
i
];
FReal
dy
=
cellCenter
.
getY
()
-
posY
[
i
];
FReal
dz
=
cellCenter
.
getZ
()
-
posZ
[
i
];
FReal
dx
=
cellCenter
.
getX
()
-
posX
[
i
dPart
];
FReal
dy
=
cellCenter
.
getY
()
-
posY
[
i
dPart
];
FReal
dz
=
cellCenter
.
getZ
()
-
posZ
[
i
dPart
];
const
FReal
potential
=
phyValue
[
i
];
const
FReal
potential
=
phyValue
[
i
dPart
];
//Computation
FReal
value
=
FReal
(
0
);
...
...
@@ -317,7 +317,7 @@ public:
FReal
dy
=
0
;
FReal
dz
=
0
;
//Center point of parent cell
const
FPoint
cellCenter
=
getLeafCenter
(
pole
->
getCoordinate
());
//
const FPoint cellCenter = getLeafCenter(pole->getCoordinate());
//Iteration over the eight children
...
...
@@ -326,9 +326,9 @@ public:
{
if
(
child
[
idxChild
]){
//Set the distance between centers of cells
dz
=
(
2
*
(
1
&
idxChild
)
-
1
)
*
boxSize
;
dy
=
(
2
*
((
1
<<
1
)
&
idxChild
)
-
1
)
*
boxSize
;
dx
=
(
2
*
((
1
<<
2
)
&
idxChild
)
-
1
)
*
boxSize
;
dz
=
((
FReal
)
(
2
*
(
1
&
idxChild
)
-
1
)
)
*
boxSize
;
dy
=
((
FReal
)
(
2
*
((
1
<<
1
)
&
idxChild
)
-
1
)
)
*
boxSize
;
dx
=
((
FReal
)
(
2
*
((
1
<<
2
)
&
idxChild
)
-
1
)
)
*
boxSize
;
//Iteration over parent multipole array
FReal
*
mult
=
pole
->
getMultipole
();
...
...
@@ -344,7 +344,7 @@ public:
//involved in the computation of the parent multipole
for
(
idx_a
=
0
;
idx_a
<=
sum
;
++
idx_a
){
for
(
idx_b
=
0
;
idx_b
<=
sum
-
a
;
++
idx_b
){
for
(
idx_
a
=
0
;
idx_
a
<
sum
-
(
a
+
b
)
;
++
idx_
a
){
for
(
idx_
c
=
0
;
idx_
c
<
sum
-
(
a
+
b
)
;
++
idx_
c
){
//Computation
//Child multipole involved
idMultiChild
=
powerToIdx
(
idx_a
,
idx_b
,
idx_c
);
...
...
@@ -372,7 +372,7 @@ public:
*/
void
M2L
(
CellClass
*
const
FRestrict
local
,
const
CellClass
*
distantNeighbors
[
343
],
const
int
size
,
const
int
inLevel
)
const
int
/*
size
*/
,
const
int
/*
inLevel
*/
)
{
//Iteration over distantNeighbors
int
idxNeigh
;
...
...
@@ -427,7 +427,7 @@ public:
*/
void
L2L
(
const
CellClass
*
const
FRestrict
local
,
CellClass
*
FRestrict
*
const
FRestrict
child
,
const
int
inLevel
)
const
int
/*
inLevel
*/
)
{
FPoint
locCenter
=
getLeafCenter
(
local
->
getCoordinate
());
FReal
dx
;
...
...
@@ -493,8 +493,7 @@ public:
const
FReal
*
iterLocal
=
local
->
getLocal
();
for
(
int
j
=
0
;
j
<
SizeVector
;
j
++
){
int
idx
=
powerToIdx
(
a
,
b
,
c
);
FReal
locForce
=
iterLocal
[
j
];
//Application of forces
forceX
[
i
]
=
FMath
::
pow
(
dx
,
a
)
*
locForce
;
...
...
@@ -515,9 +514,9 @@ public:
* @param directNeighborsParticles the particles from direct neighbors (this is an array of list)
* @param size the number of direct neighbors
*/
void
P2P
(
const
FTreeCoordinate
&
inLeafPosition
,
ContainerClass
*
const
FRestrict
targets
,
const
ContainerClass
*
const
FRestrict
sources
,
ContainerClass
*
const
directNeighborsParticles
[
27
],
const
int
size
)
void
P2P
(
const
FTreeCoordinate
&
/*
inLeafPosition
*/
,
ContainerClass
*
const
FRestrict
targets
,
const
ContainerClass
*
const
FRestrict
/*
sources
*/
,
ContainerClass
*
const
directNeighborsParticles
[
27
],
const
int
/*
size
*/
)
{
FP2P
::
FullMutual
(
targets
,
directNeighborsParticles
,
14
);
}
...
...
This diff is collapsed.
Click to expand it.
Src
/Kernels/
Taylor/FTaylorParticle.h
pp
→
Tests
/Kernels/
testTaylorKernel.c
pp
+
52
−
0
View file @
e96d276b
...
...
@@ -13,38 +13,40 @@
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FTAYLORPARTICLE_HPP
#define FTAYLORPARTICLE_HPP
#include
"../../Extensions/FExtendForces.hpp"
#include
"../../Extensions/FExtendPotential.hpp"
#include
"../../Extensions/FExtendPosition.hpp"
/**
* @author Cyrille Piacibello
* @class FTaylorParticle
*
* This class is a particle used for the Taylor Kernel
*/
class
FTaylorParticle
:
public
FExtendPotential
,
public
FFmaParticle
,
public
FExtendPosition
{
public:
/** Save current object */
void
save
(
FBufferWriter
&
buffer
)
const
{
FExtendPosition
::
save
(
buffer
);
FFmaParticle
::
save
(
buffer
);
FExtendPotential
::
save
(
buffer
);
}
/** Retrieve current object */
void
restore
(
FBufferReader
&
buffer
)
{
FExtendPosition
::
restore
(
buffer
);
FFmaParticle
::
restore
(
buffer
);
FExtendPotential
::
restore
(
buffer
);
}
};
#endif
#include
<string>
#include
"../../Src/Utils/FPoint.hpp"
#include
"../../Src/Utils/FDebug.hpp"
#include
"../../Src/Utils/FMath.hpp"
#include
"../../Src/Kernels/Taylor/FTaylorCell.hpp"
#include
"../../Src/Kernels/Taylor/FTaylorKernel.hpp"
#include
"../../Src/Kernels/P2P/FP2PParticleContainer.hpp"
#include
"../../Src/Components/FSimpleLeaf.hpp"
#include
"../../Src/Containers/FVector.hpp"
#include
"../../Src/Containers/FOctree.hpp"
#include
"../../Src/Core/FFmmAlgorithm.hpp"
#include
"../../Src/Core/FFmmAlgorithmThread.hpp"
#include
"../../Src/Core/FFmmAlgorithmTask.hpp"
int
main
(
int
/*argc*/
,
char
**
/*argv[]*/
){
const
int
P
=
10
;
const
int
order
=
1
;
FPoint
centerBox
=
FPoint
(
0
,
0
,
0
);
typedef
FTaylorCell
<
P
,
order
>
CellClass
;
typedef
FP2PParticleContainer
ContainerClass
;
typedef
FTaylorKernel
<
CellClass
,
ContainerClass
,
P
,
order
>
KernelClass
;
typedef
FSimpleLeaf
<
ContainerClass
>
LeafClass
;
typedef
FOctree
<
CellClass
,
ContainerClass
,
LeafClass
>
OctreeClass
;
KernelClass
kernel
(
9
,
1.0
,
centerBox
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment