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
f9ebf2ba
Commit
f9ebf2ba
authored
Jun 05, 2013
by
PIACIBELLO Cyrille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel corrected
parent
942183b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
22 deletions
+56
-22
Src/Kernels/Taylor/FTaylorCell.hpp
Src/Kernels/Taylor/FTaylorCell.hpp
+4
-4
Src/Kernels/Taylor/FTaylorKernel.hpp
Src/Kernels/Taylor/FTaylorKernel.hpp
+51
-17
Src/Kernels/Taylor/FTaylorParticle.hpp
Src/Kernels/Taylor/FTaylorParticle.hpp
+1
-1
No files found.
Src/Kernels/Taylor/FTaylorCell.hpp
View file @
f9ebf2ba
...
...
@@ -36,9 +36,9 @@ protected:
static
const
int
LocalSize
=
((
P
+
1
)
*
(
P
+
2
)
*
(
P
+
3
))
/
6
;
//Multipole vector
FVector
<
FReal
>
multipole_exp
=
FVector
(
MultipoleSize
);
FVector
<
FReal
>
multipole_exp
=
FVector
<
FReal
>
(
MultipoleSize
);
//Local vector
FVector
<
FReal
>
local_exp
=
FVector
(
LocalSize
);
FVector
<
FReal
>
local_exp
=
FVector
<
FReal
>
(
LocalSize
);
public:
/**
...
...
@@ -48,13 +48,13 @@ public:
}
//Get multipole Vector
FVector
*
getMultipole
(
void
)
FVector
<
FReal
>
*
getMultipole
(
void
)
{
return
multipole_exp
;
}
//Get local Vector
FVector
*
getLocal
(
void
)
FVector
<
FReal
>
*
getLocal
(
void
)
{
return
local_exp
;
}
...
...
Src/Kernels/Taylor/FTaylorKernel.hpp
View file @
f9ebf2ba
...
...
@@ -17,7 +17,7 @@
#define FTAYLORKERNEL_HPP
#include "../../Components/FAbstractKernels.hpp"
#include "../../Utils/FMemUtils.hpp"
/**
* @author Cyrille Piacibello
...
...
@@ -29,8 +29,8 @@
*/
template
<
class
ParticleClass
,
class
CellClass
,
class
ContainerClass
,
int
P
>
class
FTaylorKernel
:
public
FAbstractKernel
<
ParticleClass
,
CellClass
,
ContainerClass
>
{
template
<
class
ParticleClass
,
class
CellClass
,
class
ContainerClass
,
int
P
>
class
FTaylorKernel
:
public
FAbstractKernel
s
<
ParticleClass
,
CellClass
,
ContainerClass
>
{
private:
//Size of the multipole and local vectors
...
...
@@ -62,7 +62,7 @@ private:
* Result : ...,[2,0,0],[1,1,0],[1,0,1]... 3-tuple are sorted
* by size and alphabetical order.
*/
void
incPowers
(
int
*
const
restrict
a
,
int
*
const
restrict
b
,
int
*
const
rest
ict
c
)
void
incPowers
(
int
*
const
FRestrict
a
,
int
*
const
FRestrict
b
,
int
*
const
FRestr
ict
c
)
{
int
t
=
(
*
a
)
+
(
*
b
)
+
(
*
c
);
if
(
t
==
0
)
...
...
@@ -144,9 +144,9 @@ private:
tab
[
0
]
=
1
/
(
FMath
::
Sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
));
FReal
R3
=
tab
[
0
]
/
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
);
tab
[
1
]
=
temp
*
dx
;
tab
[
2
]
=
temp
*
dy
;
tab
[
3
]
=
temp
*
dz
;
tab
[
1
]
=
dx
*
R3
;
tab
[
2
]
=
dy
*
R3
;
tab
[
3
]
=
dz
*
R3
;
FReal
R5
=
R3
/
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
);
tab
[
4
]
=
R3
-
dx
*
dx
*
R5
;
tab
[
5
]
=
(
-
dx
)
*
dy
*
R5
;
...
...
@@ -361,15 +361,15 @@ public:
{
//Iteration over distantNeighbors
int
idxNeigh
;
FPoint
locCenter
=
local
.
getLeafCenter
(
);
FPoint
locCenter
=
getLeafCenter
(
local
.
getCoordinate
()
);
for
(
idxNeigh
=
0
;
idxNeigh
<
343
;
idxNeigh
++
){
//Need to test if current neighbor is one of the interaction list
if
(
inIteraction
s
[
idxNeigh
]){
if
(
distantNeighbor
s
[
idxNeigh
]){
//Derivatives are computed iteratively
FReal
yetComputed
[
SizeVector
];
//TODO C'est faux, k+n>p...
FReal
yetComputed
[
(
2
*
P
+
1
)
*
(
2
*
P
+
2
)
*
(
2
*
P
+
3
)
/
6
];
FMemUtils
::
memset
(
yetComputed
,
0
,
SizeVector
*
sizeof
(
FReal
(
0
)));
initDerivative
(
locCenter
,
inIteractions
[
idxNeigh
].
getLeafCenter
(
),
yetComputed
);
initDerivative
(
locCenter
,
getLeafCenter
(
distantNeighbors
[
idxNeigh
].
getCoordinate
),
yetComputed
);
//Iteration over Multipole / Local
int
al
=
0
,
bl
=
0
,
cl
=
0
;
...
...
@@ -384,9 +384,9 @@ public:
//Iterating over multipole array : k
while
(
iterMult
.
hasNotFinished
()){
FReal
data
=
computeDerivative
(
al
+
am
,
bl
+
bm
,
cl
+
cm
,
locCenter
,
inIteractions
[
idxNeigh
].
getLeafCenter
(
),
yetComputed
);
FReal
data
=
computeDerivative
(
al
+
am
,
bl
+
bm
,
cl
+
cm
,
locCenter
,
getLeafCenter
(
distantNeighbors
[
idxNeigh
].
getCoordinate
()
),
yetComputed
);
data
*=
iterMult
.
data
()
/
fctl
;
iterLocal
.
setData
();
iterLocal
.
setData
(
data
);
//updating a,b,c and iterator
incPowers
(
&
am
,
&
bm
,
&
cm
);
...
...
@@ -404,7 +404,7 @@ public:
/**
*@brief
Divide and t
ranslate the local expansion of parent cell to child cell
*@brief
T
ranslate the local expansion of parent cell to child cell
*
*/
void
L2L
(
const
CellClass
*
const
FRestrict
local
,
...
...
@@ -422,9 +422,43 @@ public:
void
L2P
(
const
CellClass
*
const
local
,
ContainerClass
*
const
particles
)
{
}
FPoint
locCenter
=
getLeafCenter
(
local
.
getCoordinate
());
//Iterator over particles
typename
ContainerClass
::
ConstBasicIterator
iterParticle
(
*
particles
);
while
(
iterParticle
.
hasNotFinished
()){
FPoint
dist
=
iterParticle
.
getPosition
()
-
locCenter
;
FReal
dx
=
dist
.
getX
();
FReal
dy
=
dist
.
getY
();
FReal
dz
=
dist
.
getZ
();
FReal
forceX
;
FReal
forceY
;
FReal
forceZ
;
int
a
=
0
,
b
=
0
,
c
=
0
;
//Iteration over Local array
typename
ContainerClass
::
BasicIterator
iterLocal
(
local
.
getLocal
());
while
(
iterLocal
.
hasNotFinished
()){
int
idx
=
powerToIdx
(
a
,
b
,
c
);
//Computation of forces
FReal
locForce
=
iterLocal
.
data
();
forceX
=
FMath
::
pow
(
dx
,
a
)
*
locForce
;
forceY
=
FMath
::
pow
(
dy
,
b
)
*
locForce
;
forceZ
=
FMath
::
pow
(
dz
,
c
)
*
locForce
;
//Application of forces
(
iterParticle
.
data
()).
incForces
(
forceX
,
forceY
,
forceZ
);
incPowers
(
&
a
,
&
b
,
&
c
);
iterLocal
.
gotoNext
();
}
iterParticle
.
gotoNext
();
}
}
};
#endif
FTAYLORKERNEL_HPP
#endif
Src/Kernels/Taylor/FTaylorParticle.hpp
View file @
f9ebf2ba
...
...
@@ -47,4 +47,4 @@ public:
};
#endif
FTAYLORPARTICLE_HPP
#endif
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