Quinoa all test code coverage report
Current view: top level - Inciter - FaceData.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 17 19 89.5 %
Date: 2024-04-22 13:03:21 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 8 52 15.4 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Inciter/FaceData.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                 :            :   \details   Face-data used only in discontinuous Galerkin discretization scheme
       9                 :            : */
      10                 :            : // *****************************************************************************
      11                 :            : #ifndef FaceData_h
      12                 :            : #define FaceData_h
      13                 :            : 
      14                 :            : #include <vector>
      15                 :            : #include <tuple>
      16                 :            : #include <map>
      17                 :            : #include <unordered_map>
      18                 :            : 
      19                 :            : #include "Types.hpp"
      20                 :            : #include "PUPUtil.hpp"
      21                 :            : #include "ContainerUtil.hpp"
      22                 :            : 
      23                 :            : namespace inciter {
      24                 :            : 
      25                 :            : //! Data associated to a tetrahedron cell id used to communicate across faces
      26                 :            : using GhostData =
      27                 :            :   std::unordered_map< std::size_t, // tet id
      28                 :            :                       std::tuple<
      29                 :            :                         // 3 node ids for potentially multiple faces
      30                 :            :                         std::vector< std::size_t >,
      31                 :            :                         // elem geometry, see tk::genGeoElemTet()
      32                 :            :                         std::vector< tk::real >,
      33                 :            :                         // coordinates of vertex of tet that is not on face
      34                 :            :                         std::array< tk::real, 3 >,
      35                 :            :                         // relative position of above vertex in inpoel
      36                 :            :                         std::size_t,
      37                 :            :                         // inpoel of said tet
      38                 :            :                         std::array< std::size_t, 4 > > >;
      39                 :            : 
      40                 :            : //! FaceData class holding face-connectivity data useful for DG discretization
      41                 :            : class FaceData {
      42                 :            : 
      43                 :            :   public:
      44                 :            :     //! Empty constructor for Charm++
      45                 :       5193 :     explicit FaceData() {}
      46                 :            : 
      47                 :            :     //! \brief Constructor: compute (element-face) data for internal and
      48                 :            :     //!   domain-boundary faces
      49                 :            :     explicit
      50                 :            :     FaceData( const std::vector< std::size_t >& inpoel,
      51                 :            :               const std::map< int, std::vector< std::size_t > >& bface,
      52                 :            :               const std::vector< std::size_t >& triinpoel );
      53                 :            : 
      54                 :            :     /** @name Accessors
      55                 :            :       * */
      56                 :            :     ///@{
      57                 :            :     const std::map< int, std::vector< std::size_t > >& Bface() const
      58 [ +  - ][ +  - ]:       2202 :     { return m_bface; }
                 [ +  - ]
      59         [ +  - ]:       2202 :     const std::vector< std::size_t >& Triinpoel() const { return m_triinpoel; }
      60                 :     879783 :     std::size_t Nbfac() const { return tk::sumvalsize( m_bface ); }
      61 [ -  - ][ -  - ]:      29086 :     const std::vector< int >& Esuel() const { return m_esuel; }
         [ -  - ][ -  - ]
         [ -  - ][ +  - ]
         [ -  - ][ -  - ]
         [ +  - ][ +  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
         [ -  - ][ -  - ]
      62                 :            :     std::vector< int >& Esuel() { return m_esuel; }
      63                 :            :     std::size_t Nipfac() const { return m_nipfac; }
      64                 :          0 :     const std::vector< std::size_t >& Inpofa() const { return m_inpofa; }
      65 [ +  - ][ -  - ]:       2259 :     std::vector< std::size_t >& Inpofa() { return m_inpofa; }
      66                 :            :     const std::vector< std::size_t >& Belem() const { return m_belem; }
      67                 :          0 :     const std::vector< int >& Esuf() const { return m_esuf; }
      68                 :       1109 :     std::vector< int >& Esuf() { return m_esuf; }
      69                 :            :     //@}
      70                 :            : 
      71                 :            :     /** @name Charm++ pack/unpack (serialization) routines
      72                 :            :       * */
      73                 :            :     ///@{
      74                 :            :     //! \brief Pack/Unpack serialize member function
      75                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      76                 :      16145 :     void pup( PUP::er &p ) {
      77                 :      16145 :       p | m_bface;
      78                 :      16145 :       p | m_triinpoel;
      79                 :      16145 :       p | m_esuel;
      80                 :      16145 :       p | m_nipfac;
      81                 :      16145 :       p | m_inpofa;
      82                 :      16145 :       p | m_belem;
      83                 :      16145 :       p | m_esuf;
      84                 :      16145 :     }
      85                 :            :     //! \brief Pack/Unpack serialize operator|
      86                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      87                 :            :     //! \param[in,out] i FaceData object reference
      88                 :      16145 :     friend void operator|( PUP::er& p, FaceData& i ) { i.pup(p); }
      89                 :            :     //@}
      90                 :            : 
      91                 :            :   private:
      92                 :            :     //! Boundary faces side-set information
      93                 :            :     std::map< int, std::vector< std::size_t > > m_bface;
      94                 :            :     //! Triangle face connecitivity
      95                 :            :     std::vector< std::size_t > m_triinpoel;
      96                 :            :     //! Elements surrounding elements
      97                 :            :     std::vector< int > m_esuel;
      98                 :            :     //! Number of internal and physical-boundary faces
      99                 :            :     std::size_t m_nipfac;
     100                 :            :     //! Face-node connectivity
     101                 :            :     std::vector< std::size_t > m_inpofa;
     102                 :            :     //! Boundary element vector
     103                 :            :     std::vector< std::size_t > m_belem;
     104                 :            :     //! Element surrounding faces
     105                 :            :     std::vector< int > m_esuf;
     106                 :            : };
     107                 :            : 
     108                 :            : } // inciter::
     109                 :            : 
     110                 :            : #endif // Discretization_h

Generated by: LCOV version 1.14