gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
GModelVertexArrays.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 <cmath>
7 #include "GmshMessage.h"
8 #include "GmshDefines.h"
9 #include "GModel.h"
10 #include "MLine.h"
11 #include "MTriangle.h"
12 #include "MQuadrangle.h"
13 #include "MTetrahedron.h"
14 #include "MHexahedron.h"
15 #include "MPrism.h"
16 #include "MPyramid.h"
17 #include "MTrihedron.h"
18 #include "MElementCut.h"
19 #include "Context.h"
20 #include "VertexArray.h"
21 #include "SmoothData.h"
22 
23 static const double curvedRepTol = 1.e-5;
24 
25 unsigned int getColorByEntity(GEntity *e)
26 {
27  if(e->getSelection()) { // selection
28  return CTX::instance()->color.geom.selection;
29  }
30  else if(e->useColor()) { // forced from a script
31  return e->getColor();
32  }
33  else if(CTX::instance()->mesh.colorCarousel == 1) { // by elementary entity
34  return CTX::instance()->color.mesh.carousel[abs(e->tag() % 20)];
35  }
36  else if(CTX::instance()->mesh.colorCarousel == 2) { // by physical entity
37  int np = e->physicals.size();
38  int p = np ? e->physicals[np - 1] : 0;
39  return CTX::instance()->color.mesh.carousel[abs(p % 20)];
40  }
41  else {
42  return CTX::instance()->color.fg;
43  }
44 }
45 
46 static unsigned int getColorByElement(MElement *ele)
47 {
48  if(ele->getVisibility() > 1) { // selection
49  return CTX::instance()->color.geom.selection;
50  }
51  else if(CTX::instance()->mesh.colorCarousel == 0) { // by element type
52  switch(ele->getType()) {
53  case TYPE_LIN: return CTX::instance()->color.mesh.line;
54  case TYPE_TRI: return CTX::instance()->color.mesh.triangle;
55  case TYPE_QUA: return CTX::instance()->color.mesh.quadrangle;
56  case TYPE_TET: return CTX::instance()->color.mesh.tetrahedron;
57  case TYPE_HEX: return CTX::instance()->color.mesh.hexahedron;
58  case TYPE_PRI: return CTX::instance()->color.mesh.prism;
59  case TYPE_PYR: return CTX::instance()->color.mesh.pyramid;
60  case TYPE_TRIH: return CTX::instance()->color.mesh.trihedron;
61  default: return CTX::instance()->color.mesh.node;
62  }
63  }
64  else if(CTX::instance()->mesh.colorCarousel == 3) { // by partition
65  return CTX::instance()
66  ->color.mesh.carousel[std::abs(ele->getPartition() % 20)];
67  }
68  else {
69  // by elementary or physical entity (this is not perfect (since
70  // e.g. a triangle can have no vertices categorized on a surface),
71  // but it's the best we can do "fast" since we don't store the
72  // associated entity in the element
73  for(std::size_t i = 0; i < ele->getNumVertices(); i++) {
74  GEntity *e = ele->getVertex(i)->onWhat();
75  if(e && (e->dim() == ele->getDim())) return getColorByEntity(e);
76  }
77  }
78  return CTX::instance()->color.fg;
79 }
80 
81 static double evalClipPlane(int clip, double x, double y, double z)
82 {
83  return CTX::instance()->clipPlane[clip][0] * x +
84  CTX::instance()->clipPlane[clip][1] * y +
85  CTX::instance()->clipPlane[clip][2] * z +
87 }
88 
89 static double intersectClipPlane(int clip, MElement *ele)
90 {
91  MVertex *v = ele->getVertex(0);
92  double val = evalClipPlane(clip, v->x(), v->y(), v->z());
93  for(std::size_t i = 1; i < ele->getNumVertices(); i++) {
94  v = ele->getVertex(i);
95  if(val * evalClipPlane(clip, v->x(), v->y(), v->z()) <= 0)
96  return 0.; // the element intersects the cut plane
97  }
98  return val;
99 }
100 
102 {
103  if(!ele->getVisibility()) return false;
104  if(CTX::instance()->mesh.qualitySup) {
105  double q;
106  if(CTX::instance()->mesh.qualityType == 3)
107  q = ele->distoShapeMeasure();
108  else if(CTX::instance()->mesh.qualityType == 2)
109  q = ele->gammaShapeMeasure();
110  else if(CTX::instance()->mesh.qualityType == 1)
111  q = ele->minSIGEShapeMeasure();
112  else
113  q = ele->minSICNShapeMeasure();
114  if(q < CTX::instance()->mesh.qualityInf ||
116  return false;
117  }
118  if(CTX::instance()->mesh.radiusSup) {
119  double r = ele->maxEdge();
120  if(r < CTX::instance()->mesh.radiusInf ||
122  return false;
123  }
124  if(CTX::instance()->clipWholeElements) {
125  bool hidden = false;
126  for(int clip = 0; clip < 6; clip++) {
127  if(CTX::instance()->mesh.clip & (1 << clip)) {
128  if(ele->getDim() < 3 && CTX::instance()->clipOnlyVolume) {}
129  else {
130  double d = intersectClipPlane(clip, ele);
131  if(ele->getDim() == 3 &&
133  hidden = true;
134  break;
135  }
136  else if(d < 0) {
137  hidden = true;
138  break;
139  }
140  }
141  }
142  }
143  if(hidden) return false;
144  }
145  return true;
146 }
147 
148 template <class T> static bool areAllElementsVisible(std::vector<T *> &elements)
149 {
150  for(std::size_t i = 0; i < elements.size(); i++)
151  if(!isElementVisible(elements[i])) return false;
152  return true;
153 }
154 
155 template <class T> static bool areSomeElementsCurved(std::vector<T *> &elements)
156 {
157  for(std::size_t i = 0; i < elements.size(); i++)
158  if(elements[i]->getPolynomialOrder() > 1) return true;
159  return false;
160 }
161 
162 template <class T>
163 static void addSmoothNormals(GEntity *e, std::vector<T *> &elements)
164 {
165  for(std::size_t i = 0; i < elements.size(); i++) {
166  MElement *ele = elements[i];
167  const bool curved =
168  (ele->getPolynomialOrder() > 1) &&
169  (ele->maxDistToStraight() > curvedRepTol * ele->getInnerRadius());
170  SPoint3 pc(0., 0., 0.);
171  if(CTX::instance()->mesh.explode != 1.) pc = ele->barycenter();
172  for(int j = 0; j < ele->getNumFacesRep(curved); j++) {
173  double x[3], y[3], z[3];
174  SVector3 n[3];
175  ele->getFaceRep(curved, j, x, y, z, n);
176  for(int k = 0; k < 3; k++) {
177  if(CTX::instance()->mesh.explode != 1.) {
178  x[k] = pc[0] + CTX::instance()->mesh.explode * (x[k] - pc[0]);
179  y[k] = pc[1] + CTX::instance()->mesh.explode * (y[k] - pc[1]);
180  z[k] = pc[2] + CTX::instance()->mesh.explode * (z[k] - pc[2]);
181  }
182  e->model()->normals->add(x[k], y[k], z[k], n[k][0], n[k][1], n[k][2]);
183  }
184  }
185  }
186 }
187 
188 template <class T>
189 static void addElementsInArrays(GEntity *e, std::vector<T *> &elements,
190  bool edges, bool faces)
191 {
192  int nthreads = CTX::instance()->numThreads;
193  if(!nthreads) nthreads = Msg::GetMaxThreads();
194 #pragma omp parallel for schedule(dynamic) num_threads(nthreads)
195  for(std::size_t i = 0; i < elements.size(); i++) {
196  MElement *ele = elements[i];
197 
198  if(!isElementVisible(ele) || ele->getDim() < 1) continue;
199 
200  unsigned int c = getColorByElement(ele);
201  unsigned int col[4] = {c, c, c, c};
202 
203  const bool curved =
204  (ele->getPolynomialOrder() > 1) &&
205  (ele->maxDistToStraight() > curvedRepTol * ele->getInnerRadius());
206 
207  SPoint3 pc(0., 0., 0.);
208  if(CTX::instance()->mesh.explode != 1.) pc = ele->barycenter();
209 
210  if(edges) {
211  bool unique = e->dim() > 1 && !CTX::instance()->pickElements;
212  for(int j = 0; j < ele->getNumEdgesRep(curved); j++) {
213  double x[2], y[2], z[2];
214  SVector3 n[2];
215  ele->getEdgeRep(curved, j, x, y, z, n);
216  if(CTX::instance()->mesh.explode != 1.) {
217  for(int k = 0; k < 2; k++) {
218  x[k] = pc[0] + CTX::instance()->mesh.explode * (x[k] - pc[0]);
219  y[k] = pc[1] + CTX::instance()->mesh.explode * (y[k] - pc[1]);
220  z[k] = pc[2] + CTX::instance()->mesh.explode * (z[k] - pc[2]);
221  }
222  }
223  if(e->dim() == 2 && CTX::instance()->mesh.smoothNormals)
224  for(int k = 0; k < 2; k++)
225  e->model()->normals->get(x[k], y[k], z[k], n[k][0], n[k][1],
226  n[k][2]);
227 #pragma omp critical
228  {
229  e->va_lines->add(x, y, z, n, col, ele, unique);
230  }
231  }
232  }
233 
234  if(faces) {
235  bool unique = e->dim() > 2 && !CTX::instance()->pickElements;
236  bool skin = e->dim() > 2 && CTX::instance()->mesh.drawSkinOnly;
237  for(int j = 0; j < ele->getNumFacesRep(curved); j++) {
238  double x[3], y[3], z[3];
239  SVector3 n[3];
240  ele->getFaceRep(curved, j, x, y, z, n);
241  if(CTX::instance()->mesh.explode != 1.) {
242  for(int k = 0; k < 3; k++) {
243  x[k] = pc[0] + CTX::instance()->mesh.explode * (x[k] - pc[0]);
244  y[k] = pc[1] + CTX::instance()->mesh.explode * (y[k] - pc[1]);
245  z[k] = pc[2] + CTX::instance()->mesh.explode * (z[k] - pc[2]);
246  }
247  }
248  if(e->dim() == 2 && CTX::instance()->mesh.smoothNormals)
249  for(int k = 0; k < 3; k++)
250  e->model()->normals->get(x[k], y[k], z[k], n[k][0], n[k][1],
251  n[k][2]);
252 #pragma omp critical
253  {
254  e->va_triangles->add(x, y, z, n, col, ele, unique, skin);
255  }
256  }
257  }
258  }
259 }
260 
262 private:
264  {
265  int num = 0;
266  if(CTX::instance()->mesh.lines) {
267  num += e->lines.size();
268  if(areSomeElementsCurved(e->lines)) num *= 2;
269  }
270  return num + 100;
271  }
272 
273 public:
274  void operator()(GEdge *e)
275  {
276  e->deleteVertexArrays();
277  if(!e->getVisibility()) return;
278  e->setAllElementsVisible(CTX::instance()->mesh.lines &&
280 
281  if(CTX::instance()->mesh.lines) {
282  e->va_lines = new VertexArray(2, _estimateNumLines(e));
284  e->va_lines->finalize();
285  }
286  }
287 };
288 
290 public:
292  {
293  addSmoothNormals(f, f->triangles);
294  addSmoothNormals(f, f->quadrangles);
295  addSmoothNormals(f, f->polygons);
296  }
297 };
298 
300 private:
301  bool _curved;
303  {
304  int num = 0;
305  if(CTX::instance()->mesh.surfaceEdges) {
306  num += (3 * f->triangles.size() + 4 * f->quadrangles.size() +
307  4 * f->polygons.size()) /
308  2;
309  if(CTX::instance()->mesh.explode != 1.) num *= 2;
310  if(_curved) num *= 2;
311  }
312  return num + 100;
313  }
315  {
316  int num = 0;
317  if(CTX::instance()->mesh.surfaceFaces) {
318  num += (f->triangles.size() + 2 * f->quadrangles.size() +
319  2 * f->polygons.size());
320  if(_curved) num *= 4;
321  }
322  return num + 100;
323  }
324 
325 public:
327  {
328  f->deleteVertexArrays();
329  if(!f->getVisibility()) return;
330  f->setAllElementsVisible(CTX::instance()->mesh.triangles &&
331  areAllElementsVisible(f->triangles) &&
333  areAllElementsVisible(f->quadrangles));
334 
335  bool edg = CTX::instance()->mesh.surfaceEdges;
336  bool fac = CTX::instance()->mesh.surfaceFaces;
337  if(edg || fac) {
338  _curved = (areSomeElementsCurved(f->triangles) ||
339  areSomeElementsCurved(f->quadrangles));
340  f->va_lines = new VertexArray(2, edg ? _estimateNumLines(f) : 100);
341  f->va_triangles =
342  new VertexArray(3, fac ? _estimateNumTriangles(f) : 100);
343  if(CTX::instance()->mesh.triangles)
344  addElementsInArrays(f, f->triangles, edg, fac);
345  if(CTX::instance()->mesh.quadrangles)
346  addElementsInArrays(f, f->quadrangles, edg, fac);
347  addElementsInArrays(f, f->polygons, edg, fac);
348  f->va_lines->finalize();
349  f->va_triangles->finalize();
350  }
351  }
352 };
353 
355 private:
356  bool _curved;
357  int _estimateIfClipped(int num)
358  {
359  if(CTX::instance()->clipWholeElements) {
360  for(int clip = 0; clip < 6; clip++) {
361  if(CTX::instance()->mesh.clip & (1 << clip)) {
362  if(CTX::instance()->clipOnlyDrawIntersectingVolume) {
363  // let be more aggressive than num^{2/3}
364  return (int)sqrt((double)num);
365  }
366  else {
367  // why not :-)
368  return num / 4;
369  }
370  }
371  }
372  }
373  return num;
374  }
376  {
377  int num = 0;
378  if(CTX::instance()->mesh.volumeEdges) {
379  // suppose edge shared by 4 elements on averge (pessmistic)
380  int numLP = 0;
381  for(std::size_t i = 0; i < r->polyhedra.size(); i++)
382  numLP += 2 * r->polyhedra[i]->getNumEdges();
383  num += (12 * r->tetrahedra.size() + 24 * r->hexahedra.size() +
384  18 * r->prisms.size() + 16 * r->pyramids.size() +
385  10 * r->trihedra.size() + numLP) /
386  4;
387  num = _estimateIfClipped(num);
388  if(CTX::instance()->mesh.explode != 1.) num *= 4;
389  if(_curved) num *= 2;
390  }
391  return num + 100;
392  }
394  {
395  int num = 0;
396  if(CTX::instance()->mesh.volumeFaces) {
397  int numFP = 0;
398  for(std::size_t i = 0; i < r->polyhedra.size(); i++)
399  numFP += r->polyhedra[i]->getNumFaces();
400  num += (4 * r->tetrahedra.size() + 12 * r->hexahedra.size() +
401  8 * r->prisms.size() + 6 * r->pyramids.size() +
402  4 * r->trihedra.size() + numFP) /
403  2;
404  num = _estimateIfClipped(num);
405  if(CTX::instance()->mesh.explode != 1.) num *= 2;
406  if(_curved) num *= 4;
407  }
408  return num + 100;
409  }
410 
411 public:
413  {
414  r->deleteVertexArrays();
415  if(!r->getVisibility()) return;
417  CTX::instance()->mesh.tetrahedra &&
423 
424  bool edg = CTX::instance()->mesh.volumeEdges;
425  bool fac = CTX::instance()->mesh.volumeFaces;
426  if(edg || fac) {
432  r->va_lines = new VertexArray(2, edg ? _estimateNumLines(r) : 100);
433  r->va_triangles =
434  new VertexArray(3, fac ? _estimateNumTriangles(r) : 100);
435  if(CTX::instance()->mesh.tetrahedra)
436  addElementsInArrays(r, r->tetrahedra, edg, fac);
437  if(CTX::instance()->mesh.hexahedra)
438  addElementsInArrays(r, r->hexahedra, edg, fac);
439  if(CTX::instance()->mesh.prisms)
440  addElementsInArrays(r, r->prisms, edg, fac);
441  if(CTX::instance()->mesh.pyramids)
442  addElementsInArrays(r, r->pyramids, edg, fac);
443  if(CTX::instance()->mesh.trihedra)
444  addElementsInArrays(r, r->trihedra, edg, fac);
445  addElementsInArrays(r, r->polyhedra, edg, fac);
446  r->va_lines->finalize();
447  r->va_triangles->finalize();
448  }
449  }
450 };
451 
453 {
454  if(!getVisibility() || !CTX::instance()->mesh.changed) return false;
455 
456  Msg::Debug("Mesh has changed: reinitializing vertex arrays");
457 
458  int status = getMeshStatus();
459 
460  if(status >= 1 && CTX::instance()->mesh.changed & ENT_CURVE)
461  std::for_each(firstEdge(), lastEdge(), initMeshGEdge());
462 
463  if(status >= 2 && CTX::instance()->mesh.changed & ENT_SURFACE) {
464  if(normals) delete normals;
465  normals = new smooth_normals(CTX::instance()->mesh.angleSmoothNormals);
466  if(CTX::instance()->mesh.smoothNormals)
467  std::for_each(firstFace(), lastFace(), initSmoothNormalsGFace());
468  std::for_each(firstFace(), lastFace(), initMeshGFace());
469  }
470 
471  if(status >= 3 && CTX::instance()->mesh.changed & ENT_VOLUME)
472  std::for_each(firstRegion(), lastRegion(), initMeshGRegion());
473  return true;
474 }
MElement::minSIGEShapeMeasure
double minSIGEShapeMeasure()
Definition: MElement.h:267
GModel::normals
smooth_normals * normals
Definition: GModel.h:653
ENT_VOLUME
#define ENT_VOLUME
Definition: GmshDefines.h:234
contextMeshOptions::trihedra
int trihedra
Definition: Context.h:84
MTriangle.h
MElement::getNumFacesRep
virtual int getNumFacesRep(bool curved)=0
initMeshGFace::_estimateNumTriangles
int _estimateNumTriangles(GFace *f)
Definition: GModelVertexArrays.cpp:314
contextMeshOptions::volumeEdges
int volumeEdges
Definition: Context.h:85
MTrihedron.h
GModel::firstEdge
eiter firstEdge()
Definition: GModel.h:356
GEntity::getColor
virtual unsigned int getColor()
Definition: GEntity.h:318
GEntity::setAllElementsVisible
void setAllElementsVisible(bool val)
Definition: GEntity.h:373
contextMeshOptions::surfaceEdges
int surfaceEdges
Definition: Context.h:85
initMeshGFace
Definition: GModelVertexArrays.cpp:299
CTX::clipOnlyVolume
int clipOnlyVolume
Definition: Context.h:278
CTX::color
struct CTX::@3 color
TYPE_LIN
#define TYPE_LIN
Definition: GmshDefines.h:65
MElement::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)=0
GFace
Definition: GFace.h:33
GEdge::lines
std::vector< MLine * > lines
Definition: GEdge.h:42
GEntity::model
GModel * model() const
Definition: GEntity.h:277
Msg::Debug
static void Debug(const char *fmt,...)
Definition: GmshMessage.cpp:752
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
MElement::getDim
virtual int getDim() const =0
contextMeshOptions::surfaceFaces
int surfaceFaces
Definition: Context.h:85
CTX::numThreads
int numThreads
Definition: Context.h:169
GEntity::va_triangles
VertexArray * va_triangles
Definition: GEntity.h:68
MVertex::z
double z() const
Definition: MVertex.h:62
GEntity::physicals
std::vector< int > physicals
Definition: GEntity.h:65
VertexArray.h
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
CTX::pickElements
int pickElements
Definition: Context.h:294
MElement::maxDistToStraight
double maxDistToStraight() const
Definition: MElement.cpp:256
initMeshGRegion::operator()
void operator()(GRegion *r)
Definition: GModelVertexArrays.cpp:412
SVector3
Definition: SVector3.h:16
TYPE_TRI
#define TYPE_TRI
Definition: GmshDefines.h:66
CTX::clipOnlyDrawIntersectingVolume
int clipOnlyDrawIntersectingVolume
Definition: Context.h:278
VertexArray
Definition: VertexArray.h:151
MVertex::onWhat
GEntity * onWhat() const
Definition: MVertex.h:82
smooth_normals
Definition: SmoothData.h:100
contextMeshOptions::prisms
int prisms
Definition: Context.h:83
GEntity::getSelection
virtual char getSelection()
Definition: GEntity.h:314
GmshMessage.h
MLine.h
edges
static int edges[6][2]
Definition: meshGRegionLocalMeshMod.cpp:23
getColorByEntity
unsigned int getColorByEntity(GEntity *e)
Definition: GModelVertexArrays.cpp:25
contextMeshOptions::volumeFaces
int volumeFaces
Definition: Context.h:85
GEntity
Definition: GEntity.h:31
TYPE_PRI
#define TYPE_PRI
Definition: GmshDefines.h:70
smooth_normals::add
void add(double x, double y, double z, double nx, double ny, double nz)
Definition: SmoothData.cpp:215
initMeshGEdge
Definition: GModelVertexArrays.cpp:261
MElement::getNumVertices
virtual std::size_t getNumVertices() const =0
areAllElementsVisible
static bool areAllElementsVisible(std::vector< T * > &elements)
Definition: GModelVertexArrays.cpp:148
addSmoothNormals
static void addSmoothNormals(GEntity *e, std::vector< T * > &elements)
Definition: GModelVertexArrays.cpp:163
ENT_SURFACE
#define ENT_SURFACE
Definition: GmshDefines.h:233
GRegion::polyhedra
std::vector< MPolyhedron * > polyhedra
Definition: GRegion.h:168
CTX::fg
unsigned int fg
Definition: Context.h:358
CTX::instance
static CTX * instance()
Definition: Context.cpp:122
MElement::getVertex
virtual const MVertex * getVertex(int num) const =0
initSmoothNormalsGFace::operator()
void operator()(GFace *f)
Definition: GModelVertexArrays.cpp:291
GRegion::hexahedra
std::vector< MHexahedron * > hexahedra
Definition: GRegion.h:164
GModel::lastFace
fiter lastFace()
Definition: GModel.h:359
MElement::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)=0
initMeshGFace::_estimateNumLines
int _estimateNumLines(GFace *f)
Definition: GModelVertexArrays.cpp:302
MElement::getType
virtual int getType() const =0
contextMeshOptions::drawSkinOnly
int drawSkinOnly
Definition: Context.h:88
MElementCut.h
MHexahedron.h
initMeshGRegion::_curved
bool _curved
Definition: GModelVertexArrays.cpp:356
GEntity::useColor
virtual bool useColor()
Definition: GEntity.cpp:43
initMeshGRegion::_estimateIfClipped
int _estimateIfClipped(int num)
Definition: GModelVertexArrays.cpp:357
Msg::GetMaxThreads
static int GetMaxThreads()
Definition: GmshMessage.cpp:1637
CTX::clipPlane
double clipPlane[6][4]
Definition: Context.h:277
initMeshGRegion::_estimateNumTriangles
int _estimateNumTriangles(GRegion *r)
Definition: GModelVertexArrays.cpp:393
MPyramid.h
GModel::firstFace
fiter firstFace()
Definition: GModel.h:355
GmshDefines.h
addElementsInArrays
static void addElementsInArrays(GEntity *e, std::vector< T * > &elements, bool edges, bool faces)
Definition: GModelVertexArrays.cpp:189
GRegion::trihedra
std::vector< MTrihedron * > trihedra
Definition: GRegion.h:167
contextMeshOptions::quadrangles
int quadrangles
Definition: Context.h:83
CTX::mesh
contextMeshOptions mesh
Definition: Context.h:313
MElement
Definition: MElement.h:30
GEntity::tag
int tag() const
Definition: GEntity.h:280
clip
static GmshColorTable clip
Definition: ColorTable.cpp:1053
initMeshGRegion
Definition: GModelVertexArrays.cpp:354
initSmoothNormalsGFace
Definition: GModelVertexArrays.cpp:289
GModel::fillVertexArrays
bool fillVertexArrays()
Definition: GModelVertexArrays.cpp:452
CTX::geom
contextGeometryOptions geom
Definition: Context.h:311
GRegion
Definition: GRegion.h:28
GRegion::prisms
std::vector< MPrism * > prisms
Definition: GRegion.h:165
getColorByElement
static unsigned int getColorByElement(MElement *ele)
Definition: GModelVertexArrays.cpp:46
TYPE_PYR
#define TYPE_PYR
Definition: GmshDefines.h:69
GRegion::pyramids
std::vector< MPyramid * > pyramids
Definition: GRegion.h:166
GModel::getVisibility
char getVisibility() const
Definition: GModel.h:340
MElement::gammaShapeMeasure
virtual double gammaShapeMeasure()
Definition: MElement.h:259
MElement::minSICNShapeMeasure
double minSICNShapeMeasure()
Definition: MElement.h:261
GModel::firstRegion
riter firstRegion()
Definition: GModel.h:354
initMeshGFace::operator()
void operator()(GFace *f)
Definition: GModelVertexArrays.cpp:326
TYPE_QUA
#define TYPE_QUA
Definition: GmshDefines.h:67
GModel::lastRegion
riter lastRegion()
Definition: GModel.h:358
contextMeshOptions::qualitySup
double qualitySup
Definition: Context.h:24
areSomeElementsCurved
static bool areSomeElementsCurved(std::vector< T * > &elements)
Definition: GModelVertexArrays.cpp:155
ENT_CURVE
#define ENT_CURVE
Definition: GmshDefines.h:232
Context.h
MTetrahedron.h
smooth_normals::get
bool get(double x, double y, double z, double &nx, double &ny, double &nz) const
Definition: SmoothData.cpp:234
z
const double z
Definition: GaussQuadratureQuad.cpp:56
MQuadrangle.h
MElement::getInnerRadius
virtual double getInnerRadius()
Definition: MElement.h:292
curvedRepTol
static const double curvedRepTol
Definition: GModelVertexArrays.cpp:23
initMeshGFace::_curved
bool _curved
Definition: GModelVertexArrays.cpp:301
GEntity::va_lines
VertexArray * va_lines
Definition: GEntity.h:68
GEdge
Definition: GEdge.h:26
TYPE_HEX
#define TYPE_HEX
Definition: GmshDefines.h:71
contextMeshOptions::radiusSup
double radiusSup
Definition: Context.h:24
MPrism.h
MElement::maxEdge
virtual double maxEdge()
Definition: MElement.cpp:246
MElement::barycenter
virtual SPoint3 barycenter(bool primary=false) const
Definition: MElement.cpp:520
contextMeshOptions::smoothNormals
int smoothNormals
Definition: Context.h:89
TYPE_TET
#define TYPE_TET
Definition: GmshDefines.h:68
contextMeshOptions::pyramids
int pyramids
Definition: Context.h:84
GModel::mesh
int mesh(int dimension)
Definition: GModel.cpp:1066
TYPE_TRIH
#define TYPE_TRIH
Definition: GmshDefines.h:76
VertexArray::finalize
void finalize()
Definition: VertexArray.cpp:138
initMeshGRegion::_estimateNumLines
int _estimateNumLines(GRegion *r)
Definition: GModelVertexArrays.cpp:375
GModel::lastEdge
eiter lastEdge()
Definition: GModel.h:360
GModel.h
MVertex::y
double y() const
Definition: MVertex.h:61
MElement::getVisibility
virtual char getVisibility() const
Definition: MElement.cpp:165
MElement::getPolynomialOrder
virtual int getPolynomialOrder() const
Definition: MElement.h:78
contextMeshOptions::explode
double explode
Definition: Context.h:22
MElement::distoShapeMeasure
double distoShapeMeasure()
Definition: MElement.h:273
contextMeshOptions::hexahedra
int hexahedra
Definition: Context.h:83
evalClipPlane
static double evalClipPlane(int clip, double x, double y, double z)
Definition: GModelVertexArrays.cpp:81
contextMeshOptions::lines
int lines
Definition: Context.h:83
isElementVisible
bool isElementVisible(MElement *ele)
Definition: GModelVertexArrays.cpp:101
MElement::getPartition
virtual int getPartition() const
Definition: MElement.h:92
VertexArray::add
void add(double *x, double *y, double *z, SVector3 *n, unsigned int *col, MElement *ele=nullptr, bool unique=true, bool boundary=false)
Definition: VertexArray.cpp:81
GEntity::dim
virtual int dim() const
Definition: GEntity.h:196
GModel::getMeshStatus
int getMeshStatus(bool countDiscrete=true)
Definition: GModel.cpp:1474
GEntity::getVisibility
virtual char getVisibility()
Definition: GEntity.cpp:35
MElement::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)=0
intersectClipPlane
static double intersectClipPlane(int clip, MElement *ele)
Definition: GModelVertexArrays.cpp:89
GEntity::deleteVertexArrays
void deleteVertexArrays()
Definition: GEntity.cpp:27
GRegion::tetrahedra
std::vector< MTetrahedron * > tetrahedra
Definition: GRegion.h:163
SmoothData.h
MVertex::x
double x() const
Definition: MVertex.h:60
initMeshGEdge::_estimateNumLines
int _estimateNumLines(GEdge *e)
Definition: GModelVertexArrays.cpp:263
faces
static int faces[4][3]
Definition: meshGRegionDelaunayInsertion.cpp:165
initMeshGEdge::operator()
void operator()(GEdge *e)
Definition: GModelVertexArrays.cpp:274