Quinoa all test code coverage report
Current view: top level - PDE/MultiMat/Problem - SodShocktube.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 6 8 75.0 %
Date: 2024-11-08 10:55:28 Functions: 2 3 66.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 2 100.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/MultiMat/Problem/SodShocktube.hpp
       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 Sod's shock-tube
       9                 :            :   \details   This file defines a policy class for the multi-material
      10                 :            :     compressible flow equations, defined in PDE/MultiMat/MultiMat.hpp.
      11                 :            :     See PDE/MultiMat/Problem.hpp for general requirements on Problem policy
      12                 :            :     classes for MultiMat.
      13                 :            : */
      14                 :            : // *****************************************************************************
      15                 :            : #ifndef MultiMatProblemSodShocktube_h
      16                 :            : #define MultiMatProblemSodShocktube_h
      17                 :            : 
      18                 :            : #include <string>
      19                 :            : 
      20                 :            : #include "Types.hpp"
      21                 :            : #include "Fields.hpp"
      22                 :            : #include "FunctionPrototypes.hpp"
      23                 :            : #include "Inciter/Options/Problem.hpp"
      24                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      25                 :            : #include "EoS/EOS.hpp"
      26                 :            : 
      27                 :            : namespace inciter {
      28                 :            : 
      29                 :            : //! MultiMat system of PDEs problem: Sod shock-tube
      30                 :            : //! \see G. A. Sod. A Survey of Several Finite Difference Methods for Systems of
      31                 :            : //!   Nonlinear Hyperbolic Conservation Laws. J. Comput. Phys., 27:1–31, 1978.
      32                 :            : class MultiMatProblemSodShocktube {
      33                 :            : 
      34                 :            :   protected:
      35                 :            :     using ncomp_t = tk::ncomp_t;
      36                 :            :     using eq = tag::multimat;
      37                 :            : 
      38                 :            :   public:
      39                 :            :     //! Initialize numerical solution
      40                 :            :     static tk::InitializeFn::result_type
      41                 :            :     initialize( ncomp_t ncomp,
      42                 :            :                 const std::vector< EOS >& mat_blk, tk::real x, tk::real,
      43                 :            :                 tk::real, tk::real );
      44                 :            : 
      45                 :            :     //! Evaluate analytical solution at (x,y,z,t) for all components
      46                 :            :     static std::vector< tk::real >
      47                 :          0 :     analyticSolution( ncomp_t ncomp,
      48                 :            :                       const std::vector< EOS >& mat_blk, tk::real x,
      49                 :            :                       tk::real y, tk::real z, tk::real t )
      50                 :          0 :     { return initialize( ncomp, mat_blk, x, y, z, t ); }
      51                 :            : 
      52                 :            :     //! Compute and return source term for this problem
      53                 :            :     static tk::SrcFn::result_type
      54                 :    2008700 :     src( ncomp_t, const std::vector< EOS >&, tk::real, tk::real,
      55                 :            :          tk::real, tk::real, std::vector< tk::real >& sv )
      56                 :            :     {
      57         [ +  + ]:   20087000 :       for (std::size_t i=0; i<sv.size(); ++i) {
      58                 :   18078300 :         sv[i] = 0.0;
      59                 :            :       }
      60                 :    2008700 :     }
      61                 :            : 
      62                 :            :     //! Return problem type
      63                 :       9084 :     static ctr::ProblemType type() noexcept
      64                 :       9084 :     { return ctr::ProblemType::SOD_SHOCKTUBE; }
      65                 :            : };
      66                 :            : 
      67                 :            : } // inciter::
      68                 :            : 
      69                 :            : #endif // MultiMatProblemSodShocktube_h

Generated by: LCOV version 1.14