gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
BoundaryLayers.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 "GModel.h"
7 #include "MLine.h"
8 #include "MTriangle.h"
9 #include "MQuadrangle.h"
10 #include "BoundaryLayers.h"
11 #include "ExtrudeParams.h"
12 #include "meshGEdge.h"
13 #include "meshGFace.h"
14 #include "GmshMessage.h"
15 #include "Field.h"
16 #include "Context.h"
17 
18 #if defined(HAVE_POST)
19 #include "PView.h"
20 #include "PViewData.h"
21 #include "OctreePost.h"
22 #else
23 class OctreePost {
24  int dummy;
25 };
26 #endif
27 
28 static double GetAveEdgeLength(std::vector<MVertex *> &elem_verts)
29 {
30  double ave = 0.0;
31  int size = elem_verts.size();
32  if(!size) return 0.0;
33  for(int i = 0; i < size - 1; i++)
34  ave += elem_verts[i]->distance(elem_verts[i + 1]);
35  ave += elem_verts[0]->distance(elem_verts[size - 1]);
36  ave /= size;
37  return ave;
38 }
39 
40 template <class T>
41 static void addExtrudeNormals(std::vector<T *> &elements, int invert,
42  OctreePost *octree, bool gouraud, int index,
43  bool skipScaleCalc)
44 {
45  if(index < 0 || index > 1) {
46  Msg::Error("Boundary layer index should be 0 or 1");
47  return;
48  }
49 
50  if(octree && !gouraud) { // get extrusion direction from post-processing view
51  std::set<MVertex *> verts;
52  for(std::size_t i = 0; i < elements.size(); i++) {
54  for(std::size_t j = 0; j < elements[i]->getNumVertices(); j++)
55  verts.insert(elements[i]->getVertex(j));
56  }
57  else {
58  std::vector<MVertex *> elem_verts;
59  elements[i]->getVertices(elem_verts);
60 
61  double aveLength = skipScaleCalc ? 1.0 : GetAveEdgeLength(elem_verts);
62 
63  for(std::size_t j = 0; j < elem_verts.size(); j++) {
64  verts.insert(elem_verts[j]);
65  // if scaleLastLayer selection, but not doing gouraud, then still
66  // scale the last layer... This might create weird behavior for the
67  // unprepared...
68  if(aveLength != 0.0)
70  elem_verts[j]->x(), elem_verts[j]->y(), elem_verts[j]->z(),
71  aveLength);
72  }
73  }
74  }
75  for(auto it = verts.begin(); it != verts.end(); it++) {
76  MVertex *v = *it;
77  double nn[3] = {0., 0., 0.};
78 #if defined(HAVE_POST)
79  octree->searchVector(v->x(), v->y(), v->z(), nn, 0);
80 #endif
81  ExtrudeParams::normals[index]->add(v->x(), v->y(), v->z(), 3, nn);
82  }
83  }
84  else { // get extrusion direction from Gouraud-shaded element normals
85  for(std::size_t i = 0; i < elements.size(); i++) {
86  MElement *ele = elements[i];
87  SVector3 n(0, 0, 0);
88  if(ele->getDim() == 2)
89  n = ele->getFace(0).normal();
90  else if(ele->getDim() == 1) // FIXME: generalize this!
91  n = crossprod(ele->getEdge(0).tangent(), SVector3(0., 0., 1.));
92  if(invert) n *= -1.;
93  double nn[3] = {n[0], n[1], n[2]};
95  for(std::size_t k = 0; k < ele->getNumVertices(); k++) {
96  MVertex *v = ele->getVertex(k);
97  ExtrudeParams::normals[index]->add(v->x(), v->y(), v->z(), 3, nn);
98  }
99  }
100  else {
101  std::vector<MVertex *> elem_verts;
102  double aveLength = 0.0;
103  elements[i]->getVertices(elem_verts);
104  if(skipScaleCalc)
105  aveLength = 1.0;
106  else
107  aveLength = GetAveEdgeLength(elem_verts);
108  for(std::size_t j = 0; j < elem_verts.size(); j++) {
109  ExtrudeParams::normals[index]->add(
110  elem_verts[j]->x(), elem_verts[j]->y(), elem_verts[j]->z(), 3, nn);
111  if(aveLength != 0.0)
113  elem_verts[j]->x(), elem_verts[j]->y(), elem_verts[j]->z(),
114  aveLength);
115  }
116  }
117  }
118  }
119 }
120 
121 typedef std::set<std::pair<bool, std::pair<int, int> > > infoset;
122 
123 // skipScaleCalcMap maps an entity tag to a flag telling whether to skip the
124 // scale calc when extruding only that entity. The flag is false when an
125 // extrusion is not scaleLast when in a boundary layer that has at least one
126 // scaleLast region. Effectively, this makes the vertices on the boundary
127 // between a scaled and not scaled region 'average' between being scaled and not
128 // scaled.
129 template <class T>
130 static void addExtrudeNormals(std::set<T *> &entities,
131  std::map<int, infoset> &infos,
132  std::map<int, bool> &skipScaleCalcMap)
133 {
134  bool normalize = true, special3dbox = false, extrudeField = false;
135 #if defined(HAVE_POST)
136  std::vector<PViewData *> datas;
137 #endif
138 
139  for(auto it = entities.begin(); it != entities.end(); it++) {
140  T *ge = *it;
141  infoset info = infos[ge->tag()];
142  for(auto it2 = info.begin(); it2 != info.end(); it2++) {
143  bool invert = it2->first;
144  int index = it2->second.first;
145  int view = it2->second.second;
146  bool gouraud = true;
147  OctreePost *octree = nullptr;
148 #if defined(HAVE_POST)
149  if(view != -1) {
150  if(view >= 0 && view < (int)PView::list.size()) {
151  octree = new OctreePost(PView::list[view]);
152  if(PView::list[view]->getData()->getNumVectors()) gouraud = false;
153  datas.push_back(PView::list[view]->getData());
154  }
155  else if(view == -3) {
156  // Force extrusion normals along x,y,z axes for single normals or at
157  // 45 degrees for multiple normals (allows to build nice 3D "boxes")
158  special3dbox = true;
159  }
160  else if(view == -5) {
161  // Force extrusion normals with a field
162  extrudeField = true;
163  }
164  else
165  Msg::Error("Unknown View[%d]: using normals instead", view);
166  }
167 #endif
168  bool skipScaleCalc = true;
169  auto itskip = skipScaleCalcMap.find(ge->tag());
170  if(itskip != skipScaleCalcMap.end())
171  skipScaleCalc = skipScaleCalcMap[ge->tag()];
172  if(ge->dim() == 1)
173  addExtrudeNormals(((GEdge *)ge)->lines, invert, octree, gouraud, index,
174  skipScaleCalc);
175  else if(ge->dim() == 2) {
176  addExtrudeNormals(((GFace *)ge)->triangles, invert, octree, gouraud,
177  index, skipScaleCalc);
178  addExtrudeNormals(((GFace *)ge)->quadrangles, invert, octree, gouraud,
179  index, skipScaleCalc);
180  }
181  if(!gouraud) normalize = false;
182  }
183  }
184 
185  // enforce coherent normals at some points if necessary
186  for(std::size_t i = 0; i < ExtrudeParams::normalsCoherence.size(); i++) {
188  double n0[3], n1[3];
189  ExtrudeParams::normals[0]->get(p.x(), p.y(), p.z(), 3, n0);
190  ExtrudeParams::normals[1]->get(p.x(), p.y(), p.z(), 3, n1);
191  ExtrudeParams::normals[0]->add(p.x(), p.y(), p.z(), 3, n1);
192  ExtrudeParams::normals[1]->add(p.x(), p.y(), p.z(), 3, n0);
193  }
194 
195  // normalize extrusion directions if not using explicit vector post-processing
196  // views
197  if(normalize) {
198  for(int i = 0; i < 2; i++) {
200  if(special3dbox) { // force normals for 3d "box" along x,y,z
201  for(auto it = ExtrudeParams::normals[i]->begin();
202  it != ExtrudeParams::normals[i]->end(); it++) {
203  for(int j = 0; j < 3; j++) {
204  if(it->vals[j] < -0.1)
205  it->vals[j] = -1.;
206  else if(it->vals[j] > 0.1)
207  it->vals[j] = 1.;
208  else
209  it->vals[j] = 0.;
210  }
211  }
212  }
213  if(extrudeField) { // force normals according to field
214  for(auto it = ExtrudeParams::normals[i]->begin();
215  it != ExtrudeParams::normals[i]->end(); it++) {
216  GEntity *ge = (GEntity *)(*entities.begin());
217  FieldManager *fields = ge->model()->getFields();
218  if(fields->getBackgroundField() > 0) {
219  Field *f = fields->get(fields->getBackgroundField());
220  double radius = (*f)(it->x, it->y, it->z);
221  for(int k = 0; k < 3; k++) it->vals[k] *= radius;
222  }
223  }
224  }
225 #if defined(HAVE_POST)
226  if(datas.size()) { // scale normals by scalar views
227  for(auto it = ExtrudeParams::normals[i]->begin();
228  it != ExtrudeParams::normals[i]->end(); it++) {
229  for(std::size_t j = 0; j < datas.size(); j++) {
230  double d, dist = -1.;
231  if(datas[j]->searchScalarClosest(it->x, it->y, it->z, dist, &d, 0)) {
232  for(int k = 0; k < 3; k++) it->vals[k] *= d;
233  break;
234  }
235  }
236  }
237  }
238 #endif
239  }
240  }
241 }
242 
243 static void checkDepends(GModel *m, GFace *f, std::set<GFace *> &dep)
244 {
245  ExtrudeParams *ep = f->meshAttributes.extrude;
246  if(ep && ep->mesh.ExtrudeMesh && ep->geo.Mode == COPIED_ENTITY) {
247  GFace *from = m->getFaceByTag(std::abs(ep->geo.Source));
248  if(!from) {
249  Msg::Error("Unknown origin face %d", ep->geo.Source);
250  return;
251  }
252  dep.insert(from);
253  checkDepends(m, from, dep);
254  }
255 }
256 
257 static unsigned int
258 FixErasedExtrScaleFlags(GModel *m, std::map<int, bool> &faceSkipScaleCalc,
259  std::map<int, bool> &edgeSkipScaleCalc)
260 {
261  unsigned int num_changed = 0;
262  // fix all extruded faces bordering ScaleLast regions
263  for(auto itreg = m->firstRegion(); itreg != m->lastRegion(); itreg++) {
264  ExtrudeParams *r_ep = (*itreg)->meshAttributes.extrude;
265  if(!r_ep || !r_ep->mesh.ExtrudeMesh || r_ep->geo.Mode != EXTRUDED_ENTITY ||
266  !r_ep->mesh.ScaleLast)
267  continue;
268  std::vector<GFace *> reg_faces = (*itreg)->faces();
269  for(auto itface = reg_faces.begin(); itface != reg_faces.end(); itface++) {
270  if(m->getFaceByTag(std::abs(r_ep->geo.Source)) != (*itface)) {
271  ExtrudeParams *f_ep = (*itface)->meshAttributes.extrude;
272  if(f_ep && f_ep->mesh.ExtrudeMesh && !f_ep->mesh.ScaleLast) {
273  num_changed++;
274  f_ep->mesh.ScaleLast = true;
275  faceSkipScaleCalc[(*itface)->tag()] = false;
276  }
277  }
278  }
279  }
280  // fix all extruded curves bordering ScaleLast faces...the previous loop
281  // should have fixed any replaced extruded faces. if a face is not bordering
282  // a region, then it would not have been replaced except by a pointless
283  // degenerate extrusion right on it...which makes no sense anyway. So... just
284  // loop through faces.
285  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
286  ExtrudeParams *f_ep = (*it)->meshAttributes.extrude;
287  if(!f_ep || !f_ep->mesh.ExtrudeMesh || !f_ep->mesh.ScaleLast) continue;
288  std::vector<GEdge *> f_edges = (*it)->edges();
289  for(auto itedge = f_edges.begin(); itedge != f_edges.end(); itedge++) {
290  if(m->getEdgeByTag(std::abs(f_ep->geo.Source)) != (*itedge)) {
291  ExtrudeParams *e_ep = (*itedge)->meshAttributes.extrude;
292  if(e_ep && e_ep->mesh.ExtrudeMesh && !e_ep->mesh.ScaleLast) {
293  num_changed++;
294  e_ep->mesh.ScaleLast = true;
295  edgeSkipScaleCalc[(*itedge)->tag()] = false;
296  }
297  }
298  }
299  }
300 
301  return num_changed;
302 }
303 
305 {
306  std::set<GFace *> sourceFaces, otherFaces;
307  std::set<GEdge *> sourceEdges, otherEdges;
308  std::map<int, infoset> sourceFaceInfo, sourceEdgeInfo;
309  std::map<int, bool> faceSkipScaleCalc, edgeSkipScaleCalc; // Trevor Strickler
310  ExtrudeParams::calcLayerScaleFactor[0] = false; // Trevor Strickler
311  ExtrudeParams::calcLayerScaleFactor[1] = false; // Trevor Strickler
312 
313  // 2D boundary layers
314  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
315  GEdge *ge = *it;
316  if(ge->getNativeType() == GEntity::GmshModel &&
319  if(ep && ep->mesh.ExtrudeMesh && ep->geo.Mode == COPIED_ENTITY) {
320  GEdge *from = m->getEdgeByTag(std::abs(ep->geo.Source));
321  if(!from) {
322  Msg::Error("Unknown source curve %d for boundary layer",
323  ep->geo.Source);
324  return 0;
325  }
326  std::pair<bool, std::pair<int, int> > tags(
327  ep->geo.Source < 0,
328  std::pair<int, int>(ep->mesh.BoundaryLayerIndex, ep->mesh.ViewIndex));
329  sourceEdgeInfo[from->tag()].insert(tags);
330  sourceEdges.insert(from);
331  // Added to scale last layer size locally: Do not worry if one section
332  // of the boundary layer index = 0 or 1 is not supposed to be
333  // scaled...that section's normals will have scaleFactor = 1.0 (exactly
334  // 1.0 to all sig figs) ...however, if that non-scaled section borders a
335  // scaled section, the boundary normals will extrude scaled.
336  if(!ep->mesh.ScaleLast) { edgeSkipScaleCalc[from->tag()] = true; }
337  else {
338  edgeSkipScaleCalc[from->tag()] = false;
340  true;
341  }
342  }
343  }
344  }
345 
346  // 3D boundary layers
347  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
348  GFace *gf = *it;
349  if(gf->getNativeType() == GEntity::GmshModel &&
352  if(ep && ep->mesh.ExtrudeMesh && ep->geo.Mode == COPIED_ENTITY) {
353  GFace *from = m->getFaceByTag(std::abs(ep->geo.Source));
354  if(!from) {
355  Msg::Error("Unknown source face %d for boundary layer",
356  ep->geo.Source);
357  return 0;
358  }
359  std::pair<bool, std::pair<int, int> > tags(
360  ep->geo.Source < 0,
361  std::pair<int, int>(ep->mesh.BoundaryLayerIndex, ep->mesh.ViewIndex));
362  sourceFaceInfo[from->tag()].insert(tags);
363  sourceFaces.insert(from);
364  // Added to scale last layer size locally: Do not worry if one section
365  // of the boundary layer index = 0 or 1 is not supposed to be
366  // scaled...that section's normals will have scaleFactor = 1.0 (exactly
367  // 1.0 to all sig figs) ...however, if that non-scaled section borders a
368  // scaled section, the boundary normals will extrude scaled
369  if(!ep->mesh.ScaleLast) { faceSkipScaleCalc[from->tag()] = true; }
370  else {
371  faceSkipScaleCalc[from->tag()] = false;
373  true;
374  }
375  std::vector<GEdge *> const &e = from->edges();
376  sourceEdges.insert(e.begin(), e.end());
377  for(auto ite = e.begin(); ite != e.end(); ite++) {
378  if(edgeSkipScaleCalc.find((*ite)->tag()) == edgeSkipScaleCalc.end())
379  edgeSkipScaleCalc[(*ite)->tag()] = true; // a default
380  if(ep->mesh.ScaleLast) edgeSkipScaleCalc[(*ite)->tag()] = false;
381  }
382  }
383  }
384  }
385 
386  if(sourceEdges.empty() && sourceFaces.empty()) return 0;
387 
388  // Just in case ReplaceDuplicates() erases the ExtrudeParams::mesh.scaleLast
389  // flag, should check all bounding regions of this curve to see if scaleLast
390  // is set. if so, reset it in the extrudeParams (maybe this could be done in
391  // the TreeUtils.... but I do not want to change the code too much and create
392  // a bug. The developers should decide that.
395  unsigned int num_changed =
396  FixErasedExtrScaleFlags(m, faceSkipScaleCalc, edgeSkipScaleCalc);
397  if(num_changed)
398  Msg::Warning(
399  "%d entities were changed from ScaleLast = false to ScaleLast = true",
400  num_changed);
401  }
402  // compute mesh dependencies in source faces (so we can e.g. create a boundary
403  // layer on an extruded mesh)
404  std::set<GFace *> sourceFacesDependencies;
405  for(auto it = sourceFaces.begin(); it != sourceFaces.end(); it++)
406  checkDepends(m, *it, sourceFacesDependencies);
407  Msg::Info("%d dependencies in mesh of source faces",
408  sourceFacesDependencies.size());
409  for(auto it = sourceFacesDependencies.begin();
410  it != sourceFacesDependencies.end(); it++) {
411  std::vector<GEdge *> const &e = (*it)->edges();
412  sourceEdges.insert(e.begin(), e.end());
413  }
414 
415  // compute set of non-source edges and faces
416  for(auto it = m->firstEdge(); it != m->lastEdge(); it++)
417  if(sourceEdges.find(*it) == sourceEdges.end()) otherEdges.insert(*it);
418  for(auto it = m->firstFace(); it != m->lastFace(); it++)
419  if(sourceFaces.find(*it) == sourceFaces.end() &&
420  sourceFacesDependencies.find(*it) == sourceFacesDependencies.end())
421  otherFaces.insert(*it);
422 
423  // mesh source surfaces (and dependencies)
424  int nIter = 0;
425  while(1) {
426  int nPending = 0;
427  for(auto it = sourceFacesDependencies.begin();
428  it != sourceFacesDependencies.end(); it++) {
429  if((*it)->meshStatistics.status == GFace::PENDING) {
430  (*it)->mesh(true);
431  nPending++;
432  }
433  }
434  if(!nPending) break;
435  if(nIter++ > CTX::instance()->mesh.maxRetries) break;
436  }
437  for(auto it = sourceFaces.begin(); it != sourceFaces.end(); it++)
438  (*it)->mesh(true);
439 
440  // make sure the source surfaces for the boundary layers are oriented
441  // correctly (normally we do this only after the 3D mesh is done; but here
442  // it's critical since we use the normals for the extrusion)
443  std::for_each(sourceFaces.begin(), sourceFaces.end(), orientMeshGFace());
444 
445  // compute a normal field for all the source edges or faces
446  for(int i = 0; i < 2; i++) {
449  }
450  if(sourceFaces.empty())
451  addExtrudeNormals(sourceEdges, sourceEdgeInfo, edgeSkipScaleCalc);
452  else
453  addExtrudeNormals(sourceFaces, sourceFaceInfo, faceSkipScaleCalc);
454 
455  // set the position of boundary layer points using the smooth normal field
456  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
457  GEdge *ge = *it;
460  if(ep && ep->mesh.ExtrudeMesh && ep->geo.Mode == EXTRUDED_ENTITY) {
461  GVertex *vsrc, *vdest;
462  if(ge->getBeginVertex() &&
464  vsrc = ge->getEndVertex();
465  vdest = ge->getBeginVertex();
466  }
467  else {
468  vsrc = ge->getBeginVertex();
469  vdest = ge->getEndVertex();
470  }
471  if(vsrc && vdest) {
472  GPoint p = vsrc->point();
473  ep->Extrude(ep->mesh.NbLayer - 1,
474  ep->mesh.NbElmLayer[ep->mesh.NbLayer - 1], p.x(), p.y(),
475  p.z());
476  vdest->setPosition(p);
477  }
478  }
479  }
480  }
481 
482  // remesh non-source edges (since they might have been modified by the change
483  // in boundary layer points)
484  std::for_each(otherFaces.begin(), otherFaces.end(), deMeshGFace());
485  for(auto it = otherEdges.begin(); it != otherEdges.end(); it++)
486  (*it)->mesh(true);
487 
488  // mesh the curves bounding the boundary layers by extrusion using the smooth
489  // normal field
490  for(auto it = m->firstEdge(); it != m->lastEdge(); it++) {
491  GEdge *ge = *it;
493  Msg::Info("Meshing curve %d", ge->tag());
494  deMeshGEdge dem;
495  dem(ge);
496  MeshExtrudedCurve(ge);
497  }
498  }
499 
500  // recompute mean plane for plane surfaces just in case
501  for(auto it = otherFaces.begin(); it != otherFaces.end(); it++) {
502  GFace *gf = *it;
503  if(gf->geomType() == GEntity::Plane) gf->computeMeanPlane();
504  }
505 
506  // mesh non-source surfaces
507  for(auto it = otherFaces.begin(); it != otherFaces.end(); it++)
508  (*it)->mesh(true);
509 
510  // mesh the surfaces bounding the boundary layers by extrusion using the
511  // smooth normal field
512  for(auto it = m->firstFace(); it != m->lastFace(); it++) {
513  GFace *gf = *it;
515  Msg::Info("Meshing surface %d (%s)", gf->tag(),
516  gf->getTypeString().c_str());
517  deMeshGFace dem;
518  dem(gf);
520  }
521  }
522 
523  return 1;
524 }
crossprod
SVector3 crossprod(const SVector3 &a, const SVector3 &b)
Definition: SVector3.h:150
MTriangle.h
tags
static std::map< SPoint2, unsigned int > tags
Definition: drawGraph2d.cpp:400
GEntity::BoundaryLayerSurface
@ BoundaryLayerSurface
Definition: GEntity.h:116
GModel::firstEdge
eiter firstEdge()
Definition: GModel.h:356
GFace::edges
virtual std::vector< GEdge * > const & edges() const
Definition: GFace.h:121
Field.h
GPoint::y
double y() const
Definition: GPoint.h:22
distance
double distance(MVertex *v1, MVertex *v2)
Definition: MVertex.h:245
GVertex::setPosition
virtual void setPosition(GPoint &p)
Definition: GVertex.cpp:32
GFace
Definition: GFace.h:33
Msg::Info
static void Info(const char *fmt,...)
Definition: GmshMessage.cpp:587
GEntity::model
GModel * model() const
Definition: GEntity.h:277
OctreePost.h
ExtrudeParams::BoundaryLayerIndex
int BoundaryLayerIndex
Definition: ExtrudeParams.h:46
MVertex
Definition: MVertex.h:24
MElement::getDim
virtual int getDim() const =0
Msg::Warning
static void Warning(const char *fmt,...)
Definition: GmshMessage.cpp:543
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MVertex::z
double z() const
Definition: MVertex.h:62
GFace::extrude
ExtrudeParams * extrude
Definition: GFace.h:357
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
COPIED_ENTITY
#define COPIED_ENTITY
Definition: ExtrudeParams.h:18
GModel::getFaceByTag
GFace * getFaceByTag(int n) const
Definition: GModel.cpp:326
MFace::normal
SVector3 normal() const
Definition: MFace.cpp:204
smooth_data::get
bool get(double x, double y, double z, int n, double *vals) const
Definition: SmoothData.cpp:112
GFace::meshAttributes
struct GFace::@18 meshAttributes
OctreePost
Definition: BoundaryLayers.cpp:23
smooth_data::add
void add(double x, double y, double z, int n, double *vals)
Definition: SmoothData.cpp:79
SVector3
Definition: SVector3.h:16
PView.h
GEntity::getNativeType
virtual ModelType getNativeType() const
Definition: GEntity.h:268
meshGEdge.h
GEdge::extrude
ExtrudeParams * extrude
Definition: GEdge.h:257
MEdge::tangent
SVector3 tangent() const
Definition: MEdge.h:69
GModel::getEdgeByTag
GEdge * getEdgeByTag(int n) const
Definition: GModel.cpp:336
GmshMessage.h
MLine.h
GEntity::GmshModel
@ GmshModel
Definition: GEntity.h:81
ExtrudeParams::geo
struct ExtrudeParams::@15 geo
PViewData.h
GEntity
Definition: GEntity.h:31
GPoint
Definition: GPoint.h:13
MElement::getNumVertices
virtual std::size_t getNumVertices() const =0
deMeshGEdge
Definition: meshGEdge.h:18
GEdge::dim
virtual int dim() const
Definition: GEdge.h:86
GEntity::Plane
@ Plane
Definition: GEntity.h:105
GPoint::z
double z() const
Definition: GPoint.h:23
CTX::instance
static CTX * instance()
Definition: Context.cpp:122
MElement::getVertex
virtual const MVertex * getVertex(int num) const =0
SPoint3::x
double x(void) const
Definition: SPoint3.h:125
MElement::getEdge
virtual MEdge getEdge(int num) const =0
GModel::lastFace
fiter lastFace()
Definition: GModel.h:359
ExtrudeParams::mesh
struct ExtrudeParams::@14 mesh
ExtrudeParams::normalsCoherence
static std::vector< SPoint3 > normalsCoherence
Definition: ExtrudeParams.h:65
EXTRUDED_ENTITY
#define EXTRUDED_ENTITY
Definition: ExtrudeParams.h:17
GVertex
Definition: GVertex.h:23
GEntity::getTypeString
virtual std::string getTypeString()
Definition: GEntity.h:133
ExtrudeParams::ScaleLast
bool ScaleLast
Definition: ExtrudeParams.h:44
FieldManager::get
Field * get(int id)
Definition: Field.cpp:74
MElement::getFace
virtual MFace getFace(int num) const =0
GModel
Definition: GModel.h:44
GEdge::getBeginVertex
virtual GVertex * getBeginVertex() const
Definition: GEdge.h:63
ExtrudeParams::NbLayer
int NbLayer
Definition: ExtrudeParams.h:39
ExtrudeParams.h
FieldManager
Definition: Field.h:145
GEntity::geomType
virtual GeomType geomType() const
Definition: GEntity.h:238
GModel::firstFace
fiter firstFace()
Definition: GModel.h:355
GEdge::meshAttributes
struct GEdge::@16 meshAttributes
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
checkDepends
static void checkDepends(GModel *m, GFace *f, std::set< GFace * > &dep)
Definition: BoundaryLayers.cpp:243
ExtrudeParams::Mode
int Mode
Definition: ExtrudeParams.h:49
smooth_data
Definition: SmoothData.h:53
deMeshGFace
Definition: meshGFace.h:30
GModel::getFields
FieldManager * getFields()
Definition: GModel.h:325
MElement
Definition: MElement.h:30
Mesh2DWithBoundaryLayers
int Mesh2DWithBoundaryLayers(GModel *m)
Definition: BoundaryLayers.cpp:304
ExtrudeParams::NbElmLayer
std::vector< int > NbElmLayer
Definition: ExtrudeParams.h:40
GEntity::tag
int tag() const
Definition: GEntity.h:280
GEntity::BoundaryLayerCurve
@ BoundaryLayerCurve
Definition: GEntity.h:103
Field
Definition: Field.h:103
GVertex::geomType
virtual GeomType geomType() const
Definition: GVertex.h:72
smooth_data::add_scale
void add_scale(double x, double y, double z, double scale_val)
Definition: SmoothData.cpp:96
ExtrudeParams::Extrude
void Extrude(int iLayer, int iElemLayer, double &dx, double &dy, double &dz)
Definition: ExtrudeParams.cpp:51
smooth_data::normalize
void normalize()
Definition: SmoothData.cpp:129
ExtrudeParams::ExtrudeMesh
bool ExtrudeMesh
Definition: ExtrudeParams.h:36
FixErasedExtrScaleFlags
static unsigned int FixErasedExtrScaleFlags(GModel *m, std::map< int, bool > &faceSkipScaleCalc, std::map< int, bool > &edgeSkipScaleCalc)
Definition: BoundaryLayers.cpp:258
ExtrudeParams::Source
int Source
Definition: ExtrudeParams.h:51
smooth_data::end
iter end()
Definition: SmoothData.h:60
FieldManager::getBackgroundField
int getBackgroundField()
Definition: Field.h:178
GModel::firstRegion
riter firstRegion()
Definition: GModel.h:354
GModel::lastRegion
riter lastRegion()
Definition: GModel.h:358
meshGFace.h
Context.h
OctreePost::searchVector
bool searchVector(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
Definition: OctreePost.cpp:634
ExtrudeParams::ViewIndex
int ViewIndex
Definition: ExtrudeParams.h:46
z
const double z
Definition: GaussQuadratureQuad.cpp:56
MQuadrangle.h
GetAveEdgeLength
static double GetAveEdgeLength(std::vector< MVertex * > &elem_verts)
Definition: BoundaryLayers.cpp:28
ExtrudeParams::calcLayerScaleFactor
static bool calcLayerScaleFactor[2]
Definition: ExtrudeParams.h:62
orientMeshGFace
Definition: meshGFace.h:42
GEdge
Definition: GEdge.h:26
GEntity::BoundaryLayerPoint
@ BoundaryLayerPoint
Definition: GEntity.h:91
SPoint3::z
double z(void) const
Definition: SPoint3.h:129
normalize
void normalize(Quaternion &q)
Definition: Camera.cpp:370
GModel::lastEdge
eiter lastEdge()
Definition: GModel.h:360
GModel.h
addExtrudeNormals
static void addExtrudeNormals(std::vector< T * > &elements, int invert, OctreePost *octree, bool gouraud, int index, bool skipScaleCalc)
Definition: BoundaryLayers.cpp:41
OctreePost::dummy
int dummy
Definition: BoundaryLayers.cpp:24
MVertex::y
double y() const
Definition: MVertex.h:61
GEdge::getEndVertex
virtual GVertex * getEndVertex() const
Definition: GEdge.h:64
GVertex::point
virtual GPoint point() const =0
ExtrudeParams::normals
static smooth_data * normals[2]
Definition: ExtrudeParams.h:64
PView::list
static std::vector< PView * > list
Definition: PView.h:112
BoundaryLayers.h
ExtrudeParams
Definition: ExtrudeParams.h:26
GPoint::x
double x() const
Definition: GPoint.h:21
GEntity::PENDING
@ PENDING
Definition: GEntity.h:130
MeshExtrudedSurface
int MeshExtrudedSurface(GFace *gf, std::set< std::pair< MVertex *, MVertex * > > *constrainedEdges=nullptr)
Definition: meshGFaceExtruded.cpp:291
MeshExtrudedCurve
int MeshExtrudedCurve(GEdge *ge)
Definition: meshGEdgeExtruded.cpp:92
MVertex::x
double x() const
Definition: MVertex.h:60
GFace::computeMeanPlane
void computeMeanPlane(const std::vector< MVertex * > &points)
Definition: GFace.cpp:756
infoset
std::set< std::pair< bool, std::pair< int, int > > > infoset
Definition: BoundaryLayers.cpp:121