gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MPyramid.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 "MPyramid.h"
7 #include "Numeric.h"
8 #include "Context.h"
9 #include "BergotBasis.h"
10 #include "BasisFactory.h"
11 #include "pointsGenerators.h"
12 
13 std::map<int, IndicesReversed> MPyramidN::_order2indicesReversedPyr;
14 
16 {
17  double mat[3][3];
18  mat[0][0] = _v[1]->x() - _v[0]->x();
19  mat[0][1] = _v[3]->x() - _v[0]->x();
20  mat[0][2] = _v[4]->x() - _v[0]->x();
21  mat[1][0] = _v[1]->y() - _v[0]->y();
22  mat[1][1] = _v[3]->y() - _v[0]->y();
23  mat[1][2] = _v[4]->y() - _v[0]->y();
24  mat[2][0] = _v[1]->z() - _v[0]->z();
25  mat[2][1] = _v[3]->z() - _v[0]->z();
26  mat[2][2] = _v[4]->z() - _v[0]->z();
27  double d = det3x3(mat);
28  if(d < 0.)
29  return -1;
30  else if(d > 0.)
31  return 1;
32  else
33  return 0;
34 }
35 
36 void MPyramid::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
37 {
38  *npts = getNGQPyrPts(pOrder);
39  *pts = getGQPyrPts(pOrder);
40 }
41 
42 bool MPyramid::getFaceInfo(const MFace &face, int &ithFace, int &sign,
43  int &rot) const
44 {
45  for(ithFace = 0; ithFace < 5; ++ithFace) {
46  if(_getFaceInfo(getFace(ithFace), face, sign, rot)) return true;
47  }
48  Msg::Error("Could not get face information for pyramid %d", getNum());
49  return false;
50 }
51 
53 
54 int MPyramidN::getNumEdgesRep(bool curved)
55 {
56  // FIXME: remove !getIsAssimilatedSerendipity() when serendip are implemented
57  return (curved && !getIsAssimilatedSerendipity()) ?
59  8;
60 }
61 
62 void MPyramidN::getEdgeRep(bool curved, int num, double *x, double *y,
63  double *z, SVector3 *n)
64 {
65  // FIXME: remove !getIsAssimilatedSerendipity() when serendip are implemented
66  if(curved && !getIsAssimilatedSerendipity()) {
67  int numSubEdges = CTX::instance()->mesh.numSubEdges;
68  static double pp[5][3] = {
69  {-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}, {0, 0, 1}};
70  static int ed[8][2] = {{0, 1}, {0, 3}, {0, 4}, {1, 2},
71  {1, 4}, {2, 3}, {2, 4}, {3, 4}};
72  int iEdge = num / numSubEdges;
73  int iSubEdge = num % numSubEdges;
74 
75  int iVertex1 = ed[iEdge][0];
76  int iVertex2 = ed[iEdge][1];
77  double t1 = (double)iSubEdge / (double)numSubEdges;
78  double u1 = pp[iVertex1][0] * (1. - t1) + pp[iVertex2][0] * t1;
79  double v1 = pp[iVertex1][1] * (1. - t1) + pp[iVertex2][1] * t1;
80  double w1 = pp[iVertex1][2] * (1. - t1) + pp[iVertex2][2] * t1;
81 
82  double t2 = (double)(iSubEdge + 1) / (double)numSubEdges;
83  double u2 = pp[iVertex1][0] * (1. - t2) + pp[iVertex2][0] * t2;
84  double v2 = pp[iVertex1][1] * (1. - t2) + pp[iVertex2][1] * t2;
85  double w2 = pp[iVertex1][2] * (1. - t2) + pp[iVertex2][2] * t2;
86 
87  SPoint3 pnt1, pnt2;
88  pnt(u1, v1, w1, pnt1);
89  pnt(u2, v2, w2, pnt2);
90  x[0] = pnt1.x();
91  x[1] = pnt2.x();
92  y[0] = pnt1.y();
93  y[1] = pnt2.y();
94  z[0] = pnt1.z();
95  z[1] = pnt2.z();
96 
97  // not great, but better than nothing
98  static const int f[8] = {0, 1, 0, 2, 2, 3, 2, 3};
99  n[0] = n[1] = getFace(f[iEdge]).normal();
100  }
101  else
102  MPyramid::getEdgeRep(false, num, x, y, z, n);
103 }
104 
105 int MPyramid::getNumFacesRep(bool curved)
106 {
107 #if defined(HAVE_VISUDEV)
108  if(CTX::instance()->heavyVisu) {
109  if(CTX::instance()->mesh.numSubEdges == 1) return 8;
110  return 6 * std::pow(CTX::instance()->mesh.numSubEdges, 2);
111  }
112 #endif
113  return 6;
114 }
115 
117 {
118  // FIXME: remove !getIsAssimilatedSerendipity() when serendip are implemented
119  return (curved && !getIsAssimilatedSerendipity()) ?
120  6 * std::pow(CTX::instance()->mesh.numSubEdges, 2) :
121  MPyramid::getNumFacesRep(curved);
122 }
123 
124 static void _myGetFaceRep(MPyramid *pyr, int num, double *x, double *y,
125  double *z, SVector3 *n, int numSubEdges)
126 {
127  static double pp[5][3] = {
128  {-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}, {0, 0, 1}};
129  int iFace = num / (numSubEdges * numSubEdges);
130  int iSubFace = num % (numSubEdges * numSubEdges);
131 
132  if(iFace > 3) {
133  iFace = 4;
134  iSubFace = num % (2 * numSubEdges * numSubEdges);
135  }
136 
137  int iVertex1, iVertex2, iVertex3, iVertex4;
138 
139  if(iFace < 4) {
140  iVertex1 = pyr->faces_pyramid(iFace, 0);
141  iVertex2 = pyr->faces_pyramid(iFace, 1);
142  iVertex3 = pyr->faces_pyramid(iFace, 2);
143  }
144  else {
145  iVertex1 = 0;
146  iVertex2 = 1;
147  iVertex3 = 2;
148  iVertex4 = 3;
149  }
150 
151  SPoint3 pnt1, pnt2, pnt3;
152 
153  if(iFace < 4) {
154  int ix = 0, iy = 0;
155  int nbt = 0;
156  for(int i = 0; i < numSubEdges; i++) {
157  int nbl = (numSubEdges - i - 1) * 2 + 1;
158  nbt += nbl;
159  if(nbt > iSubFace) {
160  iy = i;
161  ix = nbl - (nbt - iSubFace);
162  break;
163  }
164  }
165 
166  const double d = 1. / numSubEdges;
167 
168  double u1, v1, u2, v2, u3, v3;
169  if(ix % 2 == 0) {
170  u1 = ix / 2 * d;
171  v1 = iy * d;
172  u2 = (ix / 2 + 1) * d;
173  v2 = iy * d;
174  u3 = ix / 2 * d;
175  v3 = (iy + 1) * d;
176  }
177  else {
178  u1 = (ix / 2 + 1) * d;
179  v1 = iy * d;
180  u2 = (ix / 2 + 1) * d;
181  v2 = (iy + 1) * d;
182  u3 = ix / 2 * d;
183  v3 = (iy + 1) * d;
184  }
185 
186  double U1 = pp[iVertex1][0] * (1. - u1 - v1) + pp[iVertex2][0] * u1 +
187  pp[iVertex3][0] * v1;
188  double U2 = pp[iVertex1][0] * (1. - u2 - v2) + pp[iVertex2][0] * u2 +
189  pp[iVertex3][0] * v2;
190  double U3 = pp[iVertex1][0] * (1. - u3 - v3) + pp[iVertex2][0] * u3 +
191  pp[iVertex3][0] * v3;
192 
193  double V1 = pp[iVertex1][1] * (1. - u1 - v1) + pp[iVertex2][1] * u1 +
194  pp[iVertex3][1] * v1;
195  double V2 = pp[iVertex1][1] * (1. - u2 - v2) + pp[iVertex2][1] * u2 +
196  pp[iVertex3][1] * v2;
197  double V3 = pp[iVertex1][1] * (1. - u3 - v3) + pp[iVertex2][1] * u3 +
198  pp[iVertex3][1] * v3;
199 
200  double W1 = pp[iVertex1][2] * (1. - u1 - v1) + pp[iVertex2][2] * u1 +
201  pp[iVertex3][2] * v1;
202  double W2 = pp[iVertex1][2] * (1. - u2 - v2) + pp[iVertex2][2] * u2 +
203  pp[iVertex3][2] * v2;
204  double W3 = pp[iVertex1][2] * (1. - u3 - v3) + pp[iVertex2][2] * u3 +
205  pp[iVertex3][2] * v3;
206 
207  pyr->pnt(U1, V1, W1, pnt1);
208  pyr->pnt(U2, V2, W2, pnt2);
209  pyr->pnt(U3, V3, W3, pnt3);
210  }
211  else {
212  /*
213  0
214  0 1
215  0 1 2
216  0 1 2 3
217  0 1 2 3 4
218  0 1 2 3 4 5
219  */
220 
221  // on each layer, we have (numSubEdges) * 2 triangles
222  // ix and iy are the coordinates of the sub-quadrangle
223 
224  int io = iSubFace % 2;
225  int ix = (iSubFace / 2) / numSubEdges;
226  int iy = (iSubFace / 2) % numSubEdges;
227 
228  const double d = 2. / numSubEdges;
229  double ox = -1. + d * ix;
230  double oy = -1. + d * iy;
231 
232  if(io == 0) {
233  double U1 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
234  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
235  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
236  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
237  double V1 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
238  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
239  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
240  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
241  double W1 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
242  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
243  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
244  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
245 
246  ox += d;
247 
248  double U2 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
249  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
250  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
251  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
252  double V2 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
253  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
254  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
255  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
256  double W2 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
257  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
258  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
259  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
260 
261  oy += d;
262 
263  double U3 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
264  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
265  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
266  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
267  double V3 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
268  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
269  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
270  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
271  double W3 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
272  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
273  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
274  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
275 
276  pyr->pnt(U1, V1, W1, pnt1);
277  pyr->pnt(U2, V2, W2, pnt2);
278  pyr->pnt(U3, V3, W3, pnt3);
279  }
280  else {
281  double U1 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
282  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
283  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
284  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
285  double V1 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
286  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
287  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
288  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
289  double W1 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
290  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
291  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
292  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
293 
294  ox += d;
295  oy += d;
296 
297  double U2 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
298  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
299  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
300  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
301  double V2 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
302  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
303  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
304  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
305  double W2 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
306  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
307  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
308  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
309 
310  ox -= d;
311 
312  double U3 = pp[iVertex1][0] * (1. - ox) * (1 - oy) * .25 +
313  pp[iVertex2][0] * (1. + ox) * (1 - oy) * .25 +
314  pp[iVertex3][0] * (1. + ox) * (1 + oy) * .25 +
315  pp[iVertex4][0] * (1. - ox) * (1 + oy) * .25;
316  double V3 = pp[iVertex1][1] * (1. - ox) * (1 - oy) * .25 +
317  pp[iVertex2][1] * (1. + ox) * (1 - oy) * .25 +
318  pp[iVertex3][1] * (1. + ox) * (1 + oy) * .25 +
319  pp[iVertex4][1] * (1. - ox) * (1 + oy) * .25;
320  double W3 = pp[iVertex1][2] * (1. - ox) * (1 - oy) * .25 +
321  pp[iVertex2][2] * (1. + ox) * (1 - oy) * .25 +
322  pp[iVertex3][2] * (1. + ox) * (1 + oy) * .25 +
323  pp[iVertex4][2] * (1. - ox) * (1 + oy) * .25;
324 
325  pyr->pnt(U1, V1, W1, pnt1);
326  pyr->pnt(U2, V2, W2, pnt2);
327  pyr->pnt(U3, V3, W3, pnt3);
328  }
329  }
330 
331  x[0] = pnt1.x();
332  x[1] = pnt2.x();
333  x[2] = pnt3.x();
334  y[0] = pnt1.y();
335  y[1] = pnt2.y();
336  y[2] = pnt3.y();
337  z[0] = pnt1.z();
338  z[1] = pnt2.z();
339  z[2] = pnt3.z();
340 
341  SVector3 d1(x[1] - x[0], y[1] - y[0], z[1] - z[0]);
342  SVector3 d2(x[2] - x[0], y[2] - y[0], z[2] - z[0]);
343  n[0] = crossprod(d1, d2);
344  n[0].normalize();
345  n[1] = n[0];
346  n[2] = n[0];
347 }
348 
349 void MPyramid::getFaceRep(bool curved, int num, double *x, double *y, double *z,
350  SVector3 *n)
351 {
352 #if defined(HAVE_VISUDEV)
353  static const int fquad[4][4] = {
354  {0, 3, 2, 1}, {3, 2, 1, 0}, {2, 1, 0, 3}, {1, 0, 3, 2}};
355  if(CTX::instance()->heavyVisu) {
356  if(CTX::instance()->mesh.numSubEdges > 1) {
357  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
358  return;
359  }
360  if(num > 3) {
361  int i = num - 4;
362  _getFaceRepQuad(getVertex(fquad[i][0]), getVertex(fquad[i][1]),
363  getVertex(fquad[i][2]), getVertex(fquad[i][3]), x, y, z,
364  n);
365  return;
366  }
367  }
368 #endif
369  static const int f[6][3] = {{0, 1, 4}, {3, 0, 4}, {1, 2, 4},
370  {2, 3, 4}, {0, 3, 2}, {0, 2, 1}};
371  _getFaceRep(getVertex(f[num][0]), getVertex(f[num][1]), getVertex(f[num][2]),
372  x, y, z, n);
373 }
374 
375 int MPyramid::numCommonNodesInDualGraph(const MElement *const other) const
376 {
377  switch(other->getType()) {
378  case TYPE_PNT: return 1;
379  case TYPE_LIN: return 2;
380  case TYPE_QUA: return 4;
381  case TYPE_HEX: return 4;
382  default: return 3;
383  }
384 }
385 
386 void MPyramidN::getFaceRep(bool curved, int num, double *x, double *y,
387  double *z, SVector3 *n)
388 {
389  // FIXME: remove !getIsAssimilatedSerendipity() when serendip are implemented
390  if(curved && !getIsAssimilatedSerendipity())
391  _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges);
392  else
393  MPyramid::getFaceRep(false, num, x, y, z, n);
394 }
395 
396 void _getIndicesReversedPyr(int order, IndicesReversed &indices)
397 {
399 
400  indices.resize(ref.size1());
401  for(int i = 0; i < ref.size1(); ++i) {
402  const double u = ref(i, 0);
403  const double v = ref(i, 1);
404  const double w = ref(i, 2);
405  for(int j = 0; j < ref.size1(); ++j) {
406  if(u == ref(j, 1) && v == ref(j, 0) && w == ref(j, 2)) {
407  indices[i] = j;
408  break;
409  }
410  }
411  }
412 }
413 
415 {
416  auto it = _order2indicesReversedPyr.find(_order);
417  if(it == _order2indicesReversedPyr.end()) {
418  IndicesReversed indices;
419  _getIndicesReversedPyr(_order, indices);
422  }
423 
424  IndicesReversed &indices = it->second;
425 
426  // copy vertices
427  std::vector<MVertex *> oldv(5 + _vs.size());
428  std::copy(_v, _v + 5, oldv.begin());
429  std::copy(_vs.begin(), _vs.end(), oldv.begin() + 5);
430 
431  // reverse
432  for(int i = 0; i < 5; ++i) { _v[i] = oldv[indices[i]]; }
433  for(std::size_t i = 0; i < _vs.size(); ++i) { _vs[i] = oldv[indices[5 + i]]; }
434 }
435 
436 void MPyramidN::_addHOEdgePoints(int num, std::vector<MVertex *> &v,
437  bool fwd) const
438 {
439  int minVtx = num * (_order - 1);
440  int maxVtx = (num + 1) * (_order - 1) - 1;
441 
442  if(fwd)
443  for(int i = minVtx; i <= maxVtx; i++) v.push_back(_vs[i]);
444  else
445  for(int i = maxVtx; i >= minVtx; i--) v.push_back(_vs[i]);
446 }
447 
448 void MPyramidN::getFaceVertices(const int num, std::vector<MVertex *> &v) const
449 {
450  bool complete = !getIsAssimilatedSerendipity();
451 
452  int nbQ = (_order - 1) * (_order - 1);
453  int nbT = (_order - 1) * (_order - 2) / 2;
454 
455  int nb = ((num == 4) ? 4 : 3) * _order;
456  if(complete) nb += (num == 4) ? nbQ : nbT;
457 
458  v.reserve(nb);
459 
460  if(num < 4) {
461  v.push_back(_v[faces_pyramid(num, 0)]);
462  v.push_back(_v[faces_pyramid(num, 1)]);
463  v.push_back(_v[faces_pyramid(num, 2)]);
464  }
465  else {
466  v.push_back(_v[0]);
467  v.push_back(_v[3]);
468  v.push_back(_v[2]);
469  v.push_back(_v[1]);
470  }
471 
472  switch(num) {
473  case 0: // 0 1 4
474  {
475  _addHOEdgePoints(0, v);
476  _addHOEdgePoints(4, v);
477  _addHOEdgePoints(2, v, false);
478  break;
479  }
480  case 1: // 3 0 4
481  {
482  _addHOEdgePoints(1, v, false);
483  _addHOEdgePoints(2, v);
484  _addHOEdgePoints(7, v, false);
485  break;
486  }
487  case 2: // 1 2 4
488  {
489  _addHOEdgePoints(3, v);
490  _addHOEdgePoints(6, v);
491  _addHOEdgePoints(4, v, false);
492  break;
493  }
494  case 3: // 2 3 4
495  {
496  _addHOEdgePoints(5, v);
497  _addHOEdgePoints(7, v);
498  _addHOEdgePoints(6, v, false);
499  break;
500  }
501  case 4: // 0 3 2 1
502  {
503  _addHOEdgePoints(1, v);
504  _addHOEdgePoints(5, v, false);
505  _addHOEdgePoints(3, v, false);
506  _addHOEdgePoints(0, v, false);
507  break;
508  }
509  }
510 
511  if(complete) {
512  int start = 8 * (_order - 1) + num * nbT;
513  int nbPoints = (num == 4) ? nbQ : nbT;
514  for(int i = start; i < start + nbPoints; i++) v.push_back(_vs[i]);
515  }
516 }
MElement::getNum
virtual std::size_t getNum() const
Definition: MElement.h:68
MPyramidN::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPyramid.cpp:62
crossprod
SVector3 crossprod(const SVector3 &a, const SVector3 &b)
Definition: SVector3.h:150
MPyramidN::~MPyramidN
~MPyramidN()
Definition: MPyramid.cpp:52
TYPE_LIN
#define TYPE_LIN
Definition: GmshDefines.h:65
MPyramidN::reverse
virtual void reverse()
Definition: MPyramid.cpp:414
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MVertex::z
double z() const
Definition: MVertex.h:62
MPyramid::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPyramid.h:87
det3x3
double det3x3(double mat[3][3])
Definition: Numeric.cpp:126
BergotBasis.h
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
MPyramid::numCommonNodesInDualGraph
virtual int numCommonNodesInDualGraph(const MElement *const other) const
Definition: MPyramid.cpp:375
MFace::normal
SVector3 normal() const
Definition: MFace.cpp:204
TYPE_PNT
#define TYPE_PNT
Definition: GmshDefines.h:64
gmshGenerateMonomialsPyramid
fullMatrix< double > gmshGenerateMonomialsPyramid(int order, bool forSerendipPoints)
Definition: pointsGenerators.cpp:737
SVector3
Definition: SVector3.h:16
MPyramidN::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)
Definition: MPyramid.cpp:54
MPyramid
Definition: MPyramid.h:32
MPyramid::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPyramid.cpp:349
w1
const double w1
Definition: GaussQuadratureHex.cpp:18
MPyramid::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MPyramid.cpp:105
MPyramid::getFace
virtual MFace getFace(int num) const
Definition: MPyramid.h:100
CTX::instance
static CTX * instance()
Definition: Context.cpp:122
SPoint3::x
double x(void) const
Definition: SPoint3.h:125
fullMatrix< double >
MPyramidN::_order
const char _order
Definition: MPyramid.h:255
MFace
Definition: MFace.h:20
contextMeshOptions::numSubEdges
int numSubEdges
Definition: Context.h:85
MElement::getType
virtual int getType() const =0
Numeric.h
MPyramid::faces_pyramid
static int faces_pyramid(const int face, const int vert)
Definition: MPyramid.h:181
MElement::_getFaceInfo
static bool _getFaceInfo(const MFace &face, const MFace &other, int &sign, int &rot)
Definition: MElement.cpp:66
MPyramid.h
MPyramid::getFaceInfo
virtual bool getFaceInfo(const MFace &face, int &ithFace, int &sign, int &rot) const
Definition: MPyramid.cpp:42
MElement::getIsAssimilatedSerendipity
virtual bool getIsAssimilatedSerendipity() const
Definition: MElement.h:81
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
CTX::mesh
contextMeshOptions mesh
Definition: Context.h:313
MElement
Definition: MElement.h:30
MPyramidN::getFaceVertices
virtual void getFaceVertices(const int num, std::vector< MVertex * > &v) const
Definition: MPyramid.cpp:448
MPyramidN::_vs
std::vector< MVertex * > _vs
Definition: MPyramid.h:254
MPyramidN::getNumFacesRep
virtual int getNumFacesRep(bool curved)
Definition: MPyramid.cpp:116
MPyramid::getIntegrationPoints
void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MPyramid.cpp:36
MElement::pnt
virtual void pnt(double u, double v, double w, SPoint3 &p) const
Definition: MElement.cpp:1072
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
MPyramidN::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)
Definition: MPyramid.cpp:386
Context.h
IntPt
Definition: GaussIntegration.h:12
fullMatrix::size1
int size1() const
Definition: fullMatrix.h:274
z
const double z
Definition: GaussQuadratureQuad.cpp:56
getNGQPyrPts
int getNGQPyrPts(int order)
Definition: GaussQuadraturePyr.cpp:59
MPyramid::getVertex
virtual MVertex * getVertex(int num)
Definition: MPyramid.h:74
picojson::copy
void copy(const std::string &s, Iter oi)
Definition: picojson.h:510
TYPE_HEX
#define TYPE_HEX
Definition: GmshDefines.h:71
MPyramid::getVolumeSign
virtual int getVolumeSign()
Definition: MPyramid.cpp:15
_myGetFaceRep
static void _myGetFaceRep(MPyramid *pyr, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges)
Definition: MPyramid.cpp:124
MPyramidN::_order2indicesReversedPyr
static std::map< int, IndicesReversed > _order2indicesReversedPyr
Definition: MPyramid.h:251
SPoint3::z
double z(void) const
Definition: SPoint3.h:129
MPyramid::_v
MVertex * _v[5]
Definition: MPyramid.h:34
MVertex::y
double y() const
Definition: MVertex.h:61
pointsGenerators.h
getGQPyrPts
IntPt * getGQPyrPts(int order)
Definition: GaussQuadraturePyr.cpp:13
MVertex::x
double x() const
Definition: MVertex.h:60
SVector3::normalize
double normalize()
Definition: SVector3.h:38
IndicesReversed
std::vector< int > IndicesReversed
Definition: MHexahedron.h:605
BasisFactory.h
MPyramidN::_addHOEdgePoints
void _addHOEdgePoints(int num, std::vector< MVertex * > &v, bool fw=true) const
Definition: MPyramid.cpp:436
_getIndicesReversedPyr
void _getIndicesReversedPyr(int order, IndicesReversed &indices)
Definition: MPyramid.cpp:396