Quinoa all test code coverage report
Current view: top level - PDE/EoS - EOS.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 15 31 48.4 %
Date: 2024-05-15 17:17:09 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 30 16.7 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/EoS/EOS.cpp
       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     Polymorphic variant-style implementation for equations of state,
       9                 :            :     where children implement specific EOS functions.
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : 
      13                 :            : #include "EoS/EOS.hpp"
      14                 :            : #include "Exception.hpp"
      15                 :            : #include "EoS/GetMatProp.hpp"
      16                 :            : 
      17                 :            : using inciter::EOS;
      18                 :            : 
      19                 :            : //! Constructor
      20                 :            : //! \param[in] mattype Material type
      21                 :            : //! \param[in] eq Type of PDE being solved
      22                 :            : //! \param[in] k Material index
      23                 :            : //! \details Based on the input enum we assign the correct material eos
      24                 :        797 : EOS::EOS( ctr::MaterialType mattype, EqType eq, std::size_t k )
      25                 :            : {
      26         [ +  + ]:        797 :   if (mattype == ctr::MaterialType::STIFFENEDGAS) {
      27                 :            :     // query input deck to get gamma, p_c, cv
      28                 :        788 :     auto g = getmatprop< tag::gamma >(k);
      29                 :        788 :     auto ps = getmatprop< tag::pstiff >(k);
      30                 :        788 :     auto c_v = getmatprop< tag::cv >(k);
      31                 :        788 :     m_material = StiffenedGas(g, ps, c_v);
      32                 :            :   }
      33         [ -  + ]:          9 :   else if (mattype == ctr::MaterialType::JWL) {
      34 [ -  - ][ -  - ]:          0 :     if (eq == EqType::compflow) Throw("JWL not set up for PDE type");
         [ -  - ][ -  - ]
      35                 :            :     // query input deck to get jwl parameters
      36                 :          0 :     auto w = getmatprop< tag::w_gru >(k);
      37                 :          0 :     auto c_v = getmatprop< tag::cv >(k);
      38                 :          0 :     auto A_jwl = getmatprop< tag::A_jwl >(k);
      39                 :          0 :     auto B_jwl = getmatprop< tag::B_jwl >(k);
      40                 :            :     //[[maybe_unused]] auto C_jwl =
      41                 :            :     //  getmatprop< tag::multimat, tag::C_jwl >(k);
      42                 :          0 :     auto R1_jwl = getmatprop< tag::R1_jwl >(k);
      43                 :          0 :     auto R2_jwl = getmatprop< tag::R2_jwl >(k);
      44                 :          0 :     auto rho0_jwl = getmatprop< tag::rho0_jwl >(k);
      45                 :          0 :     auto de_jwl = getmatprop< tag::de_jwl >(k);
      46                 :          0 :     auto rhor_jwl = getmatprop< tag::rhor_jwl >(k);
      47                 :          0 :     auto Tr_jwl = getmatprop< tag::Tr_jwl >(k);
      48                 :          0 :     auto Pr_jwl = getmatprop< tag::Pr_jwl >(k);
      49                 :          0 :     m_material = JWL(w, c_v, rho0_jwl, de_jwl, rhor_jwl, Tr_jwl, Pr_jwl, A_jwl,
      50                 :          0 :       B_jwl, R1_jwl, R2_jwl);
      51                 :            :   }
      52         [ +  - ]:          9 :   else if (mattype == ctr::MaterialType::SMALLSHEARSOLID) {
      53         [ -  + ]:          9 :     if (eq == EqType::compflow)
      54 [ -  - ][ -  - ]:          0 :       Throw("SmallShearSolid not set up for PDE type");
                 [ -  - ]
      55                 :            :     // query input deck for SmallShearSolid parameters
      56                 :          9 :     auto g = getmatprop< tag::gamma >(k);
      57                 :          9 :     auto ps = getmatprop< tag::pstiff >(k);
      58                 :          9 :     auto c_v = getmatprop< tag::cv >(k);
      59                 :          9 :     auto mu = getmatprop< tag::mu >(k);
      60                 :          9 :     m_material = SmallShearSolid(g, ps, c_v, mu);
      61                 :            :   }
      62 [ -  - ][ -  - ]:          0 :   else Throw( "Unknown EOS for material " + std::to_string(k+1) );
         [ -  - ][ -  - ]
      63                 :        797 : }

Generated by: LCOV version 1.14