From c051c7b93ff41f626dbd7be47d803ea002e377ef Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Fri, 20 Aug 2021 16:51:17 +0000 Subject: [PATCH] [pointsource] Fix unused variable warning --- dumux/common/pointsource.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dumux/common/pointsource.hh b/dumux/common/pointsource.hh index 9f2910c8be..3eda1766f3 100644 --- a/dumux/common/pointsource.hh +++ b/dumux/common/pointsource.hh @@ -301,12 +301,11 @@ public: // split the source values equally among all concerned entities source.setEmbeddings(entities.size()*source.embeddings()); - auto fvGeometry = localView(gridGeometry); - - // loop over all concerned elements - for (const auto eIdx : entities) + if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) { - if constexpr (GridGeometry::discMethod == DiscretizationMethod::box) + // loop over all concerned elements + auto fvGeometry = localView(gridGeometry); + for (const auto eIdx : entities) { // check in which subcontrolvolume(s) we are const auto element = boundingBoxTree.entitySet().entity(eIdx); @@ -334,7 +333,10 @@ public: s.setEmbeddings(scvIndices.size()*s.embeddings()); } } - else + } + else + { + for (const auto eIdx : entities) { // add the pointsource to the DOF map const auto key = std::make_pair(eIdx, /*scvIdx=*/ 0); -- GitLab