Quinoa regression test code coverage report
Current view: top level - PDE/CompFlow/Problem - TaylorGreen.cpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 22 22 100.0 %
Date: 2021-11-09 13:40:20 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 16 34 47.1 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/CompFlow/Problem/TaylorGreen.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 "TaylorGreen.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::CompFlowProblemTaylorGreen;
      26                 :            : 
      27                 :            : tk::InitializeFn::result_type
      28                 :    2032376 : CompFlowProblemTaylorGreen::initialize( ncomp_t system,
      29                 :            :                                         ncomp_t,
      30                 :            :                                         tk::real x,
      31                 :            :                                         tk::real y,
      32                 :            :                                         tk::real,
      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                 :            : //! \return Values of all components evaluated at (x)
      41                 :            : //! \note The function signature must follow tk::InitializeFn
      42                 :            : // *****************************************************************************
      43                 :            : {
      44                 :            :   using tag::param; using std::sin; using std::cos;
      45                 :            : 
      46                 :            :   // density
      47                 :            :   auto r = 1.0;
      48                 :            :   // pressure
      49                 :    2032376 :   auto p = 10.0 + r/4.0*(cos(2.0*M_PI*x) + cos(2.0*M_PI*y));
      50                 :            :   // velocity
      51                 :    2032376 :   auto u =  sin(M_PI*x) * cos(M_PI*y);
      52                 :    2032376 :   auto v = -cos(M_PI*x) * sin(M_PI*y);
      53                 :            :   auto w = 0.0;
      54                 :            :   // total specific energy
      55                 :    2032376 :   auto rE = eos_totalenergy< eq >( system, r, u, v, w, p );
      56                 :            : 
      57                 :    2032376 :   return {{ r, r*u, r*v, r*w, rE }};
      58                 :            : }
      59                 :            : 
      60                 :            : tk::InitializeFn::result_type
      61                 :      31980 : CompFlowProblemTaylorGreen::analyticSolution( ncomp_t system,
      62                 :            :                                               ncomp_t,
      63                 :            :                                               tk::real x,
      64                 :            :                                               tk::real y,
      65                 :            :                                               tk::real,
      66                 :            :                                               tk::real )
      67                 :            : // *****************************************************************************
      68                 :            : //  Evaluate analytical solution at (x,y,z,t) for all components
      69                 :            : //! \param[in] system Equation system index, i.e., which compressible
      70                 :            : //!   flow equation system we operate on among the systems of PDEs
      71                 :            : //! \param[in] x X coordinate where to evaluate the solution
      72                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      73                 :            : //! \return Values of all components evaluated at (x)
      74                 :            : //! \note The function signature must follow tk::InitializeFn
      75                 :            : // *****************************************************************************
      76                 :            : {
      77                 :            :   using tag::param; using std::sin; using std::cos;
      78                 :            : 
      79                 :            :   // density
      80                 :            :   auto r = 1.0;
      81                 :            :   // pressure
      82                 :      31980 :   auto p = 10.0 + r/4.0*(cos(2.0*M_PI*x) + cos(2.0*M_PI*y));
      83                 :            :   // velocity
      84                 :      31980 :   auto u =  sin(M_PI*x) * cos(M_PI*y);
      85                 :      31980 :   auto v = -cos(M_PI*x) * sin(M_PI*y);
      86                 :            :   auto w = 0.0;
      87                 :            :   // total specific energy
      88                 :      31980 :   auto E = eos_totalenergy< eq >( system, r, u, v, w, p );
      89                 :            : 
      90                 :      31980 :   return {{ r, u, v, w, E, p }};
      91                 :            : }
      92                 :            : 
      93                 :            : std::vector< std::string >
      94         [ +  - ]:        168 : CompFlowProblemTaylorGreen::analyticFieldNames( ncomp_t ) const
      95                 :            : // *****************************************************************************
      96                 :            : // Return analytic field names to be output to file
      97                 :            : //! \return Vector of strings labelling analytic fields output in file
      98                 :            : // *****************************************************************************
      99                 :            : {
     100                 :            :   std::vector< std::string > n;
     101         [ +  - ]:        168 :   n.push_back( "density_analytical" );
     102         [ +  - ]:        168 :   n.push_back( "x-velocity_analytical" );
     103         [ +  - ]:        168 :   n.push_back( "y-velocity_analytical" );
     104         [ +  - ]:        168 :   n.push_back( "z-velocity_analytical" );
     105         [ +  - ]:        168 :   n.push_back( "specific_total_energy_analytical" );
     106         [ +  - ]:        168 :   n.push_back( "pressure_analytical" );
     107                 :            : 
     108                 :        168 :   return n;
     109                 :            : }
     110                 :            : 
     111                 :            : std::vector< std::string >
     112                 :         10 : CompFlowProblemTaylorGreen::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 [ +  - ][ +  - ]:         60 :   return { "r", "ru", "rv", "rw", "re" };
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
         [ +  + ][ -  + ]
         [ -  - ][ -  - ]
     119                 :            : }

Generated by: LCOV version 1.14