gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
qualityMeasures.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 QUALITY_MEASURES_H
7 #define QUALITY_MEASURES_H
8 
9 #include <vector>
10 
11 class SPoint3;
12 class SVector3;
13 class BDS_Point;
14 class BDS_Face;
15 class MVertex;
16 class MTriangle;
17 class MQuadrangle;
18 class MTetrahedron;
19 class MPrism;
20 class MHexahedron;
21 class MElement;
22 template <class scalar> class fullVector;
23 template <class scalar> class fullMatrix;
24 
25 class qmTriangle {
26 public:
27  static double gamma(MTriangle *f);
28  static double gamma(BDS_Face *f);
29  static double gamma(const BDS_Point *p1, const BDS_Point *p2,
30  const BDS_Point *p3);
31  static double gamma(const MVertex *v1, const MVertex *v2, const MVertex *v3);
32  static double gamma(const double *d1, const double *d2, const double *d3);
33  static double gamma(const double &x1, const double &y1, const double &z1,
34  const double &x2, const double &y2, const double &z2,
35  const double &x3, const double &y3, const double &z3);
36  static double eta(MTriangle *el);
37  static double angles(MTriangle *e);
38  static double minNCJ(const MTriangle *e);
39  static void NCJRange(const MTriangle *e, double &valMin, double &valMax);
40  static inline int numNCJVal() { return 3; }
41  static void NCJ(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2,
42  const SVector3 &normal, std::vector<double> &NCJ);
43  static void NCJAndGradients(const SPoint3 &p0, const SPoint3 &p1,
44  const SPoint3 &p2, const SVector3 &normal,
45  std::vector<double> &NCJ,
46  std::vector<double> &dNCJ);
47 };
48 
49 class qmQuadrangle {
50 public:
51  static double gamma(MQuadrangle *el) { return eta(el); }
52  static double eta(MQuadrangle *el);
53  static double angles(MQuadrangle *e);
54  static double minNCJ(const MQuadrangle *e);
55  static void NCJRange(const MQuadrangle *e, double &valMin, double &valMax);
56  static inline int numNCJVal() { return 4; }
57  static void NCJ(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2,
58  const SPoint3 &p3, const SVector3 &normal,
59  std::vector<double> &ncj);
60  static void NCJAndGradients(const SPoint3 &p0, const SPoint3 &p1,
61  const SPoint3 &p2, const SPoint3 &p3,
62  const SVector3 &normal, std::vector<double> &NCJ,
63  std::vector<double> &dNCJ);
64 };
65 
67 public:
69  static double qm(MTetrahedron *t, const Measures &cr,
70  double *volume = nullptr);
71  static double qm(const BDS_Point *p1, const BDS_Point *p2,
72  const BDS_Point *p3);
73  static double qm(const MVertex *v1, const MVertex *v2, const MVertex *v3,
74  const MVertex *v4, const Measures &cr,
75  double *volume = nullptr);
76  static double qm(const double &x1, const double &y1, const double &z1,
77  const double &x2, const double &y2, const double &z2,
78  const double &x3, const double &y3, const double &z3,
79  const double &x4, const double &y4, const double &z4,
80  const Measures &cr, double *volume = nullptr);
81  static double eta(const double &x1, const double &y1, const double &z1,
82  const double &x2, const double &y2, const double &z2,
83  const double &x3, const double &y3, const double &z3,
84  const double &x4, const double &y4, const double &z4,
85  double *volume = nullptr);
86  static double gamma(const double &x1, const double &y1, const double &z1,
87  const double &x2, const double &y2, const double &z2,
88  const double &x3, const double &y3, const double &z3,
89  const double &x4, const double &y4, const double &z4,
90  double *volume = nullptr);
91  static double cond(const double &x1, const double &y1, const double &z1,
92  const double &x2, const double &y2, const double &z2,
93  const double &x3, const double &y3, const double &z3,
94  const double &x4, const double &y4, const double &z4,
95  double *volume = nullptr);
96  static double minNCJ(const MTetrahedron *e);
97  // static void NCJRange(const MTetrahedron *e, double &valMin, double
98  // &valMax);
99  static inline int numNCJVal() { return 4; }
100  // static void NCJ(const double &x0, const double &y0, const double &z0,
101  // const double &x1, const double &y1, const double &z1,
102  // const double &x2, const double &y2, const double &z2,
103  // const double &x3, const double &y3, const double &z3,
104  // fullVector<double> &ncj);
105  // static void NCJAndGradients(const double &x0, const double &y0, const
106  // double &z0,
107  // const double &x1, const double &y1, const
108  // double &z1, const double &x2, const double
109  // &y2, const double &z2, const double &x3, const
110  // double &y3, const double &z3,
111  // fullMatrix<double> &ncj);
112 };
113 
114 class qmPrism {
115 public:
116  static double minNCJ(const MPrism *el);
117  static inline int numNCJVal() { return 6; }
118  // static void NCJ(const double &x0, const double &y0, const double &z0,
119  // const double &x1, const double &y1, const double &z1,
120  // const double &x2, const double &y2, const double &z2,
121  // const double &x3, const double &y3, const double &z3,
122  // const double &x4, const double &y4, const double &z4,
123  // fullVector<double> &ncj);
124 };
125 
127 public:
128  static double angles(MHexahedron *el);
129  static inline int numNCJVal() { return 8; }
130  // static void NCJ(const double &x0, const double &y0, const double &z0,
131  // const double &x1, const double &y1, const double &z1,
132  // const double &x2, const double &y2, const double &z2,
133  // const double &x3, const double &y3, const double &z3,
134  // const double &x4, const double &y4, const double &z4,
135  // fullVector<double> &ncj);
136 };
137 
138 #endif
qmQuadrangle::eta
static double eta(MQuadrangle *el)
Definition: qualityMeasures.cpp:392
qmQuadrangle::gamma
static double gamma(MQuadrangle *el)
Definition: qualityMeasures.h:51
qmTetrahedron::gamma
static double gamma(const double &x1, const double &y1, const double &z1, const double &x2, const double &y2, const double &z2, const double &x3, const double &y3, const double &z3, const double &x4, const double &y4, const double &z4, double *volume=nullptr)
Definition: qualityMeasures.cpp:674
qmQuadrangle::numNCJVal
static int numNCJVal()
Definition: qualityMeasures.h:56
fullVector
Definition: MElement.h:26
MTetrahedron
Definition: MTetrahedron.h:34
qmQuadrangle::minNCJ
static double minNCJ(const MQuadrangle *e)
MVertex
Definition: MVertex.h:24
qmPrism
Definition: qualityMeasures.h:114
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
SVector3
Definition: SVector3.h:16
qmQuadrangle::NCJRange
static void NCJRange(const MQuadrangle *e, double &valMin, double &valMax)
Definition: qualityMeasures.cpp:493
MPrism
Definition: MPrism.h:34
qmPrism::minNCJ
static double minNCJ(const MPrism *el)
Definition: qualityMeasures.cpp:769
qmTriangle::NCJ
static void NCJ(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2, const SVector3 &normal, std::vector< double > &NCJ)
Definition: qualityMeasures.cpp:290
qmTriangle::NCJAndGradients
static void NCJAndGradients(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2, const SVector3 &normal, std::vector< double > &NCJ, std::vector< double > &dNCJ)
Definition: qualityMeasures.cpp:310
qmQuadrangle::NCJAndGradients
static void NCJAndGradients(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2, const SPoint3 &p3, const SVector3 &normal, std::vector< double > &NCJ, std::vector< double > &dNCJ)
Definition: qualityMeasures.cpp:534
qmTetrahedron::eta
static double eta(const double &x1, const double &y1, const double &z1, const double &x2, const double &y2, const double &z2, const double &x3, const double &y3, const double &z3, const double &x4, const double &y4, const double &z4, double *volume=nullptr)
Definition: qualityMeasures.cpp:651
qmTetrahedron::numNCJVal
static int numNCJVal()
Definition: qualityMeasures.h:99
fullMatrix
Definition: MElement.h:27
qmTriangle
Definition: qualityMeasures.h:25
qmTriangle::minNCJ
static double minNCJ(const MTriangle *e)
qmTriangle::gamma
static double gamma(MTriangle *f)
Definition: qualityMeasures.cpp:146
qmTetrahedron::QMTET_ONE
@ QMTET_ONE
Definition: qualityMeasures.h:68
qmQuadrangle::NCJ
static void NCJ(const SPoint3 &p0, const SPoint3 &p1, const SPoint3 &p2, const SPoint3 &p3, const SVector3 &normal, std::vector< double > &ncj)
Definition: qualityMeasures.cpp:515
qmTriangle::NCJRange
static void NCJRange(const MTriangle *e, double &valMin, double &valMax)
Definition: qualityMeasures.cpp:269
qmTriangle::numNCJVal
static int numNCJVal()
Definition: qualityMeasures.h:40
qmTetrahedron::qm
static double qm(MTetrahedron *t, const Measures &cr, double *volume=nullptr)
Definition: qualityMeasures.cpp:616
qmTetrahedron::QMTET_ETA
@ QMTET_ETA
Definition: qualityMeasures.h:68
MHexahedron
Definition: MHexahedron.h:28
MElement
Definition: MElement.h:30
qmHexahedron
Definition: qualityMeasures.h:126
MTriangle
Definition: MTriangle.h:26
BDS_Face
Definition: BDS.h:164
qmQuadrangle::angles
static double angles(MQuadrangle *e)
Definition: qualityMeasures.cpp:435
qmHexahedron::angles
static double angles(MHexahedron *el)
Definition: qualityMeasures.cpp:805
qmTetrahedron::minNCJ
static double minNCJ(const MTetrahedron *e)
qmHexahedron::numNCJVal
static int numNCJVal()
Definition: qualityMeasures.h:129
qmTriangle::angles
static double angles(MTriangle *e)
Definition: qualityMeasures.cpp:200
qmTriangle::gamma
static double gamma(const double *d1, const double *d2, const double *d3)
qmTetrahedron::cond
static double cond(const double &x1, const double &y1, const double &z1, const double &x2, const double &y2, const double &z2, const double &x3, const double &y3, const double &z3, const double &x4, const double &y4, const double &z4, double *volume=nullptr)
Definition: qualityMeasures.cpp:727
qmTetrahedron::QMTET_GAMMA
@ QMTET_GAMMA
Definition: qualityMeasures.h:68
qmQuadrangle
Definition: qualityMeasures.h:49
qmTriangle::eta
static double eta(MTriangle *el)
Definition: qualityMeasures.cpp:187
BDS_Point
Definition: BDS.h:49
qmTetrahedron::Measures
Measures
Definition: qualityMeasures.h:68
qmPrism::numNCJVal
static int numNCJVal()
Definition: qualityMeasures.h:117
qmTetrahedron::qm
static double qm(const BDS_Point *p1, const BDS_Point *p2, const BDS_Point *p3)
qmTetrahedron
Definition: qualityMeasures.h:66
MQuadrangle
Definition: MQuadrangle.h:26
qmTetrahedron::QMTET_COND
@ QMTET_COND
Definition: qualityMeasures.h:68