gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MQuadrangle.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 "MQuadrangle.h"
8 #include "GaussLegendre1D.h"
9 #include "Context.h"
10 #include "Numeric.h"
11 #include "BasisFactory.h"
12 #include "pointsGenerators.h"
13 
14 #if defined(HAVE_MESH)
15 #include "qualityMeasures.h"
16 #endif
17 
18 #include <cstring>
19 
20 void MQuadrangle::getEdgeRep(bool curved, int num, double *x, double *y,
21  double *z, SVector3 *n)
22 {
23  // don't use MElement::_getEdgeRep: it's slow due to the creation of MFace
24  MVertex *v0 = _v[edges_quad(num, 0)];
25  MVertex *v1 = _v[edges_quad(num, 1)];
26  x[0] = v0->x();
27  y[0] = v0->y();
28  z[0] = v0->z();
29  x[1] = v1->x();
30  y[1] = v1->y();
31  z[1] = v1->z();
32  if(CTX::instance()->mesh.lightLines) {
33  static const int vv[4] = {2, 3, 0, 1};
34  MVertex *v2 = _v[vv[num]];
35  SVector3 t1(x[1] - x[0], y[1] - y[0], z[1] - z[0]);
36  SVector3 t2(v2->x() - x[0], v2->y() - y[0], v2->z() - z[0]);
37  SVector3 normal = crossprod(t1, t2);
38  normal.normalize();
39  n[0] = n[1] = normal;
40  }
41  else {
42  n[0] = n[1] = SVector3(0., 0., 1.);
43  }
44 }
45 
47 {
48  return curved ? 4 * CTX::instance()->mesh.numSubEdges : 4;
49 }
50 
52 {
53  return curved ? 4 * CTX::instance()->mesh.numSubEdges : 4;
54 }
55 
57 {
58  return curved ? 4 * CTX::instance()->mesh.numSubEdges : 4;
59 }
60 
62 {
63  if(getNumVertices() > 4) return MElement::getVolume();
64  double a = _v[0]->distance(_v[1]);
65  double b = _v[1]->distance(_v[2]);
66  double c = _v[2]->distance(_v[3]);
67  double d = _v[3]->distance(_v[0]);
68  double m = _v[0]->distance(_v[2]);
69  double n = _v[1]->distance(_v[3]);
70  double mn = 2. * m * n;
71  double abcd = a * a - b * b + c * c - d * d;
72  return sqrt(mn * mn - abcd * abcd) / 4.;
73 }
74 
75 int MQuadrangle::numCommonNodesInDualGraph(const MElement *const other) const
76 {
77  switch(other->getType()) {
78  case TYPE_PNT: return 1;
79  case TYPE_LIN: return 2;
80  case TYPE_TRI: return 2;
81  case TYPE_QUA: return 2;
82  default: return 4;
83  }
84 }
85 
86 static void _myGetEdgeRep(MQuadrangle *q, int num, double *x, double *y,
87  double *z, SVector3 *n, int numSubEdges)
88 {
89  n[0] = n[1] = q->getFace(0).normal();
90  int ie = num / numSubEdges;
91  int isub = num % numSubEdges;
92  double xi1 = -1. + (2. * isub) / numSubEdges;
93  double xi2 = -1. + (2. * (isub + 1)) / numSubEdges;
94  SPoint3 pnt1, pnt2;
95  switch(ie) {
96  case 0:
97  q->pnt(xi1, -1., 0., pnt1);
98  q->pnt(xi2, -1., 0., pnt2);
99  break;
100  case 1:
101  q->pnt(1., xi1, 0., pnt1);
102  q->pnt(1., xi2, 0., pnt2);
103  break;
104  case 2:
105  q->pnt(xi1, 1., 0., pnt1);
106  q->pnt(xi2, 1., 0., pnt2);
107  break;
108  case 3:
109  q->pnt(-1., xi1, 0., pnt1);
110  q->pnt(-1., xi2, 0., pnt2);
111  break;
112  }
113  x[0] = pnt1.x();
114  x[1] = pnt2.x();
115  y[0] = pnt1.y();
116  y[1] = pnt2.y();
117  z[0] = pnt1.z();
118  z[1] = pnt2.z();
119 }
120 
121 void MQuadrangleN::getEdgeRep(bool curved, int num, double *x, double *y,
122  double *z, SVector3 *n)
123 {
124  if(curved)
125  _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
126  else
127  MQuadrangle::getEdgeRep(false, num, x, y, z, n);
128 }
129 
130 void MQuadrangle8::getEdgeRep(bool curved, int num, double *x, double *y,
131  double *z, SVector3 *n)
132 {
133  if(curved)
134  _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
135  else
136  MQuadrangle::getEdgeRep(false, num, x, y, z, n);
137 }
138 
139 void MQuadrangle9::getEdgeRep(bool curved, int num, double *x, double *y,
140  double *z, SVector3 *n)
141 {
142  if(curved)
143  _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
144  else
145  MQuadrangle::getEdgeRep(false, num, x, y, z, n);
146 }
147 
148 bool MQuadrangle::getFaceInfo(const MFace &face, int &ithFace, int &sign,
149  int &rot) const
150 {
151  ithFace = 0;
152  if(_getFaceInfo(MFace(_v[0], _v[1], _v[2], _v[3]), face, sign, rot))
153  return true;
154  Msg::Error("Could not get face information for quadrangle %d", getNum());
155  return false;
156 }
157 
159 {
160 #if defined(HAVE_VISUDEV)
161  if(CTX::instance()->heavyVisu) {
162  if(CTX::instance()->mesh.numSubEdges == 1) return 4;
163  return 2 * std::pow(CTX::instance()->mesh.numSubEdges, 2);
164  }
165 #endif
166  return 2;
167 }
168 
170 {
171  return curved ? 2 * std::pow(CTX::instance()->mesh.numSubEdges, 2) :
173 }
174 
176 {
177  return curved ? 2 * std::pow(CTX::instance()->mesh.numSubEdges, 2) :
179 }
180 
182 {
183  return curved ? 2 * std::pow(CTX::instance()->mesh.numSubEdges, 2) :
185 }
186 
187 static void _myGetFaceRep(MQuadrangle *t, int num, double *x, double *y,
188  double *z, SVector3 *n, int numSubEdges)
189 {
190  int io = num % 2;
191  int ix = (num / 2) / numSubEdges;
192  int iy = (num / 2) % numSubEdges;
193 
194  const double d = 2. / numSubEdges;
195  const double ox = -1. + d * ix;
196  const double oy = -1. + d * iy;
197 
198  SPoint3 pnt1, pnt2, pnt3;
199  double J1[3][3], J2[3][3], J3[3][3];
200  if(io == 0) {
201  t->pnt(ox, oy, 0, pnt1);
202  t->pnt(ox + d, oy, 0, pnt2);
203  t->pnt(ox + d, oy + d, 0, pnt3);
204  t->getJacobian(ox, oy, 0, J1);
205  t->getJacobian(ox + d, oy, 0, J2);
206  t->getJacobian(ox + d, oy + d, 0, J3);
207  }
208  else {
209  t->pnt(ox, oy, 0, pnt1);
210  t->pnt(ox + d, oy + d, 0, pnt2);
211  t->pnt(ox, oy + d, 0, pnt3);
212  t->getJacobian(ox, oy, 0, J1);
213  t->getJacobian(ox + d, oy + d, 0, J2);
214  t->getJacobian(ox, oy + d, 0, J3);
215  }
216  {
217  SVector3 d1(J1[0][0], J1[0][1], J1[0][2]);
218  SVector3 d2(J1[1][0], J1[1][1], J1[1][2]);
219  n[0] = crossprod(d1, d2);
220  n[0].normalize();
221  }
222  {
223  SVector3 d1(J2[0][0], J2[0][1], J2[0][2]);
224  SVector3 d2(J2[1][0], J2[1][1], J2[1][2]);
225  n[1] = crossprod(d1, d2);
226  n[1].normalize();
227  }
228  {
229  SVector3 d1(J3[0][0], J3[0][1], J3[0][2]);
230  SVector3 d2(J3[1][0], J3[1][1], J3[1][2]);
231  n[2] = crossprod(d1, d2);
232  n[2].normalize();
233  }
234 
235  x[0] = pnt1.x();
236  x[1] = pnt2.x();
237  x[2] = pnt3.x();
238  y[0] = pnt1.y();
239  y[1] = pnt2.y();
240  y[2] = pnt3.y();
241  z[0] = pnt1.z();
242  z[1] = pnt2.z();
243  z[2] = pnt3.z();
244 }
245 
246 void MQuadrangle::getFaceRep(bool curved, int num, double *x, double *y,
247  double *z, SVector3 *n)
248 {
249 #if defined(HAVE_VISUDEV)
250  static const int fquad[4][4] = {
251  {0, 1, 2, 3}, {1, 2, 3, 0}, {2, 3, 0, 1}, {3, 0, 1, 2}};
252  if(CTX::instance()->heavyVisu) {
253  if(CTX::instance()->mesh.numSubEdges > 1) {
254  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
255  return;
256  }
257  _getFaceRepQuad(getVertex(fquad[num][0]), getVertex(fquad[num][1]),
258  getVertex(fquad[num][2]), getVertex(fquad[num][3]), x, y, z,
259  n);
260  return;
261  }
262 #endif
263  static const int f[2][3] = {{0, 1, 2}, {0, 2, 3}};
264  _getFaceRep(_v[f[num][0]], _v[f[num][1]], _v[f[num][2]], x, y, z, n);
265 }
266 
267 void MQuadrangleN::getFaceRep(bool curved, int num, double *x, double *y,
268  double *z, SVector3 *n)
269 {
270  if(curved)
271  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
272  else
273  MQuadrangle::getFaceRep(false, num, x, y, z, n);
274 }
275 
276 void MQuadrangle8::getFaceRep(bool curved, int num, double *x, double *y,
277  double *z, SVector3 *n)
278 {
279  if(curved)
280  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
281  else
282  MQuadrangle::getFaceRep(false, num, x, y, z, n);
283 }
284 
285 void MQuadrangle9::getFaceRep(bool curved, int num, double *x, double *y,
286  double *z, SVector3 *n)
287 {
288  if(curved)
289  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
290  else
291  MQuadrangle::getFaceRep(false, num, x, y, z, n);
292 }
293 
294 void MQuadrangle::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
295 {
296  *npts = getNGQQPts(pOrder);
297  *pts = getGQQPts(pOrder);
298 }
299 
301 {
302 #if defined(HAVE_MESH)
303  return qmQuadrangle::eta(this);
304 #else
305  return 0.;
306 #endif
307 }
308 
310 {
311 #if defined(HAVE_MESH)
312  return qmQuadrangle::gamma(this);
313 #else
314  return 0.;
315 #endif
316 }
317 
319 {
320 #if defined(HAVE_MESH)
321  return qmQuadrangle::angles(this);
322 #else
323  return 1.;
324 #endif
325 }
326 
328 {
329  // FIXME: TODO! (BRUNO SENY)
330  return 1.0;
331 }
332 
334 {
335 #if defined(HAVE_LAPACK) || defined(HAVE_EIGEN)
336  // get the coordinates (x, y, z) of the 4 points defining the Quad
337  double x[4] = {_v[0]->x(), _v[1]->x(), _v[2]->x(), _v[3]->x()};
338  double y[4] = {_v[0]->y(), _v[1]->y(), _v[2]->y(), _v[3]->y()};
339  double z[4] = {_v[0]->z(), _v[1]->z(), _v[2]->z(), _v[3]->z()};
340 
341  // get the coefficient (a,b,c,d) of the mean plane - least square!
342  // the plane has for equation " a*x+b*y+c*z+d=0 "
343 
344  // compute the centroid of the 4 points
345  double xm = (x[0] + x[1] + x[2] + x[3]) / 4;
346  double ym = (y[0] + y[1] + y[2] + y[3]) / 4;
347  double zm = (z[0] + z[1] + z[2] + z[3]) / 4;
348 
349  // using svd decomposition
350  fullMatrix<double> U(4, 3), V(3, 3);
351  fullVector<double> sigma(3);
352  for(int i = 0; i < 4; i++) {
353  U(i, 0) = x[i] - xm;
354  U(i, 1) = y[i] - ym;
355  U(i, 2) = z[i] - zm;
356  }
357 
358  U.svd(V, sigma);
359  double svd[3];
360  svd[0] = sigma(0);
361  svd[1] = sigma(1);
362  svd[2] = sigma(2);
363  int min;
364  if(fabs(svd[0]) < fabs(svd[1]) && fabs(svd[0]) < fabs(svd[2]))
365  min = 0;
366  else if(fabs(svd[1]) < fabs(svd[0]) && fabs(svd[1]) < fabs(svd[2]))
367  min = 1;
368  else
369  min = 2;
370  double a = V(0, min);
371  double b = V(1, min);
372  double c = V(2, min);
373 
374  double d = -(xm * a + ym * b + zm * c);
375 
376  double norm = sqrt(a * a + b * b + c * c);
377 
378  // projection of the 4 original points on the mean_plane
379 
380  double xp[4], yp[4], zp[4];
381 
382  for(int i = 0; i < 4; i++) {
383  xp[i] =
384  ((b * b + c * c) * x[i] - a * b * y[i] - a * c * z[i] - d * a) / norm;
385  yp[i] =
386  (-a * b * x[i] + (a * a + c * c) * y[i] - b * c * z[i] - d * b) / norm;
387  zp[i] =
388  (-a * c * x[i] - b * c * y[i] + (a * a + b * b) * z[i] - d * c) / norm;
389  }
390 
391  // go from XYZ-plane to XY-plane
392 
393  // 4 points, 4 edges => 4 inner radii of circles tangent to (at
394  // least) 3 of the four edges!
395  double xn[4], yn[4], r[4];
396 
397  planarQuad_xyz2xy(xp, yp, zp, xn, yn);
398 
399  // compute for each of the 4 possibilities the incircle radius,
400  // keeping the minimum
401  double R = 1.e22;
402  for(int j = 0; j < 4; j++) {
403  r[j] = computeInnerRadiusForQuad(xn, yn, j);
404  if(r[j] < R) { R = r[j]; }
405  }
406  return R;
407 #else
408  // Default implementation. Not sure that the following give exactly
409  // the same value as the HAVE_LAPACK case !
410  // but same value for a square
411 
412  // Mid-point of each edge of the quadrangle
413  SPoint3 A(_v[0]->x() + _v[1]->x(), _v[0]->y() + _v[1]->y(),
414  _v[0]->z() + _v[1]->z());
415  SPoint3 B(_v[1]->x() + _v[2]->x(), _v[1]->y() + _v[2]->y(),
416  _v[1]->z() + _v[2]->z());
417  SPoint3 C(_v[2]->x() + _v[3]->x(), _v[2]->y() + _v[3]->y(),
418  _v[2]->z() + _v[3]->z());
419  SPoint3 D(_v[3]->x() + _v[0]->x(), _v[3]->y() + _v[0]->y(),
420  _v[3]->z() + _v[0]->z());
421  A *= 0.5;
422  B *= 0.5;
423  C *= 0.5;
424  D *= 0.5;
425 
426  // compute the length of the side
427  double a = A.distance(B);
428  double b = B.distance(C);
429  double c = C.distance(D);
430  double d = D.distance(A);
431 
432  // perimeter
433  double s = a + b + c + d;
434  double halfs = 0.5 * s;
435 
436  return 0.25 * sqrt((a * c + b * d) * (a * d + b * c) * (a * b + c * d) /
437  ((halfs - a) * (halfs - b) * (halfs - c) * (halfs - d)));
438 #endif
439 }
440 
442 {
443  MVertex *tmp;
444  tmp = _v[1];
445  _v[1] = _v[3];
446  _v[3] = tmp;
447 
448  int npts = _order - 1, base = 0;
449  auto begin = _vs.begin() + base;
450 
451  while(npts > 0) {
452  std::reverse(begin, begin + 4 * npts);
453  base += 4 * npts;
454  if(npts > 1) {
455  tmp = _vs[base + 1];
456  _vs[base + 1] = _vs[base + 3];
457  _vs[base + 3] = tmp;
458  }
459  npts -= 2;
460  begin = _vs.begin() + base + 4;
461  }
462 }
463 
464 void MQuadrangle::reorient(int rot, bool swap)
465 {
466  MVertex *tmp[4];
467  if(swap)
468  for(int i = 0; i < 4; i++) tmp[i] = _v[(4 - i + rot) % 4];
469  else
470  for(int i = 0; i < 4; i++) tmp[i] = _v[(4 + i - rot) % 4];
471  std::memcpy(_v, tmp, 4 * sizeof(MVertex *));
472 }
473 
474 void MQuadrangle8::reorient(int rot, bool swap)
475 {
476  if(rot == 0 && !swap) return;
477 
479  MVertex *tmp[4];
480  if(swap)
481  for(int i = 0; i < 4; i++) tmp[i] = _vs[(7 - i + rot) % 4];
482  else
483  for(int i = 0; i < 4; i++) tmp[i] = _vs[(4 + i - rot) % 4];
484  std::memcpy(_vs, tmp, 4 * sizeof(MVertex *));
485 }
486 
487 void MQuadrangle9::reorient(int rot, bool swap)
488 {
489  if(rot == 0 && !swap) return;
490 
492  MVertex *tmp[4];
493  if(swap)
494  for(int i = 0; i < 4; i++) tmp[i] = _vs[(7 - i + rot) % 4]; // edge swapped
495  else
496  for(int i = 0; i < 4; i++) tmp[i] = _vs[(4 + i - rot) % 4];
497  std::memcpy(_vs, tmp, 4 * sizeof(MVertex *));
498 }
499 
500 std::map<TupleReorientation, IndicesReoriented>
502 
503 namespace {
504  void _getIndicesReorientedQuad(int order, int rot, bool swap,
505  IndicesReoriented &indices)
506  {
508  ref.add(-order / 2.);
509 
510  indices.resize(ref.size1());
511  for(int i = 0; i < ref.size1(); ++i) {
512  double u = ref(i, 0);
513  double v = ref(i, 1);
514  double tmp = u;
515  if(swap) {
516  tmp = u;
517  u = v;
518  v = tmp;
519  }
520  switch(rot) {
521  case 1:
522  u = v;
523  v = -tmp;
524  break;
525  case 2:
526  u = -u;
527  v = -v;
528  break;
529  case 3:
530  u = -v;
531  v = tmp;
532  break;
533  }
534  for(int j = 0; j < ref.size1(); ++j) {
535  if(u == ref(j, 0) && v == ref(j, 1)) {
536  indices[i] = j;
537  break;
538  }
539  }
540  }
541  }
542 } // namespace
543 
544 void MQuadrangleN::reorient(int rot, bool swap)
545 {
546  if(rot == 0 && !swap) return;
547 
548  TupleReorientation mytuple(getTypeForMSH(), std::make_pair(rot, swap));
549  auto it = _tuple2indicesReoriented.find(mytuple);
550  if(it == _tuple2indicesReoriented.end()) {
551  IndicesReoriented indices;
552  _getIndicesReorientedQuad(_order, rot, swap, indices);
553  _tuple2indicesReoriented[mytuple] = indices;
554  it = _tuple2indicesReoriented.find(mytuple);
555  }
556 
557  IndicesReoriented &indices = it->second;
558 
559  // copy vertices
560  std::vector<MVertex *> oldv(4 + _vs.size());
561  std::copy(_v, _v + 4, oldv.begin());
562  std::copy(_vs.begin(), _vs.end(), oldv.begin() + 4);
563 
564  // reorient
565  for(int i = 0; i < 4; ++i) { _v[i] = oldv[indices[i]]; }
566  for(std::size_t i = 0; i < _vs.size(); ++i) { _vs[i] = oldv[indices[4 + i]]; }
567 }
568 
569 MFaceN MQuadrangle::getHighOrderFace(int num, int sign, int rot)
570 {
571  const bool swap = sign == -1;
572  std::vector<MVertex *> vertices(getNumVertices());
573 
574  if(swap)
575  for(int i = 0; i < 4; i++) vertices[i] = _v[(4 - i + rot) % 4];
576  else
577  for(int i = 0; i < 4; i++) vertices[i] = _v[(4 + i - rot) % 4];
578 
579  return MFaceN(TYPE_QUA, 1, vertices);
580 }
581 
582 MFaceN MQuadrangle8::getHighOrderFace(int num, int sign, int rot)
583 {
584  const bool swap = sign == -1;
585  std::vector<MVertex *> vertices(getNumVertices());
586 
587  if(swap) {
588  for(int i = 0; i < 4; i++) {
589  vertices[i] = _v[(4 - i + rot) % 4];
590  vertices[4 + i] = _vs[(7 - i + rot) % 4];
591  }
592  }
593  else {
594  for(int i = 0; i < 4; i++) {
595  vertices[i] = _v[(4 + i - rot) % 4];
596  vertices[4 + i] = _vs[(4 + i - rot) % 4];
597  }
598  }
599  return MFaceN(TYPE_QUA, 2, vertices);
600 }
601 
602 MFaceN MQuadrangle9::getHighOrderFace(int num, int sign, int rot)
603 {
604  const bool swap = sign == -1;
605  std::vector<MVertex *> vertices(getNumVertices());
606 
607  if(swap) {
608  for(int i = 0; i < 4; i++) {
609  vertices[i] = _v[(4 - i + rot) % 4];
610  vertices[4 + i] = _vs[(7 - i + rot) % 4];
611  }
612  }
613  else {
614  for(int i = 0; i < 4; i++) {
615  vertices[i] = _v[(4 + i - rot) % 4];
616  vertices[4 + i] = _vs[(4 + i - rot) % 4];
617  }
618  }
619  vertices[8] = _vs[4];
620  return MFaceN(TYPE_QUA, 2, vertices);
621 }
622 
623 MFaceN MQuadrangleN::getHighOrderFace(int num, int sign, int rot)
624 {
625  const bool swap = sign == -1;
626  TupleReorientation mytuple(TYPE_QUA, std::make_pair(rot, swap));
627  auto it = _tuple2indicesReoriented.find(mytuple);
628  if(it == _tuple2indicesReoriented.end()) {
629  IndicesReoriented indices;
630  _getIndicesReorientedQuad(_order, rot, swap, indices);
631  _tuple2indicesReoriented[mytuple] = indices;
632  it = _tuple2indicesReoriented.find(mytuple);
633  }
634 
635  IndicesReoriented &indices = it->second;
636 
637  std::vector<MVertex *> vertices(getNumVertices());
638  for(std::size_t i = 0; i < getNumVertices(); ++i) {
639  vertices[i] = getVertex(indices[i]);
640  }
641  return MFaceN(TYPE_QUA, _order, vertices);
642 }
MQuadrangle8::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:276
MElement::getNum
virtual std::size_t getNum() const
Definition: MElement.h:68
MQuadrangle::getVolume
virtual double getVolume()
Definition: MQuadrangle.cpp:61
MQuadrangleN::reverse
virtual void reverse()
Definition: MQuadrangle.cpp:441
crossprod
SVector3 crossprod(const SVector3 &a, const SVector3 &b)
Definition: SVector3.h:150
D
#define D
Definition: DefaultOptions.h:24
fullMatrix::add
void add(const double &a)
Definition: fullMatrix.h:463
GaussLegendre1D.h
qualityMeasures.h
planarQuad_xyz2xy
void planarQuad_xyz2xy(double *x, double *y, double *z, double *xn, double *yn)
Definition: Numeric.cpp:376
MQuadrangleN::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:121
MQuadrangleN::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MQuadrangle.cpp:623
qmQuadrangle::eta
static double eta(MQuadrangle *el)
Definition: qualityMeasures.cpp:392
_myGetFaceRep
static void _myGetFaceRep(MQuadrangle *t, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges)
Definition: MQuadrangle.cpp:187
qmQuadrangle::gamma
static double gamma(MQuadrangle *el)
Definition: qualityMeasures.h:51
MQuadrangleN::_vs
std::vector< MVertex * > _vs
Definition: MQuadrangle.h:454
fullVector< double >
TYPE_LIN
#define TYPE_LIN
Definition: GmshDefines.h:65
MQuadrangle::getVertex
virtual MVertex * getVertex(int num)
Definition: MQuadrangle.h:64
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
MVertex
Definition: MVertex.h:24
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MVertex::z
double z() const
Definition: MVertex.h:62
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
MFace::normal
SVector3 normal() const
Definition: MFace.cpp:204
TYPE_PNT
#define TYPE_PNT
Definition: GmshDefines.h:64
_myGetEdgeRep
static void _myGetEdgeRep(MQuadrangle *q, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges)
Definition: MQuadrangle.cpp:86
MQuadrangle8::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MQuadrangle.cpp:582
SVector3
Definition: SVector3.h:16
MQuadrangle::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MQuadrangle.cpp:294
TYPE_TRI
#define TYPE_TRI
Definition: GmshDefines.h:66
MQuadrangle9::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MQuadrangle.cpp:181
MQuadrangle::edges_quad
static int edges_quad(const int edge, const int vert)
Definition: MQuadrangle.h:174
MQuadrangle::getOuterRadius
virtual double getOuterRadius()
Definition: MQuadrangle.cpp:327
MQuadrangleN::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MQuadrangle.cpp:169
MQuadrangle::angleShapeMeasure
virtual double angleShapeMeasure()
Definition: MQuadrangle.cpp:318
TupleReorientation
std::pair< int, std::pair< int, int > > TupleReorientation
Definition: MQuadrangle.h:431
MQuadrangleN::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:267
MQuadrangle::gammaShapeMeasure
virtual double gammaShapeMeasure()
Definition: MQuadrangle.cpp:309
MQuadrangle9::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MQuadrangle.cpp:602
MQuadrangle9::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MQuadrangle.cpp:56
MQuadrangle::_v
MVertex * _v[4]
Definition: MQuadrangle.h:28
MQuadrangle9::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:285
MQuadrangleN::_tuple2indicesReoriented
static std::map< TupleReorientation, IndicesReoriented > _tuple2indicesReoriented
Definition: MQuadrangle.h:451
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
MQuadrangle::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MQuadrangle.h:63
MQuadrangle9::reorient
virtual void reorient(int rotation, bool swap)
Definition: MQuadrangle.cpp:487
contextMeshOptions::numSubEdges
int numSubEdges
Definition: Context.h:85
MQuadrangleN::reorient
virtual void reorient(int rotation, bool swap)
Definition: MQuadrangle.cpp:544
MElement::getType
virtual int getType() const =0
MQuadrangle9::_vs
MVertex * _vs[5]
Definition: MQuadrangle.h:327
MQuadrangle::getInnerRadius
virtual double getInnerRadius()
Definition: MQuadrangle.cpp:333
MQuadrangle::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MQuadrangle.cpp:158
MQuadrangle9::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:139
swap
void swap(double &a, double &b)
Definition: meshTriangulation.cpp:27
MQuadrangleN::_order
const char _order
Definition: MQuadrangle.h:455
MElement::getVolume
virtual double getVolume()
Definition: MElement.cpp:567
MQuadrangle::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MQuadrangle.cpp:569
norm
void norm(const double *vec, double *norm)
Definition: gmshLevelset.cpp:202
getNGQQPts
int getNGQQPts(int order, bool forceTensorRule=false)
Definition: GaussQuadratureQuad.cpp:124
Numeric.h
computeInnerRadiusForQuad
double computeInnerRadiusForQuad(double *x, double *y, int i)
Definition: Numeric.cpp:407
MQuadrangle8::_vs
MVertex * _vs[4]
Definition: MQuadrangle.h:205
MQuadrangle::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:246
MElement::_getFaceInfo
static bool _getFaceInfo(const MFace &face, const MFace &other, int &sign, int &rot)
Definition: MElement.cpp:66
MQuadrangle9::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MQuadrangle.h:350
MQuadrangle::getFaceInfo
virtual bool getFaceInfo(const MFace &face, int &ithFace, int &sign, int &rot) const
Definition: MQuadrangle.cpp:148
MQuadrangle::reorient
virtual void reorient(int rotation, bool swap)
Definition: MQuadrangle.cpp:464
MQuadrangle::getFace
virtual MFace getFace(int num) const
Definition: MQuadrangle.h:90
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
getGQQPts
IntPt * getGQQPts(int order, bool forceTensorRule=false)
Definition: GaussQuadratureQuad.cpp:99
CTX::mesh
contextMeshOptions mesh
Definition: Context.h:313
MElement
Definition: MElement.h:30
MQuadrangle::numCommonNodesInDualGraph
virtual int numCommonNodesInDualGraph(const MElement *const other) const
Definition: MQuadrangle.cpp:75
MQuadrangleN::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MQuadrangle.cpp:46
MQuadrangle8::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MQuadrangle.h:226
MQuadrangle8::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:130
MQuadrangle8::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MQuadrangle.cpp:51
MElement::pnt
virtual void pnt(double u, double v, double w, SPoint3 &p) const
Definition: MElement.cpp:1072
SPoint3::distance
double distance(const SPoint3 &p) const
Definition: SPoint3.h:176
MElement::_getFaceRep
void _getFaceRep(MVertex *v0, MVertex *v1, MVertex *v2, double *x, double *y, double *z, SVector3 *n)
Definition: MElement.cpp:146
TYPE_QUA
#define TYPE_QUA
Definition: GmshDefines.h:67
qmQuadrangle::angles
static double angles(MQuadrangle *e)
Definition: qualityMeasures.cpp:435
Context.h
IntPt
Definition: GaussIntegration.h:12
fullMatrix::size1
int size1() const
Definition: fullMatrix.h:274
MQuadrangle8::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MQuadrangle.cpp:175
z
const double z
Definition: GaussQuadratureQuad.cpp:56
MQuadrangle.h
MFaceN
Definition: MFace.h:145
picojson::copy
void copy(const std::string &s, Iter oi)
Definition: picojson.h:510
MQuadrangleN::getTypeForMSH
virtual int getTypeForMSH() const
Definition: MQuadrangle.h:525
MQuadrangle::etaShapeMeasure
virtual double etaShapeMeasure()
Definition: MQuadrangle.cpp:300
SPoint3::z
double z(void) const
Definition: SPoint3.h:129
MQuadrangle8::reorient
virtual void reorient(int rotation, bool swap)
Definition: MQuadrangle.cpp:474
MElement::getJacobian
virtual double getJacobian(const fullMatrix< double > &gsf, double jac[3][3]) const
Definition: MElement.cpp:868
MVertex::y
double y() const
Definition: MVertex.h:61
pointsGenerators.h
MVertex::distance
double distance(MVertex *const v)
Definition: MVertex.h:105
MQuadrangleN::getVertex
virtual MVertex * getVertex(int num)
Definition: MQuadrangle.h:477
gmshGenerateMonomialsQuadrangle
fullMatrix< double > gmshGenerateMonomialsQuadrangle(int order, bool forSerendipPoints)
Definition: pointsGenerators.cpp:222
MQuadrangle
Definition: MQuadrangle.h:26
MQuadrangle::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MQuadrangle.cpp:20
MVertex::x
double x() const
Definition: MVertex.h:60
SVector3::normalize
double normalize()
Definition: SVector3.h:38
MQuadrangleN::getNumVertices
virtual std::size_t getNumVertices() const
Definition: MQuadrangle.h:476
BasisFactory.h