Walker test code coverage report
Current view: top level - IO - ParticleWriter.hpp (source / functions) Hit Total Coverage
Commit: test_coverage.info Lines: 2 2 100.0 %
Date: 2022-09-21 13:52:12 Functions: 1 1 100.0 %
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/IO/ParticleWriter.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     Charm++ group for outputing particle data to file via H5Part
       9                 :            :   \details   Charm++ group for outputing particle data to file via H5Part in
      10                 :            :      parallel using MPI-IO.
      11                 :            : */
      12                 :            : // *****************************************************************************
      13                 :            : #ifndef ParticleWriter_h
      14                 :            : #define ParticleWriter_h
      15                 :            : 
      16                 :            : #include <string>
      17                 :            : #include <vector>
      18                 :            : 
      19                 :            : #include "H5PartWriter.hpp"
      20                 :            : 
      21                 :            : #include "NoWarning/particlewriter.decl.h"
      22                 :            : 
      23                 :            : namespace tk {
      24                 :            : 
      25                 :            : //! \brief Charm++ group used to output particle data to file in parallel using
      26                 :            : //!   H5Part and MPI-IO
      27                 :            : class ParticleWriter : public CBase_ParticleWriter {
      28                 :            : 
      29                 :            :   public:
      30                 :            :     //! Constructor
      31                 :            :     //! \param[in] filename Filename of particle output file
      32                 :        281 :     explicit ParticleWriter( const std::string& filename ) :
      33                 :            :       m_writer( filename ),
      34                 :            :       m_npar( 0 ),
      35                 :            :       m_x(),
      36                 :            :       m_y(),
      37         [ +  - ]:        281 :       m_z() {}
      38                 :            : 
      39                 :            :     //! Chares contribute their number of particles they will output on my node
      40                 :            :     void npar( std::size_t n, CkCallback c );
      41                 :            : 
      42                 :            :     //! Write particle coordinates to file
      43                 :            :     void writeCoords( uint64_t it,
      44                 :            :                       const std::vector< tk::real >& x,
      45                 :            :                       const std::vector< tk::real >& y,
      46                 :            :                       const std::vector< tk::real >& z,
      47                 :            :                       CkCallback c );
      48                 :            : 
      49                 :            :   private:
      50                 :            :     tk::H5PartWriter m_writer;     //!< Particle file format writer
      51                 :            :     std::size_t m_npar;            //!< Number of particles to be written
      52                 :            :     std::vector< tk::real > m_x;   //!< Buffer collecting x coordinates
      53                 :            :     std::vector< tk::real > m_y;   //!< Buffer collecting y coordinates
      54                 :            :     std::vector< tk::real > m_z;   //!< Buffer collecting z coordinates
      55                 :            : };
      56                 :            : 
      57                 :            : } // tk::
      58                 :            : 
      59                 :            : #endif // ParticleWriter_h

Generated by: LCOV version 1.14