From 88f725b770f26d55de249e432e1d122756c7531d Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Tue, 26 Jul 2022 16:33:05 +0200
Subject: [PATCH] [test][donea] Cleanup problem

---
 test/freeflow/navierstokes/donea/problem.hh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/test/freeflow/navierstokes/donea/problem.hh b/test/freeflow/navierstokes/donea/problem.hh
index 4c580acb05..919414617a 100644
--- a/test/freeflow/navierstokes/donea/problem.hh
+++ b/test/freeflow/navierstokes/donea/problem.hh
@@ -96,7 +96,7 @@ public:
     {
         if constexpr (ParentType::isMomentumProblem())
         {
-            Sources source;
+            Sources source(0.0);
             const Scalar x = globalPos[0];
             const Scalar y = globalPos[1];
 
@@ -138,10 +138,7 @@ public:
                     values.setAllDirichlet();
             }
             else
-            {
-                values.setDirichlet(Indices::velocityXIdx);
-                values.setDirichlet(Indices::velocityYIdx);
-            }
+                values.setAllDirichlet();
         }
         else
             values.setNeumann(Indices::conti0EqIdx);
@@ -205,7 +202,7 @@ public:
      */
     DirichletValues analyticalSolution(const GlobalPosition& globalPos, Scalar time = 0.0) const
     {
-        DirichletValues values;
+        DirichletValues values(0.0);
 
         if constexpr (ParentType::isMomentumProblem())
         {
@@ -262,7 +259,8 @@ public:
 
             bool onBoundary = false;
             for (const auto& scvf : scvfs(fvGeometry))
-                onBoundary = std::max(onBoundary, scvf.boundary());
+                if (fvGeometry.scv(scvf.insideScvIdx()).dofIndex() == scv.dofIndex())
+                    onBoundary = std::max(onBoundary, scvf.boundary());
 
             if (onBoundary)
                 values.set(0);
@@ -284,7 +282,7 @@ public:
      * \param scv The sub-control volume
      */
     DirichletValues internalDirichlet(const Element& element, const SubControlVolume& scv) const
-    { return DirichletValues(analyticalSolution(scv.center())[Indices::pressureIdx]); }
+    { return DirichletValues(analyticalSolution(scv.dofPosition())[Indices::pressureIdx]); }
 
 private:
     Scalar p_(Scalar x) const
-- 
GitLab