Commit bb99ff87 authored by COULAUD Olivier's avatar COULAUD Olivier

Remove some cast (unsigned int <--> int)

Remove white space and align data
Code improvements (for cppcheck)
Add comments
parent 88347cde
......@@ -60,10 +60,10 @@ int main(int argc, char ** argv){
const FSize NbPoints = loader.getNumberOfParticles();
const unsigned int nbData = loader.getNbRecordPerline() ;
const FSize arraySize =nbData*NbPoints;
const FSize arraySize = nbData*NbPoints;
FReal * particles = new FReal[arraySize] ;
std::memset(particles,0,arraySize*sizeof(FReal));
FReal * particles = new FReal[arraySize] {};
// std::memset(particles,0,arraySize*sizeof(FReal));
FSize j = 0 ;
for(FSize idxPart = 0 ; idxPart < NbPoints ;++idxPart, j+=nbData){
......
......@@ -94,16 +94,16 @@ int main(int argc, char* argv[])
const std::string defaultFile(SCALFMMDataPath+"unitCubeXYZQ100.bfma" );
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const unsigned int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const unsigned int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
const std::string filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, defaultFile.c_str());
const int TreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeHeight.options, 5);
const int SubTreeHeight = FParameters::getValue(argc, argv, FParameterDefinitions::OctreeSubHeight.options, 2);
#ifdef _OPENMP
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, omp_get_max_threads());
omp_set_num_threads(NbThreads);
std::cout << "\n>> Using " << NbThreads << " threads.\n" << std::endl;
#else
const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
const int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
std::cout << "\n>> Sequential version.\n" << std::endl;
#endif
//
......
......@@ -42,11 +42,11 @@ template<class FReal, class CellClass, class ContainerClass, class LeafClass_, c
class FOctree : public FNoCopyable {
public:
using FRealType = FReal;
using CellClassType = CellClass;
using CellClassType = CellClass;
using ContainerClassType = ContainerClass; //< The type of the container used to store particles in the Octree
using LeafClassType = LeafClass_; //< The type of the Leaf used in the Octree
using LeafClass = LeafClass_; //< The type of the Leaf used in the Octree
using LeafClass_T = LeafClass_; //< The type of the Leaf used in the Octree
using LeafClassType = LeafClass_; //< The type of the Leaf used in the Octree
using LeafClass = LeafClass_; //< The type of the Leaf used in the Octree
using LeafClass_T = LeafClass_; //< The type of the Leaf used in the Octree
protected:
typedef FOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass> OctreeType;
......@@ -55,10 +55,10 @@ protected:
FAbstractSubOctree<FReal, CellClass , ContainerClass, LeafClass, CellAllocatorClass>* root; //< root suboctree
FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels
FReal*const boxWidthAtLevel; //< to store the width of each box at all levels
const int height; //< tree height
const int subHeight; //< tree height
const int height; //< Total tree height
const int subHeight; //< sub tree height
const int leafIndex; //< index of leaf int array
const FPoint<FReal> boxCenter; //< the space system center
......
......@@ -4,10 +4,10 @@
#define FCHEBCELL_HPP
#include <iostream>
#include "../../Components/FBasicCell.hpp"
#include "Components/FBasicCell.hpp"
#include "./FChebTensor.hpp"
#include "../../Extensions/FExtendCellType.hpp"
#include "FChebTensor.hpp"
#include "Extensions/FExtendCellType.hpp"
/**
* @author Matthias Messner (matthias.messner@inria.fr)
......@@ -22,7 +22,7 @@ class FChebCell : public FBasicCell, public FAbstractSendable
{
// nnodes = ORDER^3
// we multiply by 2 because we store the Multipole expansion end the compressed one.
static const int VectorSize = TensorTraits<ORDER>::nnodes * 2;
static constexpr int VectorSize = TensorTraits<ORDER>::nnodes * 2;
public:
......@@ -60,7 +60,7 @@ public:
};
using multipole_t = exp_impl<class multipole_tag, NRHS>;
using multipole_t = exp_impl<class multipole_tag, NRHS>;
using local_expansion_t = exp_impl<class local_expansion_tag, NLHS>;
multipole_t m_data {};
......
......@@ -8,7 +8,7 @@
#ifndef FCHEBINTERFACE_H
#define FCHEBINTERFACE_H
#include "Utils/FGlobal.hpp"
//To access leaf datas
struct FChebLeaf_struct;
......
......@@ -2,9 +2,9 @@
#ifndef FINTERPTENSOR_HPP
#define FINTERPTENSOR_HPP
#include "../../Utils/FMath.hpp"
#include "Utils/FMath.hpp"
#include "./FInterpMapping.hpp"
#include "FInterpMapping.hpp"
/**
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
#ifndef FUNIFTENSOR_HPP
#define FUNIFTENSOR_HPP
#include "../../Utils/FMath.hpp"
#include "Utils/FMath.hpp"
#include "FUnifRoots.hpp"
#include "../Interpolation/FInterpTensor.hpp"
......@@ -81,17 +81,26 @@ class FUnifTensor : public FInterpTensor<FReal, ORDER,FUnifRoots<FReal, ORDER>>
// Convention:
// lj=order-1 & li=0:order-1 => li-lj=1-order:0
// lj=1 & li=0:order-1 => li-lj=1:order-1
if(l<ORDER-1) lj=ORDER-1; else lj=0;
if(l<ORDER-1) {
lj=ORDER-1;}
else{
lj=0;}
li=(l-(ORDER-1))+lj;
for(unsigned int m=0; m<2*ORDER-1; ++m){
if(m<ORDER-1) mj=ORDER-1; else mj=0;
if(m<ORDER-1){
mj=ORDER-1;}
else {
mj=0;}
mi=(m-(ORDER-1))+mj;
for(unsigned int n=0; n<2*ORDER-1; ++n){
if(n<ORDER-1) nj=ORDER-1; else nj=0;
if(n<ORDER-1){
nj=ORDER-1;}
else{
nj=0;}
ni=(n-(ORDER-1))+nj;
NodeIdsPairs[ido][0]=li*ORDER*ORDER + mi*ORDER + ni;
......
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