From 1d3be1e4bd3a795dd562d9ec5ab2149cb604b0e2 Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Wed, 20 Jun 2018 11:14:54 +0200
Subject: [PATCH] change definition of method D velocity

not actually sure if this is ok.
But, the actual definition looks not correct.
---
 methods/Method_D.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/methods/Method_D.cpp b/methods/Method_D.cpp
index 41c11599..da1622a0 100644
--- a/methods/Method_D.cpp
+++ b/methods/Method_D.cpp
@@ -366,7 +366,7 @@ double Method_D::GetVoronoiVelocity(const vector<polygon_2d>& polygon, const vec
           intersection(measureArea, polygon_iterator, v);
           if(!v.empty())
           {
-               meanV+=(Velocity[temp]*area(v[0])/area(measureArea));
+               meanV+=Velocity[temp]*area(v[0])/area(polygon_iterator);
                if((area(v[0]) - area(polygon_iterator))>J_EPS)
                {
                     std::cout<<"this is a wrong result in calculating velocity\t"<<area(v[0])<<'\t'<<area(polygon_iterator)<< "  (diff=" << area(v[0]) - area(polygon_iterator) << ")"<< std::endl;
@@ -374,6 +374,8 @@ double Method_D::GetVoronoiVelocity(const vector<polygon_2d>& polygon, const vec
           }
           temp++;
      }
+     meanV = meanV/area(measureArea)*CMtoM*CMtoM;
+
      return meanV;
 }
 
-- 
GitLab