Quinoa all test code coverage report
Current view: top level - PDE/CompFlow/Problem - VorticalFlow.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 30 30 100.0 %
Date: 2024-04-29 14:42:33 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/VorticalFlow.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 "VorticalFlow.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::CompFlowProblemVorticalFlow;
      26                 :            : 
      27                 :            : tk::InitializeFn::result_type
      28                 :   13065775 : CompFlowProblemVorticalFlow::initialize( ncomp_t,
      29                 :            :                                          const std::vector< EOS >&,
      30                 :            :                                          tk::real x,
      31                 :            :                                          tk::real y,
      32                 :            :                                          tk::real z,
      33                 :            :                                          tk::real )
      34                 :            : // *****************************************************************************
      35                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      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                 :            :   using tag::compflow;
      44                 :            : 
      45                 :            :   // manufactured solution parameters
      46                 :   13065775 :   auto a = g_inputdeck.get< compflow, tag::alpha >();
      47                 :   13065775 :   auto b = g_inputdeck.get< compflow, tag::beta >();
      48                 :   13065775 :   auto p0 = g_inputdeck.get< compflow, tag::p0 >();
      49                 :            :   // ratio of specific heats
      50                 :   13065775 :   auto g = getmatprop< tag::gamma >();
      51                 :            :   // velocity
      52                 :   13065775 :   auto ru = a*x - b*y;
      53                 :   13065775 :   auto rv = b*x + a*y;
      54                 :   13065775 :   auto rw = -2.0*a*z;
      55                 :            :   // total specific energy
      56                 :   13065775 :   auto rE = (ru*ru+rv*rv+rw*rw)/2.0 + (p0-2.0*a*a*z*z)/(g-1.0);
      57                 :            : 
      58                 :   13065775 :   return {{ 1.0, ru, rv, rw, rE }};
      59                 :            : }
      60                 :            : 
      61                 :            : tk::InitializeFn::result_type
      62                 :     203370 : CompFlowProblemVorticalFlow::analyticSolution( ncomp_t,
      63                 :            :                                                const std::vector< EOS >&,
      64                 :            :                                                tk::real x,
      65                 :            :                                                tk::real y,
      66                 :            :                                                tk::real z,
      67                 :            :                                                tk::real )
      68                 :            : // *****************************************************************************
      69                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      70                 :            : //! \param[in] x X coordinate where to evaluate the solution
      71                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      72                 :            : //! \param[in] z Z 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::compflow;
      78                 :            : 
      79                 :            :   // manufactured solution parameters
      80                 :     203370 :   auto a = g_inputdeck.get< compflow, tag::alpha >();
      81                 :     203370 :   auto b = g_inputdeck.get< compflow, tag::beta >();
      82                 :     203370 :   auto p0 = g_inputdeck.get< compflow, tag::p0 >();
      83                 :            :   // ratio of specific heats
      84                 :     203370 :   auto g = getmatprop< tag::gamma >();
      85                 :            :   // velocity
      86                 :     203370 :   auto ru = a*x - b*y;
      87                 :     203370 :   auto rv = b*x + a*y;
      88                 :     203370 :   auto rw = -2.0*a*z;
      89                 :            :   // total specific energy
      90                 :     203370 :   auto rE = (ru*ru+rv*rv+rw*rw)/2.0 + (p0-2.0*a*a*z*z)/(g-1.0);
      91                 :            :   // pressure
      92                 :            :   auto p = p0 - 2.0*a*a*z*z;
      93                 :            : 
      94                 :     203370 :   return {{ 1.0, ru, rv, rw, rE, p }};
      95                 :            : }
      96                 :            : 
      97                 :            : std::vector< std::string >
      98         [ +  - ]:        980 : CompFlowProblemVorticalFlow::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         [ +  - ]:        980 :   n.push_back( "density_analytical" );
     106         [ +  - ]:        980 :   n.push_back( "x-velocity_analytical" );
     107         [ +  - ]:        980 :   n.push_back( "y-velocity_analytical" );
     108         [ +  - ]:        980 :   n.push_back( "z-velocity_analytical" );
     109         [ +  - ]:        980 :   n.push_back( "specific_total_energy_analytical" );
     110         [ +  - ]:        980 :   n.push_back( "pressure_analytical" );
     111                 :            : 
     112                 :        980 :   return n;
     113                 :            : }
     114                 :            : 
     115                 :            : std::vector< std::string >
     116                 :         18 : CompFlowProblemVorticalFlow::names( ncomp_t ) const
     117                 :            : // *****************************************************************************
     118                 :            : //  Return names of integral variables to be output to diagnostics file
     119                 :            : //! \return Vector of strings labelling integral variables output
     120                 :            : // *****************************************************************************
     121                 :            : {
     122 [ +  - ][ +  - ]:        108 :   return { "r", "ru", "rv", "rw", "re" };
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
         [ +  + ][ -  + ]
         [ -  - ][ -  - ]
     123                 :            : }

Generated by: LCOV version 1.14