Quinoa all test code coverage report
Current view: top level - PDE/EoS - EOS.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 15 43 34.9 %
Date: 2025-01-16 13:03:36 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 19 136 14.0 %

           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         [ +  + ]:        789 : EOS::EOS( ctr::MaterialType mattype, EqType eq, std::size_t k )
      25                 :            : {
      26         [ +  + ]:        789 :   if (mattype == ctr::MaterialType::STIFFENEDGAS) {
      27                 :            :     // query input deck to get gamma, p_c, cv
      28         [ +  - ]:        765 :     auto g = getmatprop< tag::gamma >(k);
      29         [ +  - ]:        765 :     auto ps = getmatprop< tag::pstiff >(k);
      30         [ +  - ]:        765 :     auto c_v = getmatprop< tag::cv >(k);
      31         [ +  - ]:        765 :     m_material = StiffenedGas(g, ps, c_v);
      32                 :            :   }
      33         [ -  + ]:         24 :   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         [ -  + ]:         24 :   else if (mattype == ctr::MaterialType::SMALLSHEARSOLID) {
      53         [ -  - ]:          0 :     if (eq == EqType::compflow)
      54 [ -  - ][ -  - ]:          0 :       Throw("SmallShearSolid not set up for PDE type");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      55                 :            :     // query input deck for SmallShearSolid parameters
      56         [ -  - ]:          0 :     auto g = getmatprop< tag::gamma >(k);
      57         [ -  - ]:          0 :     auto ps = getmatprop< tag::pstiff >(k);
      58         [ -  - ]:          0 :     auto c_v = getmatprop< tag::cv >(k);
      59         [ -  - ]:          0 :     auto mu = getmatprop< tag::mu >(k);
      60         [ -  - ]:          0 :     m_material = SmallShearSolid(g, ps, c_v, mu);
      61                 :            :   }
      62         [ -  + ]:         24 :   else if (mattype == ctr::MaterialType::GODUNOVROMENSKIALUMINUM) {
      63         [ -  - ]:          0 :     if (eq == EqType::compflow)
      64 [ -  - ][ -  - ]:          0 :       Throw("GodunovRomenskiAluminum not set up for PDE type");
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      65                 :            :     // query input deck for GodunovRomenski parameters
      66         [ -  - ]:          0 :     auto g = getmatprop< tag::gamma >(k);
      67         [ -  - ]:          0 :     auto c_v = getmatprop< tag::cv >(k);
      68         [ -  - ]:          0 :     auto mu = getmatprop< tag::mu >(k);
      69         [ -  - ]:          0 :     m_material = GodunovRomenskiAluminum(g, c_v, mu);
      70                 :            :   }
      71         [ +  - ]:         24 :   else if (mattype == ctr::MaterialType::THERMALLYPERFECTGAS) {
      72                 :            :     // query input deck for ThermallyPerfectGas parameters
      73         [ +  - ]:         24 :     auto g = getspecprop< tag::gamma >(k);
      74         [ +  - ]:         24 :     auto R = getspecprop< tag::R >(k);
      75                 :            :     // assume only one type of species
      76                 :            :     auto cp_coeff =
      77         [ +  - ]:         24 :       g_inputdeck.get< tag::species >()[0].get< tag::cp_coeff >()[k];
      78 [ +  - ][ +  - ]:         72 :     m_material = ThermallyPerfectGas(g, R, cp_coeff);
         [ +  - ][ +  - ]
                 [ -  - ]
      79                 :            :   }
      80 [ -  - ][ -  - ]:          0 :   else Throw( "Unknown EOS for material " + std::to_string(k+1) );
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      81                 :        789 : }

Generated by: LCOV version 1.14