LCOV - code coverage report
Current view: top level - include/base - INSFVAttributes.h (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 12 13 92.3 %
Date: 2025-08-14 10:14:56 Functions: 6 7 85.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #pragma once
      11             : 
      12             : #include "Attributes.h"
      13             : 
      14             : enum class INSFVBCs
      15             : {
      16             :   INSFVFlowBC = 1 << 1,
      17             :   INSFVFullyDevelopedFlowBC = 1 << 2,
      18             :   INSFVNoSlipWallBC = 1 << 3,
      19             :   INSFVSlipWallBC = 1 << 4,
      20             :   INSFVSymmetryBC = 1 << 5,
      21             :   INSFVFreeSurfaceBC = 1 << 6
      22             : };
      23             : 
      24             : #define clonefunc(T)                                                                               \
      25             :   virtual std::unique_ptr<Attribute> clone() const override                                        \
      26             :   {                                                                                                \
      27             :     return std::unique_ptr<Attribute>(new T(*this));                                               \
      28             :   }
      29             : 
      30             : #define hashfunc(...)                                                                              \
      31             :   virtual size_t hash() const override                                                             \
      32             :   {                                                                                                \
      33             :     size_t h = 0;                                                                                  \
      34             :     Moose::hash_combine(h, __VA_ARGS__);                                                           \
      35             :     return h;                                                                                      \
      36             :   }
      37             : 
      38             : /**
      39             :  * An attribute specifying that a boundary condition is a member of a subset of boundary conditions
      40             :  * appropriate for incompressible or weakly compressible flow physics
      41             :  */
      42      461989 : class AttribINSFVBCs : public Attribute
      43             : {
      44             : public:
      45             :   typedef INSFVBCs Key;
      46             :   void setFrom(Key k) { _val = static_cast<uint64_t>(k); }
      47             : 
      48             :   AttribINSFVBCs(TheWarehouse & w) : Attribute(w, "insfvbcs") {}
      49    20312839 :   AttribINSFVBCs(TheWarehouse & w, INSFVBCs mask)
      50    20312839 :     : Attribute(w, "insfvbcs"), _val(static_cast<uint64_t>(mask))
      51             :   {
      52    20312839 :   }
      53       28546 :   AttribINSFVBCs(TheWarehouse & w, unsigned int mask) : Attribute(w, "insfvbcs"), _val(mask) {}
      54             :   virtual void initFrom(const MooseObject * obj) override;
      55             :   virtual bool isMatch(const Attribute & other) const override;
      56             :   virtual bool isEqual(const Attribute & other) const override;
      57    20486569 :   hashfunc(_val);
      58      461989 :   clonefunc(AttribINSFVBCs);
      59             : 
      60             : private:
      61             :   uint64_t _val = 0;
      62             : };
      63             : 
      64             : /**
      65             :  * An attribute specifying that an object is a residual object applicable to the Navier-Stokes
      66             :  * momentum equation for incompressible or weakly compressible flows
      67             :  */
      68      288259 : class AttribINSFVMomentumResidualObject : public Attribute
      69             : {
      70             : public:
      71             :   typedef bool Key;
      72             :   void setFrom(const Key k) { _val = k; }
      73             :   AttribINSFVMomentumResidualObject(TheWarehouse & w)
      74             :     : Attribute(w, "insfv_residual_object"), _val(false)
      75             :   {
      76             :   }
      77       14273 :   AttribINSFVMomentumResidualObject(TheWarehouse & w, Key k)
      78       14273 :     : Attribute(w, "insfv_residual_object"), _val(k)
      79             :   {
      80       14273 :   }
      81             :   void initFrom(const MooseObject * obj) override;
      82             :   bool isMatch(const Attribute & other) const override;
      83             :   bool isEqual(const Attribute & other) const override;
      84           0 :   hashfunc(_val);
      85      288259 :   clonefunc(AttribINSFVMomentumResidualObject);
      86             : 
      87             : private:
      88             :   Key _val;
      89             : };
      90             : 
      91             : #undef clonefunc
      92             : #undef hashfunc

Generated by: LCOV version 1.14