PABLO  0.1
PArallel Balanced Linear Octree
 All Classes Functions Variables Pages
Class_Intersection_2D.tpp
1 
23 // =================================================================================== //
24 // CLASS SPECIALIZATION //
25 // =================================================================================== //
26 
27 template<>
29  // ------------------------------------------------------------------------------- //
30  // FRIENDSHIPS ------------------------------------------------------------------- //
31  template<int dim> friend class Class_Local_Tree;
32  template<int dim> friend class Class_Para_Tree;
33 
34  // ------------------------------------------------------------------------------- //
35  // TYPEDEFS ----------------------------------------------------------------------- //
36 public:
37  typedef vector<uint32_t> u32vector;
38  typedef vector<vector<uint32_t> > u32vector2D;
39  typedef vector<vector<uint64_t> > u64vector2D;
40 
41  // ------------------------------------------------------------------------------- //
42  // MEMBERS ----------------------------------------------------------------------- //
43 private:
44  uint32_t owners[2];
45  uint8_t iface;
46  bool finer;
47  //TODO proposta: eliminare isghost, contiene la stessa info in pbound
48  bool isghost;
49  bool isnew;
50  bool bound;
51  bool pbound;
53  // ------------------------------------------------------------------------------- //
54  // CONSTRUCTORS AND OPERATORS----------------------------------------------------- //
55 
56 public:
58  owners[0] = 0;
59  owners[1] = 0;
60  iface = 0;
61  isnew = false;
62  isghost = false;
63  finer = 0;
64  bound = pbound = false;
65  };
66  ~Class_Intersection(){};
67  Class_Intersection(const Class_Intersection<2> & intersection){
68  owners[0] = intersection.owners[0];
69  owners[1] = intersection.owners[1];
70  iface = intersection.iface;
71  isnew = intersection.isnew;
72  isghost = intersection.isghost;
73  finer = intersection.finer;
74  bound = intersection.bound;
75  pbound = intersection.pbound;
76  };
77  Class_Intersection<2>& operator =(const Class_Intersection<2> & intersection){
78  owners[0] = intersection.owners[0];
79  owners[1] = intersection.owners[1];
80  iface = intersection.iface;
81  isnew = intersection.isnew;
82  isghost = intersection.isghost;
83  finer = intersection.finer;
84  bound = intersection.bound;
85  pbound = intersection.pbound;
86  return *this;
87  };
88  bool operator ==(const Class_Intersection<2> & intersection){
89  bool check = true;
90  check = check && (owners[0] == intersection.owners[0]);
91  check = check && (owners[1] == intersection.owners[1]);
92  check = check && (iface == intersection.iface);
93  check = check && (isnew == intersection.isnew);
94  check = check && (isghost == intersection.isghost);
95  check = check && (finer == intersection.finer);
96  check = check && (bound == intersection.bound);
97  check = check && (pbound == intersection.pbound);
98  return check;
99 
100  };
101 
102  // ------------------------------------------------------------------------------- //
103  // METHODS ----------------------------------------------------------------------- //
104 
105  // Basic Get/Set methods --------------------------------------------------------- //
106 private:
107  uint32_t getOut(){ // Get the owner with exiting normal
108  return owners[0];
109  };
110  uint32_t getIn(){ // Get the owner with entering normal
111  return owners[1];
112  };
113  void getNormal(int8_t normal[2]){ // Get the normal of the intersection
114  for (int i=0; i<2; i++){
115  normal[i] = global2D.normals[iface][i];
116  }
117  };
118  bool getBound(){
119  return bound;
120  }
121 
122  bool getIsGhost(){
123  return isghost;
124  }
125 
126  bool getPbound(){
127  return pbound;
128  }
129 }; // end of Class_Intersection_2D.tpp
Parallel Octree Manager Class.
int8_t normals[4][3]
Intersection class definition - 2D specialization.
Local octree portion for each process.
Intersection class definition.