From e2dc2b2fa4274f1df63ac3de1a45178a43c45f4a Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 1 Sep 2009 16:59:01 +0000
Subject: [PATCH] missing initAdaptiveData when creating a new view in
 PView::combine

---
 Post/PView.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Post/PView.cpp b/Post/PView.cpp
index 8282e3331f..3c23f24029 100644
--- a/Post/PView.cpp
+++ b/Post/PView.cpp
@@ -223,9 +223,20 @@ void PView::combine(bool time, int how, bool remove)
       PView *p = new PView();
       PViewData *data = p->getData();
       bool res = time ? data->combineTime(nds[i]): data->combineSpace(nds[i]);
-      if(res)
+      if(res){
         for(unsigned int j = 0; j < nds[i].indices.size(); j++)
           rm.insert(list[nds[i].indices[j]]);
+
+        PViewOptions *opt = p->getOptions();
+        if(opt->adaptVisualizationGrid){
+          // the (empty) adaptive data created in PView() must be
+          // recreated, since we added some data
+          data->destroyAdaptiveData();
+          data->initAdaptiveData
+            (opt->timeStep, opt->maxRecursionLevel, opt->targetError);
+        }
+
+      }
       else
         delete p;
     }
-- 
GitLab