gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MPoint.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 #ifndef MPOINT_H
7 #define MPOINT_H
8 
9 #include "MElement.h"
10 #include "BasisFactory.h"
11 
12 /*
13  * MPoint
14  *
15  */
16 class MPoint : public MElement {
17 protected:
18  MVertex *_v[1];
19 
20 public:
21  MPoint(MVertex *v0, int num = 0, int part = 0) : MElement(num, part)
22  {
23  _v[0] = v0;
24  }
25  MPoint(const std::vector<MVertex *> &v, int num = 0, int part = 0)
26  : MElement(num, part)
27  {
28  _v[0] = v[0];
29  }
30  ~MPoint() {}
31  virtual int getDim() const { return 0; }
32  virtual std::size_t getNumVertices() const { return 1; }
33  virtual MVertex *getVertex(int num) { return _v[0]; }
34  virtual const MVertex *getVertex(int num) const { return _v[0]; }
35  virtual void setVertex(int num, MVertex *v) { _v[0] = v; }
36  virtual int getNumEdges() const { return 0; }
37  virtual MEdge getEdge(int num) const { return MEdge(); }
38  virtual int getNumEdgesRep(bool curved) { return 0; }
39  virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z,
40  SVector3 *n)
41  {
42  }
43  virtual int getNumFaces() { return 0; }
44  virtual MFace getFace(int num) const { return MFace(); }
45  virtual int getNumFacesRep(bool curved) { return 0; }
46  virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z,
47  SVector3 *n)
48  {
49  }
50  virtual int getType() const { return TYPE_PNT; }
51  virtual int getTypeForMSH() const { return MSH_PNT; }
52  virtual int getTypeForVTK() const { return 1; }
53  virtual const char *getStringForPOS() const { return "SP"; }
54  virtual void getNode(int num, double &u, double &v, double &w) const
55  {
56  u = v = w = 0.;
57  }
58  virtual SPoint3 barycenterUVW() const { return SPoint3(0., 0., 0.); }
59  virtual void getShapeFunctions(double u, double v, double w, double s[],
60  int o) const
61  {
62  s[0] = 1.;
63  }
64  virtual void getGradShapeFunctions(double u, double v, double w,
65  double s[][3], int o) const
66  {
67  s[0][0] = s[0][1] = s[0][2] = 0.;
68  }
69  virtual const JacobianBasis *getJacobianFuncSpace(int o) const
70  {
72  }
73  virtual bool isInside(double u, double v, double w) const
74  {
75  double tol = getTolerance();
76  if(fabs(u) > tol || fabs(v) > tol || fabs(w) > tol) return false;
77  return true;
78  }
79  virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
80  {
81  static IntPt GQL[1];
82  GQL[0].pt[0] = 0;
83  GQL[0].pt[1] = 0;
84  GQL[0].pt[2] = 0;
85  GQL[0].weight = 1;
86  *npts = 1;
87  *pts = GQL;
88  }
89  virtual int numCommonNodesInDualGraph(const MElement *const other) const
90  {
91  return 1;
92  }
93 };
94 
95 #endif
BasisFactory::getJacobianBasis
static const JacobianBasis * getJacobianBasis(int tag, FuncSpaceData)
Definition: BasisFactory.cpp:62
MPoint::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MPoint.h:45
MEdge
Definition: MEdge.h:14
MPoint::getFace
virtual MFace getFace(int num) const
Definition: MPoint.h:44
MSH_PNT
#define MSH_PNT
Definition: GmshDefines.h:94
MPoint::MPoint
MPoint(const std::vector< MVertex * > &v, int num=0, int part=0)
Definition: MPoint.h:25
MVertex
Definition: MVertex.h:24
MPoint::MPoint
MPoint(MVertex *v0, int num=0, int part=0)
Definition: MPoint.h:21
MPoint::getTypeForMSH
virtual int getTypeForMSH() const
Definition: MPoint.h:51
SPoint3
Definition: SPoint3.h:14
MPoint::~MPoint
~MPoint()
Definition: MPoint.h:30
TYPE_PNT
#define TYPE_PNT
Definition: GmshDefines.h:64
SVector3
Definition: SVector3.h:16
MPoint::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MPoint.h:38
GQL
static std::vector< IntPt * > GQL(40, nullptr)
MPoint::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MPoint.h:32
MPoint::getEdge
virtual MEdge getEdge(int num) const
Definition: MPoint.h:37
MPoint::getTypeForVTK
virtual int getTypeForVTK() const
Definition: MPoint.h:52
MPoint::getShapeFunctions
virtual void getShapeFunctions(double u, double v, double w, double s[], int o) const
Definition: MPoint.h:59
MPoint::isInside
virtual bool isInside(double u, double v, double w) const
Definition: MPoint.h:73
MPoint::getStringForPOS
virtual const char * getStringForPOS() const
Definition: MPoint.h:53
MFace
Definition: MFace.h:20
MPoint::getJacobianFuncSpace
virtual const JacobianBasis * getJacobianFuncSpace(int o) const
Definition: MPoint.h:69
MPoint::setVertex
virtual void setVertex(int num, MVertex *v)
Definition: MPoint.h:35
MPoint::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPoint.h:46
MPoint::getVertex
virtual const MVertex * getVertex(int num) const
Definition: MPoint.h:34
MElement
Definition: MElement.h:30
MPoint::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPoint.h:39
MPoint::numCommonNodesInDualGraph
virtual int numCommonNodesInDualGraph(const MElement *const other) const
Definition: MPoint.h:89
MElement::getTolerance
double getTolerance() const
Definition: MElement.cpp:61
MPoint::getType
virtual int getType() const
Definition: MPoint.h:50
MPoint::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MPoint.h:79
MPoint::_v
MVertex * _v[1]
Definition: MPoint.h:18
MPoint::getNumFaces
virtual int getNumFaces()
Definition: MPoint.h:43
IntPt
Definition: GaussIntegration.h:12
z
const double z
Definition: GaussQuadratureQuad.cpp:56
JacobianBasis
Definition: JacobianBasis.h:60
MElement.h
MPoint
Definition: MPoint.h:16
MPoint::getVertex
virtual MVertex * getVertex(int num)
Definition: MPoint.h:33
MPoint::getNumEdges
virtual int getNumEdges() const
Definition: MPoint.h:36
MPoint::getGradShapeFunctions
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int o) const
Definition: MPoint.h:64
MPoint::getDim
virtual int getDim() const
Definition: MPoint.h:31
MPoint::barycenterUVW
virtual SPoint3 barycenterUVW() const
Definition: MPoint.h:58
BasisFactory.h
MPoint::getNode
virtual void getNode(int num, double &u, double &v, double &w) const
Definition: MPoint.h:54