ParMooN
 All Classes Functions Variables Friends Pages
BaseCell.h
1 
16 #ifndef __BASECELL__
17 #define __BASECELL__
18 
19 #include <Edge.h>
20 #include <Joint.h>
21 #include <RefDesc.h>
22 #include <fstream>
23 
25 class TBaseCell
26 {
27  protected:
30 
33 
35  int ClipBoard;
36 
39 
41  int Bd_Part;
42 
44  int CellIndex;
45 
48 
51 
53  int region;
54 
56  int LayerCell;
57 
58 #ifdef __3D__
59 
61 #endif
62 
63 #ifdef _MPI
64 
66 
69 
72 
74  bool OwnCell;
75 
77  bool HaloCell;
78 
81 
84 
87 
90 
93 
96 
97 #endif
98 
101 
102 
103  public:
104  // Constructor
105  TBaseCell(TRefDesc *refdesc);
106 
107  // Destructor
108  virtual ~TBaseCell();
109 
110  // Methods
112  int SetRefDesc(TRefDesc *newrefdesc)
113  {
114  if (newrefdesc->GetShapeDesc() == GetShapeDesc())
115  {
116  RefDesc = newrefdesc;
117  return 0;
118  }
119  else
120  if (newrefdesc->GetShapeDesc()->GetN_Vertices() ==
122  {
123  RefDesc = newrefdesc;
124  return 0;
125  }
126  else
127  return -1;
128  }
129 
132  { return RefDesc; }
135  { return RefDesc->GetShapeDesc(); }
137  Shapes GetType() const
138  { return RefDesc->GetShapeDesc()->GetType(); }
139 
141  Refinements GetEdgeRef(int i) const
142  { return RefDesc->GetEdgeRef(i); }
143 
144 #ifdef __3D__
145 
146  Refinements GetFaceRef(int i)
147  { return RefDesc->GetFaceRef(i); }
148 
150  int SetEdge(int E_i, TEdge *E)
151  {
152  Edges[E_i] = E;
153  return 0;
154  }
155 
157  TEdge *GetEdge(int E_i)
158  { return Edges[E_i]; }
159 
160 #endif
161 
163  virtual int SetVertex(int Vert_i, TVertex *Vert) = 0;
165  virtual TVertex *GetVertex(int Vert_i) = 0;
166 
168  int SetJoint(int J_i, TJoint *J)
169  {
170  Joints[J_i] = J;
171  return 0;
172  }
173 
175  TJoint *GetJoint(int J_i)
176  { return Joints[J_i]; }
177 
180  { return RefDesc->GetN_OrigVertices(); }
183  { return RefDesc->GetN_OrigEdges(); }
186  { return RefDesc->GetShapeDesc()->GetN_Joints(); }
187 
188  #ifdef __3D__
189 
191  { return RefDesc->GetN_OrigFaces(); }
192  #endif
193 
195  virtual int GetN_Children() = 0;
197  virtual int GetN_Parents() = 0;
198 
200  virtual TBaseCell *GetChild(int C_i) = 0;
202  virtual TBaseCell *GetParent() = 0;
204  virtual int SetParent(TBaseCell *parent) = 0;
206  virtual int GetChildNumber(TBaseCell *Me) = 0;
207 
209  virtual int Draw(std::ofstream &dat, double scale, double StartX,
210  double StartY) = 0;
212  virtual int PS(std::ofstream &dat, double scale, double StartX,
213  double StartY) = 0;
215  virtual int MD_raw(std::ofstream &dat) = 0;
216 
219  virtual int Refine(int RefLevel) = 0;
220 
221  #ifdef __MORTAR__
222 
223  virtual int RefineMortar(int RefLevel) = 0;
224  #endif
225 
227  virtual int Derefine() = 0;
228 
230  virtual int RefDeref() = 0;
232  virtual int Gen1RegMarks() = 0;
233 
236  virtual int Gen1RegGrid() = 0;
238  virtual int Ref1Reg(int LocJointNum, TBaseCell *&RefCell) = 0;
240  virtual int Check1Reg() = 0;
242  virtual int SetNoRefinement() = 0;
244  virtual int SetRegRefine() = 0;
246  virtual int Set1Refine(int i)= 0;
248  virtual int IsToRefine() = 0;
250  virtual int ExistChildren() = 0;
252  virtual int MakeConfClosure() = 0;
253 
254  #ifdef __2D__
255 
256  virtual int LineMidXY(int J_i, int P_j, double &X, double &Y) = 0;
258  virtual int LineMidT(int J_i, int SJ_j, double &T_0, double &T_1) = 0;
259  #else
260  #endif
261 
263  void SetClipBoard(int value)
264  { ClipBoard=value; }
267  { return ClipBoard; }
268 
270  virtual double GetDiameter() = 0;
271 
273  virtual double GetShortestEdge() = 0;
274 
276  virtual double GetLengthWithReferenceMap() = 0;
277 
279  virtual double GetMeasure() = 0;
280 
288  double Get_hK(int cell_measure);
289 
291  virtual bool PointInCell(double X, double Y) = 0;
292 
293 #ifdef __3D__
294  virtual bool PointInCell(double X, double Y, double Z) = 0;
295 
296  // added 25.04.2010 for fixing refinement problem
297  void CorrectBoundaryVertices(TVertex **NewVertices, TJoint **NewJoints);
298 #endif
299 
301  virtual int GetGeoLevel() = 0;
302 
304  virtual int GetSubGridID() = 0;
305 
307  void SetReference_ID(int val)
308  { Reference_ID = val;}
309 
311  int GetReference_ID() const
312  {return Reference_ID;}
313 
315  void SetBd_Part(int val)
316  {Bd_Part = val;}
317 
319  int GetBd_Part() const
320  {return Bd_Part;}
321 
323  void SetCellIndex(int val)
324  {CellIndex = val;}
325 
327  int GetCellIndex() const
328  {return CellIndex;}
329 
331  void SetGlobalCellNo(int val)
332  {GlobalCellNo = val;}
333 
335  int GetGlobalCellNo() const
336  {return GlobalCellNo;}
337 
339  void SetLocalCellNo(int val)
340  {LocalCellNo = val;}
341 
343  int GetLocalCellNo() const
344  {return LocalCellNo;}
345 
347  void SetRegionID(int val)
348  {region = val;}
349 
351  int GetRegionID() const
352  {return region;}
353 
355  void SetAsLayerCell(int val)
356  {LayerCell = val;}
357 
359  int IsLayerCell() const
360  {return LayerCell;}
361 
363  void SetNormalOrientation();
364 
366  int GetNormalOrientation(int i) const
367  { return normalOrientation[i]; }
368 
369 
370 #ifdef _MPI
371 
373  void SetClipBoard_Par(int value)
374  { ClipBoard_Par=value; }
375 
378  { return ClipBoard_Par; }
379 
381  void SetSubDomainNo(int val)
382  {SubDomainNumber = val;}
383 
385  int GetSubDomainNo() const
386  {return SubDomainNumber;}
387 
388  void SetAsOwnCell()
389  { OwnCell=TRUE; }
390 
391  void SetAsDependentCell()
392  { DependentCell=TRUE; }
393 
394  void SetAsHaloCell()
395  {
396  OwnCell=FALSE;
397  HaloCell=TRUE;
398  }
399 
400  bool IsHaloCell() const
401  { return HaloCell; }
402 
403  void SetAsSubDomainInterfaceCell()
404  { SubDomainInterfaceCell=TRUE; }
405 
406  bool IsSubDomainInterfaceCell() const
407  { return SubDomainInterfaceCell; }
408 
409  void SetAsCrossEdgeCell()
410  { CrossEdgeCell=TRUE; }
411 
412  bool IsCrossEdgeCell() const
413  { return CrossEdgeCell; }
414 
415 
416  void SetAsCrossVertexCell()
417  { CrossVertexCell=TRUE; }
418 
419  bool IsCrossVertexCell() const
420  { return CrossVertexCell; }
421 
422  bool IsDependentCell() const
423  { return DependentCell; }
424 
425  void SetN_NeibProcesses(int n)
426  { N_NeibProcesses = n; }
427 
428  int GetN_NeibProcesses() const
429  { return N_NeibProcesses; }
430 
431  void SetNeibProcessesIds(int *Neiblist);
432 
433  int *GetNeibProcessesIds() const
434  { return NeibProcessesIds; }
435 
436 #endif
437 };
438 
439 #endif
virtual int ExistChildren()=0
are there any children of this cell
void SetSubDomainNo(int val)
set subdomain number to this cell
Definition: BaseCell.h:381
virtual int Gen1RegGrid()=0
generate such refinement information in the neighbouring cells so that the traingulation will become ...
int GetClipBoard_Par()
get value from ClipBoard
Definition: BaseCell.h:377
double Get_hK(int cell_measure)
get the value of hK
Definition: BaseCell.C:97
virtual int Gen1RegMarks()=0
set marks in neighbour cell in order to maintain 1 regularity
int Bd_Part
an integer for storing boundary part (surface meshes)
Definition: BaseCell.h:41
virtual int RefDeref()=0
make refinement or derefinement according to cell&#39;s clipboard
virtual int SetNoRefinement()=0
set refinement descriptor to no refinement
virtual double GetDiameter()=0
get diameter of a cell
TJoint ** Joints
array of all joints
Definition: BaseCell.h:32
int * NeibProcessesIds
if(N_NeibProcesses), the rank ID of neib processes
Definition: BaseCell.h:95
virtual double GetMeasure()=0
get measure of a cell
virtual int MakeConfClosure()=0
generate conforming closures
virtual int MD_raw(std::ofstream &dat)=0
write cell data according to MD format in stream dat
virtual int Derefine()=0
derefine the current cell, remove the children
int GetN_Faces()
return the number of faces of the cell
Definition: BaseCell.h:190
bool DependentCell
a bool to check this cell is neibs&#39; halo cell or not
Definition: BaseCell.h:80
virtual int GetSubGridID()=0
get subgrid ID
int N_NeibProcesses
Number of neib processes for this cell.
Definition: BaseCell.h:92
int IsLayerCell() const
get LayerCell info
Definition: BaseCell.h:359
virtual int Ref1Reg(int LocJointNum, TBaseCell *&RefCell)=0
regular refinement of joint LocJointNum
TEdge ** Edges
array of all Edges in 3D
Definition: BaseCell.h:60
virtual int RefineMortar(int RefLevel)=0
refine a mortar cell
Refinements GetFaceRef(int i)
Definition: RefDesc.h:558
int SetJoint(int J_i, TJoint *J)
set the pointer to face J_i to J
Definition: BaseCell.h:168
void SetLocalCellNo(int val)
set subdomain number to this cell
Definition: BaseCell.h:339
Refinements GetEdgeRef(int i) const
return refinement descriptor of edge i
Definition: BaseCell.h:141
void SetClipBoard(int value)
set value in ClipBoard
Definition: BaseCell.h:263
int LayerCell
an integer for indicating layer cells
Definition: BaseCell.h:56
int Reference_ID
an integer for storing physical reference of cell (e.g. material properties)
Definition: BaseCell.h:38
int ClipBoard
an integer for storing clipboard information
Definition: BaseCell.h:35
virtual double GetShortestEdge()=0
return shortest edge of a cell
int ClipBoard_Par
an integer for storing clipboard information in parallel FEspace mapping
Definition: BaseCell.h:65
Definition: RefDesc.h:70
int GetN_Joints()
Definition: ShapeDesc.h:91
int GetCellIndex() const
set subdomain number to this cell
Definition: BaseCell.h:327
TShapeDesc * GetShapeDesc() const
return shape descriptor of refinement descriptor
Definition: BaseCell.h:134
virtual int SetParent(TBaseCell *parent)=0
set the parent to parent
int GetReference_ID() const
get reference number of this cell
Definition: BaseCell.h:311
void SetNormalOrientation()
compute normal orientation w.r.t cell
Definition: BaseCell.C:170
int GlobalCellNo
an integer for storing the global cell number
Definition: BaseCell.h:47
int GetN_Joints()
return the number of joints
Definition: BaseCell.h:185
void SetGlobalCellNo(int val)
set subdomain number to this cell
Definition: BaseCell.h:331
virtual TVertex * GetVertex(int Vert_i)=0
return the pointer to vertex with number i
virtual int PS(std::ofstream &dat, double scale, double StartX, double StartY)=0
write the postscript cell data to stream dat
virtual int GetN_Children()=0
return the number of children of the cell
virtual int GetGeoLevel()=0
get geometry level
int SubDomainLocalCellNo
an integer for storing the global cell number
Definition: BaseCell.h:71
int SetEdge(int E_i, TEdge *E)
set the pointer to edge E_i to E
Definition: BaseCell.h:150
void SetBd_Part(int val)
set phase number to this cell
Definition: BaseCell.h:315
Definition: ShapeDesc.h:29
TJoint * GetJoint(int J_i)
return the pointer to face with number i
Definition: BaseCell.h:175
int GetN_OrigFaces()
Definition: RefDesc.h:338
int GetSubDomainNo() const
set subdomain number to this cell
Definition: BaseCell.h:385
int GetN_Vertices()
Definition: ShapeDesc.h:85
bool OwnCell
a bool to check this cell is own cell of the SubDomain or not
Definition: BaseCell.h:74
Definition: Joint.h:48
int SetRefDesc(TRefDesc *newrefdesc)
set refinement descriptor to newrefdesc
Definition: BaseCell.h:112
void SetReference_ID(int val)
set reference number to this cell
Definition: BaseCell.h:307
int GetN_Vertices()
return the number of vertices of the cell
Definition: BaseCell.h:179
Refinements GetEdgeRef(int J_i)
Definition: RefDesc.h:353
virtual int Refine(int RefLevel)=0
refine the current cell on level RefLevel according actual refinement descriptor
virtual int Set1Refine(int i)=0
set refinement descriptor to adaptive refinement
virtual TBaseCell * GetChild(int C_i)=0
return the child with the number C_i
TRefDesc * RefDesc
current property of refinement (including shape descriptor)
Definition: BaseCell.h:29
int GetN_OrigVertices()
Definition: RefDesc.h:333
virtual TBaseCell * GetParent()=0
return the parent cell
int CellIndex
cell index value in the collection
Definition: BaseCell.h:44
virtual int SetRegRefine()=0
set refinement descriptor to regular refinement
int region
an integer for storing the region of this cell number
Definition: BaseCell.h:53
virtual int LineMidT(int J_i, int SJ_j, double &T_0, double &T_1)=0
return parameter values
TRefDesc * GetRefDesc() const
return refinement descriptor
Definition: BaseCell.h:131
int LocalCellNo
an integer for storing the local cell number (2Phase flows)
Definition: BaseCell.h:100
bool SubDomainInterfaceCell
a bool to check this cell contains SubDomainInterface(s) or not
Definition: BaseCell.h:83
information for finite element data structure
Definition: BaseCell.h:25
virtual bool PointInCell(double X, double Y)=0
return whether a point is inside a cell
void SetClipBoard_Par(int value)
set value in ClipBoard
Definition: BaseCell.h:373
virtual double GetLengthWithReferenceMap()=0
return the length of the cell defined with the reference map
virtual int IsToRefine()=0
is the cell to refine
bool HaloCell
a bool to check this cell is a halo cell for the SubDomain or not
Definition: BaseCell.h:77
virtual int GetN_Parents()=0
return the number of parents of the cell
int GetN_OrigEdges()
Definition: RefDesc.h:330
virtual int Check1Reg()=0
check whether the surroundings of cell is 1-regular
Definition: Vertex.h:19
Refinements GetFaceRef(int i)
return refinement descriptor of face i
Definition: BaseCell.h:146
int * normalOrientation
normal orientation of joints (for each joint this is 1 or -1)
Definition: BaseCell.h:50
int GetN_Edges()
return the number of edges of the cell
Definition: BaseCell.h:182
void SetRegionID(int val)
set region number to this cell
Definition: BaseCell.h:347
virtual int LineMidXY(int J_i, int P_j, double &X, double &Y)=0
return (x,y) coordinates
TShapeDesc * GetShapeDesc()
Definition: RefDesc.h:350
void SetCellIndex(int val)
set subdomain number to this cell
Definition: BaseCell.h:323
TEdge * GetEdge(int E_i)
return the pointer to edge with number E_i
Definition: BaseCell.h:157
bool CrossVertexCell
a bool to check this cell contains cross vertices or not
Definition: BaseCell.h:89
bool CrossEdgeCell
a bool to check this cell contains cross edges or not
Definition: BaseCell.h:86
int GetLocalCellNo() const
set LocalCellNo number to this cell
Definition: BaseCell.h:343
int GetNormalOrientation(int i) const
get normal orientation w.r.t cell at i-th joint
Definition: BaseCell.h:366
int GetGlobalCellNo() const
set subdomain number to this cell
Definition: BaseCell.h:335
Shapes GetType()
Definition: ShapeDesc.h:101
int GetClipBoard()
get value from ClipBoard
Definition: BaseCell.h:266
virtual int SetVertex(int Vert_i, TVertex *Vert)=0
set the pointer of vertex Vert_i to Vert
int GetBd_Part() const
get phase number to this cell
Definition: BaseCell.h:319
virtual int GetChildNumber(TBaseCell *Me)=0
return the child number of cell Me
Definition: Edge.h:22
Shapes GetType() const
return shape type of refinement descriptor
Definition: BaseCell.h:137
void SetAsLayerCell(int val)
set as LayerCell cell
Definition: BaseCell.h:355
int GetRegionID() const
set region number to this cell
Definition: BaseCell.h:351
int SubDomainNumber
an integer for storing which subdomain contains this cell
Definition: BaseCell.h:68
virtual int Draw(std::ofstream &dat, double scale, double StartX, double StartY)=0
write boundary and interface joints to stream dat