Quinoa all test code coverage report
Current view: top level - Transfer - TransferDetails.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 3 7 42.9 %
Date: 2024-05-15 16:30:14 Functions: 1 3 33.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/Transfer/TransferDetails.hpp
       4                 :            :   \copyright 2020 Charmworks, Inc.
       5                 :            :              All rights reserved. See the LICENSE file for details.
       6                 :            :   \brief     Chare class declaration for mesh transfer workers holding part of a
       7                 :            :     mesh
       8                 :            :   \details   Chare class declaration for mesh transfer workers holding part of a
       9                 :            :     mesh.
      10                 :            : */
      11                 :            : // *****************************************************************************
      12                 :            : #ifndef TransferDetails_h
      13                 :            : #define TransferDetails_h
      14                 :            : 
      15                 :            : #include "Types.hpp"
      16                 :            : #include "PUPUtil.hpp"
      17                 :            : #include "UnsMesh.hpp"
      18                 :            : #include "CommMap.hpp"
      19                 :            : #include "Fields.hpp"
      20                 :            : 
      21                 :            : #include "NoWarning/transferdetails.decl.h"
      22                 :            : 
      23                 :            : namespace exam2m {
      24                 :            : 
      25                 :    8846444 : class PotentialCollision {
      26                 :            :   public:
      27                 :            :     std::size_t source_index, dest_index;
      28                 :            :     CkVector3d point;
      29                 :          0 :     void pup(PUP::er& p) { p | source_index; p | dest_index; p | point; }
      30                 :            : };
      31                 :            : 
      32         [ +  - ]:    2569598 : class SolutionData {
      33                 :            :   public:
      34                 :            :     std::size_t dest_index;
      35                 :            :     std::vector< tk::real > solution;
      36                 :    1380291 :     void pup(PUP::er& p) { p | dest_index; p | solution; }
      37                 :            : };
      38                 :            : 
      39                 :            : //! TransferDetails chare array holding part of a mesh
      40                 :            : class TransferDetails : public CBase_TransferDetails {
      41                 :            : 
      42                 :            :   public:
      43                 :            :     //! Constructor
      44                 :            :     explicit TransferDetails( CkArrayID p, MeshData d, CkCallback cb );
      45                 :            : 
      46                 :            :     #if defined(__clang__)
      47                 :            :       #pragma clang diagnostic push
      48                 :            :       #pragma clang diagnostic ignored "-Wundefined-func-template"
      49                 :            :     #endif
      50                 :            :     //! Migrate constructor
      51                 :            :     // cppcheck-suppress uninitMemberVar
      52                 :            :     explicit TransferDetails( CkMigrateMessage* ) {}
      53                 :            :     #if defined(__clang__)
      54                 :            :       #pragma clang diagnostic pop
      55                 :            :     #endif
      56                 :            : 
      57                 :            :     //! Set the source mesh data
      58                 :            :     void setSourceTets( std::vector< std::size_t>* inpoel,
      59                 :            :                         tk::UnsMesh::Coords* coords,
      60                 :            :                         const tk::Fields& u );
      61                 :            : 
      62                 :            :     //! Set the destination mesh data
      63                 :            :     void setDestPoints( tk::UnsMesh::Coords* coords,
      64                 :            :                         tk::Fields& u,
      65                 :            :                         CkCallback cb );
      66                 :            : 
      67                 :            :     //! Process potential collisions in the destination mesh
      68                 :            :     void processCollisions( CProxy_TransferDetails proxy,
      69                 :            :                             int nchare,
      70                 :            :                             int offset,
      71                 :            :                             int nColls,
      72                 :            :                             Collision* colls );
      73                 :            : 
      74                 :            :     //! Identify actual collisions in the source mesh
      75                 :            :     void determineActualCollisions( CProxy_TransferDetails proxy,
      76                 :            :                                     int index,
      77                 :            :                                     int nColls,
      78                 :            :                                     PotentialCollision* colls ) const;
      79                 :            : 
      80                 :            :     //! Transfer the interpolated solution data back to destination mesh
      81                 :            :     void transferSolution( const std::vector< SolutionData >& soln );
      82                 :            : 
      83                 :            :     /** @name Charm++ pack/unpack serializer member functions */
      84                 :            :     ///@{
      85                 :            :     //! \brief Pack/Unpack serialize member function
      86                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      87                 :          0 :     void pup( PUP::er &p ) override {
      88                 :          0 :       p | m_firstchunk;
      89                 :          0 :     }
      90                 :            :     //! \brief Pack/Unpack serialize operator|
      91                 :            :     //! \param[in,out] p Charm++'s PUP::er serializer object reference
      92                 :            :     //! \param[in,out] i TransferDetails object reference
      93                 :            :     friend void operator|( PUP::er& p, TransferDetails& i ) { i.pup(p); }
      94                 :            :     //@}
      95                 :            : 
      96                 :            :   private:
      97                 :            :     //! The ID of my first chunk (used for collision detection library)
      98                 :            :     int m_firstchunk;
      99                 :            :     //! Pointer to element connectivity
     100                 :            :     std::vector< std::size_t >* m_inpoel;
     101                 :            :     //! Pointer to point coordinates
     102                 :            :     tk::UnsMesh::Coords* m_coord;
     103                 :            :     //! Pointer to solution in mesh nodes
     104                 :            :     tk::Fields* m_u;
     105                 :            : 
     106                 :            :     //! The number of messages sent by the dest mesh
     107                 :            :     int m_numsent;
     108                 :            :     //! The number of messages received by the dest mesh
     109                 :            :     int m_numreceived;
     110                 :            :     //! Called once the transfer is complete (m_numsent == m_numreceived)
     111                 :            :     CkCallback m_donecb;
     112                 :            : 
     113                 :            :     //! Initialize dest mesh solution with background data
     114                 :            :     void background();
     115                 :            : 
     116                 :            :     //! Contribute vertex information to the collsion detection library
     117                 :            :     void collideVertices();
     118                 :            : 
     119                 :            :     //! Contribute tet information to the collision detection library
     120                 :            :     void collideTets() const;
     121                 :            : };
     122                 :            : 
     123                 :            : } // exam2m::
     124                 :            : 
     125                 :            : #endif // TransferDetails_h

Generated by: LCOV version 1.14