ParMooN
 All Classes Functions Variables Friends Pages
Vertex.h
1 // =======================================================================
2 // @(#)Vertex.h 1.1 10/30/98
3 //
4 // Class: TVertex
5 // Purpose: a vertex in a grid
6 //
7 // Author: Volker Behns 09.07.97
8 // Sashikumaar Ganesan 05.11.09 (added parallel methods)
9 // Sashikumaar Ganesan 08.09.2010 (added 3D parallel methods)
10 // =======================================================================
11 
12 #ifndef __VERTEX__
13 #define __VERTEX__
14 
15 #include <MooNMD_Io.h>
16 #include <Constants.h>
17 
19 class TVertex
20 {
21  protected:
23  double X;
25  double Y;
26 #ifdef __3D__
27 
28  double Z;
29 #endif
30 
32  int ClipBoard;
33 
34 #ifdef _MPI
35 
38  int N_Cells;
39 
43 
46 
48  bool CrossVert;
49 
52 
55 
58 
61 
64 #endif
65 
66 
68  bool BoundVert;
69 
70  public:
71  // Constructors
72 
73 #ifdef __3D__
74 
75  TVertex(double initX, double initY, double initZ);
76 #else
77 
78  TVertex(double initX, double initY);
79 #endif
80 
81  // Destructor
82  ~TVertex();
83 
84  // Methods
85 
86  // set coordinates
87 #ifdef __3D__
88 
89  void SetCoords(double initX, double initY, double initZ);
90 #else
91 
92  void SetCoords(double initX, double initY);
93 #endif
94 
96  double GetX() const
97  { return X; }
99  double GetY() const
100  { return Y; }
101 #ifdef __3D__
102 
103  double GetZ() const
104  { return Z; }
106  void GetCoords(double& x, double& y, double& z) const
107  {
108  x = X;
109  y = Y;
110  z = Z;
111  }
112 #else
113 
114  void GetCoords(double& x, double& y) const
115  {
116  x = X;
117  y = Y;
118  }
119 #endif
120 
122  friend std::ostream& operator << (std::ostream& s, TVertex *v);
123 
125  void SetClipBoard(int value)
126  { ClipBoard=value; }
128  int GetClipBoard() const
129  { return ClipBoard; }
130 
131  void SetAsBoundVert()
132  { BoundVert=TRUE; }
133 
134  bool IsBoundVert() const
135  { return BoundVert; }
136 
137 #ifdef _MPI
138 
140  void SetVertexCells(int n_Cells, TBaseCell **cells);
141 
142  void SetSubDomainInfo(int n_SubDomains, int *subDomain_Ranks, int *subDomainGlobalCellNo,
143  int *subDomainLocVertNo);
144 
145  void AddCrossNeib(int Neib_ID);
146 
147  void SetAsSubDomainVert()
148  { SubDomainVert = TRUE; }
149 
150  bool IsSubDomainVert()
151  { return SubDomainVert; }
152 
153  void SetAsCrossVert()
154  { CrossVert = TRUE; }
155 
156  bool IsCrossVert()
157  { return CrossVert; }
158 
159  void GetCrossNeibs(int &n_VertCrossNeibs, int *&vertCrossNeibs)
160  {
161  n_VertCrossNeibs = N_CrossNeibCells;
162  vertCrossNeibs = SubDomain_Ranks;
163  }
164 
165  void GetCrossNeibsInfo(int &N_NeibCells, int *&NeibCellRank,
166  int *&GlobalNo, int *&LocVertNo)
167  {
168  N_NeibCells = N_CrossNeibCells;
169  NeibCellRank = SubDomain_Ranks;
170  GlobalNo = SubDomainGlobalCellNo;
171  LocVertNo = SubDomainLocVertNo;
172  }
173 
174  void GetNeibs(int &n_Neibs, TBaseCell **&neighbs)
175  {
176  n_Neibs = N_Cells;
177  neighbs = Cells;
178  }
179 
180  int GetNNeibs()
181  { return N_Cells; }
182 #endif
183 };
184 
185 #endif
int * SubDomainLocVertNo
Definition: Vertex.h:60
bool SubDomainVert
Definition: Vertex.h:45
TBaseCell ** Cells
Definition: Vertex.h:42
double Z
Definition: Vertex.h:28
void SetClipBoard(int value)
Definition: Vertex.h:125
bool BoundVert
Definition: Vertex.h:68
double Y
Definition: Vertex.h:25
int GetClipBoard() const
Definition: Vertex.h:128
int * SubDomain_Ranks
Definition: Vertex.h:54
double X
Definition: Vertex.h:23
bool CrossVert
Definition: Vertex.h:48
int * SubDomainGlobalCellNo
Definition: Vertex.h:57
void GetCoords(double &x, double &y, double &z) const
Definition: Vertex.h:106
double GetY() const
Definition: Vertex.h:99
int N_Cells
Definition: Vertex.h:38
void SetVertexCells(int n_Cells, TBaseCell **cells)
Definition: Vertex.C:80
information for finite element data structure
Definition: BaseCell.h:25
TVertex(double initX, double initY, double initZ)
Definition: Vertex.C:21
int ClipBoard
Definition: Vertex.h:32
Definition: Vertex.h:19
void GetCoords(double &x, double &y) const
Definition: Vertex.h:114
void SetSubDomainInfo(int n_SubDomains, int *subDomain_Ranks, int *subDomainGlobalCellNo, int *subDomainLocVertNo)
Definition: Vertex.C:95
int N_SubDomains
Definition: Vertex.h:51
double GetZ() const
Definition: Vertex.h:103
double GetX() const
Definition: Vertex.h:96
int N_CrossNeibCells
Definition: Vertex.h:63
void SetCoords(double initX, double initY, double initZ)
Definition: Vertex.C:51
friend std::ostream & operator<<(std::ostream &s, TVertex *v)
Definition: Vertex.C:66