From 6c9d691582ab2fca3898ead04bb0a32316fa4404 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Sun, 30 Oct 2016 22:01:02 +0100
Subject: [PATCH] [bboxtree] Only call bounding box tree when there are point
 sources

When making the point source map we only want to make sure the bounding box
tree is initiated if there are any point sources. By a previous commit
this was mistakenly put in the beginning of the method so that the bounding
box tree is always built,
---
 dumux/implicit/problem.hh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dumux/implicit/problem.hh b/dumux/implicit/problem.hh
index f8044aae57..ec5788175e 100644
--- a/dumux/implicit/problem.hh
+++ b/dumux/implicit/problem.hh
@@ -1115,15 +1115,16 @@ protected:
         //! Compute the point source map, i.e. which scvs have point source contributions
     void computePointSourceMap_()
     {
-        if(!boundingBoxTree_)
-            boundingBoxTree_ = std::make_shared<BoundingBoxTree>(gridView_);
-
         // get and apply point sources if any given in the problem
         std::vector<PointSource> sources;
         asImp_().addPointSources(sources);
         // if there are point sources compute the DOF to point source map
         if (!sources.empty())
         {
+            // make sure the bounding box tree exists
+            if(!boundingBoxTree_)
+                boundingBoxTree_ = std::make_shared<BoundingBoxTree>(gridView_);
+
             // calculate point source locations and save them in a map
             pointSourceMap_.clear();
             PointSourceHelper::computePointSourceMap(asImp_(),
-- 
GitLab