diff --git a/Src/Kernels/Taylor/FTaylorKernel.hpp b/Src/Kernels/Taylor/FTaylorKernel.hpp index 9e598929f2bcec56ae87234271f5328391e3d47a..d256bb70efc9c45a9104ec82949c160487549614 100644 --- a/Src/Kernels/Taylor/FTaylorKernel.hpp +++ b/Src/Kernels/Taylor/FTaylorKernel.hpp @@ -607,7 +607,7 @@ public: * where \f\$x_c\f\$ is the centre of the cell and \f\$x_j\f\$ the \f\$j^{th}\f\$ particles and \f\$q_j\f\$ its charge. */ void L2P(const CellClass* const local, - ContainerClass* const particles) + ContainerClass* const particles) { FPoint locCenter = getLeafCenter(local->getCoordinate()); @@ -631,13 +631,16 @@ public: //Iteration over particles for(int i=0 ; igetLocal(); + FReal partPhyValue = phyValues[i]; + // + FReal locPot = 0.0, locForceX = 0.0, locForceY = 0.0, locForceZ = 0.0 ; for(int j=0 ; j CellClass; @@ -76,14 +76,21 @@ int main(int argc,char* argv[]){ for(int idxPart = 0 ; idxPart < nbParticlesInLeaf ; ++idxPart){ potential += potentials[idxPart]; - fx += forcesX[idxPart]; - fy += forcesY[idxPart]; - fz += forcesZ[idxPart]; + fx += forcesX[idxPart]; + fy += forcesY[idxPart]; + fz += forcesZ[idxPart]; printf("part : %f, fx = %f, fy = %f, fz = %f\n",leaf->getTargets()->getPositions()[0][0],fx,fy,fz); } }); - printf("potential : %f\n",potential); + // + FReal dx = part1Pos.getX() - part2Pos.getX(); + FReal dy = part1Pos.getY() - part2Pos.getY(); + FReal dz = part1Pos.getZ() - part2Pos.getZ(); + // + FReal potTheo = physVal2*physVal1*FMath::Sqrt(1.0 / (dx*dx + dy*dy + dz*dz)); + printf("Exact potential : %f Computed potential : %f Error: %f \n",potTheo, potential,potTheo- potential); + } return 0;