Quinoa all test code coverage report
Current view: top level - PDE/Transport/Problem - GaussHump.cpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 13 13 100.0 %
Date: 2021-11-11 18:25:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 7 10 70.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/Transport/Problem/GaussHump.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 transport equations
       9                 :            :   \details   This file defines a Problem policy class for the transport
      10                 :            :     equations, defined in PDE/Transport/CGTransport.h implementing
      11                 :            :     node-centered continuous Galerkin (CG) and PDE/Transport/DGTransport.h
      12                 :            :     implementing cell-centered discontinuous Galerkin (DG) discretizations.
      13                 :            :     See PDE/Transport/Problem.h for general requirements on Problem policy
      14                 :            :     classes for cg::Transport and dg::Transport.
      15                 :            : */
      16                 :            : // *****************************************************************************
      17                 :            : 
      18                 :            : #include "GaussHump.hpp"
      19                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      20                 :            : 
      21                 :            : namespace inciter {
      22                 :            : 
      23                 :            : extern ctr::InputDeck g_inputdeck;
      24                 :            : 
      25                 :            : } // ::inciter
      26                 :            : 
      27                 :            : using inciter::TransportProblemGaussHump;
      28                 :            : 
      29                 :            : std::vector< tk::real >
      30                 :    3098092 : TransportProblemGaussHump::initialize( ncomp_t system, ncomp_t ncomp,
      31                 :            :           tk::real x, tk::real y, tk::real, tk::real t )
      32                 :            : // *****************************************************************************
      33                 :            : //  Evaluate analytical solution at (x,y,t) for all components
      34                 :            : //! \param[in] system Equation system index
      35                 :            : //! \param[in] ncomp Number of components in this transport equation system
      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] t Time where to evaluate the solution
      39                 :            : //! \return Values of all components evaluated at (x,y,t)
      40                 :            : // *****************************************************************************
      41                 :            : {
      42         [ +  - ]:    6196184 :   const auto vel = prescribedVelocity( system, ncomp, x, y, 0.0, t );
      43                 :            : 
      44         [ +  - ]:    3098092 :   std::vector< tk::real > s( ncomp, 0.0 );
      45         [ +  + ]:    6196184 :   for (ncomp_t c=0; c<ncomp; ++c)
      46                 :            :   {
      47                 :            :     // center of the hump
      48                 :    3098092 :     auto x0 = 0.25 + vel[c][0]*t;
      49                 :    3098092 :     auto y0 = 0.25 + vel[c][1]*t;
      50                 :            : 
      51                 :            :     // hump
      52                 :    3098092 :     s[c] = 1.0 * exp( -((x-x0)*(x-x0) + (y-y0)*(y-y0))/(2.0 * 0.005) );
      53                 :            :   }
      54                 :    6196184 :   return s;
      55                 :            : }
      56                 :            : 
      57                 :            : std::vector< std::array< tk::real, 3 > >
      58                 :   40810462 : TransportProblemGaussHump::prescribedVelocity( ncomp_t, ncomp_t ncomp, tk::real,
      59                 :            :                                                tk::real, tk::real, tk::real )
      60                 :            : // *****************************************************************************
      61                 :            : //! Assign prescribed velocity at a point
      62                 :            : //! \param[in] ncomp Number of components in this transport equation
      63                 :            : //! \return Velocity assigned to all vertices of a tetrehedron, size:
      64                 :            : //!   ncomp * ndim = [ncomp][3]
      65                 :            : // *****************************************************************************
      66                 :            : {
      67         [ +  - ]:   40810462 :   std::vector< std::array< tk::real, 3 > > vel( ncomp );
      68                 :            : 
      69         [ +  + ]:   81620924 :   for (ncomp_t c=0; c<ncomp; ++c)
      70                 :   40810462 :     vel[c] = {{ 0.1, 0.1, 0.0 }};
      71                 :            : 
      72                 :   40810462 :   return vel;
      73                 :            : }

Generated by: LCOV version 1.14