Quinoa all test code coverage report
Current view: top level - Control/Inciter/Options - Scheme.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 7 8 87.5 %
Date: 2024-04-29 14:42:33 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 12 38 31.6 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Inciter/Options/Scheme.hpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.
       7                 :            :              All rights reserved. See the LICENSE file for details.
       8                 :            :   \brief     Discretization scheme options for inciter
       9                 :            :   \details   Discretization scheme options for inciter
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef SchemeOptions_h
      13                 :            : #define SchemeOptions_h
      14                 :            : 
      15                 :            : #include <brigand/sequences/list.hpp>
      16                 :            : 
      17                 :            : #include "Toggle.hpp"
      18                 :            : #include "PUPUtil.hpp"
      19                 :            : #include "Centering.hpp"
      20                 :            : 
      21                 :            : namespace inciter {
      22                 :            : namespace ctr {
      23                 :            : 
      24                 :            : //! Scheme types
      25                 :            : enum class SchemeType : uint8_t { ALECG
      26                 :            :                                 , OversetFE
      27                 :            :                                 , DG
      28                 :            :                                 , P0P1 
      29                 :            :                                 , DGP1 
      30                 :            :                                 , DGP2
      31                 :            :                                 , PDG
      32                 :            :                                 , FV };
      33                 :            : 
      34                 :            : //! Pack/Unpack SchemeType: forward overload to generic enum class packer
      35                 :            : inline void operator|( PUP::er& p, SchemeType& e ) { PUP::pup( p, e ); }
      36                 :            : 
      37                 :            : //! \brief Scheme options: outsource to base templated on enum type
      38                 :     436805 : class Scheme : public tk::Toggle< SchemeType > {
      39                 :            : 
      40                 :            :   public:
      41                 :            :     //! \brief Options constructor
      42                 :            :     //! \details Simply initialize in-line and pass associations to base, which
      43                 :            :     //!    will handle client interactions
      44                 :     436805 :     explicit Scheme() :
      45                 :            :       tk::Toggle< SchemeType >(
      46                 :            :         //! Group, i.e., options, name
      47                 :            :         "Scheme",
      48                 :            :         //! Enums -> names (if defined, policy codes, if not, name)
      49                 :            :         { { SchemeType::ALECG, "alecg" },
      50                 :            :           { SchemeType::OversetFE, "oversetfe" },
      51                 :            :           { SchemeType::DG, "dg" },
      52                 :            :           { SchemeType::P0P1, "p0p1" },
      53                 :            :           { SchemeType::DGP1, "dgp1" },
      54                 :            :           { SchemeType::DGP2, "dgp2" },
      55                 :            :           { SchemeType::PDG, "pdg" },
      56                 :            :           { SchemeType::FV, "fv" } },
      57                 :            :         //! keywords -> Enums
      58                 :            :         { { "alecg", SchemeType::ALECG },
      59                 :            :           { "oversetfe", SchemeType::OversetFE },
      60                 :            :           { "dg", SchemeType::DG },
      61                 :            :           { "p0p1", SchemeType::P0P1 }, 
      62                 :            :           { "dgp1", SchemeType::DGP1 }, 
      63                 :            :           { "dgp2", SchemeType::DGP2 },
      64                 :            :           { "pdg", SchemeType::PDG },
      65 [ +  - ][ +  - ]:    8736100 :           { "fv", SchemeType::FV } } ) {}
         [ +  - ][ +  + ]
         [ -  + ][ +  + ]
         [ -  + ][ -  - ]
         [ -  - ][ -  - ]
                 [ -  - ]
      66                 :            : 
      67                 :            :     //! Return scheme centering for SchemeType
      68                 :            :     //! \param[in] type Scheme type
      69                 :            :     //! \return Mesh centering for scheme type
      70                 :     436415 :     tk::Centering centering( SchemeType type ) {
      71         [ +  + ]:     436415 :       if ( type == SchemeType::ALECG ||
      72                 :            :            type == SchemeType::OversetFE )
      73                 :            : 
      74                 :            :         return tk::Centering::NODE;
      75                 :            : 
      76                 :     436063 :       else if ( type == SchemeType::DG ||
      77                 :            :                 type == SchemeType::P0P1 ||
      78                 :            :                 type == SchemeType::DGP1 ||
      79                 :            :                 type == SchemeType::DGP2 ||
      80         [ -  + ]:     436063 :                 type == SchemeType::PDG ||
      81                 :            :                 type == SchemeType::FV )
      82                 :            : 
      83                 :            :         return tk::Centering::ELEM;
      84                 :            : 
      85 [ -  - ][ -  - ]:          0 :       else Throw( "No such scheme centering" );
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      86                 :            :     }
      87                 :            : };
      88                 :            : 
      89                 :            : } // ctr::
      90                 :            : } // inciter::
      91                 :            : 
      92                 :            : #endif // SchemeOptions_h

Generated by: LCOV version 1.14