Quinoa all test code coverage report
Current view: top level - PDE/CompFlow/Problem - SedovBlastwave.cpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 9 22 40.9 %
Date: 2021-11-09 15:14:18 Functions: 2 4 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 15 50 30.0 %

           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                 :     904373 : CompFlowProblemSedovBlastwave::initialize( ncomp_t system,
      29                 :            :                                            ncomp_t,
      30                 :            :                                            tk::real x,
      31                 :            :                                            tk::real y,
      32                 :            :                                            tk::real z,
      33                 :            :                                            tk::real )
      34                 :            : // *****************************************************************************
      35                 :            : //  Initialize numerical solution
      36                 :            : //! \param[in] system Equation system index, i.e., which compressible
      37                 :            : //!   flow equation system we operate on among the systems of PDEs
      38                 :            : //! \param[in] x X coordinate where to evaluate the solution
      39                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      40                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      41                 :            : //! \return Values of all components evaluated at (x)
      42                 :            : //! \note The function signature must follow tk::InitializeFn
      43                 :            : // *****************************************************************************
      44                 :            : {
      45                 :            :   tk::real r=0, p=0, u=0, v=0, w=0, rE=0;
      46                 :            : 
      47                 :     904373 :   const auto scheme = g_inputdeck.get< tag::discr, tag::scheme >();
      48         [ +  - ]:     904373 :   const auto centering = ctr::Scheme().centering( scheme );
      49                 :            : 
      50                 :            :   // pressure
      51         [ +  - ]:     904373 :   if (centering == tk::Centering::ELEM) {
      52                 :            : 
      53 [ +  + ][ +  + ]:     904373 :     if ( (x<0.05) && (y<0.05) ) p = 783.4112; else p = 1.0e-6;
      54                 :            : 
      55         [ -  - ]:          0 :   } else if (centering == tk::Centering::NODE) {
      56                 :            : 
      57                 :            :     auto eps = std::numeric_limits< tk::real >::epsilon();
      58 [ -  - ][ -  - ]:          0 :     if (std::abs(x) < eps && std::abs(y) < eps && std::abs(z) < eps)
                 [ -  - ]
      59                 :          0 :       p = g_inputdeck.get< tag::param, tag::compflow, tag::p0 >()[ system ];
      60                 :            :     else
      61                 :            :       p = 0.67e-4;
      62                 :            : 
      63                 :            :   }
      64                 :            : 
      65                 :            :   // density
      66                 :            :   r = 1.0;
      67                 :            :   // velocity
      68                 :            :   u = v = w = 0.0;
      69                 :            :   // total specific energy
      70                 :     904373 :   rE = eos_totalenergy< eq >( system, r, u, v, w, p );
      71                 :            : 
      72                 :     904373 :   return {{ r, r*u, r*v, r*w, rE }};
      73                 :            : }
      74                 :            : 
      75                 :            : tk::InitializeFn::result_type
      76                 :          0 : CompFlowProblemSedovBlastwave::analyticSolution( ncomp_t system,
      77                 :            :                                                  ncomp_t,
      78                 :            :                                                  tk::real x,
      79                 :            :                                                  tk::real y,
      80                 :            :                                                  tk::real z,
      81                 :            :                                                  tk::real )
      82                 :            : // *****************************************************************************
      83                 :            : //  Evaluate analytical solution at (x,y,z,t) for all components
      84                 :            : //! \param[in] system Equation system index, i.e., which compressible
      85                 :            : //!   flow equation system we operate on among the systems of PDEs
      86                 :            : //! \param[in] x X coordinate where to evaluate the solution
      87                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      88                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      89                 :            : //! \return Values of all components evaluated at (x)
      90                 :            : //! \note The function signature must follow tk::InitializeFn
      91                 :            : //! \warning This is NOT the analytic solution at all times, only at t=0
      92                 :            : // *****************************************************************************
      93                 :            : {
      94                 :          0 :   return initialize( system, 0, x, y, z, 0 );
      95                 :            : }
      96                 :            : 
      97                 :            : std::vector< std::string >
      98         [ -  - ]:          0 : CompFlowProblemSedovBlastwave::analyticFieldNames( ncomp_t ) const
      99                 :            : // *****************************************************************************
     100                 :            : // Return analytic field names to be output to file
     101                 :            : //! \return Vector of strings labelling analytic fields output in file
     102                 :            : // *****************************************************************************
     103                 :            : {
     104                 :            :   std::vector< std::string > n;
     105         [ -  - ]:          0 :   n.push_back( "density_analytical" );
     106         [ -  - ]:          0 :   n.push_back( "x-velocity_analytical" );
     107         [ -  - ]:          0 :   n.push_back( "y-velocity_analytical" );
     108         [ -  - ]:          0 :   n.push_back( "z-velocity_analytical" );
     109         [ -  - ]:          0 :   n.push_back( "specific_total_energy_analytical" );
     110         [ -  - ]:          0 :   n.push_back( "pressure_analytical" );
     111                 :            : 
     112                 :          0 :   return n;
     113                 :            : }
     114                 :            : std::vector< std::string >
     115                 :          7 : CompFlowProblemSedovBlastwave::names( ncomp_t ) const
     116                 :            : // *****************************************************************************
     117                 :            : //  Return names of integral variables to be output to diagnostics file
     118                 :            : //! \return Vector of strings labelling integral variables output
     119                 :            : // *****************************************************************************
     120                 :            : {
     121 [ +  - ][ +  - ]:         42 :   return { "r", "ru", "rv", "rw", "re" };
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
         [ +  + ][ -  + ]
         [ -  - ][ -  - ]
     122                 :            : }

Generated by: LCOV version 1.14