Quinoa all test code coverage report
Current view: top level - Control/Walker/Options - CoeffPolicy.hpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 21 25 84.0 %
Date: 2021-11-11 18:25:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 25 50 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Control/Walker/Options/CoeffPolicy.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     Differential equation coefficients policy options
       9                 :            :   \details   Differential equation coefficients policy options
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef CoeffPolicyOptions_h
      13                 :            : #define CoeffPolicyOptions_h
      14                 :            : 
      15                 :            : #include <brigand/sequences/list.hpp>
      16                 :            : #include <brigand/algorithms/for_each.hpp>
      17                 :            : 
      18                 :            : #include "Toggle.hpp"
      19                 :            : #include "Keywords.hpp"
      20                 :            : #include "PUPUtil.hpp"
      21                 :            : 
      22                 :            : namespace walker {
      23                 :            : namespace ctr {
      24                 :            : 
      25                 :            : //! Differential equation coefficients policy types
      26                 :            : enum class CoeffPolicyType : uint8_t { CONST_COEFF=0
      27                 :            :                                      , DECAY
      28                 :            :                                      , HOMOGENEOUS
      29                 :            :                                      , HOMOGENEOUS_DECAY
      30                 :            :                                      , MONTE_CARLO_HOMOGENEOUS_DECAY
      31                 :            :                                      , HYDROTIMESCALE
      32                 :            :                                      , CONST_SHEAR
      33                 :            :                                      , STATIONARY
      34                 :            :                                      , INSTANTANEOUS_VELOCITY
      35                 :            :                                      };
      36                 :            : 
      37                 :            : //! Pack/Unpack CoeffPolicyType: forward overload to generic enum class packer
      38                 :        371 : inline void operator|( PUP::er& p, CoeffPolicyType& e ) { PUP::pup( p, e ); }
      39                 :            : 
      40                 :            : //! CoeffPolicy options: outsource searches to base templated on enum type
      41                 :            : class CoeffPolicy : public tk::Toggle< CoeffPolicyType > {
      42                 :            : 
      43                 :            :   public:
      44                 :            :     //! Valid expected choices to make them also available at compile-time
      45                 :            :     using keywords = brigand::list< kw::constcoeff
      46                 :            :                                   , kw::decay
      47                 :            :                                   , kw::homogeneous
      48                 :            :                                   , kw::homdecay
      49                 :            :                                   , kw::montecarlo_homdecay
      50                 :            :                                   , kw::hydrotimescale
      51                 :            :                                   , kw::const_shear
      52                 :            :                                   , kw::stationary
      53                 :            :                                   , kw::inst_velocity
      54                 :            :                                   >;
      55                 :            : 
      56                 :            :     //! \brief Options constructor
      57                 :            :     //! \details Simply initialize in-line and pass associations to base, which
      58                 :            :     //!    will handle client interactions
      59                 :        172 :     explicit CoeffPolicy() :
      60                 :            :       tk::Toggle< CoeffPolicyType >(
      61                 :            :         //! Group, i.e., options, name
      62                 :            :         "Coefficients Policy",
      63                 :            :         //! Enums -> names
      64         [ +  - ]:        172 :         { { CoeffPolicyType::CONST_COEFF, kw::constcoeff::name() },
      65         [ +  - ]:        344 :           { CoeffPolicyType::DECAY, kw::decay::name() },
      66         [ +  - ]:        344 :           { CoeffPolicyType::HOMOGENEOUS, kw::homogeneous::name() },
      67         [ +  - ]:        344 :           { CoeffPolicyType::HOMOGENEOUS_DECAY, kw::homdecay::name() },
      68                 :          0 :           { CoeffPolicyType::MONTE_CARLO_HOMOGENEOUS_DECAY,
      69         [ +  - ]:        344 :             kw::montecarlo_homdecay::name() },
      70         [ +  - ]:        344 :           { CoeffPolicyType::HYDROTIMESCALE, kw::hydrotimescale::name() },
      71         [ +  - ]:        344 :           { CoeffPolicyType::CONST_SHEAR, kw::const_shear::name() },
      72         [ +  - ]:        344 :           { CoeffPolicyType::STATIONARY, kw::stationary::name() },
      73                 :          0 :           { CoeffPolicyType::INSTANTANEOUS_VELOCITY,
      74         [ +  - ]:        344 :             kw::inst_velocity::name() } },
      75                 :            :         //! keywords -> Enums
      76                 :          0 :         {  { kw::constcoeff::string(), CoeffPolicyType::CONST_COEFF },
      77         [ +  - ]:        344 :            { kw::decay::string(), CoeffPolicyType::DECAY },
      78         [ +  - ]:        344 :            { kw::homogeneous::string(), CoeffPolicyType::HOMOGENEOUS },
      79         [ +  - ]:        344 :            { kw::homdecay::string(), CoeffPolicyType::HOMOGENEOUS_DECAY },
      80         [ +  - ]:        344 :            { kw::montecarlo_homdecay::string(),
      81                 :          0 :              CoeffPolicyType::MONTE_CARLO_HOMOGENEOUS_DECAY },
      82         [ +  - ]:        344 :            { kw::hydrotimescale::string(), CoeffPolicyType::HYDROTIMESCALE },
      83         [ +  - ]:        344 :            { kw::const_shear::string(), CoeffPolicyType::CONST_SHEAR },
      84         [ +  - ]:        344 :            { kw::stationary::string(), CoeffPolicyType::STATIONARY },
      85         [ +  - ]:        344 :            { kw::inst_velocity::string(),
      86 [ +  - ][ +  - ]:       6364 :              CoeffPolicyType::INSTANTANEOUS_VELOCITY } } )
         [ +  - ][ +  - ]
         [ +  + ][ +  + ]
         [ -  - ][ -  - ]
      87                 :        172 :     {}
      88                 :            : };
      89                 :            : 
      90                 :            : } // ctr::
      91                 :            : } // walker::
      92                 :            : 
      93                 :            : #endif // CoeffPolicyOptions_h

Generated by: LCOV version 1.14