Quinoa regression test code coverage report
Current view: top level - PDE - InfoMesh.hpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 7 12 58.3 %
Date: 2021-11-09 13:40:20 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 20 25.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/InfoMesh.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     Assemble info on the configuration of solver coupling
       9                 :            :   \details   Assemble info on the configuration of solver coupling.
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef InfoMesht_h
      13                 :            : #define InfoMesht_h
      14                 :            : 
      15                 :            : #include "ContainerUtil.hpp"
      16                 :            : 
      17                 :            : namespace inciter {
      18                 :            : 
      19                 :            : //! Extract configuration info on mesh (solver) coupling
      20                 :            : //! \tparam eq Equation (solver) type
      21                 :            : //! \param[in] c Index of eq (solver) to extract info on
      22                 :            : //! \param[in,out] nfo Info object to augment
      23                 :            : //! \note The index c is the index of the solver within the solvers of type eq.
      24                 :            : template< class eq >
      25                 :        233 : void infoMesh( std::size_t c,
      26                 :            :                std::vector< std::pair< std::string, std::string > >& nfo )
      27                 :            : {
      28                 :            :   using tk::parameters;
      29                 :            : 
      30                 :            :   const auto& mesh = g_inputdeck.template get< tag::param, eq, tag::mesh >();
      31                 :            :   const auto& mesh_filename = mesh.template get< tag::filename >();
      32                 :            : 
      33         [ +  + ]:        233 :   if (mesh_filename.size() > c) {
      34         [ +  - ]:         10 :     nfo.emplace_back( "mesh id",
      35                 :         10 :       std::to_string( mesh.template get< tag::id >()[c] ) );
      36                 :         10 :     nfo.emplace_back( "mesh", mesh.template get< tag::filename >()[c] );
      37                 :            :   }
      38                 :            : 
      39                 :            :   const auto& mesh_reference = mesh.template get< tag::reference >();
      40                 :            : 
      41 [ +  - ][ -  + ]:        233 :   if (mesh_reference.size() > c && mesh_reference[c] != '-') {
      42 [ -  - ][ -  - ]:          0 :     nfo.emplace_back( "mesh reference", std::string( 1, mesh_reference[c] ) );
      43                 :            :     const auto& mesh_location = mesh.template get< tag::location >();
      44         [ -  - ]:          0 :     if (mesh_location.size() > c)
      45         [ -  - ]:          0 :       nfo.emplace_back( "mesh location", parameters( mesh_location[c] ) );
      46                 :            :     const auto& mesh_orientation = mesh.template get< tag::orientation >();
      47         [ -  - ]:          0 :     if (mesh_orientation.size() > c)
      48         [ -  - ]:          0 :       nfo.emplace_back( "mesh orientation", parameters( mesh_orientation[c] ) );
      49                 :            :   }
      50                 :        233 : }
      51                 :            : 
      52                 :            : } // inciter::
      53                 :            : 
      54                 :            : #endif // InfoMesh_h

Generated by: LCOV version 1.14