Commit f8916551 authored by BLANCHARD Pierre's avatar BLANCHARD Pierre

Redesigned P2P wrapper, Implemented generic tensorial P2P wrapper.

parent 1b775bdf
......@@ -216,14 +216,14 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP,NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP,NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -81,7 +81,7 @@ class FChebM2LHandler : FNoCopyable
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"<< MatrixKernelClass::Identifier << "_" << precision_type
stream << "m2l_k"<< MatrixKernelClass::getID() << "_" << precision_type
<< "_o" << order << "_e" << epsilon << ".bin";
return stream.str();
}
......
......@@ -469,14 +469,14 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -240,14 +240,14 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -96,7 +96,7 @@ class FChebTensorialM2LHandler<ORDER,MatrixKernelClass,HOMOGENEOUS> : FNoCopyabl
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"<< MatrixKernelClass::Identifier << "_" << precision_type
stream << "m2l_k"<< MatrixKernelClass::getID() << "_" << precision_type
<< "_o" << order << "_e" << epsilon << ".bin";
return stream.str();
}
......@@ -220,7 +220,7 @@ class FChebTensorialM2LHandler<ORDER,MatrixKernelClass,NON_HOMOGENEOUS> : FNoCop
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"<< MatrixKernelClass::Identifier << "_" << precision_type
stream << "m2l_k"<< MatrixKernelClass::getID() << "_" << precision_type
<< "_o" << order << "_e" << epsilon << ".bin";
return stream.str();
}
......
......@@ -9,11 +9,3 @@ const unsigned int FInterpMatrixKernel_R_IJ::applyTab[]={0,1,2,
1,3,4,
2,4,5};
/// R_IJK
const unsigned int FInterpMatrixKernel_R_IJK::indexTab[]={0,0,0,1,1,1,2,2,2,0,
0,1,2,0,1,2,0,1,2,1,
0,1,2,0,1,2,0,1,2,2};
const unsigned int FInterpMatrixKernel_R_IJK::applyTab[]={0,3,6,3,1,9,6,9,2,
3,1,9,1,4,7,9,7,5,
6,9,2,9,7,5,2,5,8};
......@@ -5,131 +5,19 @@
#include "../P2P/FP2P.hpp"
#include "../P2P/FP2PR.hpp"
template <KERNEL_FUNCTION_IDENTIFIER Identifier, int NVALS>
struct DirectInteractionComputer
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const MatrixKernel){
FP2P::FullMutual(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
template <typename ContainerClass, typename MatrixKernelClass>
static void P2PRemote( ContainerClass* const FRestrict inTargets,
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const MatrixKernel){
FP2P::FullRemote(inTargets,inNeighbors,inSize,MatrixKernel);
}
};
///////////////////////////////////////////////////////
// P2P Wrappers
///////////////////////////////////////////////////////
/*! Specialization for Laplace potential */
template <>
struct DirectInteractionComputer<ONE_OVER_R, 1>
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const /*MatrixKernel*/){
FP2PR::FullMutual(TargetParticles,NeighborSourceParticles,14);
}
template <typename ContainerClass, typename MatrixKernelClass>
static void P2PRemote( ContainerClass* const FRestrict inTargets,
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const /*MatrixKernel*/){
FP2PR::FullRemote(inTargets,inNeighbors,inSize);
}
};
/*! Specialization for GradGradR potential */
template <>
struct DirectInteractionComputer<R_IJ, 1>
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const MatrixKernel){
FP2P::FullMutualRIJ(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
template <typename ContainerClass, typename MatrixKernelClass>
static void P2PRemote( ContainerClass* const FRestrict inTargets,
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const MatrixKernel){
FP2P::FullRemoteRIJ(inTargets,inNeighbors,inSize,MatrixKernel);
}
};
/*! Specialization for GradGradGradR potential */
template <>
struct DirectInteractionComputer<R_IJK, 1>
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const MatrixKernel){
FP2P::FullMutualRIJK(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
template <typename ContainerClass, typename MatrixKernelClass>
static void P2PRemote( ContainerClass* const FRestrict inTargets,
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const MatrixKernel){
FP2P::FullRemoteRIJK(inTargets,inNeighbors,inSize,MatrixKernel);
}
};
///////////////////////////////////////////////////////
// In case of multi right hand side
///////////////////////////////////////////////////////
template <int NVALS>
struct DirectInteractionComputer<ONE_OVER_R, NVALS>
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P(ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const /*MatrixKernel*/){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2PR::FullMutual(TargetParticles,NeighborSourceParticles,14);
}
}
template <typename ContainerClass, typename MatrixKernelClass>
static void P2PRemote(ContainerClass* const FRestrict inTargets,
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const /*MatrixKernel*/){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2PR::FullRemote(inTargets,inNeighbors,inSize);
}
}
};
/*! Specialization for GradGradR potential */
template <int NVALS>
struct DirectInteractionComputer<R_IJ, NVALS>
template <int NCMP, int NVALS>
struct DirectInteractionComputer
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const MatrixKernel){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2P::FullMutualRIJ(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
FP2P::FullMutualKIJ(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
}
......@@ -139,22 +27,22 @@ struct DirectInteractionComputer<R_IJ, NVALS>
const int inSize,
const MatrixKernelClass *const MatrixKernel){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2P::FullRemoteRIJ(inTargets,inNeighbors,inSize,MatrixKernel);
FP2P::FullRemoteKIJ(inTargets,inNeighbors,inSize,MatrixKernel);
}
}
};
/*! Specialization for GradGradGradR potential */
/*! Specialization for scalar kernels */
template <int NVALS>
struct DirectInteractionComputer<R_IJK, NVALS>
struct DirectInteractionComputer<1, NVALS>
{
template <typename ContainerClass, typename MatrixKernelClass>
static void P2P( ContainerClass* const FRestrict TargetParticles,
ContainerClass* const NeighborSourceParticles[27],
const MatrixKernelClass *const MatrixKernel){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2P::FullMutualRIJK(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs)
FP2P::FullMutual(TargetParticles,NeighborSourceParticles,14,MatrixKernel);
}
template <typename ContainerClass, typename MatrixKernelClass>
......@@ -162,9 +50,8 @@ struct DirectInteractionComputer<R_IJK, NVALS>
ContainerClass* const inNeighbors[27],
const int inSize,
const MatrixKernelClass *const MatrixKernel){
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs){
FP2P::FullRemoteRIJK(inTargets,inNeighbors,inSize,MatrixKernel);
}
for(int idxRhs = 0 ; idxRhs < NVALS ; ++idxRhs)
FP2P::FullRemote(inTargets,inNeighbors,inSize,MatrixKernel);
}
};
......
This diff is collapsed.
......@@ -131,6 +131,193 @@ inline void FullRemote(ContainerClass* const FRestrict inTargets, ContainerClass
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tensorial Matrix Kernels: K_IJ
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @brief FullMutualKIJ
*/
template <class ContainerClass, typename MatrixKernelClass>
inline void FullMutualKIJ(ContainerClass* const FRestrict inTargets, ContainerClass* const inNeighbors[],
const int limiteNeighbors, const MatrixKernelClass *const MatrixKernel){
// get information on tensorial aspect of matrix kernel
const int ncmp = MatrixKernelClass::NCMP;
const int applyTab[9] = {0,1,2,
1,3,4,
2,4,5};
const int nbParticlesTargets = inTargets->getNbParticles();
const FReal*const targetsX = inTargets->getPositions()[0];
const FReal*const targetsY = inTargets->getPositions()[1];
const FReal*const targetsZ = inTargets->getPositions()[2];
for(int idxNeighbors = 0 ; idxNeighbors < limiteNeighbors ; ++idxNeighbors){
for(int idxTarget = 0 ; idxTarget < nbParticlesTargets ; ++idxTarget){
if( inNeighbors[idxNeighbors] ){
const int nbParticlesSources = inNeighbors[idxNeighbors]->getNbParticles();
const FReal*const sourcesX = inNeighbors[idxNeighbors]->getPositions()[0];
const FReal*const sourcesY = inNeighbors[idxNeighbors]->getPositions()[1];
const FReal*const sourcesZ = inNeighbors[idxNeighbors]->getPositions()[2];
for(int idxSource = 0 ; idxSource < nbParticlesSources ; ++idxSource){
// evaluate kernel and its partial derivatives
const FPoint sourcePoint(sourcesX[idxSource],sourcesY[idxSource],sourcesZ[idxSource]);
const FPoint targetPoint(targetsX[idxTarget],targetsY[idxTarget],targetsZ[idxTarget]);
FReal Kxy[ncmp];
FReal dKxy[ncmp][3];
MatrixKernel->evaluateBlockAndDerivative(sourcePoint,targetPoint,Kxy,dKxy);
for(unsigned int i = 0 ; i < 3 ; ++i){
FReal*const targetsPotentials = inTargets->getPotentials(i);
FReal*const targetsForcesX = inTargets->getForcesX(i);
FReal*const targetsForcesY = inTargets->getForcesY(i);
FReal*const targetsForcesZ = inTargets->getForcesZ(i);
FReal*const sourcesPotentials = inNeighbors[idxNeighbors]->getPotentials(i);
FReal*const sourcesForcesX = inNeighbors[idxNeighbors]->getForcesX(i);
FReal*const sourcesForcesY = inNeighbors[idxNeighbors]->getForcesY(i);
FReal*const sourcesForcesZ = inNeighbors[idxNeighbors]->getForcesZ(i);
for(unsigned int j = 0 ; j < 3 ; ++j){
const FReal*const targetsPhysicalValues = inTargets->getPhysicalValues(j);
const FReal*const sourcesPhysicalValues = inNeighbors[idxNeighbors]->getPhysicalValues(j);
// update component to be applied
const int d = applyTab[i*3+j];
// forces prefactor
FReal coef = -(targetsPhysicalValues[idxTarget] * sourcesPhysicalValues[idxSource]);
targetsForcesX[idxTarget] += dKxy[d][0] * coef;
targetsForcesY[idxTarget] += dKxy[d][1] * coef;
targetsForcesZ[idxTarget] += dKxy[d][2] * coef;
targetsPotentials[idxTarget] += ( Kxy[d] * sourcesPhysicalValues[idxSource] );
sourcesForcesX[idxSource] -= dKxy[d][0] * coef;
sourcesForcesY[idxSource] -= dKxy[d][1] * coef;
sourcesForcesZ[idxSource] -= dKxy[d][2] * coef;
sourcesPotentials[idxSource] += Kxy[d] * targetsPhysicalValues[idxTarget];
}// j
}// i
}
}
}
}
for(int idxTarget = 0 ; idxTarget < nbParticlesTargets ; ++idxTarget){
for(int idxSource = idxTarget + 1 ; idxSource < nbParticlesTargets ; ++idxSource){
// evaluate kernel and its partial derivatives
const FPoint sourcePoint(targetsX[idxSource],targetsY[idxSource],targetsZ[idxSource]);
const FPoint targetPoint(targetsX[idxTarget],targetsY[idxTarget],targetsZ[idxTarget]);
FReal Kxy[ncmp];
FReal dKxy[ncmp][3];
MatrixKernel->evaluateBlockAndDerivative(sourcePoint,targetPoint,Kxy,dKxy);
for(unsigned int i = 0 ; i < 3 ; ++i){
FReal*const targetsPotentials = inTargets->getPotentials(i);
FReal*const targetsForcesX = inTargets->getForcesX(i);
FReal*const targetsForcesY = inTargets->getForcesY(i);
FReal*const targetsForcesZ = inTargets->getForcesZ(i);
for(unsigned int j = 0 ; j < 3 ; ++j){
const FReal*const targetsPhysicalValues = inTargets->getPhysicalValues(j);
// update component to be applied
const int d = applyTab[i*3+j];
// forces prefactor
const FReal coef = -(targetsPhysicalValues[idxTarget] * targetsPhysicalValues[idxSource]);
targetsForcesX[idxTarget] += dKxy[d][0] * coef;
targetsForcesY[idxTarget] += dKxy[d][1] * coef;
targetsForcesZ[idxTarget] += dKxy[d][2] * coef;
targetsPotentials[idxTarget] += ( Kxy[d] * targetsPhysicalValues[idxSource] );
targetsForcesX[idxSource] -= dKxy[d][0] * coef;
targetsForcesY[idxSource] -= dKxy[d][1] * coef;
targetsForcesZ[idxSource] -= dKxy[d][2] * coef;
targetsPotentials[idxSource] += Kxy[d] * targetsPhysicalValues[idxTarget];
}// j
}// i
}
}
}
/**
* @brief FullRemoteKIJ
*/
template <class ContainerClass, typename MatrixKernelClass>
inline void FullRemoteKIJ(ContainerClass* const FRestrict inTargets, ContainerClass* const inNeighbors[],
const int limiteNeighbors, const MatrixKernelClass *const MatrixKernel){
// get information on tensorial aspect of matrix kernel
const int ncmp = MatrixKernelClass::NCMP;
const int applyTab[9] = {0,1,2,
1,3,4,
2,4,5};
const int nbParticlesTargets = inTargets->getNbParticles();
const FReal*const targetsX = inTargets->getPositions()[0];
const FReal*const targetsY = inTargets->getPositions()[1];
const FReal*const targetsZ = inTargets->getPositions()[2];
for(int idxNeighbors = 0 ; idxNeighbors < limiteNeighbors ; ++idxNeighbors){
for(int idxTarget = 0 ; idxTarget < nbParticlesTargets ; ++idxTarget){
if( inNeighbors[idxNeighbors] ){
const int nbParticlesSources = inNeighbors[idxNeighbors]->getNbParticles();
const FReal*const sourcesX = inNeighbors[idxNeighbors]->getPositions()[0];
const FReal*const sourcesY = inNeighbors[idxNeighbors]->getPositions()[1];
const FReal*const sourcesZ = inNeighbors[idxNeighbors]->getPositions()[2];
for(int idxSource = 0 ; idxSource < nbParticlesSources ; ++idxSource){
// evaluate kernel and its partial derivatives
const FPoint sourcePoint(sourcesX[idxSource],sourcesY[idxSource],sourcesZ[idxSource]);
const FPoint targetPoint(targetsX[idxTarget],targetsY[idxTarget],targetsZ[idxTarget]);
FReal Kxy[ncmp];
FReal dKxy[ncmp][3];
MatrixKernel->evaluateBlockAndDerivative(sourcePoint,targetPoint,Kxy,dKxy);
for(unsigned int i = 0 ; i < 3 ; ++i){
FReal*const targetsPotentials = inTargets->getPotentials(i);
FReal*const targetsForcesX = inTargets->getForcesX(i);
FReal*const targetsForcesY = inTargets->getForcesY(i);
FReal*const targetsForcesZ = inTargets->getForcesZ(i);
for(unsigned int j = 0 ; j < 3 ; ++j){
const FReal*const targetsPhysicalValues = inTargets->getPhysicalValues(j);
const FReal*const sourcesPhysicalValues = inNeighbors[idxNeighbors]->getPhysicalValues(j);
// update component to be applied
const int d = applyTab[i*3+j];
// forces prefactor
const FReal coef = -(targetsPhysicalValues[idxTarget] * sourcesPhysicalValues[idxSource]);
targetsForcesX[idxTarget] += dKxy[d][0] * coef;
targetsForcesY[idxTarget] += dKxy[d][1] * coef;
targetsForcesZ[idxTarget] += dKxy[d][2] * coef;
targetsPotentials[idxTarget] += ( Kxy[d] * sourcesPhysicalValues[idxSource] );
}// j
}// i
}
}
}
}
}
}
......
......@@ -232,7 +232,7 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
......@@ -240,7 +240,7 @@ public:
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -213,7 +213,7 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
......@@ -221,7 +221,7 @@ public:
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -188,7 +188,7 @@ class FUnifM2LHandler<ORDER,HOMOGENEOUS>
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"/*<< MatrixKernelClass::Identifier*/ << "_" << precision_type
stream << "m2l_k"/*<< MatrixKernelClass::getID()*/ << "_" << precision_type
<< "_o" << order << ".bin";
return stream.str();
}
......@@ -353,7 +353,7 @@ class FUnifM2LHandler<ORDER,NON_HOMOGENEOUS>
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"/*<< MatrixKernelClass::Identifier*/ << "_" << precision_type
stream << "m2l_k"/*<< MatrixKernelClass::getID()*/ << "_" << precision_type
<< "_o" << order << ".bin";
return stream.str();
}
......
This diff is collapsed.
......@@ -251,14 +251,14 @@ public:
ContainerClass* const NeighborSourceParticles[27],
const int /* size */)
{
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2P(TargetParticles,NeighborSourceParticles,MatrixKernel);
}
void P2PRemote(const FTreeCoordinate& /*inPosition*/,
ContainerClass* const FRestrict inTargets, const ContainerClass* const FRestrict /*inSources*/,
ContainerClass* const inNeighbors[27], const int /*inSize*/){
DirectInteractionComputer<MatrixKernelClass::Identifier, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
DirectInteractionComputer<MatrixKernelClass::NCMP, NVALS>::P2PRemote(inTargets,inNeighbors,27,MatrixKernel);
}
};
......
......@@ -212,7 +212,7 @@ class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,HOMOGENEOUS>
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"/*<< MatrixKernelClass::Identifier*/ << "_" << precision_type
stream << "m2l_k"/*<< MatrixKernelClass::getID()*/ << "_" << precision_type
<< "_o" << order << ".bin";
return stream.str();
}
......@@ -406,7 +406,7 @@ class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,NON_HOMOGENEOUS>
{
const char precision_type = (typeid(FReal)==typeid(double) ? 'd' : 'f');
std::stringstream stream;
stream << "m2l_k"/*<< MatrixKernelClass::Identifier*/ << "_" << precision_type
stream << "m2l_k"/*<< MatrixKernelClass::getID*/ << "_" << precision_type
<< "_o" << order << ".bin";
return stream.str();
}
......
......@@ -68,10 +68,7 @@ int main(int argc, char* argv[])
// typedefs
typedef FInterpMatrixKernel_R_IJ MatrixKernelClass;
// typedef FInterpMatrixKernelR MatrixKernelClass;
// typedef FInterpMatrixKernel_R_IJK MatrixKernelClass;
const KERNEL_FUNCTION_IDENTIFIER MK_ID = MatrixKernelClass::Identifier;
const unsigned int NPV = MatrixKernelClass::NPV;
const unsigned int NPOT = MatrixKernelClass::NPOT;
const unsigned int NRHS = MatrixKernelClass::NRHS;
......@@ -79,15 +76,6 @@ int main(int argc, char* argv[])
const double CoreWidth = 0.1;
const MatrixKernelClass MatrixKernel(CoreWidth);
std::cout<< "Interaction kernel: ";
if(MK_ID == ONE_OVER_R) std::cout<< "1/R";
else if(MK_ID == R_IJ)
std::cout<< "Ra_{,ij}"
<< " with core width a=" << CoreWidth <<std::endl;
else if(MK_ID == R_IJK)
std::cout<< "Ra_{,ijk} (BEWARE! Forces NOT YET IMPLEMENTED)"
<< " with core width a=" << CoreWidth <<std::endl;
else std::runtime_error("Provide a valid matrix kernel!");
// init particles position and physical value
struct TestParticle{
......@@ -134,37 +122,15 @@ int main(int argc, char* argv[])
{
for(int idxTarget = 0 ; idxTarget < loader.getNumberOfParticles() ; ++idxTarget){
for(int idxOther = idxTarget + 1 ; idxOther < loader.getNumberOfParticles() ; ++idxOther){
if(MK_ID == R_IJ)
FP2P::MutualParticlesRIJ(particles[idxTarget].position.getX(), particles[idxTarget].position.getY(),
particles[idxTarget].position.getZ(), particles[idxTarget].physicalValue,
particles[idxTarget].forces[0], particles[idxTarget].forces[1],
particles[idxTarget].forces[2], particles[idxTarget].potential,
particles[idxOther].position.getX(), particles[idxOther].position.getY(),
particles[idxOther].position.getZ(), particles[idxOther].physicalValue,
particles[idxOther].