From 91140f2653242b602a7313fdad226f393defef46 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 28 Aug 2008 21:05:52 +0000
Subject: [PATCH] finalize should reinit adaptive data

---
 Post/PViewData.cpp              | 2 +-
 Post/adaptiveData.cpp           | 6 ++++--
 benchmarks/2d/transfinite_b.geo | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Post/PViewData.cpp b/Post/PViewData.cpp
index c2852b19b4..bedcbe799f 100644
--- a/Post/PViewData.cpp
+++ b/Post/PViewData.cpp
@@ -25,8 +25,8 @@ bool PViewData::finalize()
     Msg::Info("Initializing adaptive data %p interp size=%d",
 	this, _interpolation.size());
     _adaptive = new adaptiveData(this);
-    _adaptive->initWithLowResolution(0);
   }
+  if(_adaptive) _adaptive->initWithLowResolution(0);
   _dirty = false;
   return true;
 }
diff --git a/Post/adaptiveData.cpp b/Post/adaptiveData.cpp
index 1467b34221..ac09c30bae 100644
--- a/Post/adaptiveData.cpp
+++ b/Post/adaptiveData.cpp
@@ -999,11 +999,13 @@ void adaptiveElements<T>::initWithLowResolution(PViewData *data, int step)
       if(data->skipElement(step, ent, ele) ||
 	 data->getNumEdges(step, ent, ele) != T::numEdges) continue;
       if(numVal != data->getNumValues(step, ent, ele)){
-	Msg::Error("Wrong number of values (%d) in element %d (expecting %d)", numVal, ele, data->getNumValues(step, ent, ele));
+	Msg::Error("Wrong number of values (%d) in element %d (expecting %d)",
+		   numVal, ele, data->getNumValues(step, ent, ele));
 	continue;
       }
       if(numNodes != data->getNumNodes(step, ent, ele)){
-	Msg::Error("Wrong number of nodes (%d) in element %d (expecting %d)", numNodes, ele, data->getNumNodes(step, ent, ele));
+	Msg::Error("Wrong number of nodes (%d) in element %d (expecting %d)",
+		   numNodes, ele, data->getNumNodes(step, ent, ele));
 	continue;
       }
       for(int nod = 0; nod < numNodes; nod++){
diff --git a/benchmarks/2d/transfinite_b.geo b/benchmarks/2d/transfinite_b.geo
index 8efc8c4535..1a209a14a2 100644
--- a/benchmarks/2d/transfinite_b.geo
+++ b/benchmarks/2d/transfinite_b.geo
@@ -16,4 +16,4 @@ Transfinite Line {4} = 20 Using Progression 1./1.2;
 Transfinite Line {3,2} = 10 Using Progression 1;
 Transfinite Line {5} = 19 Using Progression 1;
 Transfinite Surface {7} = {3,6,4,2} Alternated;
-Recombine Surface {7};
+//Recombine Surface {7};
-- 
GitLab