Commit b1ec2122 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille
parents 713eff0d 1d359be6
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -219,7 +219,8 @@ public:
-4406.48579000 6815.52906417 10340.2577024
*/
void fillParticle(FPoint* inPosition, FReal inForces[3], FReal* inPhysicalValue, int* inIndex){
FReal x, y, z, fx, fy, fz, vx, vy, vz;
FReal x, y, z, fx=0.0, fy=0.0, fz=0.0, vx=0.0, vy=0.0, vz=0.0;
int index;
......
......@@ -107,6 +107,7 @@ public:
*/
virtual ~FFmaGenericLoader(){
file->close();
delete file ;
}
/**
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -1314,7 +1314,7 @@ inline void FChebInterpolator<ORDER,MatrixKernelClass>::applyL2PTotal(const FPoi
forces[idxLhs][i] = FReal(0.);
}
for(int idxLhs = 0 ; idxLhs < nLhs ; ++idxLhs){
for( int idxLhs = 0 ; idxLhs < nLhs ; ++idxLhs){
{
FReal f2[4], f4[4], f8[4];
......@@ -1352,8 +1352,8 @@ inline void FChebInterpolator<ORDER,MatrixKernelClass>::applyL2PTotal(const FPoi
forces[idxLhs][2] = ( FReal(2.)*f2[3] + FReal(4.)*f4[3] + FReal(8.)*f8[3]) * jacobian[2] / nnodes; // 7 flops
} // 28 + (ORDER-1) * ((ORDER-1) * (27 + (ORDER-1) * 16)) flops
const unsigned int idxPot = idxLhs / nPV;
const unsigned int idxPV = idxLhs % nPV;
const int idxPot = idxLhs / nPV;
const int idxPV = idxLhs % nPV;
// get potentials, physValues and forces components
const FReal*const physicalValues = inParticles->getPhysicalValues(idxPV);
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -23,10 +23,10 @@
#include <fstream>
#include <typeinfo>
#include "../../Utils/FBlas.hpp"
#include "../../Utils/FTic.hpp"
#include "Utils/FBlas.hpp"
#include "Utils/FTic.hpp"
#include "./FChebTensor.hpp"
#include "FChebTensor.hpp"
template <int ORDER>
......@@ -518,8 +518,11 @@ unsigned int Compress(const FReal epsilon, const unsigned int ninteractions,
const unsigned int info_col
= FBlas::gesvd(ninteractions*nnodes, nnodes, K_col, S, Q, nnodes,
LWORK, WORK);
if (info_col!=0)
throw std::runtime_error("SVD did not converge with " + info_col);
if (info_col!=0){
std::stringstream stream;
stream << info_col;
throw std::runtime_error("SVD did not converge with " + stream.str());
}
delete [] K_col;
const unsigned int k_col = getRank<ORDER>(S, epsilon);
......@@ -534,8 +537,11 @@ unsigned int Compress(const FReal epsilon, const unsigned int ninteractions,
const unsigned int info_row
= FBlas::gesvdSO(nnodes, ninteractions*nnodes, K_row, S, Q, nnodes,
LWORK, WORK);
if (info_row!=0)
throw std::runtime_error("SVD did not converge with " + info_row);
if (info_row!=0){
std::stringstream stream;
stream << info_row;
throw std::runtime_error("SVD did not converge with " + stream.str());
}
const unsigned int k_row = getRank<ORDER>(S, epsilon);
delete [] WORK;
......
......@@ -347,7 +347,7 @@ struct FInterpMatrixKernel_R_IJ : FInterpAbstractMatrixKernel
{}
// returns position in reduced storage from position in full 3x3 matrix
int getPosition(const unsigned int n) const
unsigned int getPosition(const unsigned int n) const
{return applyTab[n];}
// returns Core Width squared
......@@ -450,7 +450,7 @@ struct FInterpMatrixKernel_R_IJK : FInterpAbstractMatrixKernel
{}
// returns position in reduced storage from position in full 3x3x3 matrix
int getPosition(const unsigned int n) const
unsigned int getPosition(const unsigned int n) const
{return applyTab[n];}
// returns Core Width squared
......
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
......@@ -43,10 +43,10 @@ class FInterpSymmetries
unsigned int getQuadIdx(const int i, const int j, const int k) const
{
// find right quadrant index (if < 0 then 0, else 1)
const int si = ((unsigned int)i >> (sizeof(int)*CHAR_BIT-1));
const int sj = ((unsigned int)j >> (sizeof(int)*CHAR_BIT-2)) & 2;
const int sk = ((unsigned int)k >> (sizeof(int)*CHAR_BIT-3)) & 4;
return (sk | sj | si);
const int si = ((unsigned int)i >> (sizeof(int)*CHAR_BIT-1));
const int sj = ((unsigned int)j >> (sizeof(int)*CHAR_BIT-2)) & 2;
const int sk = ((unsigned int)k >> (sizeof(int)*CHAR_BIT-3)) & 4;
return static_cast<unsigned int>(sk | sj | si);
}
......@@ -113,17 +113,17 @@ class FInterpSymmetries
unsigned int getPermutationArrayAndIndex(const int i, const int j, const int k,
unsigned int permutation[nnodes]) const
unsigned int getPermutationArrayAndIndex(const int i, const int j, const int k,
unsigned int permutation[nnodes]) const
{
// find right quadrant index (if < 0 then 0, else 1)
const unsigned int qidx = getQuadIdx(i,j,k);
// store absolut values of (i,j,k) in (u[0],u[1],u[2])
const unsigned int imask = i >> (sizeof(int)*CHAR_BIT-1);
const unsigned int jmask = j >> (sizeof(int)*CHAR_BIT-1);
const unsigned int kmask = k >> (sizeof(int)*CHAR_BIT-1);
const unsigned int u[3] = {(i+imask)^imask, (j+jmask)^jmask, (k+kmask)^kmask};
// store absolute values of (i,j,k) in (u[0],u[1],u[2])
const int imask = i >> (sizeof(int)*CHAR_BIT-1);
const int jmask = j >> (sizeof(int)*CHAR_BIT-1);
const int kmask = k >> (sizeof(int)*CHAR_BIT-1);
const int u[3] = {(i+imask)^imask, (j+jmask)^jmask, (k+kmask)^kmask};
// find right cone index
const int q0 = (u[1]>u[0]) << 2;
......@@ -135,7 +135,7 @@ class FInterpSymmetries
for (unsigned int n=0; n<nnodes; ++n) permutation[n] = permutations[qidx*8 + cidx][n];
// set permutation index /////////////////////////////////////////
return (u[perms[cidx][0]]+3)*7*7 + (u[perms[cidx][1]]+3)*7 + (u[perms[cidx][2]]+3);
return static_cast<unsigned> (u[perms[cidx][0]]+3)*7*7 + (u[perms[cidx][1]]+3)*7 + (u[perms[cidx][2]]+3);
}
......
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