From 7beaa1cdbc1b2567809ddcc00f12ad325ed9cea3 Mon Sep 17 00:00:00 2001
From: Matti Pellika <matti.pellikka@tut.fi>
Date: Tue, 15 Jan 2013 08:50:55 +0000
Subject: [PATCH] Fix compile; Print total time spend on (co)homology tasks.

---
 Geo/Chain.cpp  | 11 +++++++++++
 Geo/Chain.h    | 10 +++-------
 Geo/GModel.cpp |  7 +++++++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/Geo/Chain.cpp b/Geo/Chain.cpp
index 16221db165..c56186f658 100644
--- a/Geo/Chain.cpp
+++ b/Geo/Chain.cpp
@@ -14,8 +14,19 @@
 #include "MHexahedron.h"
 #include "MPrism.h"
 
+#if defined(HAVE_FLTK)
+#include "FlGui.h"
+#endif
+
 #if defined(HAVE_KBIPACK)
 
+void updateFltkTree()
+{
+#if defined(HAVE_FLTK)
+  FlGui::instance()->rebuildTree();
+#endif
+}
+
 std::map<GEntity*, std::set<MVertex*, MVertexLessThanNum>,
          GEntityLessThan> ElemChain::_vertexCache;
 
diff --git a/Geo/Chain.h b/Geo/Chain.h
index dc995eb12e..0873fe4876 100644
--- a/Geo/Chain.h
+++ b/Geo/Chain.h
@@ -18,12 +18,10 @@
 #include "PViewOptions.h"
 #endif
 
-#if defined(HAVE_FLTK)
-#include "FlGui.h"
-#endif
-
 #if defined(HAVE_KBIPACK)
 
+void updateFltkTree();
+
 template <class TTypeA, class TTypeB>
   bool convert(const TTypeA& input, TTypeB& output ){
   std::stringstream stream;
@@ -520,9 +518,7 @@ void Chain<C>::addToModel(GModel* m, bool post,
     if(opt->tangents == 0) opt->tangents = size;
     if(opt->normals == 0) opt->normals = size;
     view->setOptions(opt);
-#if defined(HAVE_FLTK)
-    FlGui::instance()->rebuildTree();
-#endif
+    updateFltkTree();
   }
 #endif
 }
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 731cd69370..cad2e8a5a1 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -3187,6 +3187,8 @@ void GModel::computeHomology()
   if(_homologyRequests.empty()) return;
 
 #if defined(HAVE_KBIPACK)
+  double t1 = Cpu();
+
   // find unique domain/subdomain requests
   typedef std::pair<std::vector<int>, std::vector<int> > dpair;
   typedef std::pair<std::string, std::vector<int> > tpair;
@@ -3253,6 +3255,11 @@ void GModel::computeHomology()
     _pruneMeshVertexAssociations();
     delete homology;
   }
+
+  double t2 = Cpu();
+  Msg::StatusBar(true, "Done homology and cohomology computation (%g s)",
+                 t2 - t1);
+
 #else
   Msg::Error("Homology computation requires KBIPACK");
 #endif
-- 
GitLab