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
624f3999
Commit
624f3999
authored
Sep 02, 2014
by
BRAMAS Berenger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some compilation errors on other config
parent
7342eb81
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
19 deletions
+86
-19
Src/Kernels/Interpolation/FInterpMatrixKernel.hpp
Src/Kernels/Interpolation/FInterpMatrixKernel.hpp
+64
-6
Src/Kernels/Interpolation/FInterpP2PKernels.hpp
Src/Kernels/Interpolation/FInterpP2PKernels.hpp
+5
-4
Src/Kernels/P2P/FP2P.hpp
Src/Kernels/P2P/FP2P.hpp
+2
-4
Src/Utils/FMath.hpp
Src/Utils/FMath.hpp
+15
-5
No files found.
Src/Kernels/Interpolation/FInterpMatrixKernel.hpp
View file @
624f3999
...
...
@@ -140,6 +140,16 @@ struct FInterpMatrixKernelR : FInterpAbstractMatrixKernel
return
FReal
(
2.
)
/
CellWidth
;
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
void
evaluateBlockAndDerivative
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
block
[
1
],
FReal
blockDerivative
[
3
])
const
{
evaluateBlockAndDerivative
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
,
blockDerivative
);
}
};
/// One over r when the box size is rescaled to 1
...
...
@@ -202,9 +212,9 @@ struct FInterpMatrixKernelRH :FInterpMatrixKernelR{
block
[
0
]
=
one_over_rL
;
blockDerivative
[
0
]
[
0
]
=
LX
*
one_over_rL3
*
diffx
;
blockDerivative
[
0
][
1
]
=
LY
*
one_over_rL3
*
diffy
;
blockDerivative
[
0
][
2
]
=
LZ
*
one_over_rL3
*
diffz
;
blockDerivative
[
0
]
=
LX
*
one_over_rL3
*
diffx
;
blockDerivative
[
1
]
=
LY
*
one_over_rL3
*
diffy
;
blockDerivative
[
2
]
=
LZ
*
one_over_rL3
*
diffz
;
}
...
...
@@ -219,6 +229,16 @@ struct FInterpMatrixKernelRH :FInterpMatrixKernelR{
return
FReal
(
2.
)
/
CellWidth
;
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
void
evaluateBlockAndDerivative
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
block
[
1
],
FReal
blockDerivative
[
3
])
const
{
evaluateBlockAndDerivative
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
,
blockDerivative
);
}
};
...
...
@@ -282,9 +302,9 @@ struct FInterpMatrixKernelRR : FInterpAbstractMatrixKernel
block
[
0
]
=
one_over_r2
;
const
ValueClass
coef
=
FMath
::
ConvertTo
<
ValueClass
,
FReal
>
(
-
2.
)
*
one_over_r4
;
blockDerivative
[
0
]
[
0
]
=
coef
*
diffx
;
blockDerivative
[
0
][
1
]
=
coef
*
diffy
;
blockDerivative
[
0
][
2
]
=
coef
*
diffz
;
blockDerivative
[
0
]
=
coef
*
diffx
;
blockDerivative
[
1
]
=
coef
*
diffy
;
blockDerivative
[
2
]
=
coef
*
diffz
;
}
...
...
@@ -298,6 +318,17 @@ struct FInterpMatrixKernelRR : FInterpAbstractMatrixKernel
{
return
FReal
(
4.
)
/
(
CellWidth
*
CellWidth
);
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
void
evaluateBlockAndDerivative
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
block
[
1
],
FReal
blockDerivative
[
3
])
const
{
evaluateBlockAndDerivative
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
,
blockDerivative
);
}
};
...
...
@@ -387,6 +418,18 @@ struct FInterpMatrixKernelLJ : FInterpAbstractMatrixKernel
return
FReal
(
1.0
);
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
void
evaluateBlockAndDerivative
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
block
[
1
],
FReal
blockDerivative
[
3
])
const
{
evaluateBlockAndDerivative
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
,
blockDerivative
);
}
};
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -530,6 +573,14 @@ struct FInterpMatrixKernel_R_IJ : FInterpAbstractMatrixKernel
return
FReal
(
2.
)
/
CellWidth
;
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
};
/// R_{,ijk}
...
...
@@ -676,6 +727,13 @@ struct FInterpMatrixKernel_R_IJK : FInterpAbstractMatrixKernel
return
FReal
(
4.
)
/
(
CellWidth
*
CellWidth
);
}
FReal
evaluate
(
const
FPoint
&
p1
,
const
FPoint
&
p2
)
const
{
return
evaluate
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
());
}
void
evaluateBlock
(
const
FPoint
&
p1
,
const
FPoint
&
p2
,
FReal
*
block
)
const
{
evaluateBlock
<
FReal
>
(
p1
.
getX
(),
p1
.
getY
(),
p1
.
getZ
(),
p2
.
getX
(),
p2
.
getY
(),
p2
.
getZ
(),
block
);
}
};
...
...
Src/Kernels/Interpolation/FInterpP2PKernels.hpp
View file @
624f3999
...
...
@@ -3,6 +3,7 @@
#include "../P2P/FP2P.hpp"
#include "../P2P/FP2PR.hpp"
template
<
KERNEL_FUNCTION_IDENTIFIER
Identifier
,
int
NVALS
>
...
...
@@ -36,7 +37,7 @@ struct DirectInteractionComputer<ONE_OVER_R, 1>
static
void
P2P
(
ContainerClass
*
const
FRestrict
TargetParticles
,
ContainerClass
*
const
NeighborSourceParticles
[
27
],
const
MatrixKernelClass
*
const
/*MatrixKernel*/
){
FP2P
::
FullMutual
(
TargetParticles
,
NeighborSourceParticles
,
14
);
FP2P
R
::
FullMutual
(
TargetParticles
,
NeighborSourceParticles
,
14
);
}
template
<
typename
ContainerClass
,
typename
MatrixKernelClass
>
...
...
@@ -44,7 +45,7 @@ struct DirectInteractionComputer<ONE_OVER_R, 1>
ContainerClass
*
const
inNeighbors
[
27
],
const
int
inSize
,
const
MatrixKernelClass
*
const
/*MatrixKernel*/
){
FP2P
::
FullRemote
(
inTargets
,
inNeighbors
,
inSize
);
FP2P
R
::
FullRemote
(
inTargets
,
inNeighbors
,
inSize
);
}
};
...
...
@@ -103,7 +104,7 @@ struct DirectInteractionComputer<ONE_OVER_R, NVALS>
ContainerClass
*
const
NeighborSourceParticles
[
27
],
const
MatrixKernelClass
*
const
/*MatrixKernel*/
){
for
(
int
idxRhs
=
0
;
idxRhs
<
NVALS
;
++
idxRhs
){
FP2P
::
FullMutual
(
TargetParticles
,
NeighborSourceParticles
,
14
);
FP2P
R
::
FullMutual
(
TargetParticles
,
NeighborSourceParticles
,
14
);
}
}
...
...
@@ -113,7 +114,7 @@ struct DirectInteractionComputer<ONE_OVER_R, NVALS>
const
int
inSize
,
const
MatrixKernelClass
*
const
/*MatrixKernel*/
){
for
(
int
idxRhs
=
0
;
idxRhs
<
NVALS
;
++
idxRhs
){
FP2P
::
FullRemote
(
inTargets
,
inNeighbors
,
inSize
);
FP2P
R
::
FullRemote
(
inTargets
,
inNeighbors
,
inSize
);
}
}
};
...
...
Src/Kernels/P2P/FP2P.hpp
View file @
624f3999
...
...
@@ -44,8 +44,7 @@ inline void MutualParticles(const FReal sourceX,const FReal sourceY,const FReal
const
FPoint
targetPoint
(
targetX
,
targetY
,
targetZ
);
FReal
Kxy
[
1
];
FReal
dKxy
[
3
];
MatrixKernel
->
evaluateBlockAndDerivative
(
sourcePoint
.
getX
(),
sourcePoint
.
getY
(),
sourcePoint
.
getZ
(),
targetPoint
.
getX
(),
targetPoint
.
getY
(),
targetPoint
.
getZ
(),
Kxy
,
dKxy
);
MatrixKernel
->
evaluateBlockAndDerivative
(
sourcePoint
,
targetPoint
,
Kxy
,
dKxy
);
FReal
coef
=
(
targetPhysicalValue
*
sourcePhysicalValue
);
(
*
targetForceX
)
+=
dKxy
[
0
]
*
coef
;
...
...
@@ -85,8 +84,7 @@ inline void NonMutualParticles(const FReal sourceX,const FReal sourceY,const FRe
const
FPoint
targetPoint
(
targetX
,
targetY
,
targetZ
);
FReal
Kxy
[
1
];
FReal
dKxy
[
3
];
MatrixKernel
->
evaluateBlockAndDerivative
(
sourcePoint
.
getX
(),
sourcePoint
.
getY
(),
sourcePoint
.
getZ
(),
targetPoint
.
getX
(),
targetPoint
.
getY
(),
targetPoint
.
getZ
(),
Kxy
,
dKxy
);
MatrixKernel
->
evaluateBlockAndDerivative
(
sourcePoint
,
targetPoint
,
Kxy
,
dKxy
);
FReal
coef
=
(
targetPhysicalValue
*
sourcePhysicalValue
);
(
*
targetForceX
)
+=
dKxy
[
0
]
*
coef
;
...
...
Src/Utils/FMath.hpp
View file @
624f3999
...
...
@@ -258,7 +258,7 @@ struct FMath{
}
static
__m256d
Rsqrt
(
const
__m256d
inV
){
return
_mm256_r
sqrt_pd
(
inV
);
return
FMath
::
One
<
__m256d
>
()
/
_mm256_
sqrt_pd
(
inV
);
}
#endif
...
...
@@ -453,25 +453,35 @@ struct FMath{
};
template
<
>
inline
constexpr
float
FMath
::
Zero
<
float
>
(){
inline
float
FMath
::
Zero
<
float
>
(){
return
float
(
0.0
);
}
template
<
>
inline
constexpr
double
FMath
::
Zero
<
double
>
(){
inline
double
FMath
::
Zero
<
double
>
(){
return
double
(
0.0
);
}
template
<
>
inline
constexpr
float
FMath
::
One
<
float
>
(){
inline
float
FMath
::
One
<
float
>
(){
return
float
(
1.0
);
}
template
<
>
inline
constexpr
double
FMath
::
One
<
double
>
(){
inline
double
FMath
::
One
<
double
>
(){
return
double
(
1.0
);
}
template
<
>
inline
float
FMath
::
ConvertTo
<
float
,
float
>
(
const
float
val
){
return
val
;
}
template
<
>
inline
double
FMath
::
ConvertTo
<
double
,
double
>
(
const
double
val
){
return
val
;
}
#ifdef ScalFMM_USE_SSE
template
<
>
inline
__m128
FMath
::
One
<
__m128
>
(){
...
...
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