Commit 624f3999 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Remove some compilation errors on other config

parent 7342eb81
......@@ -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);
}
};
......
......@@ -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);
FP2PR::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);
FP2PR::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);
FP2PR::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);
FP2PR::FullRemote(inTargets,inNeighbors,inSize);
}
}
};
......
......@@ -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;
......
......@@ -258,7 +258,7 @@ struct FMath{
}
static __m256d Rsqrt(const __m256d inV){
return _mm256_rsqrt_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>(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment