LCOV - code coverage report
Current view: top level - src/Field - BConds.h (source / functions) Coverage Total Hit
Test: report.info Lines: 100.0 % 3 3
Test Date: 2025-05-12 09:25:18 Functions: 80.0 % 150 120

            Line data    Source code
       1              : //   Class BConds
       2              : //   This is the container class for the field BCs.
       3              : //   It calls the findBCNeighbors and apply in the
       4              : //   respective BC classes to apply field BCs
       5              : //
       6              : #ifndef IPPL_FIELD_BC_H
       7              : #define IPPL_FIELD_BC_H
       8              : 
       9              : #include <array>
      10              : #include <iostream>
      11              : #include <memory>
      12              : 
      13              : #include "Field/BcTypes.h"
      14              : 
      15              : namespace ippl {
      16              :     /*!
      17              :      * A container for boundary conditions
      18              :      * @tparam Field the type of the field to which the boundary conditions will be applied
      19              :      * @tparam Dim the rank of the field (redundant parameter required to avoid a circular
      20              :      * dependency loop between Field and BConds)
      21              :      */
      22              :     template <typename Field, unsigned Dim>
      23              :     class BConds {
      24              :     public:
      25              :         using bc_type        = detail::BCondBase<Field>;
      26              :         using container      = std::array<std::shared_ptr<bc_type>, 2 * Dim>;
      27              :         using iterator       = typename container::iterator;
      28              :         using const_iterator = typename container::const_iterator;
      29              : 
      30          592 :         BConds()  = default;
      31          714 :         ~BConds() = default;
      32              : 
      33              :         void findBCNeighbors(Field& field);
      34              :         void apply(Field& field);
      35              : 
      36              :         bool changesPhysicalCells() const;
      37              :         virtual void write(std::ostream&) const;
      38              : 
      39              :         const std::shared_ptr<bc_type>& operator[](const int& i) const noexcept { return bc_m[i]; }
      40              : 
      41         4320 :         std::shared_ptr<bc_type>& operator[](const int& i) noexcept { return bc_m[i]; }
      42              : 
      43              :     private:
      44              :         container bc_m;
      45              :     };
      46              : 
      47              :     template <typename Field, unsigned Dim>
      48              :     inline std::ostream& operator<<(std::ostream& os, const BConds<Field, Dim>& bc) {
      49              :         bc.write(os);
      50              :         return os;
      51              :     }
      52              : }  // namespace ippl
      53              : 
      54              : #include "Field/BConds.hpp"
      55              : 
      56              : #endif
        

Generated by: LCOV version 2.0-1