gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
ghostFace.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 //
6 // Contributed by Anthony Royer
7 
8 #ifndef GHOST_FACE_H
9 #define GHOST_FACE_H
10 
11 #include "GModel.h"
12 #include "discreteFace.h"
13 #include "MTriangle.h"
14 #include "MQuadrangle.h"
15 #include "MElementCut.h"
16 
17 class ghostFace : public discreteFace {
18 private:
20  std::map<MElement *, int> _ghostCells;
21  bool _saveMesh;
22  bool _haveMesh;
23 
24 public:
25  ghostFace(GModel *model, const int num, const int partition)
26  : discreteFace(model, num), _partition(partition), _ghostCells(),
27  _saveMesh(false), _haveMesh(false)
28  {
29  }
30  virtual ~ghostFace()
31  {
32  if(!_haveMesh) {
33  triangles.clear();
34  quadrangles.clear();
35  polygons.clear();
36  mesh_vertices.clear();
37  }
38  }
39  virtual GeomType geomType() const { return GhostSurface; }
40  virtual void setPartition(const int partition) { _partition = partition; }
41  virtual int getPartition() const { return _partition; }
42  bool saveMesh() const { return _saveMesh; }
43  void saveMesh(bool saveMesh) { _saveMesh = saveMesh; }
44  bool haveMesh() const { return _haveMesh; }
45  void haveMesh(bool haveMesh) { _haveMesh = haveMesh; }
46  virtual std::map<MElement *, int> &getGhostCells() { return _ghostCells; }
47 
48  virtual void addTriangle(MTriangle *t, int onWhichPartition)
49  {
51  _ghostCells.insert(std::pair<MElement *, int>(t, onWhichPartition));
53  }
54  virtual void addQuadrangle(MQuadrangle *q, int onWhichPartition)
55  {
57  _ghostCells.insert(std::pair<MElement *, int>(q, onWhichPartition));
59  }
60  virtual void addPolygon(MPolygon *p, int onWhichPartition)
61  {
63  _ghostCells.insert(std::pair<MElement *, int>(p, onWhichPartition));
65  }
66  virtual void addElement(int type, MElement *e, int onWhichPartition)
67  {
68  GFace::addElement(type, e);
69  _ghostCells.insert(std::pair<MElement *, int>(e, onWhichPartition));
71  }
72 
73  // To make the hidden function visible in ghostFace
77 };
78 
79 #endif
MTriangle.h
GFace::addQuadrangle
void addQuadrangle(MQuadrangle *q)
Definition: GFace.h:440
ghostFace
Definition: ghostFace.h:17
ghostFace::getGhostCells
virtual std::map< MElement *, int > & getGhostCells()
Definition: ghostFace.h:46
GFace::triangles
std::vector< MTriangle * > triangles
Definition: GFace.h:428
GEntity::model
GModel * model() const
Definition: GEntity.h:277
ghostFace::addTriangle
virtual void addTriangle(MTriangle *t, int onWhichPartition)
Definition: ghostFace.h:48
GFace::addPolygon
void addPolygon(MPolygon *p)
Definition: GFace.h:444
ghostFace::addPolygon
virtual void addPolygon(MPolygon *p, int onWhichPartition)
Definition: ghostFace.h:60
ghostFace::addElement
virtual void addElement(int type, MElement *e, int onWhichPartition)
Definition: ghostFace.h:66
GModel::addGhostCells
void addGhostCells(MElement *elm, short partition)
Definition: GModel.h:619
GEntity::GhostSurface
@ GhostSurface
Definition: GEntity.h:126
GFace::quadrangles
std::vector< MQuadrangle * > quadrangles
Definition: GFace.h:429
ghostFace::geomType
virtual GeomType geomType() const
Definition: ghostFace.h:39
ghostFace::haveMesh
bool haveMesh() const
Definition: ghostFace.h:44
GEntity::mesh_vertices
std::vector< MVertex * > mesh_vertices
Definition: GEntity.h:56
MElementCut.h
ghostFace::ghostFace
ghostFace(GModel *model, const int num, const int partition)
Definition: ghostFace.h:25
ghostFace::_ghostCells
std::map< MElement *, int > _ghostCells
Definition: ghostFace.h:20
GFace::polygons
std::vector< MPolygon * > polygons
Definition: GFace.h:430
GModel
Definition: GModel.h:44
GFace::addElement
void addElement(int type, MElement *e)
Definition: GFace.cpp:2739
ghostFace::getPartition
virtual int getPartition() const
Definition: ghostFace.h:41
ghostFace::_saveMesh
bool _saveMesh
Definition: ghostFace.h:21
ghostFace::haveMesh
void haveMesh(bool haveMesh)
Definition: ghostFace.h:45
MElement
Definition: MElement.h:30
discreteFace.h
GEntity::GeomType
GeomType
Definition: GEntity.h:88
ghostFace::saveMesh
void saveMesh(bool saveMesh)
Definition: ghostFace.h:43
MTriangle
Definition: MTriangle.h:26
ghostFace::setPartition
virtual void setPartition(const int partition)
Definition: ghostFace.h:40
ghostFace::~ghostFace
virtual ~ghostFace()
Definition: ghostFace.h:30
MQuadrangle.h
ghostFace::addQuadrangle
virtual void addQuadrangle(MQuadrangle *q, int onWhichPartition)
Definition: ghostFace.h:54
ghostFace::_haveMesh
bool _haveMesh
Definition: ghostFace.h:22
MPolygon
Definition: MElementCut.h:198
ghostFace::_partition
int _partition
Definition: ghostFace.h:19
GModel.h
ghostFace::saveMesh
bool saveMesh() const
Definition: ghostFace.h:42
MQuadrangle
Definition: MQuadrangle.h:26
discreteFace
Definition: discreteFace.h:18
GFace::addTriangle
void addTriangle(MTriangle *t)
Definition: GFace.h:436