Quinoa regression test code coverage report
Current view: top level - PDE/CompFlow/Problem - VorticalFlow.cpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 28 28 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/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                 :   17490127 : CompFlowProblemVorticalFlow::initialize( ncomp_t system,
      29                 :            :                                          ncomp_t,
      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] 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                 :            :   using tag::param; using tag::compflow;
      46                 :            : 
      47                 :            :   // manufactured solution parameters
      48                 :   17490127 :   auto a = g_inputdeck.get< param, compflow, tag::alpha >()[ system ];
      49                 :   17490127 :   auto b = g_inputdeck.get< param, compflow, tag::beta >()[ system ];
      50                 :   17490127 :   auto p0 = g_inputdeck.get< param, compflow, tag::p0 >()[ system ];
      51                 :            :   // ratio of specific heats
      52                 :            :   auto g = gamma< tag::compflow >(system);
      53                 :            :   // velocity
      54                 :   17490127 :   auto ru = a*x - b*y;
      55                 :   17490127 :   auto rv = b*x + a*y;
      56                 :   17490127 :   auto rw = -2.0*a*z;
      57                 :            :   // total specific energy
      58                 :   17490127 :   auto rE = (ru*ru+rv*rv+rw*rw)/2.0 + (p0-2.0*a*a*z*z)/(g-1.0);
      59                 :            : 
      60                 :   17490127 :   return {{ 1.0, ru, rv, rw, rE }};
      61                 :            : }
      62                 :            : 
      63                 :            : tk::InitializeFn::result_type
      64                 :     239570 : CompFlowProblemVorticalFlow::analyticSolution( ncomp_t system,
      65                 :            :                                                ncomp_t,
      66                 :            :                                                tk::real x,
      67                 :            :                                                tk::real y,
      68                 :            :                                                tk::real z,
      69                 :            :                                                tk::real )
      70                 :            : // *****************************************************************************
      71                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      72                 :            : //! \param[in] system Equation system index, i.e., which compressible
      73                 :            : //!   flow equation system we operate on among the systems of PDEs
      74                 :            : //! \param[in] x X coordinate where to evaluate the solution
      75                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      76                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      77                 :            : //! \return Values of all components evaluated at (x)
      78                 :            : //! \note The function signature must follow tk::InitializeFn
      79                 :            : // *****************************************************************************
      80                 :            : {
      81                 :            :   using tag::param; using tag::compflow;
      82                 :            : 
      83                 :            :   // manufactured solution parameters
      84                 :     239570 :   auto a = g_inputdeck.get< param, compflow, tag::alpha >()[ system ];
      85                 :     239570 :   auto b = g_inputdeck.get< param, compflow, tag::beta >()[ system ];
      86                 :     239570 :   auto p0 = g_inputdeck.get< param, compflow, tag::p0 >()[ system ];
      87                 :            :   // ratio of specific heats
      88                 :            :   auto g = gamma< tag::compflow >(system);
      89                 :            :   // velocity
      90                 :     239570 :   auto ru = a*x - b*y;
      91                 :     239570 :   auto rv = b*x + a*y;
      92                 :     239570 :   auto rw = -2.0*a*z;
      93                 :            :   // total specific energy
      94                 :     239570 :   auto rE = (ru*ru+rv*rv+rw*rw)/2.0 + (p0-2.0*a*a*z*z)/(g-1.0);
      95                 :            :   // pressure
      96                 :            :   auto p = p0 - 2.0*a*a*z*z;
      97                 :            : 
      98                 :     239570 :   return {{ 1.0, ru, rv, rw, rE, p }};
      99                 :            : }
     100                 :            : 
     101                 :            : std::vector< std::string >
     102         [ +  - ]:       2080 : CompFlowProblemVorticalFlow::analyticFieldNames( ncomp_t ) const
     103                 :            : // *****************************************************************************
     104                 :            : // Return analytic field names to be output to file
     105                 :            : //! \return Vector of strings labelling analytic fields output in file
     106                 :            : // *****************************************************************************
     107                 :            : {
     108                 :            :   std::vector< std::string > n;
     109         [ +  - ]:       2080 :   n.push_back( "density_analytical" );
     110         [ +  - ]:       2080 :   n.push_back( "x-velocity_analytical" );
     111         [ +  - ]:       2080 :   n.push_back( "y-velocity_analytical" );
     112         [ +  - ]:       2080 :   n.push_back( "z-velocity_analytical" );
     113         [ +  - ]:       2080 :   n.push_back( "specific_total_energy_analytical" );
     114         [ +  - ]:       2080 :   n.push_back( "pressure_analytical" );
     115                 :            : 
     116                 :       2080 :   return n;
     117                 :            : }
     118                 :            : 
     119                 :            : std::vector< std::string >
     120                 :         27 : CompFlowProblemVorticalFlow::names( ncomp_t ) const
     121                 :            : // *****************************************************************************
     122                 :            : //  Return names of integral variables to be output to diagnostics file
     123                 :            : //! \return Vector of strings labelling integral variables output
     124                 :            : // *****************************************************************************
     125                 :            : {
     126 [ +  - ][ +  - ]:        162 :   return { "r", "ru", "rv", "rw", "re" };
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
         [ +  + ][ -  + ]
         [ -  - ][ -  - ]
     127                 :            : }

Generated by: LCOV version 1.14