LCOV - code coverage report
Current view: top level - geom/facet/cgm - CubitOctreeCell.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 0 13 0.0 %
Date: 2020-06-30 00:58:45 Functions: 0 12 0.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : //-------------------------------------------------------------------------
       2                 :            : // Filename      : CubitOctreeCell.hpp
       3                 :            : //
       4                 :            : // Purpose       : A cell of the CubitOctree model is defined   
       5                 :            : //
       6                 :            : // Creator       : William Roshan Quadros
       7                 :            : //
       8                 :            : // Creation Date :  01/01/2003
       9                 :            : //
      10                 :            : // Owner         : 
      11                 :            : //-------------------------------------------------------------------------
      12                 :            : #ifndef CUBITOCTREECELL_H
      13                 :            : #define CUBITOCTREECELL_H 
      14                 :            : 
      15                 :            : #include "DLIList.hpp"
      16                 :            : #include "CubitVector.hpp"
      17                 :            : 
      18                 :            : class CubitOctreeNode;
      19                 :            : class CubitOctree;
      20                 :            : class RefFace;
      21                 :            : class CubitBox;
      22                 :            : class CubitFacet;
      23                 :            : class CubitFacetEdge; 
      24                 :            : class CubitPoint;
      25                 :            : class OctreeIntersectionData;
      26                 :            : class OctreeFacetPointData;
      27                 :            : 
      28                 :            : 
      29                 :            : class CubitOctreeCell
      30                 :            : {
      31                 :            :   
      32                 :            : public:
      33                 :            :   CubitOctreeCell(){}
      34                 :            :   CubitOctreeCell( CubitVector center, double dimension, int level, CubitOctreeCell *parent_cell );
      35                 :            :     //- Constructor
      36                 :            :   
      37                 :            :   virtual ~CubitOctreeCell();
      38                 :            :     //- Distructor
      39                 :            :   
      40                 :            :   void display( CubitOctree *ptr_octree, int opt);
      41                 :            :     //- Display of cells
      42                 :            :     
      43                 :            :   void display_color_wireframe( CubitOctree *ptr_octree);
      44                 :            :     //- diaplay cell in wireframe by color coding size at node
      45                 :            :     
      46                 :            :   void display_octreefacetpointdata( void );
      47                 :            :     //-  Displays the facet point data contained in the list
      48                 :            : 
      49                 :            :   void release_octreefacetpointdata( void );
      50                 :            :     //- Releases the facet point data stored at cells 
      51                 :            : 
      52                 :            :   void set_oct_grid_node(const int i, const int j, const int k, CubitOctreeNode *ptr_node );
      53                 :            :   
      54                 :          0 :   inline int get_depth( void ){ return depth; }
      55                 :            :     //- returns depth
      56                 :            :   
      57                 :          0 :   inline double get_dimension( void ){ return dimension; }
      58                 :            :     //- returns the dimension
      59                 :            :   
      60                 :            :   void set_child( int i, int j, int k, CubitOctreeCell *ptr_child_cell );
      61                 :            :     //- updates the child of the cell
      62                 :            :   
      63                 :          0 :   inline CubitVector get_center( void ){ return mCenter; }
      64                 :            :     //- returns the center of the cell
      65                 :            :   
      66                 :          0 :   inline CubitOctreeNode *get_octree_grid_node( const int i, const int j, const int k ){ return cubitOctreeNode[i][j][k]; }
      67                 :            :     //- returns the node of the cell
      68                 :            :   
      69                 :          0 :   inline int id( void ){ return num; }
      70                 :            :     //- returns the numbers
      71                 :            :   
      72                 :            :   CubitOctreeCell * get_child( const int i, const int j, const int k );
      73                 :            :     //- returns the child at i,j,k
      74                 :            :   
      75                 :          0 :   inline void set_leaf( bool type ){ leaf = type; }
      76                 :            :   
      77                 :            :   CubitOctreeCell * find_leaf_octree_cell(const CubitVector &point );
      78                 :            :     //- Find the leaf cell 
      79                 :            :   
      80                 :            :   void subdivide_octree_based_on_point( CubitPoint *ptr_point );
      81                 :            :     //- subdivides the CubitOctree based on point ( either original point or centroid )
      82                 :            :   
      83                 :          0 :   bool is_leaf( void ){ return leaf; }
      84                 :            :     //- returns the status of leaf 
      85                 :            :   
      86                 :            :   void distribute_facet_points_among_children( void );
      87                 :            :     // distributes the facet points and associated face among the children
      88                 :            :   
      89                 :          0 :   int num_of_facet_point_data( void ){ return octreeFacetPointDataList.size(); }
      90                 :            :     //- returns number of facet points and centroids
      91                 :            :   
      92                 :            :   CubitBoolean append_list_item( OctreeFacetPointData *ptr_facet_point_data );
      93                 :            :     //- appends the arguments into the respective list
      94                 :            : 
      95                 :          0 :   inline DLIList<OctreeFacetPointData*>* get_facet_point_data_list() 
      96                 :            :       {
      97                 :          0 :         return &octreeFacetPointDataList;
      98                 :            :       }
      99                 :            :   
     100                 :            :   
     101                 :          0 :   inline void set_mark( CubitBoolean type ){ mark = type; }
     102                 :          0 :   inline CubitBoolean get_mark( void ){ return mark; }
     103                 :            : 
     104                 :            :   inline void set_visit( CubitBoolean type ){ visit = type; }
     105                 :            :   inline CubitBoolean get_visit( void ){ return visit; }
     106                 :            :   
     107                 :            :   CubitBoolean add_adjacent_unmarked_cells( DLIList< CubitOctreeCell *> &queue );
     108                 :            :   
     109                 :            :   CubitBoolean is_intersects_box(const CubitBox &box );
     110                 :            :   
     111                 :            :   CubitBoolean does_facet_intersect_octreecell( CubitFacet *ptr_facet );
     112                 :            : 
     113                 :            : 
     114                 :            :   void set_color_and_intersection_datas(CubitFacet *ptr_facet, RefFace *ptr_Ref_face,
     115                 :            : #ifdef USE_octree_BGMESH
     116                 :            :                                         DLIList<CubitOctreeCell*> *greyCellList,
     117                 :            : #endif
     118                 :            :                                         CubitSense surf_sense=CUBIT_FORWARD);
     119                 :            :     //- if cell intersects supplied facet call this function to color cell grey and attached OctreeIntersectionDatas to its nodes
     120                 :            :     //- function assumes that grid nodes of cell still have halfspace settings corresponding to the supplied facet
     121                 :            :   
     122                 :            :     // The function assumes that nodes have half space information
     123                 :            :   CubitBoolean does_contain_positive_and_negative_nodes();
     124                 :            : 
     125                 :            :   CubitBoolean is_facet_point_data_present( const CubitVector &coord );
     126                 :            :   CubitBoolean is_facet_point_data_present( OctreeFacetPointData *new_facet_point_data );
     127                 :            :     //- Currently CubitVector is passed and distance between existing points and coord is compared
     128                 :            :     //- with SKL_EPSILON in determining if the coord already exists.  
     129                 :            :     //- To avoid SKL_EPSILON CubitPoint srl number can be used.  This function is currently not used.
     130                 :            : 
     131                 :            :   CubitBoolean interpolate_grey_octreecell_node( void );
     132                 :            :     //- Finds size at WHITE nodes of GREY cells
     133                 :            :   
     134                 :            :   void coloring( /*DLIList<CubitOctreeCell *> &grey_cell_list,*/ DLIList<CubitOctreeCell*> &black_cell_list);
     135                 :            :     //- Colors the cells with WHITE (cell outside solid), BLACK (cell inside solid), and GREY (cell at the boundary)
     136                 :            : 
     137                 :            :     // Trilienar interpolation  
     138                 :            :     // if number of nodes with zero size exceeds  MAX_NUM_ZERO_SIZE_NODES
     139                 :            :     // then average size is used instead of zero
     140                 :            :     // Even GREY grid nodes are consided 
     141                 :            :     // If a node has zero size then that node is not considered
     142                 :            :     // Therefore color is not important but the size
     143                 :            :   double trilinear_interpolation(const CubitVector &point );
     144                 :            :   
     145                 :            :   double inverse_distance_interpolation(const CubitVector &point );
     146                 :            :   double min_size_interpolation(const CubitVector &point );
     147                 :            :   double min_distance_interpolation(const CubitVector &point );
     148                 :            :   
     149                 :            :   CubitStatus find_indices_in_parent( int *index );
     150                 :            : 
     151                 :            : #ifndef NDEBUG
     152                 :            :   void write_octreecell_sizing_info_file( FILE *pof, DLIList<CubitOctreeCell*> &stack );
     153                 :            : #endif
     154                 :            : 
     155                 :            :     /*
     156                 :            :       void set_node( CubitOctreeNode *r_t_n_, CubitOctreeNode *r_t_f_, CubitOctreeNode *r_b_n_, CubitOctreeNode *r_b_f_, CubitOctreeNode *l_t_n_, CubitOctreeNode *l_t_f_, CubitOctreeNode *l_b_n_, CubitOctreeNode *l_b_f_ );
     157                 :            :         //- Sets the eight nodes of the cell
     158                 :            :     
     159                 :            :         void set_octreecell( CubitOctreeCell *left_cell, CubitOctreeCell *right_cell, CubitOctreeCell *bottom_cell, CubitOctreeCell *top_cell, CubitOctreeCell *far_cell, CubitOctreeCell *near_cell );
     160                 :            :           //- Sets the six adjacent cells
     161                 :            :           */    
     162                 :            :   inline void mark_color( int type ){ color = type; }
     163                 :            :     //- Cell contained completely inside the solid is call BLACK
     164                 :            :     //- Cell contained completely outside the solid is calle WHITE
     165                 :            :     //- Cell at the boundary with some nodes inside and others outside
     166                 :            :     //  are called GREY
     167                 :            : 
     168                 :          0 :   inline int get_color() {return color;}
     169                 :            :     //- Returns the color of cell
     170                 :            : 
     171                 :            : private:
     172                 :            :   
     173                 :            :   CubitVector mCenter;
     174                 :            :     //- Center of cell
     175                 :            :   
     176                 :            :   double dimension;
     177                 :            :     //- size of the CubitOctree cell
     178                 :            :   
     179                 :            :   int depth;
     180                 :            :     //- depth of the node
     181                 :            :   
     182                 :            :   CubitBoolean leaf;
     183                 :            :     //- to check leaf 
     184                 :            :   
     185                 :            :   int num;
     186                 :            :     //- Serial number of cell
     187                 :            :   
     188                 :            :   int color;    
     189                 :            :     //- WHITE (outside solid), BLACK (inside solid), and GREY (on boundary)
     190                 :            :   
     191                 :            :   CubitBoolean mark;
     192                 :            :     //- Mark used for visiting cell;
     193                 :            : 
     194                 :            :   CubitBoolean visit;
     195                 :            :   
     196                 :            :     //CubitOctreeNode* (*CubitOctreeNode)[2][2];
     197                 :            :   CubitOctreeNode* cubitOctreeNode[2][2][2];
     198                 :            :   
     199                 :            :     //- Eight corner nodes of cell
     200                 :            :   
     201                 :            :     //CubitOctree *CubitOctree;
     202                 :            :     //- CubitOctree is currently not used
     203                 :            :   
     204                 :            :   CubitOctreeCell *parent;
     205                 :            :   CubitOctreeCell *children[2][2][2];
     206                 :            :     //- eight children
     207                 :            :   
     208                 :            :   DLIList< OctreeFacetPointData *> octreeFacetPointDataList;
     209                 :            :     //- Stores the facet points 
     210                 :            :   
     211                 :            :   DLIList<OctreeIntersectionData*> *myFacetList;
     212                 :            :   
     213                 :            : };
     214                 :            : 
     215                 :            : #endif
     216                 :            : 
     217                 :            : //EOF
     218                 :            : 

Generated by: LCOV version 1.11