From 75878f8e47aa18683c4563a7d256153c784cf3b3 Mon Sep 17 00:00:00 2001
From: Emilie Marchandise <emilie.marchandise@uclouvain.be>
Date: Thu, 6 Dec 2012 17:00:00 +0000
Subject: [PATCH] initialize some variables in curvature

---
 Geo/Curvature.cpp                              | 15 ++++++++++-----
 Mesh/CenterlineField.cpp                       |  4 ++--
 Mesh/meshGEdge.cpp                             |  3 ++-
 benchmarks/centerlines/aorta_centerlines.geo   | 12 ++++++------
 benchmarks/centerlines/carotid_centerlines.geo |  6 +++---
 benchmarks/centerlines/cyl_centerlines.geo     |  4 ++--
 benchmarks/curvature/test.geo                  |  2 +-
 7 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/Geo/Curvature.cpp b/Geo/Curvature.cpp
index 6bfbd321b6..7032e02fb5 100644
--- a/Geo/Curvature.cpp
+++ b/Geo/Curvature.cpp
@@ -688,25 +688,27 @@ void Curvature::computePointareas(){
       const int V0 = _VertexToInt[A->getNum()];
       const int V1 = _VertexToInt[B->getNum()];
       const int V2 = _VertexToInt[C->getNum()];
-      
+
+      factor[0] = 1.0;
+      factor[1] = 1.0;
+      factor[2] = 1.0;
       // if (_isOnBoundary[V0])
       // {
       //     factor[0] = 1.0;
       // }
-      // else { factor[0] = 1.0;}
+      // else {factor[0] = 1.0;}
       // if (_isOnBoundary[V1])
       // {
       //     factor[1] = 1.0;
       // }
       // else {factor[1] = 1.0;}
-
       // if (_isOnBoundary[V2])
       // {
       //     factor[2] = 1.0;
       // }
       // else {factor[2] = 1.0;}
-
-      //Edges
+      
+//Edges
       e[0] = SVector3(C->x() - B->x(), C->y() - B->y(), C->z() - B->z()); //vector side of a triangular element
       e[1] = SVector3(A->x() - C->x(), A->y() - C->y(), A->z() - C->z());
       e[2] = SVector3(B->x() - A->x(), B->y() - A->y(), B->z() - A->z());
@@ -1128,6 +1130,9 @@ void Curvature::computeCurvature_Rusinkiewicz(int isMax)
       //Estimate curvature based on variations of normals along edges:
       //intialization:
       m = SVector3(0.0, 0.0, 0.0);
+       for (int i = 0; i< 3; ++i)
+	 for (int j = 0; j< 3; ++j)
+	   w(i,j) = 0.0;
 
       //filling:
       for (int j = 0; j< 3; ++j)
diff --git a/Mesh/CenterlineField.cpp b/Mesh/CenterlineField.cpp
index 354eacbdd1..88dbe9e8c4 100644
--- a/Mesh/CenterlineField.cpp
+++ b/Mesh/CenterlineField.cpp
@@ -1029,7 +1029,7 @@ bool Centerline::cutByDisk(SVector3 &PT, SVector3 &NORM, double &maxRad)
 
 double Centerline::operator() (double x, double y, double z, GEntity *ge)
 {
- 
+
   if (update_needed){
      std::ifstream input;
      input.open(fileName.c_str());
@@ -1041,7 +1041,6 @@ double Centerline::operator() (double x, double y, double z, GEntity *ge)
    }
 
    double xyz[3] = {x,y,z};
-
    //take xyz = closest point on boundary in case we are on the planar in/out faces
    //or in the volume
    bool isCompound = false;
@@ -1078,6 +1077,7 @@ double Centerline::operator() (double x, double y, double z, GEntity *ge)
 
 void  Centerline::operator() (double x, double y, double z, SMetric3 &metr, GEntity *ge)
 {
+
   if (update_needed){
      std::ifstream input;
      input.open(fileName.c_str());
diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp
index 7ff2757035..eae12ec8de 100644
--- a/Mesh/meshGEdge.cpp
+++ b/Mesh/meshGEdge.cpp
@@ -369,9 +369,10 @@ void meshGEdge::operator() (GEdge *ge)
     N = ge->meshAttributes.nbPointsTransfinite;
   }
   else{
-    if (CTX::instance()->mesh.algo2d == ALGO_2D_BAMG || CTX::instance()->mesh.algo2d == ALGO_2D_PACK_PRLGRMS || blf)
+    if (CTX::instance()->mesh.algo2d == ALGO_2D_BAMG || CTX::instance()->mesh.algo2d == ALGO_2D_PACK_PRLGRMS || blf){
       a = Integration(ge, t_begin, t_end, F_Lc_aniso, Points,
                       CTX::instance()->mesh.lcIntegrationPrecision);
+    }
     else{
       a = Integration(ge, t_begin, t_end, F_Lc, Points,
                       CTX::instance()->mesh.lcIntegrationPrecision);
diff --git a/benchmarks/centerlines/aorta_centerlines.geo b/benchmarks/centerlines/aorta_centerlines.geo
index 694fdceb2d..dd0d76ec71 100644
--- a/benchmarks/centerlines/aorta_centerlines.geo
+++ b/benchmarks/centerlines/aorta_centerlines.geo
@@ -1,16 +1,16 @@
-Mesh.Algorithm = 8; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
-Mesh.Algorithm3D = 1; //(1=tetgen, 4=netgen, 5=FrontalDel, 6=FrontalHex, 7=MMG3D, 9=R-tree
+Mesh.Algorithm = 7; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
+Mesh.Algorithm3D = 7; //(1=tetgen, 4=netgen, 5=FrontalDel, 6=FrontalHex, 7=MMG3D, 9=R-tree
 
-Mesh.LcIntegrationPrecision = 1.e-3;
+Mesh.LcIntegrationPrecision = 1.e-2;
 
-Mesh.RecombineAll = 1;
-Mesh.Bunin = 60;
+//Mesh.RecombineAll = 1;
+//Mesh.Bunin = 60;
 
 Merge "aorta2.stl";
 
 Field[1] = Centerline;
 Field[1].FileName = "centerlinesAORTA.vtk";
-Field[1].nbPoints = 25; //33;
+Field[1].nbPoints = 25; 
 
 Field[1].nbElemLayer = 4;
 Field[1].hLayer = 0.2;//percent of vessel radius
diff --git a/benchmarks/centerlines/carotid_centerlines.geo b/benchmarks/centerlines/carotid_centerlines.geo
index f043b80644..51aca8bc7a 100644
--- a/benchmarks/centerlines/carotid_centerlines.geo
+++ b/benchmarks/centerlines/carotid_centerlines.geo
@@ -1,10 +1,10 @@
-Mesh.Algorithm = 8; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
+Mesh.Algorithm = 1; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
 Mesh.Algorithm3D = 1;//(1=tetgen, 4=netgen, 5=FrontalDel, 6=FrontalHex, 7=MMG3D, 9=R-tree
 
 Mesh.LcIntegrationPrecision = 1.e-2;
 
-Mesh.RecombineAll = 1;
-Mesh.Bunin = 100;
+//Mesh.RecombineAll = 1;
+//Mesh.Bunin = 100;
 
 Merge "carotid.stl";
 
diff --git a/benchmarks/centerlines/cyl_centerlines.geo b/benchmarks/centerlines/cyl_centerlines.geo
index 0405dbe15c..8e88efc01c 100644
--- a/benchmarks/centerlines/cyl_centerlines.geo
+++ b/benchmarks/centerlines/cyl_centerlines.geo
@@ -1,4 +1,4 @@
-Mesh.Algorithm = 7; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
+Mesh.Algorithm = 8; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
 Mesh.Algorithm3D = 7; //(1=tetgen, 4=netgen, 7=mmg3D
 
 Mesh.LcIntegrationPrecision = 1.e-2;
@@ -6,7 +6,7 @@ Mesh.LcIntegrationPrecision = 1.e-2;
 Merge "cylemi.stl";
 
 Mesh.RecombineAll = 1;
-//Mesh.Bunin = 200;
+//Mesh.Bunin = 100;
 
 Field[1] = Centerline;
 Field[1].FileName = "centerlinesCYL.vtk";
diff --git a/benchmarks/curvature/test.geo b/benchmarks/curvature/test.geo
index 2e8167cd6d..d4121badb9 100644
--- a/benchmarks/curvature/test.geo
+++ b/benchmarks/curvature/test.geo
@@ -1,4 +1,4 @@
- Mesh.RemeshParametrization=0; //(0) harmonic (1) conformal
+ Mesh.RemeshParametrization=1; //(0) harmonic (1) conformal
  Mesh.RemeshAlgorithm=1; //(0) nosplit (1) automatic (2) split only with metis 
  
  Mesh.Algorithm=1; //(1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)
-- 
GitLab