gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
xyFace.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 // a face in the XY plane for simple 2D interface meshing
7 
8 #ifndef XY_FACE_H
9 #define XY_FACE_H
10 
11 #include "xyEdge.h"
12 #include "GFace.h"
13 
14 class xyFace : public GFace {
15 public:
16  xyFace(GModel *gm, int t, xyEdge *e) : GFace(gm, t) { l_edges.push_back(e); }
17  virtual ~xyFace() {}
18  Range<double> parBounds(int i) const { return Range<double>(0, 1); }
19  virtual GPoint point(double par1, double par2) const
20  {
21  double pp[2] = {par1, par2};
22  return GPoint(par1, par2, 0.0, this, pp);
23  }
24  virtual GPoint closestPoint(const SPoint3 &queryPoint,
25  const double initialGuess[2]) const
26  {
27  double u[2] = {queryPoint.x(), queryPoint.y()};
28  return GPoint(queryPoint.x(), queryPoint.y(), 0.0, this, u);
29  }
30  virtual bool containsPoint(const SPoint3 &pt) const { return true; }
31  virtual SVector3 normal(const SPoint2 &param) const
32  {
33  SVector3 n(0, 0, 1);
34  return n;
35  }
36  virtual Pair<SVector3, SVector3> firstDer(const SPoint2 &param) const
37  {
38  SVector3 t1(1, 0, 0);
39  SVector3 t2(0, 1, 0);
40  return Pair<SVector3, SVector3>(t1, t2);
41  }
42  virtual void secondDer(const SPoint2 &, SVector3 &a, SVector3 &b,
43  SVector3 &c) const
44  {
45  SVector3 v(0, 0, 0);
46  a = v;
47  b = v;
48  c = v;
49  }
50  virtual GEntity::GeomType geomType() const { return GEntity::Plane; }
51  ModelType getNativeType() const { return GmshModel; }
52  void *getNativePtr() const { return nullptr; }
53  virtual SPoint2 parFromPoint(const SPoint3 &p, bool onSurface = true,
54  bool convTestXYZ = false) const
55  {
56  return SPoint2(p.x(), p.y());
57  }
58  bool degenerate(int dim) const { return false; }
59 };
60 
61 #endif
GEntity::ModelType
ModelType
Definition: GEntity.h:79
xyFace::parBounds
Range< double > parBounds(int i) const
Definition: xyFace.h:18
xyFace::normal
virtual SVector3 normal(const SPoint2 &param) const
Definition: xyFace.h:31
GFace.h
GFace
Definition: GFace.h:33
SPoint2
Definition: SPoint2.h:12
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
xyFace::geomType
virtual GEntity::GeomType geomType() const
Definition: xyFace.h:50
SPoint3
Definition: SPoint3.h:14
xyFace::xyFace
xyFace(GModel *gm, int t, xyEdge *e)
Definition: xyFace.h:16
SVector3
Definition: SVector3.h:16
xyFace::parFromPoint
virtual SPoint2 parFromPoint(const SPoint3 &p, bool onSurface=true, bool convTestXYZ=false) const
Definition: xyFace.h:53
GEntity::GmshModel
@ GmshModel
Definition: GEntity.h:81
GFace::dim
virtual int dim() const
Definition: GFace.h:175
GPoint
Definition: GPoint.h:13
xyFace::point
virtual GPoint point(double par1, double par2) const
Definition: xyFace.h:19
xyFace::degenerate
bool degenerate(int dim) const
Definition: xyFace.h:58
GEntity::Plane
@ Plane
Definition: GEntity.h:105
SPoint3::x
double x(void) const
Definition: SPoint3.h:125
Range
Definition: Range.h:10
xyEdge
Definition: xyEdge.h:11
xyFace::containsPoint
virtual bool containsPoint(const SPoint3 &pt) const
Definition: xyFace.h:30
GModel
Definition: GModel.h:44
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
xyFace::getNativeType
ModelType getNativeType() const
Definition: xyFace.h:51
GEntity::GeomType
GeomType
Definition: GEntity.h:88
xyFace::closestPoint
virtual GPoint closestPoint(const SPoint3 &queryPoint, const double initialGuess[2]) const
Definition: xyFace.h:24
xyFace::getNativePtr
void * getNativePtr() const
Definition: xyFace.h:52
xyFace::firstDer
virtual Pair< SVector3, SVector3 > firstDer(const SPoint2 &param) const
Definition: xyFace.h:36
Pair
Definition: Pair.h:10
xyFace
Definition: xyFace.h:14
xyFace::~xyFace
virtual ~xyFace()
Definition: xyFace.h:17
xyFace::secondDer
virtual void secondDer(const SPoint2 &, SVector3 &a, SVector3 &b, SVector3 &c) const
Definition: xyFace.h:42
GFace::l_edges
std::vector< GEdge * > l_edges
Definition: GFace.h:37
xyEdge.h