Quinoa all test code coverage report
Current view: top level - Inciter/AMR - Refinement_State.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 7 7 100.0 %
Date: 2024-04-22 13:03:21 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 10 50.0 %

           Branch data     Line data    Source code
       1                 :            : //
       2                 :            : // Created by Robert Francis Bird on 10/27/16.
       3                 :            : //
       4                 :            : 
       5                 :            : #ifndef TETAMR_AMR_DATA_H
       6                 :            : #define TETAMR_AMR_DATA_H
       7                 :            : 
       8                 :            : #include <cstddef>
       9                 :            : 
      10                 :            : #include "Types.hpp"
      11                 :            : #include "AMR_types.hpp"
      12                 :            : 
      13                 :            : namespace AMR {
      14                 :            :     // Types
      15                 :            :     using real_t = tk::real;
      16                 :            : 
      17                 :            :     const size_t DEFUALT_CHILD_NUMBER = 0; // Used to mark "doesn't have children"
      18                 :            : 
      19                 :            :     // TODO: Populate this enum with the available refinement cases
      20                 :            :     enum Refinement_Case { initial_grid = 0, one_to_two, one_to_four, one_to_eight,
      21                 :            :         two_to_eight, four_to_eight, none };
      22                 :            : 
      23                 :            :     enum Derefinement_Case { two_to_one = 0, four_to_one, four_to_two,
      24                 :            :         eight_to_one, eight_to_two, eight_to_four, skip };
      25                 :            : 
      26 [ +  - ][ +  - ]:    1841637 :     class Refinement_State {
      27                 :            : 
      28                 :            :         public:
      29                 :            :             /// Common to active and master elements
      30                 :            :             size_t active_element_number; // TODO: Some of these can be removed?
      31                 :            :             Refinement_Case refinement_case;
      32                 :            :             child_id_list_t children;
      33                 :            :             size_t refinement_level;
      34                 :            :             size_t child_number;
      35                 :            :             size_t parent_id;
      36                 :            :             bool normal;
      37                 :            :             bool has_parent;
      38                 :            : 
      39         [ -  + ]:     979192 :             Refinement_State() {}
      40                 :            : 
      41                 :            :             /**
      42                 :            :              * @brief Constructor which allows for all data fields to be explicitly
      43                 :            :              * specified
      44                 :            :              *
      45                 :            :              * @param active_element_number_in The active element id
      46                 :            :              * @param refinement_case_in The refinement case
      47                 :            :              * @param children_in The children ids
      48                 :            :              * @param refinement_level_in The level of refinement
      49                 :            :              * @param child_number_in ??  // TODO: What is this?
      50                 :            :              * @param parent_id_in Id of parent element
      51                 :            :              * @param has_parent_in True if element has a parent, default is true
      52                 :            :             */
      53                 :            :             Refinement_State(
      54                 :            :                     size_t active_element_number_in,
      55                 :            :                     Refinement_Case refinement_case_in,
      56                 :            :                     const child_id_list_t& children_in,
      57                 :            :                     size_t refinement_level_in,
      58                 :            :                     size_t child_number_in,
      59                 :            :                     size_t parent_id_in,
      60                 :            :                     bool has_parent_in=true
      61                 :            :             ) :
      62                 :            :                     active_element_number(active_element_number_in),
      63                 :            :                     refinement_case(refinement_case_in),
      64                 :            :                     children(children_in),
      65                 :            :                     refinement_level(refinement_level_in),
      66                 :            :                     child_number(child_number_in),
      67                 :            :                     parent_id(parent_id_in),
      68                 :            :                     normal(0),
      69                 :            :                     has_parent(has_parent_in)
      70                 :            :             {
      71                 :            :                 // Empty
      72                 :            :             }
      73                 :            : 
      74                 :            :             /**
      75                 :            :              * @brief Constructor which assumes sensible Defaults for new nodes
      76                 :            :              *
      77                 :            :              * @param active_element_number_in The active element id
      78                 :            :              * @param refinement_case_in The refinement case
      79                 :            :              * @param refinement_level_in The level of refinement
      80                 :            :              * @param parent_id_in Id of parent element
      81                 :            :              * @param has_parent_in True if element has a parent, default is true
      82                 :            :              */
      83                 :     862445 :             Refinement_State(
      84                 :            :                     size_t active_element_number_in,
      85                 :            :                     Refinement_Case refinement_case_in,
      86                 :            :                     size_t refinement_level_in,
      87                 :            :                     size_t parent_id_in,
      88                 :            :                     bool has_parent_in=true
      89                 :     862445 :             ) :
      90                 :            :                     active_element_number(active_element_number_in),
      91                 :            :                     refinement_case(refinement_case_in),
      92                 :            :                     refinement_level(refinement_level_in),
      93                 :            :                     child_number(DEFUALT_CHILD_NUMBER), // Give it default child id
      94                 :            :                     parent_id(parent_id_in),
      95                 :            :                     normal(0),
      96         [ +  - ]:     862445 :                     has_parent(has_parent_in)
      97                 :            :             {
      98                 :            :                 // Set default size of children to be sensible
      99         [ +  - ]:     862445 :                 children.reserve(MAX_CHILDREN);
     100                 :     862445 :             }
     101                 :            :     };
     102                 :            : 
     103                 :            : }
     104                 :            : 
     105                 :            : #endif //TETAMR_AMR_DATA_H
     106                 :            : 

Generated by: LCOV version 1.14