From fa2f714fa4da1489fb0717f374eea38227196829 Mon Sep 17 00:00:00 2001
From: Carlo Camilloni <carlo.camilloni@gmail.com>
Date: Mon, 26 May 2014 11:05:24 +0200
Subject: [PATCH] HISTOGRAM: workaround for floor approximation in grid
 assignment

---
 src/analysis/Histogram.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/analysis/Histogram.cpp b/src/analysis/Histogram.cpp
index 5b2ac4a47..5b5f5e2c4 100644
--- a/src/analysis/Histogram.cpp
+++ b/src/analysis/Histogram.cpp
@@ -215,6 +215,12 @@ void Histogram::performAnalysis(){
   } else {
     for(unsigned i=0;i<getNumberOfDataPoints();++i){
       getDataPoint( i, point, weight );
+      // Without KERNEL the point are assigned with a lower approximation (floor)
+      // in order to have a correct assigmnet points must be translated of half
+      // the mesh
+      std::vector<double> dx_;
+      dx_ = gg->getDx();
+      for(unsigned j=0;j<point.size();j++) point[j]+=0.5*dx_[j];
       gg->addValue(gg->getIndex(point), weight);
     }  
   }
-- 
GitLab