Quinoa all test code coverage report
Current view: top level - PDE/CompFlow/Problem - SedovBlastwave.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 12 26 46.2 %
Date: 2024-04-29 14:42:33 Functions: 2 4 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 16 54 29.6 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/CompFlow/Problem/SedovBlastwave.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     Problem configuration for the compressible flow equations
       9                 :            :   \details   This file defines a Problem policy class for the compressible flow
      10                 :            :     equations, defined in PDE/CompFlow/CompFlow.h. See PDE/CompFlow/Problem.h
      11                 :            :     for general requirements on Problem policy classes for CompFlow.
      12                 :            : */
      13                 :            : // *****************************************************************************
      14                 :            : 
      15                 :            : #include "SedovBlastwave.hpp"
      16                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      17                 :            : #include "FieldOutput.hpp"
      18                 :            : 
      19                 :            : namespace inciter {
      20                 :            : 
      21                 :            : extern ctr::InputDeck g_inputdeck;
      22                 :            : 
      23                 :            : } // ::inciter
      24                 :            : 
      25                 :            : using inciter::CompFlowProblemSedovBlastwave;
      26                 :            : 
      27                 :            : tk::InitializeFn::result_type
      28                 :     435713 : CompFlowProblemSedovBlastwave::initialize( ncomp_t,
      29                 :            :                                            const std::vector< EOS >& mat_blk,
      30                 :            :                                            tk::real x,
      31                 :            :                                            tk::real y,
      32                 :            :                                            tk::real z,
      33                 :            :                                            tk::real )
      34                 :            : // *****************************************************************************
      35                 :            : //  Initialize numerical solution
      36                 :            : //! \param[in] x X coordinate where to evaluate the solution
      37                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      38                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      39                 :            : //! \return Values of all components evaluated at (x)
      40                 :            : //! \note The function signature must follow tk::InitializeFn
      41                 :            : // *****************************************************************************
      42                 :            : {
      43                 :     435713 :   tk::real r=0, p=0, u=0, v=0, w=0, rE=0;
      44                 :            : 
      45                 :     435713 :   const auto scheme = g_inputdeck.get< tag::scheme >();
      46         [ +  - ]:     435713 :   const auto centering = ctr::Scheme().centering( scheme );
      47                 :            : 
      48                 :            :   // pressure
      49         [ +  - ]:     435713 :   if (centering == tk::Centering::ELEM) {
      50                 :            : 
      51 [ +  + ][ +  + ]:     435713 :     if ( (x<0.05) && (y<0.05) ) p = 783.4112; else p = 1.0e-6;
      52                 :            : 
      53         [ -  - ]:          0 :   } else if (centering == tk::Centering::NODE) {
      54                 :            : 
      55                 :            :     auto eps = std::numeric_limits< tk::real >::epsilon();
      56 [ -  - ][ -  - ]:          0 :     if (std::abs(x) < eps && std::abs(y) < eps && std::abs(z) < eps)
                 [ -  - ]
      57                 :          0 :       p = g_inputdeck.get< tag::compflow, tag::p0 >();
      58                 :            :     else
      59                 :          0 :       p = 0.67e-4;
      60                 :            : 
      61                 :            :   }
      62                 :            : 
      63                 :            :   // density
      64                 :     435713 :   r = 1.0;
      65                 :            :   // velocity
      66                 :     435713 :   u = v = w = 0.0;
      67                 :            :   // total specific energy
      68         [ +  - ]:     435713 :   rE = mat_blk[0].compute< EOS::totalenergy >( r, u, v, w, p );
      69                 :            : 
      70                 :     435713 :   return {{ r, r*u, r*v, r*w, rE }};
      71                 :            : }
      72                 :            : 
      73                 :            : tk::InitializeFn::result_type
      74                 :          0 : CompFlowProblemSedovBlastwave::analyticSolution(
      75                 :            :   ncomp_t,
      76                 :            :   const std::vector< EOS >& mat_blk,
      77                 :            :   tk::real x,
      78                 :            :   tk::real y,
      79                 :            :   tk::real z,
      80                 :            :   tk::real )
      81                 :            : // *****************************************************************************
      82                 :            : //  Evaluate analytical solution at (x,y,z,t) for all components
      83                 :            : //! \param[in] x X coordinate where to evaluate the solution
      84                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      85                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      86                 :            : //! \return Values of all components evaluated at (x)
      87                 :            : //! \note The function signature must follow tk::InitializeFn
      88                 :            : //! \warning This is NOT the analytic solution at all times, only at t=0
      89                 :            : // *****************************************************************************
      90                 :            : {
      91                 :          0 :   return initialize( 0, mat_blk, x, y, z, 0 );
      92                 :            : }
      93                 :            : 
      94                 :            : std::vector< std::string >
      95 [ -  - ][ -  - ]:          0 : CompFlowProblemSedovBlastwave::analyticFieldNames( ncomp_t ) const
      96                 :            : // *****************************************************************************
      97                 :            : // Return analytic field names to be output to file
      98                 :            : //! \return Vector of strings labelling analytic fields output in file
      99                 :            : // *****************************************************************************
     100                 :            : {
     101                 :            :   std::vector< std::string > n;
     102         [ -  - ]:          0 :   n.push_back( "density_analytical" );
     103         [ -  - ]:          0 :   n.push_back( "x-velocity_analytical" );
     104         [ -  - ]:          0 :   n.push_back( "y-velocity_analytical" );
     105         [ -  - ]:          0 :   n.push_back( "z-velocity_analytical" );
     106         [ -  - ]:          0 :   n.push_back( "specific_total_energy_analytical" );
     107         [ -  - ]:          0 :   n.push_back( "pressure_analytical" );
     108                 :            : 
     109                 :          0 :   return n;
     110                 :            : }
     111                 :            : std::vector< std::string >
     112                 :          5 : CompFlowProblemSedovBlastwave::names( ncomp_t ) const
     113                 :            : // *****************************************************************************
     114                 :            : //  Return names of integral variables to be output to diagnostics file
     115                 :            : //! \return Vector of strings labelling integral variables output
     116                 :            : // *****************************************************************************
     117                 :            : {
     118 [ +  - ][ +  - ]:         30 :   return { "r", "ru", "rv", "rw", "re" };
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
         [ +  + ][ -  + ]
         [ -  - ][ -  - ]
     119                 :            : }

Generated by: LCOV version 1.14