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
40f46768
Commit
40f46768
authored
Sep 04, 2014
by
PIACIBELLO Cyrille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change FComplexe to FComplex in all files and name of files
parent
077ce97b
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
2237 additions
and
2123 deletions
+2237
-2123
Src/Kernels/Interpolation/FInterpCell.hpp
Src/Kernels/Interpolation/FInterpCell.hpp
+12
-12
Src/Kernels/P2P/FP2P.hpp
Src/Kernels/P2P/FP2P.hpp
+550
-550
Src/Kernels/Rotation/FRotationCell.hpp
Src/Kernels/Rotation/FRotationCell.hpp
+8
-8
Src/Kernels/Rotation/FRotationKernel.hpp
Src/Kernels/Rotation/FRotationKernel.hpp
+921
-921
Src/Kernels/Rotation/FRotationOriginalKernel.hpp
Src/Kernels/Rotation/FRotationOriginalKernel.hpp
+23
-23
Src/Kernels/Spherical/FAbstractSphericalKernel.hpp
Src/Kernels/Spherical/FAbstractSphericalKernel.hpp
+34
-34
Src/Kernels/Spherical/FHarmonic.hpp
Src/Kernels/Spherical/FHarmonic.hpp
+15
-15
Src/Kernels/Spherical/FSphericalBlasKernel.hpp
Src/Kernels/Spherical/FSphericalBlasKernel.hpp
+126
-126
Src/Kernels/Spherical/FSphericalBlockBlasKernel.hpp
Src/Kernels/Spherical/FSphericalBlockBlasKernel.hpp
+26
-26
Src/Kernels/Spherical/FSphericalCell.hpp
Src/Kernels/Spherical/FSphericalCell.hpp
+12
-12
Src/Kernels/Spherical/FSphericalKernel.hpp
Src/Kernels/Spherical/FSphericalKernel.hpp
+127
-127
Src/Kernels/Spherical/FSphericalRotationKernel.hpp
Src/Kernels/Spherical/FSphericalRotationKernel.hpp
+43
-43
Src/Kernels/Uniform/FUnifCell.hpp
Src/Kernels/Uniform/FUnifCell.hpp
+12
-12
Src/Kernels/Uniform/FUnifDenseKernel.hpp
Src/Kernels/Uniform/FUnifDenseKernel.hpp
+1
-1
Src/Kernels/Uniform/FUnifKernel.hpp
Src/Kernels/Uniform/FUnifKernel.hpp
+1
-1
Src/Kernels/Uniform/FUnifM2LHandler.hpp
Src/Kernels/Uniform/FUnifM2LHandler.hpp
+18
-18
Src/Kernels/Uniform/FUnifSymKernel.hpp
Src/Kernels/Uniform/FUnifSymKernel.hpp
+13
-13
Src/Kernels/Uniform/FUnifSymM2LHandler.hpp
Src/Kernels/Uniform/FUnifSymM2LHandler.hpp
+12
-12
Src/Kernels/Uniform/FUnifTensorialKernel.hpp
Src/Kernels/Uniform/FUnifTensorialKernel.hpp
+1
-1
Src/Kernels/Uniform/FUnifTensorialM2LHandler.hpp
Src/Kernels/Uniform/FUnifTensorialM2LHandler.hpp
+22
-22
Src/Utils/FComplex.hpp
Src/Utils/FComplex.hpp
+23
-23
Src/Utils/FDft.hpp
Src/Utils/FDft.hpp
+25
-25
Src/Utils/FMpi.hpp
Src/Utils/FMpi.hpp
+2
-2
Tests/Utils/testFFTW.cpp
Tests/Utils/testFFTW.cpp
+4
-4
Tests/Utils/testFFTWMultidim.cpp
Tests/Utils/testFFTWMultidim.cpp
+4
-4
Tests/Utils/testFastDiscreteConvolution.cpp
Tests/Utils/testFastDiscreteConvolution.cpp
+5
-5
Tests/Utils/testUnifInterpolator.cpp
Tests/Utils/testUnifInterpolator.cpp
+7
-7
Tests/Utils/testUnifTensorialInterpolator.cpp
Tests/Utils/testUnifTensorialInterpolator.cpp
+8
-8
UTests/utestMpiTreeBuilder.cpp
UTests/utestMpiTreeBuilder.cpp
+23
-17
UTests/utestRotation.cpp
UTests/utestRotation.cpp
+60
-37
UTests/utestSphericalDirect.cpp
UTests/utestSphericalDirect.cpp
+99
-14
No files found.
Src/Kernels/Interpolation/FInterpCell.hpp
View file @
40f46768
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "../../Components/FBasicCell.hpp"
#include "../../Components/FBasicCell.hpp"
#include "../../Extensions/FExtendCellType.hpp"
#include "../../Extensions/FExtendCellType.hpp"
#include "../../Utils/FComplex
e
.hpp"
#include "../../Utils/FComplex.hpp"
/**
/**
* @author Pierre Blanchard (pierre.blanchard@inria.fr)
* @author Pierre Blanchard (pierre.blanchard@inria.fr)
...
@@ -51,17 +51,17 @@ class FInterpCell : public FBasicCell
...
@@ -51,17 +51,17 @@ class FInterpCell : public FBasicCell
FReal
multipole_exp
[
NRHS
*
NVALS
*
VectorSize
];
//< Multipole expansion
FReal
multipole_exp
[
NRHS
*
NVALS
*
VectorSize
];
//< Multipole expansion
FReal
local_exp
[
NLHS
*
NVALS
*
VectorSize
];
//< Local expansion
FReal
local_exp
[
NLHS
*
NVALS
*
VectorSize
];
//< Local expansion
// PB: Store multipole and local expansion in Fourier space
// PB: Store multipole and local expansion in Fourier space
FComplex
e
transformed_multipole_exp
[
NRHS
*
NVALS
*
TransformedVectorSize
];
FComplex
transformed_multipole_exp
[
NRHS
*
NVALS
*
TransformedVectorSize
];
FComplex
e
transformed_local_exp
[
NLHS
*
NVALS
*
TransformedVectorSize
];
FComplex
transformed_local_exp
[
NLHS
*
NVALS
*
TransformedVectorSize
];
public:
public:
FInterpCell
(){
FInterpCell
(){
memset
(
multipole_exp
,
0
,
sizeof
(
FReal
)
*
NRHS
*
NVALS
*
VectorSize
);
memset
(
multipole_exp
,
0
,
sizeof
(
FReal
)
*
NRHS
*
NVALS
*
VectorSize
);
memset
(
local_exp
,
0
,
sizeof
(
FReal
)
*
NLHS
*
NVALS
*
VectorSize
);
memset
(
local_exp
,
0
,
sizeof
(
FReal
)
*
NLHS
*
NVALS
*
VectorSize
);
memset
(
transformed_multipole_exp
,
0
,
memset
(
transformed_multipole_exp
,
0
,
sizeof
(
FComplex
e
)
*
NRHS
*
NVALS
*
TransformedVectorSize
);
sizeof
(
FComplex
)
*
NRHS
*
NVALS
*
TransformedVectorSize
);
memset
(
transformed_local_exp
,
0
,
memset
(
transformed_local_exp
,
0
,
sizeof
(
FComplex
e
)
*
NLHS
*
NVALS
*
TransformedVectorSize
);
sizeof
(
FComplex
)
*
NLHS
*
NVALS
*
TransformedVectorSize
);
}
}
~
FInterpCell
()
{}
~
FInterpCell
()
{}
...
@@ -90,20 +90,20 @@ public:
...
@@ -90,20 +90,20 @@ public:
}
}
/** Get Transformed Multipole */
/** Get Transformed Multipole */
const
FComplex
e
*
getTransformedMultipole
(
const
int
inRhs
)
const
{
const
FComplex
*
getTransformedMultipole
(
const
int
inRhs
)
const
{
return
this
->
transformed_multipole_exp
+
inRhs
*
TransformedVectorSize
;
return
this
->
transformed_multipole_exp
+
inRhs
*
TransformedVectorSize
;
}
}
/** Get Transformed Local */
/** Get Transformed Local */
const
FComplex
e
*
getTransformedLocal
(
const
int
inRhs
)
const
{
const
FComplex
*
getTransformedLocal
(
const
int
inRhs
)
const
{
return
this
->
transformed_local_exp
+
inRhs
*
TransformedVectorSize
;
return
this
->
transformed_local_exp
+
inRhs
*
TransformedVectorSize
;
}
}
/** Get Transformed Multipole */
/** Get Transformed Multipole */
FComplex
e
*
getTransformedMultipole
(
const
int
inRhs
){
FComplex
*
getTransformedMultipole
(
const
int
inRhs
){
return
this
->
transformed_multipole_exp
+
inRhs
*
TransformedVectorSize
;
return
this
->
transformed_multipole_exp
+
inRhs
*
TransformedVectorSize
;
}
}
/** Get Transformed Local */
/** Get Transformed Local */
FComplex
e
*
getTransformedLocal
(
const
int
inRhs
){
FComplex
*
getTransformedLocal
(
const
int
inRhs
){
return
this
->
transformed_local_exp
+
inRhs
*
TransformedVectorSize
;
return
this
->
transformed_local_exp
+
inRhs
*
TransformedVectorSize
;
}
}
...
@@ -117,9 +117,9 @@ public:
...
@@ -117,9 +117,9 @@ public:
memset
(
multipole_exp
,
0
,
sizeof
(
FReal
)
*
NRHS
*
NVALS
*
VectorSize
);
memset
(
multipole_exp
,
0
,
sizeof
(
FReal
)
*
NRHS
*
NVALS
*
VectorSize
);
memset
(
local_exp
,
0
,
sizeof
(
FReal
)
*
NLHS
*
NVALS
*
VectorSize
);
memset
(
local_exp
,
0
,
sizeof
(
FReal
)
*
NLHS
*
NVALS
*
VectorSize
);
memset
(
transformed_multipole_exp
,
0
,
memset
(
transformed_multipole_exp
,
0
,
sizeof
(
FComplex
e
)
*
NRHS
*
NVALS
*
TransformedVectorSize
);
sizeof
(
FComplex
)
*
NRHS
*
NVALS
*
TransformedVectorSize
);
memset
(
transformed_local_exp
,
0
,
memset
(
transformed_local_exp
,
0
,
sizeof
(
FComplex
e
)
*
NLHS
*
NVALS
*
TransformedVectorSize
);
sizeof
(
FComplex
)
*
NLHS
*
NVALS
*
TransformedVectorSize
);
}
}
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
...
@@ -171,7 +171,7 @@ public:
...
@@ -171,7 +171,7 @@ public:
}
}
static
constexpr
int
GetSize
(){
static
constexpr
int
GetSize
(){
return
(
NRHS
+
NLHS
)
*
NVALS
*
VectorSize
*
(
int
)
sizeof
(
FReal
)
+
(
NRHS
+
NLHS
)
*
NVALS
*
TransformedVectorSize
*
(
int
)
sizeof
(
FComplex
e
);
return
(
NRHS
+
NLHS
)
*
NVALS
*
VectorSize
*
(
int
)
sizeof
(
FReal
)
+
(
NRHS
+
NLHS
)
*
NVALS
*
TransformedVectorSize
*
(
int
)
sizeof
(
FComplex
);
}
}
...
...
Src/Kernels/P2P/FP2P.hpp
View file @
40f46768
This diff is collapsed.
Click to expand it.
Src/Kernels/Rotation/FRotationCell.hpp
View file @
40f46768
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#ifndef FROTATIONCELL_HPP
#ifndef FROTATIONCELL_HPP
#define FROTATIONCELL_HPP
#define FROTATIONCELL_HPP
#include "../../Utils/FComplex
e
.hpp"
#include "../../Utils/FComplex.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Extensions/FExtendCellType.hpp"
#include "../../Extensions/FExtendCellType.hpp"
...
@@ -43,9 +43,9 @@ protected:
...
@@ -43,9 +43,9 @@ protected:
static
const
int
LocalSize
=
((
P
+
2
)
*
(
P
+
1
))
/
2
;
// Artimethique suite (n+1)*n/2
static
const
int
LocalSize
=
((
P
+
2
)
*
(
P
+
1
))
/
2
;
// Artimethique suite (n+1)*n/2
//< Multipole vector (static memory)
//< Multipole vector (static memory)
FComplex
e
multipole_exp
[
MultipoleSize
];
//< For multipole extenssion
FComplex
multipole_exp
[
MultipoleSize
];
//< For multipole extenssion
//< Local vector (static memory)
//< Local vector (static memory)
FComplex
e
local_exp
[
LocalSize
];
//< For local extenssion
FComplex
local_exp
[
LocalSize
];
//< For local extenssion
public:
public:
/** Default constructor
/** Default constructor
...
@@ -75,20 +75,20 @@ public:
...
@@ -75,20 +75,20 @@ public:
}
}
/** Get Multipole array */
/** Get Multipole array */
const
FComplex
e
*
getMultipole
()
const
{
const
FComplex
*
getMultipole
()
const
{
return
multipole_exp
;
return
multipole_exp
;
}
}
/** Get Local array */
/** Get Local array */
const
FComplex
e
*
getLocal
()
const
{
const
FComplex
*
getLocal
()
const
{
return
local_exp
;
return
local_exp
;
}
}
/** Get Multipole array */
/** Get Multipole array */
FComplex
e
*
getMultipole
()
{
FComplex
*
getMultipole
()
{
return
multipole_exp
;
return
multipole_exp
;
}
}
/** Get Local array */
/** Get Local array */
FComplex
e
*
getLocal
()
{
FComplex
*
getLocal
()
{
return
local_exp
;
return
local_exp
;
}
}
...
@@ -145,7 +145,7 @@ public:
...
@@ -145,7 +145,7 @@ public:
buffer
.
fillArray
(
local_exp
,
LocalSize
);
buffer
.
fillArray
(
local_exp
,
LocalSize
);
}
}
static
constexpr
int
GetSize
(){
static
constexpr
int
GetSize
(){
return
((
int
)
sizeof
(
FComplex
e
))
*
(
MultipoleSize
+
LocalSize
);
return
((
int
)
sizeof
(
FComplex
))
*
(
MultipoleSize
+
LocalSize
);
}
}
};
};
...
...
Src/Kernels/Rotation/FRotationKernel.hpp
View file @
40f46768
This diff is collapsed.
Click to expand it.
Src/Kernels/Rotation/FRotationOriginalKernel.hpp
View file @
40f46768
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "../../Components/FAbstractKernels.hpp"
#include "../../Components/FAbstractKernels.hpp"
#include "../../Utils/FSmartPointer.hpp"
#include "../../Utils/FSmartPointer.hpp"
#include "../../Utils/FComplex
e
.hpp"
#include "../../Utils/FComplex.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Utils/FMemUtils.hpp"
#include "../../Utils/FSpherical.hpp"
#include "../../Utils/FSpherical.hpp"
...
@@ -192,12 +192,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -192,12 +192,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* The computation is simply a multiplication per a complex number \f$ e^{-i \phi m} \f$
* The computation is simply a multiplication per a complex number \f$ e^{-i \phi m} \f$
* Phi should be in [0,2pi]
* Phi should be in [0,2pi]
*/
*/
void
rotateMultipoleAroundZ
(
FComplex
e
vec
[],
const
FReal
phi
){
void
rotateMultipoleAroundZ
(
FComplex
vec
[],
const
FReal
phi
){
FComplex
e
cell_rotate
[
SizeArray
];
FComplex
cell_rotate
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
// O_{l,m}( \alpha, \beta + \phi ) = e^{-i \phi m} O_{l,m}( \alpha, \beta )
// O_{l,m}( \alpha, \beta + \phi ) = e^{-i \phi m} O_{l,m}( \alpha, \beta )
const
FComplex
e
exp_minus_imphi
(
FMath
::
Cos
(
-
phi
*
FReal
(
m
)),
FMath
::
Sin
(
-
phi
*
FReal
(
m
)));
const
FComplex
exp_minus_imphi
(
FMath
::
Cos
(
-
phi
*
FReal
(
m
)),
FMath
::
Sin
(
-
phi
*
FReal
(
m
)));
cell_rotate
[
atLm
(
l
,
m
)].
equalMul
(
exp_minus_imphi
,
vec
[
atLm
(
l
,
m
)]);
cell_rotate
[
atLm
(
l
,
m
)].
equalMul
(
exp_minus_imphi
,
vec
[
atLm
(
l
,
m
)]);
}
}
}
}
...
@@ -214,12 +214,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -214,12 +214,12 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* The computation is simply a multiplication per a complex number \f$ e^{i \phi m} \f$
* The computation is simply a multiplication per a complex number \f$ e^{i \phi m} \f$
* Phi should be in [0,2pi]
* Phi should be in [0,2pi]
*/
*/
void
rotateTaylorAroundZ
(
FComplex
e
vec
[],
const
FReal
phi
){
void
rotateTaylorAroundZ
(
FComplex
vec
[],
const
FReal
phi
){
FComplex
e
cell_rotate
[
SizeArray
];
FComplex
cell_rotate
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
// M_{l,m}( \alpha, \beta + \phi ) = e^{i \phi m} M_{l,m}( \alpha, \beta )
// M_{l,m}( \alpha, \beta + \phi ) = e^{i \phi m} M_{l,m}( \alpha, \beta )
const
FComplex
e
exp_imphi
(
FMath
::
Cos
(
phi
*
FReal
(
m
)),
FMath
::
Sin
(
phi
*
FReal
(
m
)));
const
FComplex
exp_imphi
(
FMath
::
Cos
(
phi
*
FReal
(
m
)),
FMath
::
Sin
(
phi
*
FReal
(
m
)));
cell_rotate
[
atLm
(
l
,
m
)].
equalMul
(
exp_imphi
,
vec
[
atLm
(
l
,
m
)]);
cell_rotate
[
atLm
(
l
,
m
)].
equalMul
(
exp_imphi
,
vec
[
atLm
(
l
,
m
)]);
}
}
}
}
...
@@ -238,8 +238,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -238,8 +238,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* \f$ O_{l,-m} = \bar{ O_{l,m} } (-1)^m \f$
* \f$ O_{l,-m} = \bar{ O_{l,m} } (-1)^m \f$
* Theta should be in [0,pi]
* Theta should be in [0,pi]
*/
*/
void
rotateMultipoleAroundY
(
FComplex
e
vec
[],
const
FReal
theta
){
void
rotateMultipoleAroundY
(
FComplex
vec
[],
const
FReal
theta
){
FComplex
e
cell_rotate
[
SizeArray
];
FComplex
cell_rotate
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
FReal
w_lkm_real
=
0.0
;
FReal
w_lkm_real
=
0.0
;
...
@@ -278,8 +278,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -278,8 +278,8 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
* \f$ M_{l,-m} = \bar{ M_{l,m} } (-1)^m \f$
* \f$ M_{l,-m} = \bar{ M_{l,m} } (-1)^m \f$
* Theta should be in [0,pi]
* Theta should be in [0,pi]
*/
*/
void
rotateTaylorAroundY
(
FComplex
e
vec
[],
const
FReal
theta
){
void
rotateTaylorAroundY
(
FComplex
vec
[],
const
FReal
theta
){
FComplex
e
cell_rotate
[
SizeArray
];
FComplex
cell_rotate
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
FReal
w_lkm_real
=
0.0
;
FReal
w_lkm_real
=
0.0
;
...
@@ -313,7 +313,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -313,7 +313,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
*
* Rotation are not commutative so we have to do it in the right order
* Rotation are not commutative so we have to do it in the right order
*/
*/
void
rotateMultipole
(
FComplex
e
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
void
rotateMultipole
(
FComplex
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
rotateMultipoleAroundZ
(
vec
,(
FMath
::
FPiDiv2
+
azimuth
));
rotateMultipoleAroundZ
(
vec
,(
FMath
::
FPiDiv2
+
azimuth
));
rotateMultipoleAroundY
(
vec
,
inclination
);
rotateMultipoleAroundY
(
vec
,
inclination
);
}
}
...
@@ -324,7 +324,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -324,7 +324,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
*
* Rotation are not commutative so we have to do it in the right order
* Rotation are not commutative so we have to do it in the right order
*/
*/
void
deRotateMultipole
(
FComplex
e
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
void
deRotateMultipole
(
FComplex
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
rotateMultipoleAroundY
(
vec
,
-
inclination
);
rotateMultipoleAroundY
(
vec
,
-
inclination
);
rotateMultipoleAroundZ
(
vec
,
-
(
FMath
::
FPiDiv2
+
azimuth
));
rotateMultipoleAroundZ
(
vec
,
-
(
FMath
::
FPiDiv2
+
azimuth
));
}
}
...
@@ -336,7 +336,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -336,7 +336,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
*
* Rotation are not commutative so we have to do it in the right order
* Rotation are not commutative so we have to do it in the right order
*/
*/
void
rotateTaylor
(
FComplex
e
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
void
rotateTaylor
(
FComplex
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
rotateTaylorAroundZ
(
vec
,(
FMath
::
FPiDiv2
+
azimuth
));
rotateTaylorAroundZ
(
vec
,(
FMath
::
FPiDiv2
+
azimuth
));
rotateTaylorAroundY
(
vec
,
inclination
);
rotateTaylorAroundY
(
vec
,
inclination
);
}
}
...
@@ -347,7 +347,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
...
@@ -347,7 +347,7 @@ class FRotationOriginalKernel : public FAbstractKernels<CellClass,ContainerClass
*
*
* Rotation are not commutative so we have to do it in the right order
* Rotation are not commutative so we have to do it in the right order
*/
*/
void
deRotateTaylor
(
FComplex
e
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
void
deRotateTaylor
(
FComplex
vec
[],
const
FReal
azimuth
,
const
FReal
inclination
){
rotateTaylorAroundY
(
vec
,
-
inclination
);
rotateTaylorAroundY
(
vec
,
-
inclination
);
rotateTaylorAroundZ
(
vec
,
-
(
FMath
::
FPiDiv2
+
azimuth
));
rotateTaylorAroundZ
(
vec
,
-
(
FMath
::
FPiDiv2
+
azimuth
));
}
}
...
@@ -446,7 +446,7 @@ public:
...
@@ -446,7 +446,7 @@ public:
void
P2M
(
CellClass
*
const
inPole
,
const
ContainerClass
*
const
inParticles
)
{
void
P2M
(
CellClass
*
const
inPole
,
const
ContainerClass
*
const
inParticles
)
{
const
FReal
i_pow_m
[
4
]
=
{
0
,
FMath
::
FPiDiv2
,
FMath
::
FPi
,
-
FMath
::
FPiDiv2
};
const
FReal
i_pow_m
[
4
]
=
{
0
,
FMath
::
FPiDiv2
,
FMath
::
FPi
,
-
FMath
::
FPiDiv2
};
// w is the multipole moment
// w is the multipole moment
FComplex
e
*
FRestrict
const
w
=
inPole
->
getMultipole
();
FComplex
*
FRestrict
const
w
=
inPole
->
getMultipole
();
// Copying the position is faster than using cell position
// Copying the position is faster than using cell position
const
FPoint
cellPosition
=
getLeafCenter
(
inPole
->
getCoordinate
());
const
FPoint
cellPosition
=
getLeafCenter
(
inPole
->
getCoordinate
());
...
@@ -498,7 +498,7 @@ public:
...
@@ -498,7 +498,7 @@ public:
*/
*/
void
M2M
(
CellClass
*
const
FRestrict
inPole
,
const
CellClass
*
const
FRestrict
*
const
FRestrict
inChildren
,
const
int
inLevel
)
{
void
M2M
(
CellClass
*
const
FRestrict
inPole
,
const
CellClass
*
const
FRestrict
*
const
FRestrict
inChildren
,
const
int
inLevel
)
{
// A buffer to copy the source w allocated once
// A buffer to copy the source w allocated once
FComplex
e
source_w
[
SizeArray
];
FComplex
source_w
[
SizeArray
];
// For all children
// For all children
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
// if child exists
// if child exists
...
@@ -512,7 +512,7 @@ public:
...
@@ -512,7 +512,7 @@ public:
const
FReal
b
=
-
sph
.
getR
();
const
FReal
b
=
-
sph
.
getR
();
// Translate it
// Translate it
FComplex
e
target_w
[
SizeArray
];
FComplex
target_w
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
// w{l,m}(a+b) = sum(j=m:l, b^(l-j)/(l-j)! w{j,m}(a)
// w{l,m}(a+b) = sum(j=m:l, b^(l-j)/(l-j)! w{j,m}(a)
...
@@ -549,7 +549,7 @@ public:
...
@@ -549,7 +549,7 @@ public:
*/
*/
void
M2L
(
CellClass
*
const
FRestrict
inLocal
,
const
CellClass
*
inInteractions
[],
const
int
/*inSize*/
,
const
int
inLevel
)
{
void
M2L
(
CellClass
*
const
FRestrict
inLocal
,
const
CellClass
*
inInteractions
[],
const
int
/*inSize*/
,
const
int
inLevel
)
{
// To copy the multipole data allocated once
// To copy the multipole data allocated once
FComplex
e
source_w
[
SizeArray
];
FComplex
source_w
[
SizeArray
];
// For all children
// For all children
for
(
int
idxNeigh
=
0
;
idxNeigh
<
343
;
++
idxNeigh
){
for
(
int
idxNeigh
=
0
;
idxNeigh
<
343
;
++
idxNeigh
){
// if interaction exits
// if interaction exits
...
@@ -563,7 +563,7 @@ public:
...
@@ -563,7 +563,7 @@ public:
const
FReal
b
=
sph
.
getR
();
const
FReal
b
=
sph
.
getR
();
// Transfer to u
// Transfer to u
FComplex
e
target_u
[
SizeArray
];
FComplex
target_u
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
// u{l,m}(a-b) = sum(j=|m|:P-l, (j+l)!/b^(j+l+1) w{j,-m}(a)
// u{l,m}(a-b) = sum(j=|m|:P-l, (j+l)!/b^(j+l+1) w{j,-m}(a)
...
@@ -601,7 +601,7 @@ public:
...
@@ -601,7 +601,7 @@ public:
*/
*/
void
L2L
(
const
CellClass
*
const
FRestrict
inLocal
,
CellClass
*
FRestrict
*
const
FRestrict
inChildren
,
const
int
inLevel
)
{
void
L2L
(
const
CellClass
*
const
FRestrict
inLocal
,
CellClass
*
FRestrict
*
const
FRestrict
inChildren
,
const
int
inLevel
)
{
// To copy the source local allocated once
// To copy the source local allocated once
FComplex
e
source_u
[
SizeArray
];
FComplex
source_u
[
SizeArray
];
// For all children
// For all children
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
// if child exists
// if child exists
...
@@ -615,7 +615,7 @@ public:
...
@@ -615,7 +615,7 @@ public:
const
FReal
b
=
sph
.
getR
();
const
FReal
b
=
sph
.
getR
();
// Translate
// Translate
FComplex
e
target_u
[
SizeArray
];
FComplex
target_u
[
SizeArray
];
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
l
=
0
;
l
<=
P
;
++
l
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
for
(
int
m
=
0
;
m
<=
l
;
++
m
){
// u{l,m}(r-b) = sum(j=0:P, b^(j-l)/(j-l)! u{j,m}(r);
// u{l,m}(r-b) = sum(j=0:P, b^(j-l)/(j-l)! u{j,m}(r);
...
@@ -660,7 +660,7 @@ public:
...
@@ -660,7 +660,7 @@ public:
void
L2P
(
const
CellClass
*
const
inLocal
,
ContainerClass
*
const
inParticles
){
void
L2P
(
const
CellClass
*
const
inLocal
,
ContainerClass
*
const
inParticles
){
const
FReal
i_pow_m
[
4
]
=
{
0
,
FMath
::
FPiDiv2
,
FMath
::
FPi
,
-
FMath
::
FPiDiv2
};
const
FReal
i_pow_m
[
4
]
=
{
0
,
FMath
::
FPiDiv2
,
FMath
::
FPi
,
-
FMath
::
FPiDiv2
};
// Take the local value from the cell
// Take the local value from the cell
const
FComplex
e
*
FRestrict
const
u
=
inLocal
->
getLocal
();
const
FComplex
*
FRestrict
const
u
=
inLocal
->
getLocal
();
// Copying the position is faster than using cell position
// Copying the position is faster than using cell position
const
FPoint
cellPosition
=
getLeafCenter
(
inLocal
->
getCoordinate
());
const
FPoint
cellPosition
=
getLeafCenter
(
inLocal
->
getCoordinate
());
...
...
Src/Kernels/Spherical/FAbstractSphericalKernel.hpp
View file @
40f46768
...
@@ -50,21 +50,21 @@ protected:
...
@@ -50,21 +50,21 @@ protected:
FHarmonic
harmonic
;
//< The harmonic computation class
FHarmonic
harmonic
;
//< The harmonic computation class
// For normal computation
// For normal computation
FSmartPointer
<
FComplex
e
*>
preL2LTransitions
;
//< The pre-computation for the L2L based on the level
FSmartPointer
<
FComplex
*>
preL2LTransitions
;
//< The pre-computation for the L2L based on the level
FSmartPointer
<
FComplex
e
*>
preM2MTransitions
;
//< The pre-computation for the M2M based on the level
FSmartPointer
<
FComplex
*>
preM2MTransitions
;
//< The pre-computation for the M2M based on the level
/** Alloc and init pre-vectors*/
/** Alloc and init pre-vectors*/
void
allocAndInit
(){
void
allocAndInit
(){
preL2LTransitions
=
new
FComplex
e
*
[
treeHeight
];
preL2LTransitions
=
new
FComplex
*
[
treeHeight
];
memset
(
preL2LTransitions
.
getPtr
(),
0
,
(
treeHeight
)
*
sizeof
(
FComplex
e
*
));
memset
(
preL2LTransitions
.
getPtr
(),
0
,
(
treeHeight
)
*
sizeof
(
FComplex
*
));
preM2MTransitions
=
new
FComplex
e
*
[
treeHeight
];
preM2MTransitions
=
new
FComplex
*
[
treeHeight
];
memset
(
preM2MTransitions
.
getPtr
(),
0
,
(
treeHeight
)
*
sizeof
(
FComplex
e
*
));
memset
(
preM2MTransitions
.
getPtr
(),
0
,
(
treeHeight
)
*
sizeof
(
FComplex
*
));
FReal
treeWidthAtLevel
=
(
boxWidth
)
/
2
;
FReal
treeWidthAtLevel
=
(
boxWidth
)
/
2
;
for
(
int
idxLevel
=
0
;
idxLevel
<
treeHeight
-
1
;
++
idxLevel
){
for
(
int
idxLevel
=
0
;
idxLevel
<
treeHeight
-
1
;
++
idxLevel
){
preL2LTransitions
[
idxLevel
]
=
new
FComplex
e
[
8
*
harmonic
.
getExpSize
()];
preL2LTransitions
[
idxLevel
]
=
new
FComplex
[
8
*
harmonic
.
getExpSize
()];
preM2MTransitions
[
idxLevel
]
=
new
FComplex
e
[
8
*
harmonic
.
getExpSize
()];
preM2MTransitions
[
idxLevel
]
=
new
FComplex
[
8
*
harmonic
.
getExpSize
()];
const
FPoint
father
(
treeWidthAtLevel
,
treeWidthAtLevel
,
treeWidthAtLevel
);
const
FPoint
father
(
treeWidthAtLevel
,
treeWidthAtLevel
,
treeWidthAtLevel
);
treeWidthAtLevel
/=
2
;
treeWidthAtLevel
/=
2
;
...
@@ -80,7 +80,7 @@ protected:
...
@@ -80,7 +80,7 @@ protected:
);
);
harmonic
.
computeInner
(
FSpherical
(
M2MVector
));
harmonic
.
computeInner
(
FSpherical
(
M2MVector
));
FMemUtils
::
copyall
<
FComplex
e
>
(
&
preM2MTransitions
[
idxLevel
][
harmonic
.
getExpSize
()
*
idxChild
],
harmonic
.
result
(),
harmonic
.
getExpSize
());
FMemUtils
::
copyall
<
FComplex
>
(
&
preM2MTransitions
[
idxLevel
][
harmonic
.
getExpSize
()
*
idxChild
],
harmonic
.
result
(),
harmonic
.
getExpSize
());
const
FPoint
L2LVector
(
const
FPoint
L2LVector
(
(
treeWidthAtLevel
*
FReal
(
1
+
(
childBox
.
getX
()
*
2
)))
-
father
.
getX
(),
(
treeWidthAtLevel
*
FReal
(
1
+
(
childBox
.
getX
()
*
2
)))
-
father
.
getX
(),
...
@@ -89,7 +89,7 @@ protected:
...
@@ -89,7 +89,7 @@ protected:
);
);
harmonic
.
computeInner
(
FSpherical
(
L2LVector
));
harmonic
.
computeInner
(
FSpherical
(
L2LVector
));
FMemUtils
::
copyall
<
FComplex
e
>
(
&
preL2LTransitions
[
idxLevel
][
harmonic
.
getExpSize
()
*
idxChild
],
harmonic
.
result
(),
harmonic
.
getExpSize
());
FMemUtils
::
copyall
<
FComplex
>
(
&
preL2LTransitions
[
idxLevel
][
harmonic
.
getExpSize
()
*
idxChild
],
harmonic
.
result
(),
harmonic
.
getExpSize
());
}
}
}
}
}
}
...
@@ -145,7 +145,7 @@ public:
...
@@ -145,7 +145,7 @@ public:
/** P2M with a cell and all its particles */
/** P2M with a cell and all its particles */
void
P2M
(
CellClass
*
const
inPole
,
const
ContainerClass
*
const
inParticles
)
{
void
P2M
(
CellClass
*
const
inPole
,
const
ContainerClass
*
const
inParticles
)
{
FComplex
e
*
FRestrict
const
cellMultiPole
=
inPole
->
getMultipole
();
FComplex
*
FRestrict
const
cellMultiPole
=
inPole
->
getMultipole
();
// Copying the position is faster than using cell position
// Copying the position is faster than using cell position
const
FPoint
polePosition
=
getLeafCenter
(
inPole
->
getCoordinate
());
const
FPoint
polePosition
=
getLeafCenter
(
inPole
->
getCoordinate
());
// For all particles in the leaf box
// For all particles in the leaf box
...
@@ -163,9 +163,9 @@ public:
...
@@ -163,9 +163,9 @@ public:
/** M2M with a cell and all its child */
/** M2M with a cell and all its child */
void
M2M
(
CellClass
*
const
FRestrict
inPole
,
const
CellClass
*
const
FRestrict
*
const
FRestrict
inChild
,
const
int
inLevel
)
{
void
M2M
(
CellClass
*
const
FRestrict
inPole
,
const
CellClass
*
const
FRestrict
*
const
FRestrict
inChild
,
const
int
inLevel
)
{
FComplex
e
*
FRestrict
const
multipole_exp_target
=
inPole
->
getMultipole
();
FComplex
*
FRestrict
const
multipole_exp_target
=
inPole
->
getMultipole
();
// iter on each child and process M2M
// iter on each child and process M2M
const
FComplex
e
*
FRestrict
const
preM2MTransitionsAtLevel
=
preM2MTransitions
[
inLevel
];
const
FComplex
*
FRestrict
const
preM2MTransitionsAtLevel
=
preM2MTransitions
[
inLevel
];
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
if
(
inChild
[
idxChild
]){
if
(
inChild
[
idxChild
]){
multipoleToMultipole
(
multipole_exp_target
,
inChild
[
idxChild
]
->
getMultipole
(),
&
preM2MTransitionsAtLevel
[
idxChild
*
harmonic
.
getExpSize
()]);
multipoleToMultipole
(
multipole_exp_target
,
inChild
[
idxChild
]
->
getMultipole
(),
&
preM2MTransitionsAtLevel
[
idxChild
*
harmonic
.
getExpSize
()]);
...
@@ -180,7 +180,7 @@ public:
...
@@ -180,7 +180,7 @@ public:
/** L2L with a cell and all its child */
/** L2L with a cell and all its child */
void
L2L
(
const
CellClass
*
const
FRestrict
pole
,
CellClass
*
FRestrict
*
const
FRestrict
child
,
const
int
inLevel
)
{
void
L2L
(
const
CellClass
*
const
FRestrict
pole
,
CellClass
*
FRestrict
*
const
FRestrict
child
,
const
int
inLevel
)
{
// iter on each child and process L2L
// iter on each child and process L2L
const
FComplex
e
*
FRestrict
const
preL2LTransitionsAtLevel
=
preL2LTransitions
[
inLevel
];
const
FComplex
*
FRestrict
const
preL2LTransitionsAtLevel
=
preL2LTransitions
[
inLevel
];
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
for
(
int
idxChild
=
0
;
idxChild
<
8
;
++
idxChild
){
if
(
child
[
idxChild
]){
if
(
child
[
idxChild
]){
localToLocal
(
child
[
idxChild
]
->
getLocal
(),
pole
->
getLocal
(),
&
preL2LTransitionsAtLevel
[
idxChild
*
harmonic
.
getExpSize
()]);
localToLocal
(
child
[
idxChild
]
->
getLocal
(),
pole
->
getLocal
(),
&
preL2LTransitionsAtLevel
[
idxChild
*
harmonic
.
getExpSize
()]);
...
@@ -190,7 +190,7 @@ public:
...
@@ -190,7 +190,7 @@ public:
/** L2P with a cell and all its particles */
/** L2P with a cell and all its particles */
void
L2P
(
const
CellClass
*
const
local
,
ContainerClass
*
const
inParticles
){
void
L2P
(
const
CellClass
*
const
local
,
ContainerClass
*
const
inParticles
){
const
FComplex
e
*
const
cellLocal
=
local
->
getLocal
();
const
FComplex
*
const
cellLocal
=
local
->
getLocal
();
// Copying the position is faster than using cell position
// Copying the position is faster than using cell position
const
FPoint
localPosition
=
getLeafCenter
(
local
->
getCoordinate
());
const
FPoint
localPosition
=
getLeafCenter
(
local
->
getCoordinate
());
// For all particles in the leaf box
// For all particles in the leaf box
...
@@ -265,7 +265,7 @@ private:
...
@@ -265,7 +265,7 @@ private:
* Phi(x) = sum_{n=0}^{+} sum_{m=-n}^{n} M_n^m O_n^{-m} (x - *p_center)
* Phi(x) = sum_{n=0}^{+} sum_{m=-n}^{n} M_n^m O_n^{-m} (x - *p_center)
*
*
*/
*/
void
particleToMultiPole
(
FComplex
e
*
const
cellMultiPole
,
const
FPoint
&
inPolePosition
,
void
particleToMultiPole
(
FComplex
*
const
cellMultiPole
,
const
FPoint
&
inPolePosition
,
const
FPoint
&
particlePosition
,
const
FReal
particlePhysicalValue
){
const
FPoint
&
particlePosition
,
const
FReal
particlePhysicalValue
){
// Inner of Qi - Z0 => harmonic.result
// Inner of Qi - Z0 => harmonic.result
...
@@ -304,9 +304,9 @@ private:
...
@@ -304,9 +304,9 @@ private:
*
*
* Warning: if j-n < |k-l| we do nothing.
* Warning: if j-n < |k-l| we do nothing.
*/
*/
void
multipoleToMultipole
(
FComplex
e
*
const
FRestrict
multipole_exp_target
,
void
multipoleToMultipole
(
FComplex
*
const
FRestrict
multipole_exp_target
,
const
FComplex
e
*
const
FRestrict
multipole_exp_src
,
const
FComplex
*
const
FRestrict
multipole_exp_src
,
const
FComplex
e
*
const
FRestrict
M2M_Inner_transfer
){
const
FComplex
*
const
FRestrict
M2M_Inner_transfer
){
// n from 0 to P
// n from 0 to P
for
(
int
n
=
0
;
n
<=
devP
;
++
n
){
for
(
int
n
=
0
;
n
<=
devP
;
++
n
){
...
@@ -318,7 +318,7 @@ private:
...
@@ -318,7 +318,7 @@ private:
// l from -n to <0
// l from -n to <0