LCOV - code coverage report
Current view: top level - src/FEM/Quadrature - MidpointQuadrature.hpp (source / functions) Coverage Total Hit
Test: report.info Lines: 100.0 % 14 14
Test Date: 2025-05-21 11:16:25 Functions: 100.0 % 36 36
Branches: 66.7 % 6 4

             Branch data     Line data    Source code
       1                 :             : 
       2                 :             : 
       3                 :             : namespace ippl {
       4                 :             :     template <typename T, unsigned NumNodes1D, typename ElementType>
       5                 :         126 :     MidpointQuadrature<T, NumNodes1D, ElementType>::MidpointQuadrature(
       6                 :             :         const ElementType& ref_element)
       7                 :         126 :         : Quadrature<T, NumNodes1D, ElementType>(ref_element) {
       8                 :         126 :         this->degree_m = 1;
       9                 :             : 
      10                 :         126 :         this->a_m = 0.0;
      11                 :         126 :         this->b_m = 1.0;
      12                 :             : 
      13         [ +  - ]:         126 :         computeNodesAndWeights();
      14                 :         126 :     }
      15                 :             : 
      16                 :             :     template <typename T, unsigned NumNodes1D, typename ElementType>
      17                 :         126 :     void MidpointQuadrature<T, NumNodes1D, ElementType>::computeNodesAndWeights() {
      18                 :         126 :         const T segment_length = (this->b_m - this->a_m) / NumNodes1D;
      19                 :             : 
      20                 :         126 :         this->weights_m = Vector<T, NumNodes1D>(segment_length);
      21                 :             : 
      22         [ +  - ]:         126 :         this->integration_nodes_m = Vector<T, NumNodes1D>();
      23         [ +  + ]:         288 :         for (unsigned i = 0; i < NumNodes1D; ++i) {
      24                 :         162 :             this->integration_nodes_m[i] = 0.5 * segment_length + i * segment_length + this->a_m;
      25                 :             :         }
      26                 :         126 :     }
      27                 :             : 
      28                 :             : }  // namespace ippl
        

Generated by: LCOV version 2.0-1