From 2250ee3f6f297936dcae03b8c258d0d2d678dc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20L=C3=BCbke?= Date: Fri, 7 Feb 2025 09:51:46 +0100 Subject: [PATCH] refactor(advection): move steady state check to velocities --- include/tug/Advection/Advection.hpp | 4 +--- include/tug/Advection/Velocities.hpp | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/tug/Advection/Advection.hpp b/include/tug/Advection/Advection.hpp index 6fd52b7..a20de13 100644 --- a/include/tug/Advection/Advection.hpp +++ b/include/tug/Advection/Advection.hpp @@ -120,9 +120,7 @@ public: this->setDomain(velocities.domainX(), velocities.domainY()); if constexpr (hyd_mode == HYDRAULIC_MODE::STEADY_STATE) { - if (!velocities.isSteady()) { - velocities.run(); - } + velocities.run(); } for (int i = 0; i < this->getIterations(); i++) { diff --git a/include/tug/Advection/Velocities.hpp b/include/tug/Advection/Velocities.hpp index b98a195..f62f8d9 100644 --- a/include/tug/Advection/Velocities.hpp +++ b/include/tug/Advection/Velocities.hpp @@ -206,6 +206,10 @@ public: .deltaCol = this->deltaCol()}; if constexpr (hyd_mode == HYDRAULIC_MODE::STEADY_STATE) { + if (steady) { + return; + } + const T deltaColSquare = this->deltaCol() * this->deltaCol(); const T deltaRowSquare = this->deltaRow() * this->deltaRow(); const T minDeltaSquare = std::min(deltaColSquare, deltaRowSquare);