Quinoa all test code coverage report
Current view: top level - PDE/MultiMat/Problem - SinewavePacket.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 0 16 0.0 %
Date: 2024-11-22 09:12:55 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/MultiMat/Problem/SinewavePacket.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/MultiMat/MultiMat.h. See PDE/MultiMat/Problem.h
      11                 :            :     for general requirements on Problem policy classes for MultiMat.
      12                 :            : */
      13                 :            : // *****************************************************************************
      14                 :            : 
      15                 :            : #include "SinewavePacket.hpp"
      16                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      17                 :            : #include "MultiMat/MultiMatIndexing.hpp"
      18                 :            : 
      19                 :            : namespace inciter {
      20                 :            : 
      21                 :            : extern ctr::InputDeck g_inputdeck;
      22                 :            : 
      23                 :            : }
      24                 :            : 
      25                 :            : using inciter::MultiMatProblemSinewavePacket;
      26                 :            : 
      27                 :            : tk::InitializeFn::result_type
      28                 :          0 : MultiMatProblemSinewavePacket::initialize( ncomp_t ncomp,
      29                 :            :                                            const std::vector< EOS >& mat_blk,
      30                 :            :                                            tk::real x,
      31                 :            :                                            tk::real /*y*/,
      32                 :            :                                            tk::real /*z*/,
      33                 :            :                                            tk::real t )
      34                 :            : // *****************************************************************************
      35                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      36                 :            : //! \param[in] ncomp Number of scalar components in this PDE system
      37                 :            : //! \param[in] x X coordinate where to evaluate the solution
      38                 :            : //! \param[in] t Time where to evaluate the solution
      39                 :            : //! \return Values of all components evaluated at (x,t)
      40                 :            : //! \note The function signature must follow tk::InitializeFn
      41                 :            : // *****************************************************************************
      42                 :            : {
      43                 :          0 :   auto nmat = g_inputdeck.get< eq, tag::nmat >();
      44                 :            : 
      45                 :            :   Assert(nmat == 1, "Sinewave packet advection not set up for more than one "
      46                 :            :     "material");
      47                 :            : 
      48                 :            :   // see also Control/Inciter/InputDeck/Grammar.hpp
      49                 :            :   Assert( ncomp == 3*nmat+3, "Incorrect number of components in multi-material "
      50                 :            :           "system" );
      51                 :            : 
      52                 :          0 :   std::vector< tk::real > s( ncomp, 0.0 );
      53                 :          0 :   auto u = 1.0;
      54                 :          0 :   auto v = 0.0;
      55                 :          0 :   auto w = 0.0;
      56                 :            :   auto pi = 4.0 * std::atan(1.0);
      57                 :            : 
      58                 :            :   // location
      59                 :          0 :   auto xi = x - u*t;
      60                 :            : 
      61                 :            :   // exact solution
      62                 :            :   auto a = 20.0;
      63                 :            :   auto c = 20.0;
      64                 :          0 :   auto rhob = std::exp(-a*(xi-0.5)*(xi-0.5)) * std::sin(c*pi*xi) + 2.0;
      65                 :          0 :   s[volfracIdx(nmat, 0)] = 1.0;
      66         [ -  - ]:          0 :   s[densityIdx(nmat, 0)] = s[volfracIdx(nmat, 0)] * rhob;
      67                 :          0 :   s[energyIdx(nmat, 0)] = s[volfracIdx(nmat, 0)]
      68 [ -  - ][ -  - ]:          0 :     * mat_blk[0].compute< EOS::totalenergy >( rhob, u, v, w, 1.0 );
      69                 :          0 :   s[momentumIdx(nmat, 0)] = rhob * u;
      70                 :          0 :   s[momentumIdx(nmat, 1)] = rhob * v;
      71                 :          0 :   s[momentumIdx(nmat, 2)] = rhob * w;
      72                 :            : 
      73                 :          0 :   return s;
      74                 :            : }

Generated by: LCOV version 1.14