From 8ec729080a043a0a85ab7d68632f6098f8c92908 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de>
Date: Wed, 27 Sep 2023 18:56:29 +0200
Subject: [PATCH] [assembly] reuse noop

---
 dumux/experimental/assembly/cclocalassembler.hh   | 11 +++--------
 dumux/experimental/assembly/cvfelocalassembler.hh | 11 +++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/dumux/experimental/assembly/cclocalassembler.hh b/dumux/experimental/assembly/cclocalassembler.hh
index 80a1b79bf0..ea58dfcf7d 100644
--- a/dumux/experimental/assembly/cclocalassembler.hh
+++ b/dumux/experimental/assembly/cclocalassembler.hh
@@ -29,6 +29,7 @@
 #include <dumux/discretization/fluxstencil.hh>
 #include <dumux/discretization/cellcentered/elementsolution.hh>
 
+#include <dumux/experimental/common/typetraits/typetraits.hh>
 #include <dumux/experimental/assembly/fvlocalassemblerbase.hh>
 
 namespace Dumux::Experimental {
@@ -36,12 +37,6 @@ namespace Dumux::Experimental {
 #ifndef DOXYGEN
 namespace Detail::CC {
 
-struct NoOperator
-{
-    template<class... Args>
-    constexpr void operator()(Args&&...) const {}
-};
-
 template<class X, class Y>
 using Impl = std::conditional_t<!std::is_same_v<X, void>, X, Y>;
 
@@ -75,12 +70,12 @@ public:
 
     using ParentType::ParentType;
 
-    template <class ResidualVector, class StageParams, class PartialReassembler = DefaultPartialReassembler, class CouplingFunction = Detail::CC::NoOperator>
+    template <class ResidualVector, class StageParams, class PartialReassembler = DefaultPartialReassembler, class CouplingFunction = Noop>
     void assembleJacobianAndResidual(JacobianMatrix& jac, ResidualVector& res, GridVariables& gridVariables,
                                      const StageParams& stageParams, ResidualVector& temporal, ResidualVector& spatial,
                                      ResidualVector& constrainedDofs,
                                      const PartialReassembler* partialReassembler = nullptr,
-                                     const CouplingFunction& maybeAssembleCouplingBlocks = {})
+                                     const CouplingFunction& maybeAssembleCouplingBlocks = noop)
     {
         this->asImp_().bindLocalViews();
         const auto globalI = this->fvGeometry().gridGeometry().elementMapper().index(this->element());
diff --git a/dumux/experimental/assembly/cvfelocalassembler.hh b/dumux/experimental/assembly/cvfelocalassembler.hh
index 7c58d0115a..bec9d86816 100644
--- a/dumux/experimental/assembly/cvfelocalassembler.hh
+++ b/dumux/experimental/assembly/cvfelocalassembler.hh
@@ -26,6 +26,7 @@
 
 #include <dumux/assembly/numericepsilon.hh>
 #include <dumux/assembly/diffmethod.hh>
+#include <dumux/experimental/common/typetraits/typetraits.hh>
 #include <dumux/experimental/assembly/fvlocalassemblerbase.hh>
 #include <dumux/assembly/partialreassembler.hh>
 #include <dumux/assembly/entitycolor.hh>
@@ -39,12 +40,6 @@ namespace Dumux::Experimental {
 #ifndef DOXYGEN
 namespace Detail::CVFE {
 
-struct NoOperator
-{
-    template<class... Args>
-    constexpr void operator()(Args&&...) const {}
-};
-
 template<class X, class Y>
 using Impl = std::conditional_t<!std::is_same_v<X, void>, X, Y>;
 
@@ -90,12 +85,12 @@ public:
      * \brief Computes the derivatives with respect to the given element and adds them
      *        to the global matrix. The element residual is written into the right hand side.
      */
-    template <class ResidualVector, class StageParams, class PartialReassembler = DefaultPartialReassembler, class CouplingFunction = Detail::CVFE::NoOperator>
+    template <class ResidualVector, class StageParams, class PartialReassembler = DefaultPartialReassembler, class CouplingFunction = Noop>
     void assembleJacobianAndResidual(JacobianMatrix& jac, ResidualVector& res, GridVariables& gridVariables,
                                      const StageParams& stageParams, ResidualVector& temporal, ResidualVector& spatial,
                                      ResidualVector& constrainedDofs,
                                      const PartialReassembler* partialReassembler = nullptr,
-                                     const CouplingFunction& maybeAssembleCouplingBlocks = {})
+                                     const CouplingFunction& maybeAssembleCouplingBlocks = noop)
     {
         this->asImp_().bindLocalViews();
         const auto eIdxGlobal = this->asImp_().problem().gridGeometry().elementMapper().index(this->element());
-- 
GitLab