gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MTriangle.cpp
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 #include "GmshConfig.h"
7 #include "MTriangle.h"
8 #include "Numeric.h"
9 #include "Context.h"
10 #include "BasisFactory.h"
11 #include "pointsGenerators.h"
12 
13 #if defined(HAVE_MESH)
14 #include "qualityMeasures.h"
15 #include "HighOrder.h"
16 #endif
17 
18 #include <cmath>
19 #include <cstring>
20 
21 void MTriangle::getEdgeRep(bool curved, int num, double *x, double *y,
22  double *z, SVector3 *n)
23 {
24  // don't use MElement::_getEdgeRep: it's slow due to the creation of MFace
25  // could speed this up by computing and storing the normal only if num==0; we
26  // always call getEdgeRep in sequence
27  MVertex *v0 = _v[edges_tri(num, 0)];
28  MVertex *v1 = _v[edges_tri(num, 1)];
29  x[0] = v0->x();
30  y[0] = v0->y();
31  z[0] = v0->z();
32  x[1] = v1->x();
33  y[1] = v1->y();
34  z[1] = v1->z();
35  if(CTX::instance()->mesh.lightLines) {
36  static const int vv[3] = {2, 0, 1};
37  MVertex *v2 = _v[vv[num]];
38  SVector3 t1(x[1] - x[0], y[1] - y[0], z[1] - z[0]);
39  SVector3 t2(v2->x() - x[0], v2->y() - y[0], v2->z() - z[0]);
40  SVector3 normal = crossprod(t1, t2);
41  normal.normalize();
42  n[0] = n[1] = normal;
43  }
44  else {
45  n[0] = n[1] = SVector3(0., 0., 1.);
46  }
47 }
48 
50 {
51  double p1[3] = {_v[0]->x(), _v[0]->y(), _v[0]->z()};
52  double p2[3] = {_v[1]->x(), _v[1]->y(), _v[1]->z()};
53  double p3[3] = {_v[2]->x(), _v[2]->y(), _v[2]->z()};
54  double res[3];
55  circumCenterXYZ(p1, p2, p3, res);
56  return SPoint3(res[0], res[1], res[2]);
57 }
58 
60 {
61  if(getNumVertices() > 3) return MElement::getVolume();
62  SPoint3 p0(_v[0]->x(), _v[0]->y(), _v[0]->z());
63  SPoint3 p1(_v[1]->x(), _v[1]->y(), _v[1]->z());
64  SPoint3 p2(_v[2]->x(), _v[2]->y(), _v[2]->z());
65  SVector3 v1(p0, p1), v2(p0, p2);
66  return norm(crossprod(v1, v2)) / 2.;
67 }
68 
70 {
71  // radius of inscribed circle = 2 * Area / sum(Line_i)
72  double dist[3], k = 0.;
73  for(int i = 0; i < 3; i++) {
74  MEdge e = getEdge(i);
75  dist[i] = e.getVertex(0)->distance(e.getVertex(1));
76  k += 0.5 * dist[i];
77  }
78  double const area =
79  std::sqrt(k * (k - dist[0]) * (k - dist[1]) * (k - dist[2]));
80  return area / k;
81 }
82 
84 {
85  // radius of circle circumscribing a triangle
86  double dist[3], k = 0.0;
87  for(int i = 0; i < 3; i++) {
88  MEdge e = getEdge(i);
89  dist[i] = e.getVertex(0)->distance(e.getVertex(1));
90  k += 0.5 * dist[i];
91  }
92  double const area =
93  std::sqrt(k * (k - dist[0]) * (k - dist[1]) * (k - dist[2]));
94  return dist[0] * dist[1] * dist[2] / (4 * area);
95 }
96 
98 {
99 #if defined(HAVE_MESH)
100  return qmTriangle::angles(this);
101 #else
102  return 0.;
103 #endif
104 }
105 
107 {
108 #if defined(HAVE_MESH)
109  return qmTriangle::eta(this);
110 #else
111  return 0.;
112 #endif
113 }
114 
116 {
117 #if defined(HAVE_MESH)
118  return qmTriangle::gamma(this);
119 #else
120  return 0.;
121 #endif
122 }
123 
124 void MTriangle::xyz2uvw(double xyz[3], double uvw[3]) const
125 {
126  // double M[2][2], R[2];
127  // const SPoint2 p0 (getVertex(0)->x(),getVertex(0)->y());
128  // const SPoint2 p1 (getVertex(1)->x(),getVertex(1)->y());
129  // const SPoint2 p2 (getVertex(2)->x(),getVertex(2)->y());
130  // M[0][0] = p1.x() - p0.x();
131  // M[0][1] = p2.x() - p0.x();
132  // M[1][0] = p1.y() - p0.y();
133  // M[1][1] = p2.y() - p0.y();
134  // R[0] = (xyz[0] - p0.x());
135  // R[1] = (xyz[1] - p0.y());
136  // sys2x2(M, R, uvw);
137  // return;
138  const double O[3] = {_v[0]->x(), _v[0]->y(), _v[0]->z()};
139 
140  const double d[3] = {xyz[0] - O[0], xyz[1] - O[1], xyz[2] - O[2]};
141  const double d1[3] = {_v[1]->x() - O[0], _v[1]->y() - O[1],
142  _v[1]->z() - O[2]};
143  const double d2[3] = {_v[2]->x() - O[0], _v[2]->y() - O[1],
144  _v[2]->z() - O[2]};
145 
146  const double Jxy = d1[0] * d2[1] - d1[1] * d2[0];
147  const double Jxz = d1[0] * d2[2] - d1[2] * d2[0];
148  const double Jyz = d1[1] * d2[2] - d1[2] * d2[1];
149 
150  if((std::abs(Jxy) > std::abs(Jxz)) && (std::abs(Jxy) > std::abs(Jyz))) {
151  uvw[0] = (d[0] * d2[1] - d[1] * d2[0]) / Jxy;
152  uvw[1] = (d[1] * d1[0] - d[0] * d1[1]) / Jxy;
153  }
154  else if(std::abs(Jxz) > std::abs(Jyz)) {
155  uvw[0] = (d[0] * d2[2] - d[2] * d2[0]) / Jxz;
156  uvw[1] = (d[2] * d1[0] - d[0] * d1[2]) / Jxz;
157  }
158  else {
159  uvw[0] = (d[1] * d2[2] - d[2] * d2[1]) / Jyz;
160  uvw[1] = (d[2] * d1[1] - d[1] * d1[2]) / Jyz;
161  }
162  uvw[2] = 0.0;
163 }
164 
165 int MTriangle::numCommonNodesInDualGraph(const MElement *const other) const
166 {
167  switch(other->getType()) {
168  case TYPE_PNT: return 1;
169  case TYPE_LIN: return 2;
170  case TYPE_TRI: return 2;
171  case TYPE_QUA: return 2;
172  default: return 3;
173  }
174 }
175 
177 {
178  return curved ? 3 * CTX::instance()->mesh.numSubEdges : 3;
179 }
180 
182 {
183  return curved ? 3 * CTX::instance()->mesh.numSubEdges : 3;
184 }
185 
186 static void _myGetEdgeRep(MTriangle *t, int num, double *x, double *y,
187  double *z, SVector3 *n, int numSubEdges)
188 {
189  n[0] = n[1] = t->getFace(0).normal();
190 
191  if(num < numSubEdges) {
192  SPoint3 pnt1, pnt2;
193  t->pnt((double)num / numSubEdges, 0., 0., pnt1);
194  t->pnt((double)(num + 1) / numSubEdges, 0., 0, pnt2);
195  x[0] = pnt1.x();
196  x[1] = pnt2.x();
197  y[0] = pnt1.y();
198  y[1] = pnt2.y();
199  z[0] = pnt1.z();
200  z[1] = pnt2.z();
201  return;
202  }
203  if(num < 2 * numSubEdges) {
204  SPoint3 pnt1, pnt2;
205  num -= numSubEdges;
206  t->pnt(1. - (double)num / numSubEdges, (double)num / numSubEdges, 0, pnt1);
207  t->pnt(1. - (double)(num + 1) / numSubEdges,
208  (double)(num + 1) / numSubEdges, 0, pnt2);
209  x[0] = pnt1.x();
210  x[1] = pnt2.x();
211  y[0] = pnt1.y();
212  y[1] = pnt2.y();
213  z[0] = pnt1.z();
214  z[1] = pnt2.z();
215  return;
216  }
217  {
218  SPoint3 pnt1, pnt2;
219  num -= 2 * numSubEdges;
220  t->pnt(0, (double)num / numSubEdges, 0, pnt1);
221  t->pnt(0, (double)(num + 1) / numSubEdges, 0, pnt2);
222  x[0] = pnt1.x();
223  x[1] = pnt2.x();
224  y[0] = pnt1.y();
225  y[1] = pnt2.y();
226  z[0] = pnt1.z();
227  z[1] = pnt2.z();
228  }
229 }
230 
231 void MTriangleN::getEdgeRep(bool curved, int num, double *x, double *y,
232  double *z, SVector3 *n)
233 {
234  if(curved)
235  _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
236  else
237  MTriangle::getEdgeRep(false, num, x, y, z, n);
238 }
239 
240 void MTriangle6::getEdgeRep(bool curved, int num, double *x, double *y,
241  double *z, SVector3 *n)
242 {
243  if(curved)
244  _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
245  else
246  MTriangle::getEdgeRep(false, num, x, y, z, n);
247 }
248 
249 bool MTriangle::getFaceInfo(const MFace &face, int &ithFace, int &sign,
250  int &rot) const
251 {
252  ithFace = 0;
253  if(_getFaceInfo(MFace(_v[0], _v[1], _v[2]), face, sign, rot)) return true;
254  Msg::Error("Could not get face information for triangle %d", getNum());
255  return false;
256 }
257 
259 {
260  return curved ? std::pow(CTX::instance()->mesh.numSubEdges, 2) : 1;
261 }
263 {
264  return curved ? std::pow(CTX::instance()->mesh.numSubEdges, 2) : 1;
265 }
266 
267 static void _myGetFaceRep(MTriangle *t, int num, double *x, double *y,
268  double *z, SVector3 *n, int numSubEdges)
269 {
270  // on the first layer, we have (numSubEdges-1) * 2 + 1 triangles
271  // on the second layer, we have (numSubEdges-2) * 2 + 1 triangles
272  // on the ith layer, we have (numSubEdges-1-i) * 2 + 1 triangles
273  int ix = 0, iy = 0;
274  int nbt = 0;
275  for(int i = 0; i < numSubEdges; i++) {
276  int nbl = (numSubEdges - i - 1) * 2 + 1;
277  nbt += nbl;
278  if(nbt > num) {
279  iy = i;
280  ix = nbl - (nbt - num);
281  break;
282  }
283  }
284 
285  const double d = 1. / numSubEdges;
286 
287  SPoint3 pnt1, pnt2, pnt3;
288  double J1[3][3], J2[3][3], J3[3][3];
289  if(ix % 2 == 0) {
290  t->pnt(ix / 2 * d, iy * d, 0, pnt1);
291  t->pnt((ix / 2 + 1) * d, iy * d, 0, pnt2);
292  t->pnt(ix / 2 * d, (iy + 1) * d, 0, pnt3);
293  t->getJacobian(ix / 2 * d, iy * d, 0, J1);
294  t->getJacobian((ix / 2 + 1) * d, iy * d, 0, J2);
295  t->getJacobian(ix / 2 * d, (iy + 1) * d, 0, J3);
296  }
297  else {
298  t->pnt((ix / 2 + 1) * d, iy * d, 0, pnt1);
299  t->pnt((ix / 2 + 1) * d, (iy + 1) * d, 0, pnt2);
300  t->pnt(ix / 2 * d, (iy + 1) * d, 0, pnt3);
301  t->getJacobian((ix / 2 + 1) * d, iy * d, 0, J1);
302  t->getJacobian((ix / 2 + 1) * d, (iy + 1) * d, 0, J2);
303  t->getJacobian(ix / 2 * d, (iy + 1) * d, 0, J3);
304  }
305  {
306  SVector3 d1(J1[0][0], J1[0][1], J1[0][2]);
307  SVector3 d2(J1[1][0], J1[1][1], J1[1][2]);
308  n[0] = crossprod(d1, d2);
309  n[0].normalize();
310  }
311  {
312  SVector3 d1(J2[0][0], J2[0][1], J2[0][2]);
313  SVector3 d2(J2[1][0], J2[1][1], J2[1][2]);
314  n[1] = crossprod(d1, d2);
315  n[1].normalize();
316  }
317  {
318  SVector3 d1(J3[0][0], J3[0][1], J3[0][2]);
319  SVector3 d2(J3[1][0], J3[1][1], J3[1][2]);
320  n[2] = crossprod(d1, d2);
321  n[2].normalize();
322  }
323 
324  x[0] = pnt1.x();
325  x[1] = pnt2.x();
326  x[2] = pnt3.x();
327  y[0] = pnt1.y();
328  y[1] = pnt2.y();
329  y[2] = pnt3.y();
330  z[0] = pnt1.z();
331  z[1] = pnt2.z();
332  z[2] = pnt3.z();
333 }
334 
335 void MTriangleN::getFaceRep(bool curved, int num, double *x, double *y,
336  double *z, SVector3 *n)
337 {
338  if(curved)
339  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
340  else
341  MTriangle::getFaceRep(false, num, x, y, z, n);
342 }
343 
344 void MTriangle6::getFaceRep(bool curved, int num, double *x, double *y,
345  double *z, SVector3 *n)
346 {
347  if(curved)
348  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
349  else
350  MTriangle::getFaceRep(false, num, x, y, z, n);
351 }
352 
353 void MTriangle::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
354 {
355  *npts = getNGQTPts(pOrder);
356  *pts = getGQTPts(pOrder);
357 }
358 
360 {
361  MVertex *tmp;
362  tmp = _v[1];
363  _v[1] = _v[2];
364  _v[2] = tmp;
365 
366  int npts = _order - 1, base = 0;
367  auto begin = _vs.begin() + base;
368 
369  while(npts > 0) {
370  std::reverse(begin, begin + 3 * npts);
371  base += 3 * npts;
372  if(npts > 2) {
373  tmp = _vs[base + 1];
374  _vs[base + 1] = _vs[base + 2];
375  _vs[base + 2] = tmp;
376  }
377  npts -= 3;
378  begin = _vs.begin() + base + 3;
379  }
380 }
381 
382 void MTriangle::reorient(int rot, bool swap)
383 {
384  if(rot == 0 && !swap) return;
385 
386  MVertex *tmp[3];
387  std::memcpy(tmp, _v, 3 * sizeof(MVertex *));
388  if(swap)
389  for(int i = 0; i < 3; i++) _v[i] = tmp[(3 - i + rot) % 3];
390  else
391  for(int i = 0; i < 3; i++) _v[i] = tmp[(3 + i - rot) % 3];
392 }
393 
394 void MTriangle6::reorient(int rot, bool swap)
395 {
396  if(rot == 0 && !swap) return;
397 
399  MVertex *tmp[3];
400  std::memcpy(tmp, _vs, 3 * sizeof(MVertex *));
401  if(swap)
402  for(int i = 0; i < 3; i++) _vs[i] = tmp[(5 + rot - i) % 3];
403  else
404  for(int i = 0; i < 3; i++) _vs[i] = tmp[(3 - rot + i) % 3];
405 }
406 
407 std::map<TupleReorientation, IndicesReoriented>
409 
410 namespace {
411  void _getIndicesReorientedTri(int order, int rot, bool swap,
412  IndicesReoriented &indices)
413  {
415 
416  indices.resize(ref.size1());
417  for(int i = 0; i < ref.size1(); ++i) {
418  double u = ref(i, 0);
419  double v = ref(i, 1);
420  double tmp;
421  if(swap) {
422  tmp = u;
423  u = v;
424  v = tmp;
425  }
426  switch(rot) {
427  case 1:
428  tmp = u;
429  u = order - u - v;
430  v = tmp;
431  break;
432  case 2:
433  tmp = v;
434  v = order - u - v;
435  u = tmp;
436  break;
437  }
438  for(int j = 0; j < ref.size1(); ++j) {
439  if(u == ref(j, 0) && v == ref(j, 1)) {
440  indices[i] = j;
441  break;
442  }
443  }
444  }
445  }
446 } // namespace
447 
448 void MTriangleN::reorient(int rot, bool swap)
449 {
450  if(rot == 0 && !swap) return;
451 
452  TupleReorientation mytuple(getTypeForMSH(), std::make_pair(rot, swap));
453  auto it = _tuple2indicesReoriented.find(mytuple);
454  if(it == _tuple2indicesReoriented.end()) {
455  IndicesReoriented indices;
456  _getIndicesReorientedTri(_order, rot, swap, indices);
457  _tuple2indicesReoriented[mytuple] = indices;
458  it = _tuple2indicesReoriented.find(mytuple);
459  }
460 
461  IndicesReoriented &indices = it->second;
462 
463  // copy vertices
464  std::vector<MVertex *> oldv(3 + _vs.size());
465  std::copy(_v, _v + 3, oldv.begin());
466  std::copy(_vs.begin(), _vs.end(), oldv.begin() + 3);
467 
468  // reorient
469  for(int i = 0; i < 3; ++i) { _v[i] = oldv[indices[i]]; }
470  for(std::size_t i = 0; i < _vs.size(); ++i) { _vs[i] = oldv[indices[3 + i]]; }
471 }
472 
473 MFaceN MTriangle::getHighOrderFace(int num, int sign, int rot)
474 {
475  const bool swap = sign == -1;
476  std::vector<MVertex *> vertices(getNumVertices());
477 
478  if(swap)
479  for(int i = 0; i < 3; i++) vertices[i] = _v[(3 - i + rot) % 3];
480  else
481  for(int i = 0; i < 3; i++) vertices[i] = _v[(3 + i - rot) % 3];
482 
483  return MFaceN(TYPE_TRI, 1, vertices);
484 }
485 
486 MFaceN MTriangle6::getHighOrderFace(int num, int sign, int rot)
487 {
488  const bool swap = sign == -1;
489  std::vector<MVertex *> vertices(getNumVertices());
490 
491  if(swap) {
492  for(int i = 0; i < 3; i++) {
493  vertices[i] = _v[(3 - i + rot) % 3];
494  vertices[3 + i] = _vs[(5 - i + rot) % 3];
495  }
496  }
497  else {
498  for(int i = 0; i < 3; i++) {
499  vertices[i] = _v[(3 + i - rot) % 3];
500  vertices[3 + i] = _vs[(3 + i - rot) % 3];
501  }
502  }
503  return MFaceN(TYPE_TRI, 2, vertices);
504 }
505 
506 MFaceN MTriangleN::getHighOrderFace(int num, int sign, int rot)
507 {
508  const bool swap = sign == -1;
509 
510  TupleReorientation mytuple(TYPE_TRI, std::make_pair(rot, swap));
511  auto it = _tuple2indicesReoriented.find(mytuple);
512  if(it == _tuple2indicesReoriented.end()) {
513  IndicesReoriented indices;
514  _getIndicesReorientedTri(_order, rot, swap, indices);
515  _tuple2indicesReoriented[mytuple] = indices;
516  it = _tuple2indicesReoriented.find(mytuple);
517  }
518 
519  IndicesReoriented &indices = it->second;
520 
521  std::vector<MVertex *> vertices(getNumVertices());
522  for(std::size_t i = 0; i < getNumVertices(); ++i) {
523  vertices[i] = getVertex(indices[i]);
524  }
525  return MFaceN(TYPE_TRI, _order, vertices);
526 }
MElement::getNum
virtual std::size_t getNum() const
Definition: MElement.h:68
crossprod
SVector3 crossprod(const SVector3 &a, const SVector3 &b)
Definition: SVector3.h:150
MTriangle.h
qualityMeasures.h
MTriangle6::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MTriangle.cpp:486
MTriangle::getFace
virtual MFace getFace(int num) const
Definition: MTriangle.h:91
MEdge
Definition: MEdge.h:14
MTriangle::getInnerRadius
virtual double getInnerRadius()
Definition: MTriangle.cpp:69
gmshGenerateMonomialsTriangle
fullMatrix< double > gmshGenerateMonomialsTriangle(int order, bool serendip)
Definition: pointsGenerators.cpp:182
MTriangle::xyz2uvw
virtual void xyz2uvw(double xyz[3], double uvw[3]) const
Definition: MTriangle.cpp:124
MTriangle::circumcenter
virtual SPoint3 circumcenter()
Definition: MTriangle.cpp:49
TYPE_LIN
#define TYPE_LIN
Definition: GmshDefines.h:65
MTriangle::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MTriangle.cpp:473
MTriangle::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.cpp:21
MTriangleN::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.cpp:231
MTriangle::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MTriangle.cpp:353
MVertex
Definition: MVertex.h:24
MTriangle::gammaShapeMeasure
virtual double gammaShapeMeasure()
Definition: MTriangle.cpp:115
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MVertex::z
double z() const
Definition: MVertex.h:62
MTriangle6::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MTriangle.h:213
SPoint3
Definition: SPoint3.h:14
MTriangle::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MTriangle.h:61
MFace::normal
SVector3 normal() const
Definition: MFace.cpp:204
TYPE_PNT
#define TYPE_PNT
Definition: GmshDefines.h:64
SVector3
Definition: SVector3.h:16
TYPE_TRI
#define TYPE_TRI
Definition: GmshDefines.h:66
MTriangleN::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MTriangle.cpp:176
_myGetFaceRep
static void _myGetFaceRep(MTriangle *t, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges)
Definition: MTriangle.cpp:267
MTriangle::edges_tri
static int edges_tri(const int edge, const int vert)
Definition: MTriangle.h:165
MTriangle::etaShapeMeasure
virtual double etaShapeMeasure()
Definition: MTriangle.cpp:106
MTriangle::getOuterRadius
virtual double getOuterRadius()
Definition: MTriangle.cpp:83
TupleReorientation
std::pair< int, std::pair< int, int > > TupleReorientation
Definition: MQuadrangle.h:431
MTriangleN::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MTriangle.h:342
CTX::instance
static CTX * instance()
Definition: Context.cpp:122
IndicesReoriented
std::vector< int > IndicesReoriented
Definition: MQuadrangle.h:430
SPoint3::x
double x(void) const
Definition: SPoint3.h:125
fullMatrix< double >
MFace
Definition: MFace.h:20
MTriangle6::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MTriangle.cpp:258
getNGQTPts
int getNGQTPts(int order, bool forceTensorRule=false)
Definition: GaussQuadratureTri.cpp:904
MEdge::getVertex
MVertex * getVertex(std::size_t i) const
Definition: MEdge.h:39
contextMeshOptions::numSubEdges
int numSubEdges
Definition: Context.h:85
MElement::getType
virtual int getType() const =0
HighOrder.h
swap
void swap(double &a, double &b)
Definition: meshTriangulation.cpp:27
MTriangleN::reorient
virtual void reorient(int rotation, bool swap)
Definition: MTriangle.cpp:448
qmTriangle::gamma
static double gamma(MTriangle *f)
Definition: qualityMeasures.cpp:146
MElement::getVolume
virtual double getVolume()
Definition: MElement.cpp:567
norm
void norm(const double *vec, double *norm)
Definition: gmshLevelset.cpp:202
MTriangle::getVolume
virtual double getVolume()
Definition: MTriangle.cpp:59
Numeric.h
MTriangle::getFaceInfo
virtual bool getFaceInfo(const MFace &face, int &ithFace, int &sign, int &rot) const
Definition: MTriangle.cpp:249
MTriangle::_v
MVertex * _v[3]
Definition: MTriangle.h:28
MElement::_getFaceInfo
static bool _getFaceInfo(const MFace &face, const MFace &other, int &sign, int &rot)
Definition: MElement.cpp:66
MTriangleN::_order
const char _order
Definition: MTriangle.h:321
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
CTX::mesh
contextMeshOptions mesh
Definition: Context.h:313
MElement
Definition: MElement.h:30
MTriangleN::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MTriangle.cpp:506
MTriangle
Definition: MTriangle.h:26
MTriangleN::getVertex
virtual MVertex * getVertex(int num)
Definition: MTriangle.h:343
MElement::pnt
virtual void pnt(double u, double v, double w, SPoint3 &p) const
Definition: MElement.cpp:1072
MTriangle::numCommonNodesInDualGraph
virtual int numCommonNodesInDualGraph(const MElement *const other) const
Definition: MTriangle.cpp:165
TYPE_QUA
#define TYPE_QUA
Definition: GmshDefines.h:67
MTriangleN::reverse
virtual void reverse()
Definition: MTriangle.cpp:359
Context.h
IntPt
Definition: GaussIntegration.h:12
fullMatrix::size1
int size1() const
Definition: fullMatrix.h:274
MTriangle::getEdge
virtual MEdge getEdge(int num) const
Definition: MTriangle.h:74
MTriangle6::reorient
virtual void reorient(int rotation, bool swap)
Definition: MTriangle.cpp:394
z
const double z
Definition: GaussQuadratureQuad.cpp:56
MTriangleN::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MTriangle.cpp:262
MFaceN
Definition: MFace.h:145
circumCenterXYZ
void circumCenterXYZ(double *p1, double *p2, double *p3, double *res, double *uv)
Definition: Numeric.cpp:342
O
#define O
Definition: DefaultOptions.h:22
picojson::copy
void copy(const std::string &s, Iter oi)
Definition: picojson.h:510
qmTriangle::angles
static double angles(MTriangle *e)
Definition: qualityMeasures.cpp:200
MTriangleN::getTypeForMSH
virtual int getTypeForMSH() const
Definition: MTriangle.h:391
MTriangleN::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.cpp:335
SPoint3::z
double z(void) const
Definition: SPoint3.h:129
qmTriangle::eta
static double eta(MTriangle *el)
Definition: qualityMeasures.cpp:187
MElement::getJacobian
virtual double getJacobian(const fullMatrix< double > &gsf, double jac[3][3]) const
Definition: MElement.cpp:868
getGQTPts
IntPt * getGQTPts(int order, bool forceTensorRule=false)
Definition: GaussQuadratureTri.cpp:889
MTriangleN::_tuple2indicesReoriented
static std::map< TupleReorientation, IndicesReoriented > _tuple2indicesReoriented
Definition: MTriangle.h:317
MTriangleN::_vs
std::vector< MVertex * > _vs
Definition: MTriangle.h:320
MVertex::y
double y() const
Definition: MVertex.h:61
MTriangle6::_vs
MVertex * _vs[3]
Definition: MTriangle.h:193
pointsGenerators.h
_myGetEdgeRep
static void _myGetEdgeRep(MTriangle *t, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges)
Definition: MTriangle.cpp:186
MTriangle::reorient
virtual void reorient(int rotation, bool swap)
Definition: MTriangle.cpp:382
MVertex::distance
double distance(MVertex *const v)
Definition: MVertex.h:105
MTriangle6::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MTriangle.cpp:181
MTriangle6::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.cpp:344
MTriangle::angleShapeMeasure
virtual double angleShapeMeasure()
Definition: MTriangle.cpp:97
MVertex::x
double x() const
Definition: MVertex.h:60
MTriangle6::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.cpp:240
SVector3::normalize
double normalize()
Definition: SVector3.h:38
BasisFactory.h
MTriangle::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MTriangle.h:96