ParMooN
 All Classes Functions Variables Friends Pages
SurfEdgeCollection.h
1 #ifndef __SURFEDGECOLLECTION__
2 #define __SURFEDGECOLLECTION__
3 
4 #include <Collection.h>
5 
6 // #define iFLIP(x,y) if ( x > y ) { int ivar; ivar = a; a = b; b = ivar; }
7 
9 {
10  protected:
13 
15  int mN_Edges;
16 
18  int **mEdgeHash;
19 
20  protected:
21  void Init(TCollection *Coll, int N_SurfaceJoints,
22  int *CellNumbers, int *JointNumbers);
23 
24  inline int Flip(int &a, int &b)
25  {
26  if ( a > b )
27  {
28  int ivar;
29  ivar = a; a = b; b = ivar;
30  }
31 
32  return a+b;
33  }
34 
35  void IncreaseBucket(int a, int b, int &counter);
36  int FindEdge(int *Bucket, int a, int b);
37 
38 
39  public:
40  TSurfEdgeCollection (TCollection *Coll, int N_SurfaceJoints,
41  int *CellNumbers, int *JointNumbers);
42 
44 
45  int GetN_Edges()
46  { return mN_Edges; }
47 
48  int GetN_Vertices()
49  { return mN_Vertices; }
50 
51  int GetEdge(int a, int b)
52  {
53  if ( a < 0 || b < 0 ) return -1;
54  else return FindEdge(mEdgeHash[Flip(a,b)], a, b);
55  }
56 };
57 #endif
Definition: SurfEdgeCollection.h:8
int mN_Edges
Definition: SurfEdgeCollection.h:15
int ** mEdgeHash
Definition: SurfEdgeCollection.h:18
store cells in an array, used by cell iterators
Definition: Collection.h:18
int mN_Vertices
Definition: SurfEdgeCollection.h:12
void Init(TCollection *Coll, int N_SurfaceJoints, int *CellNumbers, int *JointNumbers)
Methods.
Definition: SurfEdgeCollection.C:30