gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MElement.h
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 #ifndef MELEMENT_H
7 #define MELEMENT_H
8 
9 #include <stdio.h>
10 #include <algorithm>
11 #include <string>
12 #include <fstream>
13 
14 #include "GmshMessage.h"
15 #include "ElementType.h"
16 #include "MVertex.h"
17 #include "MEdge.h"
18 #include "MFace.h"
19 #include "FuncSpaceData.h"
20 #include "GaussIntegration.h"
21 
22 class GModel;
23 class nodalBasis;
24 class JacobianBasis;
25 class bezierCoeff;
26 template <class scalar> class fullVector;
27 template <class scalar> class fullMatrix;
28 
29 // A mesh element.
30 class MElement {
31 private:
32  // the id number of the element (this number is unique and is guaranteed never
33  // to change once a mesh has been generated, unless the mesh is explicitly
34  // renumbered)
35  std::size_t _num;
36  // the number of the mesh partition the element belongs to
37  short _partition;
38  // a visibility flag
39  char _visible;
40 
41 protected:
42  // the tolerance used to determine if a point is inside an element, in
43  // parametric coordinates
44  static double _isInsideTolerance;
45 
46 protected:
47  void _getEdgeRep(MVertex *v0, MVertex *v1, double *x, double *y, double *z,
48  SVector3 *n, int faceIndex = -1);
49  void _getFaceRep(MVertex *v0, MVertex *v1, MVertex *v2, double *x, double *y,
50  double *z, SVector3 *n);
51 #if defined(HAVE_VISUDEV)
52  void _getFaceRepQuad(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3,
53  double *x, double *y, double *z, SVector3 *n);
54 #endif
55 
56  static bool _getFaceInfo(const MFace &face, const MFace &other, int &sign,
57  int &rot);
58 
59 public:
60  MElement(std::size_t num = 0, int part = 0);
61  virtual ~MElement() {}
62 
63  // tolerance in reference coordinates to determine if a point is inside an
64  // element
65  double getTolerance() const;
66 
67  // return the tag of the element
68  virtual std::size_t getNum() const { return _num; }
69 
70  // force the immutable number (this should never be used, except when
71  // explicitly renumbering the mesh)
72  void forceNum(std::size_t num);
73 
74  // return the geometrical dimension of the element
75  virtual int getDim() const = 0;
76 
77  // return the polynomial order the element
78  virtual int getPolynomialOrder() const { return 1; }
79 
80  // return true if the element can be considered as a serendipity element
81  virtual bool getIsAssimilatedSerendipity() const
82  {
84  }
85  // return true if the element has to be considered as a serendipity element
86  virtual bool getIsOnlySerendipity() const
87  {
89  }
90 
91  // get/set the partition to which the element belongs
92  virtual int getPartition() const { return _partition; }
93  virtual void setPartition(int num) { _partition = (short)num; }
94 
95  // get/set the visibility flag
96  virtual char getVisibility() const;
97  virtual void setVisibility(char val) { _visible = val; }
98 
99  // get & set the vertices
100  virtual std::size_t getNumVertices() const = 0;
101  virtual const MVertex *getVertex(int num) const = 0;
102  virtual MVertex *getVertex(int num) = 0;
103  void getVertices(std::vector<MVertex *> &verts)
104  {
105  const auto N = getNumVertices();
106  verts.resize(N);
107  for(std::size_t i = 0; i < N; i++) verts[i] = getVertex(i);
108  }
109  virtual void setVertex(int num, MVertex *v)
110  {
111  Msg::Error("Vertex set not supported for this element");
112  }
113 
114  // give an MVertex as input and get its local number
115  virtual void getVertexInfo(const MVertex *vertex, int &ithVertex) const
116  {
117  Msg::Error("Vertex information not available for this element");
118  }
119 
120  // get the vertex using the I-deas UNV ordering
121  virtual MVertex *getVertexUNV(int num) { return getVertex(num); }
122 
123  // get the vertex using the VTK ordering
124  virtual MVertex *getVertexVTK(int num) { return getVertex(num); }
125 
126  // get the vertex using the MATLAB ordering
127  virtual MVertex *getVertexMATLAB(int num) { return getVertex(num); }
128 
129  // get the vertex using the Tochnog ordering
130  virtual MVertex *getVertexTOCHNOG(int num) { return getVertex(num); }
131 
132  // get the vertex using the Nastran BDF ordering
133  virtual MVertex *getVertexBDF(int num) { return getVertex(num); }
134 
135  // get the vertex using DIFF ordering
136  virtual MVertex *getVertexDIFF(int num) { return getVertex(num); }
137 
138  // get the vertex using INP ordering
139  virtual MVertex *getVertexINP(int num) { return getVertex(num); }
140 
141  // get the vertex using KEY ordering
142  virtual MVertex *getVertexKEY(int num) { return getVertex(num); }
143 
144  // get the vertex using RAD ordering
145  virtual MVertex *getVertexRAD(int num) { return getVertex(num); }
146 
147  // get the vertex using NEU ordering
148  virtual MVertex *getVertexNEU(int num) { return getVertex(num); }
149 
150  // get the number of vertices associated with edges, faces and volumes (i.e.
151  // internal vertices on edges, faces and volume; nonzero only for higher order
152  // elements, polygons or polyhedra) - These functions should be renamed to
153  // getNumInternal*Vertices(), to avoid confusion with getEdgeVertices() and
154  // getFaceVertices()
155  virtual int getNumEdgeVertices() const { return 0; }
156  virtual int getNumFaceVertices() const { return 0; }
157  virtual int getNumVolumeVertices() const { return 0; }
158 
159  // get the number of primary vertices (first-order element)
160  std::size_t getNumPrimaryVertices() const
161  {
164  }
165 
166  // get the edges
167  virtual int getNumEdges() const = 0;
168  virtual MEdge getEdge(int num) const = 0;
169  virtual MEdgeN getHighOrderEdge(int num, int sign);
171  {
172  int num, sign;
173  if(!getEdgeInfo(edge, num, sign)) return MEdgeN();
174  return getHighOrderEdge(num, sign);
175  }
176 
177  // give an MEdge as input and get its local number and sign
178  virtual bool getEdgeInfo(const MEdge &edge, int &ithEdge, int &sign) const;
179  virtual int numEdge2numVertex(int numEdge, int numVert) const
180  {
181  Msg::Error("Edge information not available for this element");
182  return -1;
183  }
184 
185  // get the edge using the local orientation defined by Solin
186  virtual MEdge getEdgeSolin(int numEdge) { return getEdge(numEdge); }
187 
188  // get an edge representation for drawing
189  virtual int getNumEdgesRep(bool curved) = 0;
190  virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z,
191  SVector3 *n) = 0;
192 
193  // get the faces
194  virtual int getNumFaces() = 0;
195  virtual MFace getFace(int num) const = 0;
196  virtual MFaceN getHighOrderFace(int num, int sign, int rot);
198  {
199  int num, sign, rot;
200  if(!getFaceInfo(face, num, sign, rot)) return MFaceN();
201  return this->getHighOrderFace(num, sign, rot);
202  }
203 
204  // give an MFace as input and get its local number, sign and rotation
205  virtual bool getFaceInfo(const MFace &face, int &ithFace, int &sign,
206  int &rot) const
207  {
208  Msg::Error("Face information not available for this element");
209  return false;
210  }
211 
212  // get the face using the local orientation defined by Solin
213  virtual MFace getFaceSolin(int numFace) { return getFace(numFace); }
214 
215  // get a face representation for drawing
216  virtual int getNumFacesRep(bool curved) = 0;
217  virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z,
218  SVector3 *n) = 0;
219 
220  // get all the vertices on a edge or a face
221  virtual void getEdgeVertices(const int num, std::vector<MVertex *> &v) const
222  {
223  v.resize(0);
224  }
225  virtual void getFaceVertices(const int num, std::vector<MVertex *> &v) const
226  {
227  v.resize(0);
228  }
229 
230  // get and set parent and children for hierarchial grids
231  virtual MElement *getParent() const { return nullptr; }
232  virtual void setParent(MElement *p, bool owner = false) {}
233  virtual void updateParent(GModel *gm) {} // used only for reading msh files
234  virtual int getNumChildren() const { return 0; }
235  virtual MElement *getChild(int i) const { return nullptr; }
236  virtual bool ownsParent() const { return false; }
237 
238  // get base element in case of MSubElement
239  virtual const MElement *getBaseElement() const { return this; }
240  virtual MElement *getBaseElement() { return this; }
241 
242  // get and set domain for borders
243  virtual MElement *getDomain(int i) const { return nullptr; }
244  virtual void setDomain(MElement *e, int i) {}
245 
246  // get the type of the element
247  virtual int getType() const = 0;
248 
249  // get the max/min edge length
250  virtual double maxEdge();
251  virtual double minEdge();
252 
253  // max. distance between curved and straight element among all high-order
254  // nodes
255  double maxDistToStraight() const;
256 
257  // get the quality measures
258  double skewness();
259  virtual double gammaShapeMeasure() { return 0.; }
260  virtual double etaShapeMeasure() { return 0.; }
262  {
263  double sICNMin, sICNMax;
264  signedInvCondNumRange(sICNMin, sICNMax);
265  return sICNMin;
266  }
268  {
269  double minSIGE, maxSIGE;
270  signedInvGradErrorRange(minSIGE, maxSIGE);
271  return minSIGE;
272  }
274  {
275  double jmin, jmax;
276  scaledJacRange(jmin, jmax);
277  return jmin;
278  }
279  double minIsotropyMeasure(bool knownValid = false, bool reversedOk = false);
280  double minScaledJacobian(bool knownValid = false, bool reversedOk = false);
281  virtual double angleShapeMeasure() { return 1.0; }
282  virtual void scaledJacRange(double &jmin, double &jmax,
283  GEntity *ge = nullptr) const;
284  virtual void idealJacRange(double &jmin, double &jmax, GEntity *ge = nullptr);
285  virtual void signedInvCondNumRange(double &iCNMin, double &iCNMax,
286  GEntity *ge = nullptr);
287  virtual void signedInvGradErrorRange(double &minSIGE, double &maxSIGE);
288 
289  // get the radius of the inscribed circle/sphere if it exists, otherwise get
290  // the minimum radius of all the circles/spheres tangent to the most
291  // boundaries of the element.
292  virtual double getInnerRadius() { return 0.; }
293 
294  // get the radius of the circumscribed circle/sphere if it exists, otherwise
295  // get the maximum radius of all the circles/spheres tangent to the most
296  // boundaries of the element.
297  virtual double getOuterRadius() { return 0.; }
298 
299  // compute the barycenter
300  virtual SPoint3 barycenter(bool primary = false) const;
301  // compute the barycenter without divided by the number of nodes
302  virtual SPoint3 fastBarycenter(bool primary = false) const;
303  virtual SPoint3 barycenterUVW() const;
304  // compute the barycenter in infinity norm
305  virtual SPoint3 barycenter_infty() const;
306 
307  // reverse the orientation of the element
308  virtual void reverse() {}
309 
310  // get volume of element
311  virtual double getVolume();
312 
313  // return sign of volume (+1 or -1) for 3D elements (or 0 if element has zero
314  // volume)
315  virtual int getVolumeSign();
316 
317  // compute and change the orientation of 3D elements to get positive volume
318  // (return false if element has zero volume)
319  virtual bool setVolumePositive();
320 
321  // compute the extrema of the Jacobian determinant return 1 if the element is
322  // valid, 0 if the element is invalid, -1 if the element is reversed
323  int getValidity();
324 
325  // return an information string for the element
326  virtual std::string getInfoString(bool multline);
327 
328  // get the function space for the element
329  virtual const nodalBasis *getFunctionSpace(int order = -1,
330  bool serendip = false) const;
331  virtual const FuncSpaceData getFuncSpaceData(int order = -1,
332  bool serendip = false) const;
333 
334  // get the function space for the jacobian of the element
335  virtual const JacobianBasis *
336  getJacobianFuncSpace(int orderElement = -1) const;
337  virtual const FuncSpaceData
338  getJacobianFuncSpaceData(int orderElement = -1) const;
339 
340  // return parametric coordinates (u,v,w) of a vertex
341  virtual void getNode(int num, double &u, double &v, double &w) const;
342 
343  // return the interpolating nodal shape functions evaluated at point (u,v,w)
344  // in parametric coordinates (if order == -1, use the polynomial order of the
345  // element)
346  virtual void getShapeFunctions(double u, double v, double w, double s[],
347  int order = -1) const;
348 
349  // return the gradient of the nodal shape functions evaluated at point (u,v,w)
350  // in parametric coordinates (if order == -1, use the polynomial order of the
351  // element)
352  virtual void getGradShapeFunctions(double u, double v, double w,
353  double s[][3], int order = -1) const;
354  virtual void getHessShapeFunctions(double u, double v, double w,
355  double s[][3][3], int order = -1) const;
356  virtual void getThirdDerivativeShapeFunctions(double u, double v, double w,
357  double s[][3][3][3],
358  int order = -1) const;
359  // return the Jacobian of the element evaluated at point (u,v,w) in parametric
360  // coordinates: jac[i][j] = \partial x_j / \partial u_i (beware the
361  // transposition compared to the usual definition of the Jacobian)
362  virtual double getJacobian(const fullMatrix<double> &gsf,
363  double jac[3][3]) const;
364  // To be compatible with _vgrads of functionSpace without having to put under
365  // fullMatrix form
366  virtual double getJacobian(const std::vector<SVector3> &gsf,
367  double jac[3][3]) const;
368  // jac is an row-major order array
369  virtual double getJacobian(const std::vector<SVector3> &gsf,
370  double *jac) const;
371  virtual double getJacobian(double u, double v, double w,
372  double jac[3][3]) const;
373  double getJacobian(double u, double v, double w, fullMatrix<double> &j) const;
374  virtual double getPrimaryJacobian(double u, double v, double w,
375  double jac[3][3]) const;
376  double getJacobianDeterminant(double u, double v, double w) const
377  {
378  double jac[3][3];
379  return getJacobian(u, v, w, jac);
380  }
381  void getSignedJacobian(fullVector<double> &jacobian, int o = -1) const;
382 
383  void getNodesCoord(fullMatrix<double> &nodesXYZ) const;
384  void getNodesCoordNonSerendip(fullMatrix<double> &nodesXYZ) const;
386 
387  virtual std::size_t getNumShapeFunctions() const { return getNumVertices(); }
388  virtual std::size_t getNumPrimaryShapeFunctions() const
389  {
390  return getNumPrimaryVertices();
391  }
392  virtual const MVertex *getShapeFunctionNode(int i) const
393  {
394  return getVertex(i);
395  }
396  virtual MVertex *getShapeFunctionNode(int i) { return getVertex(i); }
397 
398  // return the eigenvalues of the metric evaluated at point (u,v,w) in
399  // parametric coordinates
400  virtual double getEigenvaluesMetric(double u, double v, double w,
401  double values[3]) const;
402 
403  // get the point in cartesian coordinates corresponding to the point (u,v,w)
404  // in parametric coordinates
405  virtual void pnt(double u, double v, double w, SPoint3 &p) const;
406  virtual void pnt(double u, double v, double w, double *p) const;
407  // To be compatible with functionSpace without changing form
408  virtual void pnt(const std::vector<double> &sf, SPoint3 &p) const;
409  virtual void primaryPnt(double u, double v, double w, SPoint3 &p);
410 
411  // invert the parametrisation
412  virtual void xyz2uvw(double xyz[3], double uvw[3]) const;
413 
414  // move point between parent and element parametric spaces
415  virtual void movePointFromParentSpaceToElementSpace(double &u, double &v,
416  double &w) const;
417  virtual void movePointFromElementSpaceToParentSpace(double &u, double &v,
418  double &w) const;
419 
420  // test if a point, given in parametric coordinates, belongs to the element
421  virtual bool isInside(double u, double v, double w) const = 0;
422 
423  // interpolate the given nodal data (resp. its gradient, curl and divergence)
424  // at point (u,v,w) in parametric coordinates
425  double interpolate(double val[], double u, double v, double w, int stride = 1,
426  int order = -1);
427  void interpolateGrad(double val[], double u, double v, double w, double f[],
428  int stride = 1, double invjac[3][3] = nullptr,
429  int order = -1);
430  void interpolateCurl(double val[], double u, double v, double w, double f[],
431  int stride = 3, int order = -1);
432  double interpolateDiv(double val[], double u, double v, double w,
433  int stride = 3, int order = -1);
434 
435  // integration routines
436  virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
437  {
438  Msg::Error("No integration points defined for this type of element: %d",
439  this->getType());
440  *npts = 0;
441  *pts = nullptr;
442  }
443  double integrate(double val[], int pOrder, int stride = 1, int order = -1);
444  // val[] must contain interpolation data for face/edge vertices of given
445  // edge/face
446  double integrateCirc(double val[], int edge, int pOrder, int order = -1);
447  double integrateFlux(double val[], int face, int pOrder, int order = -1);
448 
449  // IO routines
450  virtual void writeMSH2(FILE *fp, double version = 1.0, bool binary = false,
451  int num = 0, int elementary = 1, int physical = 1,
452  int parentNum = 0, int dom1Num = 0, int dom2Num = 0,
453  std::vector<short> *ghosts = nullptr);
454  virtual void writeMSH3(FILE *fp, bool binary = false, int elementary = 1,
455  std::vector<short> *ghosts = nullptr);
456  virtual void writePOS(FILE *fp, bool printElementary, bool printElementNumber,
457  bool printSICN, bool printSIGE, bool printGamma,
458  bool printDisto, double scalingFactor = 1.0,
459  int elementary = 1);
460  virtual void writeSTL(FILE *fp, bool binary = false,
461  double scalingFactor = 1.0);
462  virtual void writeX3D(FILE *fp, double scalingFactor = 1.0);
463  virtual void writeVRML(FILE *fp);
464  virtual void writePLY2(FILE *fp);
465  virtual void writeUNV(FILE *fp, int num = 0, int elementary = 1,
466  int physical = 1);
467  virtual void writeVTK(FILE *fp, bool binary = false, bool bigEndian = false);
468  virtual void writeMATLAB(FILE *fp, int filetype, int elementary = 0,
469  int physical = 0, bool binary = false);
470  virtual void writeTOCHNOG(FILE *fp, int num);
471  virtual void writeMESH(FILE *fp, int elementTagType = 1, int elementary = 1,
472  int physical = 0);
473  virtual void writeNEU(FILE *fp, unsigned gambitType, int adjust,
474  int phys = 0);
475  virtual void writeIR3(FILE *fp, int elementTagType, int num, int elementary,
476  int physical);
477  virtual void writeBDF(FILE *fp, int format = 0, int elementTagType = 1,
478  int elementary = 1, int physical = 0);
479  virtual void writeDIFF(FILE *fp, int num, bool binary = false,
480  int physical_property = 1);
481  virtual void writeINP(FILE *fp, int num);
482  virtual void writeKEY(FILE *fp, int pid, int num);
483  virtual void writeRAD(FILE *fp, int num);
484  virtual void writeSU2(FILE *fp, int num);
485 
486  // info for specific IO formats (returning 0 means that the element is not
487  // implemented in that format)
488  virtual int getTypeForMSH() const { return 0; }
489  virtual int getTypeForUNV() const { return 0; }
490  virtual int getTypeForVTK() const { return 0; }
491  virtual const char *getStringForTOCHNOG() const { return nullptr; }
492  virtual const char *getStringForPOS() const { return nullptr; }
493  virtual const char *getStringForBDF() const { return nullptr; }
494  virtual const char *getStringForDIFF() const { return nullptr; }
495  virtual const char *getStringForINP() const { return nullptr; }
496  virtual const char *getStringForKEY() const { return nullptr; }
497  virtual const char *getStringForRAD() const { return nullptr; }
498 
499  // return the number of vertices, as well as the element name if 'name' != 0
500  static unsigned int getInfoMSH(const int typeMSH,
501  const char **const name = nullptr);
502  std::string getName();
503  virtual std::size_t getNumVerticesForMSH() { return getNumVertices(); }
504  virtual void getVerticesIdForMSH(std::vector<int> &verts);
505 
506  // copy element and parent if any, vertexMap contains the new vertices
507  virtual MElement *copy(std::map<int, MVertex *> &vertexMap,
508  std::map<MElement *, MElement *> &newParents,
509  std::map<MElement *, MElement *> &newDomains);
510 
511  // Return the number of nodes that this element must have with the other in
512  // order to put an edge between them in the dual graph used during the
513  // partitioning.
514  virtual int numCommonNodesInDualGraph(const MElement *const other) const = 0;
515 };
516 
518 public:
519  MElement *create(int type, std::vector<MVertex *> &v, std::size_t num = 0,
520  int part = 0, bool owner = false, int parent = 0,
521  MElement *parent_ptr = nullptr, MElement *d1 = nullptr,
522  MElement *d2 = nullptr);
523  MElement *create(int num, int type, const std::vector<int> &data,
524  GModel *model);
525 };
526 
528  bool operator()(const MElement *e1, const MElement *e2) const
529  {
530  return e1->getNum() < e2->getNum();
531  }
532 };
533 
535  bool operator()(const MElement *e1, const MElement *e2) const
536  {
537  return e1->getNum() == e2->getNum();
538  }
539 };
540 
542  size_t operator()(const MElement *e) const { return e->getNum(); }
543 };
544 
546  bool operator()(MElement *e1, MElement *e2) const
547  {
548  std::vector<MVertex *> v1, v2;
549  e1->getVertices(v1);
550  e2->getVertices(v2);
551  std::sort(v1.begin(), v1.end());
552  std::sort(v2.begin(), v2.end());
553  return v1 < v2;
554  }
555 };
556 
557 #endif
MElement::getJacobianFuncSpaceData
virtual const FuncSpaceData getJacobianFuncSpaceData(int orderElement=-1) const
Definition: MElement.cpp:686
MElement::minSIGEShapeMeasure
double minSIGEShapeMeasure()
Definition: MElement.h:267
MElement::getNum
virtual std::size_t getNum() const
Definition: MElement.h:68
MElement::getIsOnlySerendipity
virtual bool getIsOnlySerendipity() const
Definition: MElement.h:86
MElementPtrHash::operator()
size_t operator()(const MElement *e) const
Definition: MElement.h:542
MElement::xyz2uvw
virtual void xyz2uvw(double xyz[3], double uvw[3]) const
Definition: MElement.cpp:1128
MElement::getFaceInfo
virtual bool getFaceInfo(const MFace &face, int &ithFace, int &sign, int &rot) const
Definition: MElement.h:205
MElement::barycenter_infty
virtual SPoint3 barycenter_infty() const
Definition: MElement.cpp:499
MElement::getNumFacesRep
virtual int getNumFacesRep(bool curved)=0
MElement::integrateFlux
double integrateFlux(double val[], int face, int pOrder, int order=-1)
Definition: MElement.cpp:1322
MElement::getNodesCoordNonSerendip
void getNodesCoordNonSerendip(fullMatrix< double > &nodesXYZ) const
Definition: MElement.cpp:980
MElement::getPrimaryJacobian
virtual double getPrimaryJacobian(double u, double v, double w, double jac[3][3]) const
Definition: MElement.cpp:939
MElement::getStringForTOCHNOG
virtual const char * getStringForTOCHNOG() const
Definition: MElement.h:491
MElement::setVolumePositive
virtual bool setVolumePositive()
Definition: MElement.cpp:591
MElement::getVertexVTK
virtual MVertex * getVertexVTK(int num)
Definition: MElement.h:124
MEdge
Definition: MEdge.h:14
MElement::getHighOrderFace
virtual MFaceN getHighOrderFace(int num, int sign, int rot)
Definition: MElement.cpp:207
MElement::getVertexDIFF
virtual MVertex * getVertexDIFF(int num)
Definition: MElement.h:136
MElementPtrLessThan::operator()
bool operator()(const MElement *e1, const MElement *e2) const
Definition: MElement.h:528
MElement::writeMSH2
virtual void writeMSH2(FILE *fp, double version=1.0, bool binary=false, int num=0, int elementary=1, int physical=1, int parentNum=0, int dom1Num=0, int dom2Num=0, std::vector< short > *ghosts=nullptr)
Definition: MElement.cpp:1368
MElement::getVertexBDF
virtual MVertex * getVertexBDF(int num)
Definition: MElement.h:133
MElement::getBaseElement
virtual const MElement * getBaseElement() const
Definition: MElement.h:239
MElement::getDomain
virtual MElement * getDomain(int i) const
Definition: MElement.h:243
MElement::forceNum
void forceNum(std::size_t num)
Definition: MElement.cpp:54
MElement::writePLY2
virtual void writePLY2(FILE *fp)
Definition: MElement.cpp:1661
fullVector
Definition: MElement.h:26
MElement::getEdgeRep
virtual void getEdgeRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)=0
MElement::getTypeForVTK
virtual int getTypeForVTK() const
Definition: MElement.h:490
MElement::getTypeForMSH
virtual int getTypeForMSH() const
Definition: MElement.h:488
MElement::getVertexKEY
virtual MVertex * getVertexKEY(int num)
Definition: MElement.h:142
MElement::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MElement.h:436
MElement::getStringForPOS
virtual const char * getStringForPOS() const
Definition: MElement.h:492
MElementFactory
Definition: MElement.h:517
MElement::setPartition
virtual void setPartition(int num)
Definition: MElement.h:93
MElement::getFaceVertices
virtual void getFaceVertices(const int num, std::vector< MVertex * > &v) const
Definition: MElement.h:225
MElement::getOuterRadius
virtual double getOuterRadius()
Definition: MElement.h:297
MElement::writeX3D
virtual void writeX3D(FILE *fp, double scalingFactor=1.0)
Definition: MElement.cpp:1643
MElement::getVertex
virtual MVertex * getVertex(int num)=0
MElement::getValidity
int getValidity()
Definition: MElement.cpp:600
MVertex
Definition: MVertex.h:24
MElement::getDim
virtual int getDim() const =0
MElementPtrLessThan
Definition: MElement.h:527
MElement::writeUNV
virtual void writeUNV(FILE *fp, int num=0, int elementary=1, int physical=1)
Definition: MElement.cpp:1741
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MElement::getEdgeInfo
virtual bool getEdgeInfo(const MEdge &edge, int &ithEdge, int &sign) const
Definition: MElement.cpp:189
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
MElement::maxDistToStraight
double maxDistToStraight() const
Definition: MElement.cpp:256
MElement::writeMSH3
virtual void writeMSH3(FILE *fp, bool binary=false, int elementary=1, std::vector< short > *ghosts=nullptr)
Definition: MElement.cpp:1473
MElement::getParent
virtual MElement * getParent() const
Definition: MElement.h:231
MElement::getHighOrderEdge
virtual MEdgeN getHighOrderEdge(int num, int sign)
Definition: MElement.cpp:171
MElement::MElement
MElement(std::size_t num=0, int part=0)
Definition: MElement.cpp:40
MElement::getStringForBDF
virtual const char * getStringForBDF() const
Definition: MElement.h:493
ElementType::getSerendipity
int getSerendipity(int type)
Definition: ElementType.cpp:598
MElement::getThirdDerivativeShapeFunctions
virtual void getThirdDerivativeShapeFunctions(double u, double v, double w, double s[][3][3][3], int order=-1) const
Definition: MElement.cpp:488
MElement::getShapeFunctionNode
virtual const MVertex * getShapeFunctionNode(int i) const
Definition: MElement.h:392
SVector3
Definition: SVector3.h:16
GaussIntegration.h
MElement::writeNEU
virtual void writeNEU(FILE *fp, unsigned gambitType, int adjust, int phys=0)
Definition: MElement.cpp:1786
MElement::minScaledJacobian
double minScaledJacobian(bool knownValid=false, bool reversedOk=false)
Definition: MElement.cpp:289
MElement::getStringForINP
virtual const char * getStringForINP() const
Definition: MElement.h:495
MElement::writeIR3
virtual void writeIR3(FILE *fp, int elementTagType, int num, int elementary, int physical)
Definition: MElement.cpp:1800
MElement::getEigenvaluesMetric
virtual double getEigenvaluesMetric(double u, double v, double w, double values[3]) const
Definition: MElement.cpp:1022
MElement::getEdgeVertices
virtual void getEdgeVertices(const int num, std::vector< MVertex * > &v) const
Definition: MElement.h:221
MElement::writeVRML
virtual void writeVRML(FILE *fp)
Definition: MElement.cpp:1669
MElement::writeTOCHNOG
virtual void writeTOCHNOG(FILE *fp, int num)
Definition: MElement.cpp:1676
GmshMessage.h
MElement::getVertexMATLAB
virtual MVertex * getVertexMATLAB(int num)
Definition: MElement.h:127
MElement::setParent
virtual void setParent(MElement *p, bool owner=false)
Definition: MElement.h:232
MElement::copy
virtual MElement * copy(std::map< int, MVertex * > &vertexMap, std::map< MElement *, MElement * > &newParents, std::map< MElement *, MElement * > &newDomains)
Definition: MElement.cpp:2486
MElement::getHessShapeFunctions
virtual void getHessShapeFunctions(double u, double v, double w, double s[][3][3], int order=-1) const
Definition: MElement.cpp:478
GEntity
Definition: GEntity.h:31
MElement::getNumVertices
virtual std::size_t getNumVertices() const =0
MElement::setVertex
virtual void setVertex(int num, MVertex *v)
Definition: MElement.h:109
MElement::getVertexINP
virtual MVertex * getVertexINP(int num)
Definition: MElement.h:139
MElement::ownsParent
virtual bool ownsParent() const
Definition: MElement.h:236
MElement::minEdge
virtual double minEdge()
Definition: MElement.cpp:236
MElement::getVertexUNV
virtual MVertex * getVertexUNV(int num)
Definition: MElement.h:121
MElement::getSignedJacobian
void getSignedJacobian(fullVector< double > &jacobian, int o=-1) const
Definition: MElement.cpp:961
MElement::updateParent
virtual void updateParent(GModel *gm)
Definition: MElement.h:233
MElement::getVertex
virtual const MVertex * getVertex(int num) const =0
fullMatrix
Definition: MElement.h:27
MElement::getEdge
virtual MEdge getEdge(int num) const =0
MElement::writeSU2
virtual void writeSU2(FILE *fp, int num)
Definition: MElement.cpp:2046
MFace
Definition: MFace.h:20
MElement::primaryPnt
virtual void primaryPnt(double u, double v, double w, SPoint3 &p)
Definition: MElement.cpp:1114
MElement::_getEdgeRep
void _getEdgeRep(MVertex *v0, MVertex *v1, double *x, double *y, double *z, SVector3 *n, int faceIndex=-1)
Definition: MElement.cpp:107
MFace.h
MElement::getNumEdgesRep
virtual int getNumEdgesRep(bool curved)=0
MElement::fastBarycenter
virtual SPoint3 fastBarycenter(bool primary=false) const
Definition: MElement.cpp:536
MElement::interpolateGrad
void interpolateGrad(double val[], double u, double v, double w, double f[], int stride=1, double invjac[3][3]=nullptr, int order=-1)
Definition: MElement.cpp:1230
MElement::getType
virtual int getType() const =0
MElement::getVertexRAD
virtual MVertex * getVertexRAD(int num)
Definition: MElement.h:145
MElement::getNumChildren
virtual int getNumChildren() const
Definition: MElement.h:234
bezierCoeff
Definition: bezierBasis.h:127
MElement::getNumFaces
virtual int getNumFaces()=0
MElement::getNumFaceVertices
virtual int getNumFaceVertices() const
Definition: MElement.h:156
MElement::getEdgeSolin
virtual MEdge getEdgeSolin(int numEdge)
Definition: MElement.h:186
MVertex.h
MElement::getNumVolumeVertices
virtual int getNumVolumeVertices() const
Definition: MElement.h:157
MElement::getStringForRAD
virtual const char * getStringForRAD() const
Definition: MElement.h:497
MElement::numEdge2numVertex
virtual int numEdge2numVertex(int numEdge, int numVert) const
Definition: MElement.h:179
MElement::getNumEdgeVertices
virtual int getNumEdgeVertices() const
Definition: MElement.h:155
MElement::getVolume
virtual double getVolume()
Definition: MElement.cpp:567
MElement::getFace
virtual MFace getFace(int num) const =0
GModel
Definition: GModel.h:44
MElement::writeDIFF
virtual void writeDIFF(FILE *fp, int num, bool binary=false, int physical_property=1)
Definition: MElement.cpp:1877
MElement::getNumShapeFunctions
virtual std::size_t getNumShapeFunctions() const
Definition: MElement.h:387
MElement::writeINP
virtual void writeINP(FILE *fp, int num)
Definition: MElement.cpp:1898
MElement::movePointFromElementSpaceToParentSpace
virtual void movePointFromElementSpaceToParentSpace(double &u, double &v, double &w) const
Definition: MElement.cpp:1202
MElement::_getFaceInfo
static bool _getFaceInfo(const MFace &face, const MFace &other, int &sign, int &rot)
Definition: MElement.cpp:66
MElement::getNumPrimaryShapeFunctions
virtual std::size_t getNumPrimaryShapeFunctions() const
Definition: MElement.h:388
MElement::interpolateCurl
void interpolateCurl(double val[], double u, double v, double w, double f[], int stride=3, int order=-1)
Definition: MElement.cpp:1253
MElement::reverse
virtual void reverse()
Definition: MElement.h:308
MElement::getIsAssimilatedSerendipity
virtual bool getIsAssimilatedSerendipity() const
Definition: MElement.h:81
MElement::etaShapeMeasure
virtual double etaShapeMeasure()
Definition: MElement.h:260
MElement::getVertexTOCHNOG
virtual MVertex * getVertexTOCHNOG(int num)
Definition: MElement.h:130
MElement::_isInsideTolerance
static double _isInsideTolerance
Definition: MElement.h:44
MElement
Definition: MElement.h:30
MElement::getVertexInfo
virtual void getVertexInfo(const MVertex *vertex, int &ithVertex) const
Definition: MElement.h:115
MElementPtrEqual
Definition: MElement.h:534
MElement::_visible
char _visible
Definition: MElement.h:39
MElement::getVerticesIdForMSH
virtual void getVerticesIdForMSH(std::vector< int > &verts)
Definition: MElement.cpp:2479
MElement::getVertexNEU
virtual MVertex * getVertexNEU(int num)
Definition: MElement.h:148
MElement::writeMATLAB
virtual void writeMATLAB(FILE *fp, int filetype, int elementary=0, int physical=0, bool binary=false)
Definition: MElement.cpp:1711
MElement::getBaseElement
virtual MElement * getBaseElement()
Definition: MElement.h:240
MElement::_num
std::size_t _num
Definition: MElement.h:35
MElement::numCommonNodesInDualGraph
virtual int numCommonNodesInDualGraph(const MElement *const other) const =0
MElement::signedInvCondNumRange
virtual void signedInvCondNumRange(double &iCNMin, double &iCNMax, GEntity *ge=nullptr)
Definition: MElement.cpp:389
MElement::getTolerance
double getTolerance() const
Definition: MElement.cpp:61
MElement::getInfoString
virtual std::string getInfoString(bool multline)
Definition: MElement.cpp:616
MElementFactory::create
MElement * create(int type, std::vector< MVertex * > &v, std::size_t num=0, int part=0, bool owner=false, int parent=0, MElement *parent_ptr=nullptr, MElement *d1=nullptr, MElement *d2=nullptr)
Definition: MElement.cpp:2556
MElement::_partition
short _partition
Definition: MElement.h:37
MElement::pnt
virtual void pnt(double u, double v, double w, SPoint3 &p) const
Definition: MElement.cpp:1072
MElement::integrate
double integrate(double val[], int pOrder, int stride=1, int order=-1)
Definition: MElement.cpp:1279
FuncSpaceData
Definition: FuncSpaceData.h:16
MElement::getVertices
void getVertices(std::vector< MVertex * > &verts)
Definition: MElement.h:103
MElement::gammaShapeMeasure
virtual double gammaShapeMeasure()
Definition: MElement.h:259
MElement::minSICNShapeMeasure
double minSICNShapeMeasure()
Definition: MElement.h:261
MElement::writeRAD
virtual void writeRAD(FILE *fp, int num)
Definition: MElement.cpp:1959
MElement::_getFaceRep
void _getFaceRep(MVertex *v0, MVertex *v1, MVertex *v2, double *x, double *y, double *z, SVector3 *n)
Definition: MElement.cpp:146
MElementPtrLessThanVertices::operator()
bool operator()(MElement *e1, MElement *e2) const
Definition: MElement.h:546
MElement::getStringForKEY
virtual const char * getStringForKEY() const
Definition: MElement.h:496
MElement::getStringForDIFF
virtual const char * getStringForDIFF() const
Definition: MElement.h:494
MElement::integrateCirc
double integrateCirc(double val[], int edge, int pOrder, int order=-1)
Definition: MElement.cpp:1296
MEdge.h
MElement::writeMESH
virtual void writeMESH(FILE *fp, int elementTagType=1, int elementary=1, int physical=0)
Definition: MElement.cpp:1766
MElement::getNodesCoord
void getNodesCoord(fullMatrix< double > &nodesXYZ) const
Definition: MElement.cpp:969
MElement::movePointFromParentSpaceToElementSpace
virtual void movePointFromParentSpaceToElementSpace(double &u, double &v, double &w) const
Definition: MElement.cpp:1188
MElement::getBezierVerticesCoord
bezierCoeff * getBezierVerticesCoord() const
Definition: MElement.cpp:998
MEdgeN
Definition: MEdge.h:136
nodalBasis
Definition: nodalBasis.h:12
IntPt
Definition: GaussIntegration.h:12
MElement::getFuncSpaceData
virtual const FuncSpaceData getFuncSpaceData(int order=-1, bool serendip=false) const
Definition: MElement.cpp:673
MElement::~MElement
virtual ~MElement()
Definition: MElement.h:61
MElement::getShapeFunctionNode
virtual MVertex * getShapeFunctionNode(int i)
Definition: MElement.h:396
MElement::getChild
virtual MElement * getChild(int i) const
Definition: MElement.h:235
z
const double z
Definition: GaussQuadratureQuad.cpp:56
FuncSpaceData.h
JacobianBasis
Definition: JacobianBasis.h:60
MElement::getInnerRadius
virtual double getInnerRadius()
Definition: MElement.h:292
MElement::getNumPrimaryVertices
std::size_t getNumPrimaryVertices() const
Definition: MElement.h:160
MFaceN
Definition: MFace.h:145
MElement::getInfoMSH
static unsigned int getInfoMSH(const int typeMSH, const char **const name=nullptr)
Definition: MElement.cpp:2057
MElement::interpolateDiv
double interpolateDiv(double val[], double u, double v, double w, int stride=3, int order=-1)
Definition: MElement.cpp:1267
MElement::writeVTK
virtual void writeVTK(FILE *fp, bool binary=false, bool bigEndian=false)
Definition: MElement.cpp:1689
MElement::getJacobianDeterminant
double getJacobianDeterminant(double u, double v, double w) const
Definition: MElement.h:376
MElement::idealJacRange
virtual void idealJacRange(double &jmin, double &jmax, GEntity *ge=nullptr)
Definition: MElement.cpp:337
MElementPtrHash
Definition: MElement.h:541
MElement::isInside
virtual bool isInside(double u, double v, double w) const =0
MElement::getJacobianFuncSpace
virtual const JacobianBasis * getJacobianFuncSpace(int orderElement=-1) const
Definition: MElement.cpp:679
MElement::getShapeFunctions
virtual void getShapeFunctions(double u, double v, double w, double s[], int order=-1) const
Definition: MElement.cpp:458
MElement::signedInvGradErrorRange
virtual void signedInvGradErrorRange(double &minSIGE, double &maxSIGE)
Definition: MElement.cpp:440
MElement::angleShapeMeasure
virtual double angleShapeMeasure()
Definition: MElement.h:281
MElementPtrEqual::operator()
bool operator()(const MElement *e1, const MElement *e2) const
Definition: MElement.h:535
MElement::maxEdge
virtual double maxEdge()
Definition: MElement.cpp:246
MElement::barycenter
virtual SPoint3 barycenter(bool primary=false) const
Definition: MElement.cpp:520
MElement::getNode
virtual void getNode(int num, double &u, double &v, double &w) const
Definition: MElement.cpp:448
MElement::writeSTL
virtual void writeSTL(FILE *fp, bool binary=false, double scalingFactor=1.0)
Definition: MElement.cpp:1593
MElement::getVolumeSign
virtual int getVolumeSign()
Definition: MElement.cpp:580
MElement::setVisibility
virtual void setVisibility(char val)
Definition: MElement.h:97
MElement::getJacobian
virtual double getJacobian(const fullMatrix< double > &gsf, double jac[3][3]) const
Definition: MElement.cpp:868
MElement::getHighOrderEdge
MEdgeN getHighOrderEdge(const MEdge &edge)
Definition: MElement.h:170
MElement::getNumVerticesForMSH
virtual std::size_t getNumVerticesForMSH()
Definition: MElement.h:503
MElement::getName
std::string getName()
Definition: MElement.cpp:2472
MElement::getTypeForUNV
virtual int getTypeForUNV() const
Definition: MElement.h:489
MElementPtrLessThanVertices
Definition: MElement.h:545
MElement::getVisibility
virtual char getVisibility() const
Definition: MElement.cpp:165
MElement::getPolynomialOrder
virtual int getPolynomialOrder() const
Definition: MElement.h:78
MElement::getHighOrderFace
MFaceN getHighOrderFace(const MFace &face)
Definition: MElement.h:197
MElement::distoShapeMeasure
double distoShapeMeasure()
Definition: MElement.h:273
MElement::getFunctionSpace
virtual const nodalBasis * getFunctionSpace(int order=-1, bool serendip=false) const
Definition: MElement.cpp:666
ElementType.h
MElement::getPartition
virtual int getPartition() const
Definition: MElement.h:92
MElement::getFaceSolin
virtual MFace getFaceSolin(int numFace)
Definition: MElement.h:213
MElement::minIsotropyMeasure
double minIsotropyMeasure(bool knownValid=false, bool reversedOk=false)
Definition: MElement.cpp:280
MElement::getNumEdges
virtual int getNumEdges() const =0
MElement::getFaceRep
virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n)=0
MElement::writePOS
virtual void writePOS(FILE *fp, bool printElementary, bool printElementNumber, bool printSICN, bool printSIGE, bool printGamma, bool printDisto, double scalingFactor=1.0, int elementary=1)
Definition: MElement.cpp:1515
MElement::interpolate
double interpolate(double val[], double u, double v, double w, int stride=1, int order=-1)
Definition: MElement.cpp:1216
MElement::barycenterUVW
virtual SPoint3 barycenterUVW() const
Definition: MElement.cpp:550
MElement::scaledJacRange
virtual void scaledJacRange(double &jmin, double &jmax, GEntity *ge=nullptr) const
Definition: MElement.cpp:298
MElement::skewness
double skewness()
Definition: MElement.cpp:2751
MElement::setDomain
virtual void setDomain(MElement *e, int i)
Definition: MElement.h:244
MElement::getGradShapeFunctions
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int order=-1) const
Definition: MElement.cpp:468
MElement::writeBDF
virtual void writeBDF(FILE *fp, int format=0, int elementTagType=1, int elementary=1, int physical=0)
Definition: MElement.cpp:1818
MElement::writeKEY
virtual void writeKEY(FILE *fp, int pid, int num)
Definition: MElement.cpp:1912