MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
mesh.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_MESH
13 #define MFEM_MESH
14 
15 #include "../config/config.hpp"
16 #include "../general/stable3d.hpp"
17 #include "triangle.hpp"
18 #include "tetrahedron.hpp"
19 #include "vertex.hpp"
20 #include "ncmesh.hpp"
21 #include "../fem/eltrans.hpp"
22 #include "../fem/coefficient.hpp"
23 #include <iostream>
24 #include <fstream>
25 #include <limits>
26 
27 namespace mfem
28 {
29 
30 // Data type mesh
31 
32 class KnotVector;
33 class NURBSExtension;
34 class FiniteElementSpace;
35 class GridFunction;
36 struct Refinement;
37 class named_ifstream;
38 
39 #ifdef MFEM_USE_MPI
40 class ParMesh;
41 class ParNCMesh;
42 #endif
43 
44 
45 class Mesh
46 {
47 #ifdef MFEM_USE_MPI
48  friend class ParMesh;
49  friend class ParNCMesh;
50 #endif
51  friend class NURBSExtension;
52 
53 protected:
54  int Dim;
55  int spaceDim;
56 
59 
60  int BaseGeom, BaseBdrGeom; // element base geometries, -1 if not all the same
61 
62  int meshgen; // see MeshGenerator()
63 
64  // Counter for Mesh transformations: refinement, derefinement, rebalancing.
65  // Used for checking during Update operations on objects depending on the
66  // Mesh, such as FiniteElementSpace, GridFunction, etc.
67  long sequence;
68 
70  // Vertices are only at the corners of elements, where you would expect them
71  // in the lowest-order mesh.
75 
76  struct FaceInfo
77  {
78  // Inf = 64 * LocalFaceIndex + FaceOrientation
80  int NCFace; /* -1 if this is a regular conforming/boundary face;
81  index into 'nc_faces_info' if >= 0. */
82  };
83  // NOTE: in NC meshes, master faces have Elem2No == -1. Slave faces on the
84  // other hand have Elem2No and Elem2Inf set to the master face's element and
85  // its local face number.
86 
87  struct NCFaceInfo
88  {
89  bool Slave; // true if this is a slave face, false if master face
90  int MasterFace; // if Slave, this is the index of the master face
91  const DenseMatrix* PointMatrix; // if Slave, position within master face
92  // (NOTE: PointMatrix points to a matrix owned by NCMesh.)
93 
94  NCFaceInfo(bool slave, int master, const DenseMatrix* pm)
95  : Slave(slave), MasterFace(master), PointMatrix(pm) {}
96  };
97 
100 
105  Table *bel_to_edge; // for 3D
107  mutable Table *face_edge;
108  mutable Table *edge_vertex;
109 
113 
114  // refinement embeddings for forward compatibility with NCMesh
116 
117  // Nodes are only active for higher order meshes, and share locations with
118  // the vertices, plus all the higher- order control points within the
119  // element and along the edges and on the faces.
122 
123  static const int vtk_quadratic_tet[10];
124  static const int vtk_quadratic_hex[27];
125 
126 #ifdef MFEM_USE_MEMALLOC
127  friend class Tetrahedron;
129 #endif
130 
131 public:
137 
139 
142 
145 
146 protected:
148 
149  void Init();
150 
151  void InitTables();
152 
153  void DeleteTables();
154 
155  Element *ReadElementWithoutAttr(std::istream &);
156  static void PrintElementWithoutAttr(const Element *, std::ostream &);
157 
158  Element *ReadElement(std::istream &);
159  static void PrintElement(const Element *, std::ostream &);
160 
161  // Readers for different mesh formats, used in the Load() method.
162  // The implementations of these methods are in mesh_readers.cpp.
163  void ReadMFEMMesh(std::istream &input, bool mfem_v11, int &curved);
164  void ReadLineMesh(std::istream &input);
165  void ReadNetgen2DMesh(std::istream &input, int &curved);
166  void ReadNetgen3DMesh(std::istream &input);
167  void ReadTrueGridMesh(std::istream &input);
168  void ReadVTKMesh(std::istream &input, int &curved, int &read_gf);
169  void ReadNURBSMesh(std::istream &input, int &curved, int &read_gf);
170  void ReadInlineMesh(std::istream &input, int generate_edges = 0);
171  void ReadGmshMesh(std::istream &input);
172  /* Note NetCDF (optional library) is used for reading cubit files */
173 #ifdef MFEM_USE_NETCDF
174  void ReadCubit(named_ifstream &input, int &curved, int &read_gf);
175 #endif
176 
177  static void skip_comment_lines(std::istream &is, const char comment_char)
178  {
179  while (1)
180  {
181  is >> std::ws;
182  if (is.peek() != comment_char) { break; }
183  is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
184  }
185  }
186  // Check for, and remove, a trailing '\r'.
187  static void filter_dos(std::string &line)
188  {
189  if (!line.empty() && *line.rbegin() == '\r')
190  { line.resize(line.size()-1); }
191  }
192 
193  void SetMeshGen(); // set 'meshgen'
194 
196  double GetLength(int i, int j) const;
197 
200  void GetElementJacobian(int i, DenseMatrix &J);
201 
202  void MarkForRefinement();
204  void GetEdgeOrdering(DSTable &v_to_v, Array<int> &order);
206 
207  void PrepareNodeReorder(DSTable **old_v_to_v, Table **old_elem_vert);
208  void DoNodeReorder(DSTable *old_v_to_v, Table *old_elem_vert);
209 
211  STable3D *GetElementToFaceTable(int ret_ftbl = 0);
212 
215  void RedRefinement(int i, const DSTable &v_to_v,
216  int *edge1, int *edge2, int *middle)
217  { UniformRefinement(i, v_to_v, edge1, edge2, middle); }
218 
221  void GreenRefinement(int i, const DSTable &v_to_v,
222  int *edge1, int *edge2, int *middle)
223  { Bisection(i, v_to_v, edge1, edge2, middle); }
224 
226  void Bisection(int i, const DSTable &, int *, int *, int *);
227 
229  void Bisection(int i, const DSTable &, int *);
230 
232  void UniformRefinement(int i, const DSTable &, int *, int *, int *);
233 
236  void AverageVertices (int * indexes, int n, int result);
237 
239  int FindCoarseElement(int i);
240 
242  void UpdateNodes();
243 
245  virtual void QuadUniformRefinement();
246 
248  virtual void HexUniformRefinement();
249 
251  virtual void NURBSUniformRefinement();
252 
254  virtual void LocalRefinement(const Array<int> &marked_el, int type = 3);
255 
257  virtual void NonconformingRefinement(const Array<Refinement> &refinements,
258  int nc_limit = 0);
259 
261  virtual bool NonconformingDerefinement(Array<double> &elem_error,
262  double threshold, int nc_limit = 0,
263  int op = 1);
264 
266  void DerefineMesh(const Array<int> &derefinements);
267 
269  void LoadPatchTopo(std::istream &input, Array<int> &edge_to_knot);
270 
271  void UpdateNURBS();
272 
273  void PrintTopo(std::ostream &out, const Array<int> &e_to_k) const;
274 
278  int i);
280  int i);
283  int i);
286  int i);
288  void GetLocalFaceTransformation(int face_type, int elem_type,
290  int inf);
294  const FaceInfo &fi);
295  bool IsSlaveFace(const FaceInfo &fi) const;
296 
298  static int GetTriOrientation (const int * base, const int * test);
300  static int GetQuadOrientation (const int * base, const int * test);
301 
302  static void GetElementArrayEdgeTable(const Array<Element*> &elem_array,
303  const DSTable &v_to_v,
304  Table &el_to_edge);
305 
309  void GetVertexToVertexTable(DSTable &) const;
310 
317 
319  void AddPointFaceElement(int lf, int gf, int el);
320 
321  void AddSegmentFaceElement (int lf, int gf, int el, int v0, int v1);
322 
323  void AddTriangleFaceElement (int lf, int gf, int el,
324  int v0, int v1, int v2);
325 
326  void AddQuadFaceElement (int lf, int gf, int el,
327  int v0, int v1, int v2, int v3);
331  bool FaceIsTrueInterior(int FaceNo) const
332  {
333  return FaceIsInterior(FaceNo) || (faces_info[FaceNo].Elem2Inf >= 0);
334  }
335 
336  // shift cyclically 3 integers left-to-right
337  inline static void ShiftL2R(int &, int &, int &);
338  // shift cyclically 3 integers so that the smallest is first
339  inline static void Rotate3(int &, int &, int &);
340 
341  void FreeElement (Element *E);
342 
343  void GenerateFaces();
344  void GenerateNCFaceInfo();
345 
347  void InitMesh(int _Dim, int _spaceDim, int NVert, int NElem, int NBdrElem);
348 
349  void InitBaseGeom();
350 
355  void Make3D(int nx, int ny, int nz, Element::Type type, int generate_edges,
356  double sx, double sy, double sz);
357 
362  void Make2D(int nx, int ny, Element::Type type, int generate_edges,
363  double sx, double sy);
364 
366  void Make1D(int n, double sx = 1.0);
367 
369  void InitFromNCMesh(const NCMesh &ncmesh);
370 
372  Mesh(const NCMesh &ncmesh);
373 
376  void Swap(Mesh& other, bool non_geometry = false);
377 
378 public:
379 
380  Mesh() { Init(); InitTables(); meshgen = 0; Dim = 0; }
381 
386  explicit Mesh(const Mesh &mesh, bool copy_nodes = true);
387 
388  Mesh(int _Dim, int NVert, int NElem, int NBdrElem = 0, int _spaceDim= -1)
389  {
390  if (_spaceDim == -1)
391  {
392  _spaceDim = _Dim;
393  }
394  InitMesh(_Dim, _spaceDim, NVert, NElem, NBdrElem);
395  }
396 
397  Element *NewElement(int geom);
398 
399  void AddVertex(const double *);
400  void AddTri(const int *vi, int attr = 1);
401  void AddTriangle(const int *vi, int attr = 1);
402  void AddQuad(const int *vi, int attr = 1);
403  void AddTet(const int *vi, int attr = 1);
404  void AddHex(const int *vi, int attr = 1);
405  void AddHexAsTets(const int *vi, int attr = 1);
406  // 'elem' should be allocated using the NewElement method
407  void AddElement(Element *elem) { elements[NumOfElements++] = elem; }
408  void AddBdrElement(Element *elem) { boundary[NumOfBdrElements++] = elem; }
409  void AddBdrSegment(const int *vi, int attr = 1);
410  void AddBdrTriangle(const int *vi, int attr = 1);
411  void AddBdrQuad(const int *vi, int attr = 1);
412  void AddBdrQuadAsTriangles(const int *vi, int attr = 1);
414  void FinalizeTriMesh(int generate_edges = 0, int refine = 0,
415  bool fix_orientation = true);
416  void FinalizeQuadMesh(int generate_edges = 0, int refine = 0,
417  bool fix_orientation = true);
418  void FinalizeTetMesh(int generate_edges = 0, int refine = 0,
419  bool fix_orientation = true);
420  void FinalizeHexMesh(int generate_edges = 0, int refine = 0,
421  bool fix_orientation = true);
422 
423  void SetAttributes();
424 
425 #ifdef MFEM_USE_GECKO
426 
430  void GetGeckoElementReordering(Array<int> &ordering);
431 #endif
432 
436  void ReorderElements(const Array<int> &ordering, bool reorder_vertices = true);
437 
442  Mesh(int nx, int ny, int nz, Element::Type type, int generate_edges = 0,
443  double sx = 1.0, double sy = 1.0, double sz = 1.0)
444  {
445  Make3D(nx, ny, nz, type, generate_edges, sx, sy, sz);
446  }
447 
452  Mesh(int nx, int ny, Element::Type type, int generate_edges = 0,
453  double sx = 1.0, double sy = 1.0)
454  {
455  Make2D(nx, ny, type, generate_edges, sx, sy);
456  }
457 
459  explicit Mesh(int n, double sx = 1.0)
460  {
461  Make1D(n, sx);
462  }
463 
467  Mesh(const char *filename, int generate_edges = 0, int refine = 1,
468  bool fix_orientation = true);
469 
473  Mesh(std::istream &input, int generate_edges = 0, int refine = 1,
474  bool fix_orientation = true);
475 
477  Mesh(Mesh *mesh_array[], int num_pieces);
478 
479  /* This is similar to the above mesh constructor, but here the current
480  mesh is destroyed and another one created based on the data stream
481  again given in MFEM, netgen, or VTK format. If generate_edges = 0
482  (default) edges are not generated, if 1 edges are generated. */
483  void Load(std::istream &input, int generate_edges = 0, int refine = 1,
484  bool fix_orientation = true);
485 
489  inline int MeshGenerator() { return meshgen; }
490 
493  inline int GetNV() const { return NumOfVertices; }
494 
496  inline int GetNE() const { return NumOfElements; }
497 
499  inline int GetNBE() const { return NumOfBdrElements; }
500 
502  inline int GetNEdges() const { return NumOfEdges; }
503 
505  inline int GetNFaces() const { return NumOfFaces; }
506 
508  int GetNumFaces() const;
509 
511  virtual long ReduceInt(int value) const { return value; }
512 
514  long GetGlobalNE() const { return ReduceInt(NumOfElements); }
515 
517  inline int EulerNumber() const
520  inline int EulerNumber2D() const
521  { return NumOfVertices - NumOfEdges + NumOfElements; }
522 
523  int Dimension() const { return Dim; }
524  int SpaceDimension() const { return spaceDim; }
525 
529  const double *GetVertex(int i) const { return vertices[i](); }
530 
534  double *GetVertex(int i) { return vertices[i](); }
535 
536  const Element* const *GetElementsArray() const
537  { return elements.GetData(); }
538 
539  const Element *GetElement(int i) const { return elements[i]; }
540 
541  Element *GetElement(int i) { return elements[i]; }
542 
543  const Element *GetBdrElement(int i) const { return boundary[i]; }
544 
545  Element *GetBdrElement(int i) { return boundary[i]; }
546 
547  const Element *GetFace(int i) const { return faces[i]; }
548 
549  int GetFaceBaseGeometry(int i) const;
550 
551  int GetElementBaseGeometry(int i = 0) const
552  { return i < GetNE() ? elements[i]->GetGeometryType() : BaseGeom; }
553 
554  int GetBdrElementBaseGeometry(int i = 0) const
555  { return i < GetNBE() ? boundary[i]->GetGeometryType() : BaseBdrGeom; }
556 
558  void GetElementVertices(int i, Array<int> &dofs) const
559  { elements[i]->GetVertices(dofs); }
560 
562  void GetBdrElementVertices(int i, Array<int> &dofs) const
563  { boundary[i]->GetVertices(dofs); }
564 
566  void GetElementEdges(int i, Array<int> &edges, Array<int> &cor) const;
567 
569  void GetBdrElementEdges(int i, Array<int> &edges, Array<int> &cor) const;
570 
573  void GetFaceEdges(int i, Array<int> &, Array<int> &) const;
574 
576  void GetFaceVertices(int i, Array<int> &vert) const
577  {
578  if (Dim == 1)
579  {
580  vert.SetSize(1); vert[0] = i;
581  }
582  else
583  {
584  faces[i]->GetVertices(vert);
585  }
586  }
587 
589  void GetEdgeVertices(int i, Array<int> &vert) const;
590 
592  Table *GetFaceEdgeTable() const;
593 
595  Table *GetEdgeVertexTable() const;
596 
598  void GetElementFaces(int i, Array<int> &, Array<int> &) const;
599 
601  void GetBdrElementFace(int i, int *, int *) const;
602 
606  int GetBdrElementEdgeIndex(int i) const;
607 
610  void GetBdrElementAdjacentElement(int bdr_el, int &el, int &info) const;
611 
613  int GetElementType(int i) const;
614 
616  int GetBdrElementType(int i) const;
617 
618  /* Return point matrix of element i of dimension Dim X #dofs, where for
619  every degree of freedom we give its coordinates in space of dimension
620  Dim. */
621  void GetPointMatrix(int i, DenseMatrix &pointmat) const;
622 
623  /* Return point matrix of boundary element i of dimension Dim X #dofs,
624  where for every degree of freedom we give its coordinates in space
625  of dimension Dim. */
626  void GetBdrPointMatrix(int i, DenseMatrix &pointmat) const;
627 
629 
633 
636 
639  void GetElementTransformation(int i, const Vector &nodes,
641 
645 
649 
652 
656 
659 
689  int mask = 31);
690 
692  {
693  if (faces_info[FaceNo].Elem2No < 0) { return NULL; }
694  return GetFaceElementTransformations (FaceNo);
695  }
696 
698 
700  bool FaceIsInterior(int FaceNo) const
701  {
702  return (faces_info[FaceNo].Elem2No >= 0);
703  }
704  void GetFaceElements (int Face, int *Elem1, int *Elem2);
705  void GetFaceInfos (int Face, int *Inf1, int *Inf2);
706 
707  int GetFaceGeometryType(int Face) const;
708  int GetFaceElementType(int Face) const;
709 
711  void CheckElementOrientation(bool fix_it = true);
713  void CheckBdrElementOrientation(bool fix_it = true);
714 
716  int GetAttribute(int i) const { return elements[i]->GetAttribute();}
717 
719  int GetBdrAttribute(int i) const { return boundary[i]->GetAttribute(); }
720 
721  const Table &ElementToElementTable();
722 
723  const Table &ElementToFaceTable() const;
724 
725  const Table &ElementToEdgeTable() const;
726 
729 
733  Table *GetFaceToElementTable() const;
734 
743  virtual void ReorientTetMesh();
744 
745  int *CartesianPartitioning(int nxyz[]);
746  int *GeneratePartitioning(int nparts, int part_method = 1);
747  void CheckPartitioning(int *partitioning);
748 
749  void CheckDisplacements(const Vector &displacements, double &tmax);
750 
751  // Vertices are only at the corners of elements, where you would expect them
752  // in the lowest-order mesh.
753  void MoveVertices(const Vector &displacements);
754  void GetVertices(Vector &vert_coord) const;
755  void SetVertices(const Vector &vert_coord);
756 
757  // Nodes are only active for higher order meshes, and share locations with
758  // the vertices, plus all the higher- order control points within the element
759  // and along the edges and on the faces.
760  void GetNode(int i, double *coord);
761  void SetNode(int i, const double *coord);
762 
763  // Node operations for curved mesh.
764  // They call the corresponding '...Vertices' method if the
765  // mesh is not curved (i.e. Nodes == NULL).
766  void MoveNodes(const Vector &displacements);
767  void GetNodes(Vector &node_coord) const;
768  void SetNodes(const Vector &node_coord);
769 
771  GridFunction *GetNodes() { return Nodes; }
772  const GridFunction *GetNodes() const { return Nodes; }
774  void NewNodes(GridFunction &nodes, bool make_owner = false);
777  void SwapNodes(GridFunction *&nodes, int &own_nodes_);
778 
780  void GetNodes(GridFunction &nodes) const;
788  void SetNodalGridFunction(GridFunction *nodes, bool make_owner = false);
791  const FiniteElementSpace *GetNodalFESpace() const;
792 
796  void SetCurvature(int order, bool discont = false, int space_dim = -1,
797  int ordering = 1);
798 
800  void UniformRefinement();
801 
810  void GeneralRefinement(const Array<Refinement> &refinements,
811  int nonconforming = -1, int nc_limit = 0);
812 
815  void GeneralRefinement(const Array<int> &el_to_refine,
816  int nonconforming = -1, int nc_limit = 0);
817 
819  void RandomRefinement(double prob, bool aniso = false,
820  int nonconforming = -1, int nc_limit = 0);
821 
823  void RefineAtVertex(const Vertex& vert,
824  double eps = 0.0, int nonconforming = -1);
825 
828  bool RefineByError(const Array<double> &elem_error, double threshold,
829  int nonconforming = -1, int nc_limit = 0);
830 
833  bool RefineByError(const Vector &elem_error, double threshold,
834  int nonconforming = -1, int nc_limit = 0);
835 
841  bool DerefineByError(Array<double> &elem_error, double threshold,
842  int nc_limit = 0, int op = 1);
843 
845  bool DerefineByError(const Vector &elem_error, double threshold,
846  int nc_limit = 0, int op = 1);
847 
848  // NURBS mesh refinement methods
850  void DegreeElevate(int t);
851 
855  void EnsureNCMesh(bool triangles_nonconforming = false);
856 
857  bool Conforming() const { return ncmesh == NULL; }
858  bool Nonconforming() const { return ncmesh != NULL; }
859 
863 
866 
871  long GetSequence() const { return sequence; }
872 
874  virtual void PrintXG(std::ostream &out = std::cout) const;
875 
877  virtual void Print(std::ostream &out = std::cout) const;
878 
880  void PrintVTK(std::ostream &out);
881 
886  void PrintVTK(std::ostream &out, int ref, int field_data=0);
887 
888  void GetElementColoring(Array<int> &colors, int el0 = 0);
889 
893  void PrintWithPartitioning (int *partitioning,
894  std::ostream &out, int elem_attr = 0) const;
895 
896  void PrintElementsWithPartitioning (int *partitioning,
897  std::ostream &out,
898  int interior_faces = 0);
899 
901 
905  void PrintSurfaces(const Table &Aface_face, std::ostream &out) const;
906 
907  void ScaleSubdomains (double sf);
908  void ScaleElements (double sf);
909 
910  void Transform(void (*f)(const Vector&, Vector&));
911  void Transform(VectorCoefficient &deformation);
912 
914  void RemoveUnusedVertices();
915 
919 
922  double GetElementSize(int i, int type = 0);
923 
924  double GetElementSize(int i, const Vector &dir);
925 
926  double GetElementVolume(int i);
927 
930  void GetBoundingBox(Vector &min, Vector &max, int ref = 2);
931 
932  void PrintCharacteristics(Vector *Vh = NULL, Vector *Vk = NULL,
933  std::ostream &out = std::cout);
934 
935  virtual void PrintInfo(std::ostream &out = std::cout)
936  {
937  PrintCharacteristics(NULL, NULL, out);
938  }
939 
940  void MesquiteSmooth(const int mesquite_option = 0);
941 
943  virtual ~Mesh();
944 };
945 
948 std::ostream &operator<<(std::ostream &out, const Mesh &mesh);
949 
950 
953 {
954 private:
955  int n, layer;
956  double p[2], s;
957  Vector tip;
958 public:
959  NodeExtrudeCoefficient(const int dim, const int _n, const double _s);
960  void SetLayer(const int l) { layer = l; }
962  virtual void Eval(Vector &V, ElementTransformation &T,
963  const IntegrationPoint &ip);
965 };
966 
967 
969 Mesh *Extrude1D(Mesh *mesh, const int ny, const double sy,
970  const bool closed = false);
971 
972 
975 class named_ifstream : public std::ifstream
976 {
977 public:
978  const char *filename;
979  named_ifstream(const char *mesh_name) :
980  std::ifstream(mesh_name), filename(mesh_name) {}
981 };
982 
983 
984 // inline functions
985 inline void Mesh::ShiftL2R(int &a, int &b, int &c)
986 {
987  int t = a;
988  a = c; c = b; b = t;
989 }
990 
991 inline void Mesh::Rotate3(int &a, int &b, int &c)
992 {
993  if (a < b)
994  {
995  if (a > c)
996  {
997  ShiftL2R(a, b, c);
998  }
999  }
1000  else
1001  {
1002  if (b < c)
1003  {
1004  ShiftL2R(c, b, a);
1005  }
1006  else
1007  {
1008  ShiftL2R(a, b, c);
1009  }
1010  }
1011 }
1012 
1013 }
1014 
1015 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:44
void AddHex(const int *vi, int attr=1)
Definition: mesh.cpp:881
std::ostream & operator<<(std::ostream &out, const Mesh &mesh)
Definition: mesh.cpp:8230
void GetFaceEdges(int i, Array< int > &, Array< int > &) const
Definition: mesh.cpp:3404
void PrintSurfaces(const Table &Aface_face, std::ostream &out) const
Print set of disjoint surfaces:
Definition: mesh.cpp:7734
void GetPointMatrix(int i, DenseMatrix &pointmat) const
Definition: mesh.cpp:3690
static const int vtk_quadratic_hex[27]
Definition: mesh.hpp:124
int * CartesianPartitioning(int nxyz[])
Definition: mesh.cpp:4293
virtual void PrintInfo(std::ostream &out=std::cout)
Definition: mesh.hpp:935
const DenseMatrix * PointMatrix
Definition: mesh.hpp:91
int GetBdrAttribute(int i) const
Return the attribute of boundary element i.
Definition: mesh.hpp:719
const double * GetVertex(int i) const
Return pointer to vertex i&#39;s coordinates.
Definition: mesh.hpp:529
void ScaleElements(double sf)
Definition: mesh.cpp:7869
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:27
Table * GetEdgeVertexTable() const
Returns the edge-to-vertex Table (3D)
Definition: mesh.cpp:3470
void GetBdrElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of bdr element i.
Definition: mesh.cpp:3372
void FreeElement(Element *E)
Definition: mesh.cpp:8183
void DerefineMesh(const Array< int > &derefinements)
Derefine elements once a list of derefinements is known.
Definition: mesh.cpp:5764
void GetFaceInfos(int Face, int *Inf1, int *Inf2)
Definition: mesh.cpp:718
void SetVertices(const Vector &vert_coord)
Definition: mesh.cpp:5054
static const int vtk_quadratic_tet[10]
Definition: mesh.hpp:123
void GetEdgeVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of edge i.
Definition: mesh.cpp:3434
bool FaceIsTrueInterior(int FaceNo) const
Definition: mesh.hpp:331
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Definition: mesh.cpp:8243
long GetGlobalNE() const
Return the total (global) number of elements.
Definition: mesh.hpp:514
void AddHexAsTets(const int *vi, int attr=1)
Definition: mesh.cpp:886
void GetFaceElements(int Face, int *Elem1, int *Elem2)
Definition: mesh.cpp:712
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Array< Element * > boundary
Definition: mesh.hpp:73
Geometry::Constants< Geometry::SQUARE > quad_t
Definition: mesh.hpp:134
int * GeneratePartitioning(int nparts, int part_method=1)
Definition: mesh.cpp:4338
CoarseFineTransformations CoarseFineTr
Definition: mesh.hpp:115
int own_nodes
Definition: mesh.hpp:121
bool Conforming() const
Definition: mesh.hpp:857
void MoveVertices(const Vector &displacements)
Definition: mesh.cpp:5034
int GetNBE() const
Returns number of boundary elements.
Definition: mesh.hpp:499
IsoparametricTransformation Transformation
Definition: mesh.hpp:110
void GetLocalPtToSegTransformation(IsoparametricTransformation &, int)
Used in GetFaceElementTransformations (...)
Definition: mesh.cpp:474
void PrintWithPartitioning(int *partitioning, std::ostream &out, int elem_attr=0) const
Definition: mesh.cpp:7249
int GetFaceGeometryType(int Face) const
Definition: mesh.cpp:724
const Geometry::Type geom
void NewNodes(GridFunction &nodes, bool make_owner=false)
Replace the internal node GridFunction with the given GridFunction.
Definition: mesh.cpp:5138
int NumOfEdges
Definition: mesh.hpp:58
void SwapNodes(GridFunction *&nodes, int &own_nodes_)
Definition: mesh.cpp:5152
void GetElementFaces(int i, Array< int > &, Array< int > &) const
Return the indices and the orientations of all faces of element i.
Definition: mesh.cpp:3565
void GetLocalFaceTransformation(int face_type, int elem_type, IsoparametricTransformation &Transf, int inf)
Used in GetFaceElementTransformations (...)
Definition: mesh.cpp:570
void AddBdrElement(Element *elem)
Definition: mesh.hpp:408
int BaseGeom
Definition: mesh.hpp:60
void GetBoundingBox(Vector &min, Vector &max, int ref=2)
Definition: mesh.cpp:87
void ReadNetgen2DMesh(std::istream &input, int &curved)
void DegreeElevate(int t)
Definition: mesh.cpp:2779
int EulerNumber2D() const
Equals 1 - num_holes.
Definition: mesh.hpp:520
void AddTri(const int *vi, int attr=1)
Definition: mesh.cpp:853
void DeleteTables()
Definition: mesh.cpp:751
void GetFaceVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of face i.
Definition: mesh.hpp:576
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
GridFunction * Nodes
Definition: mesh.hpp:120
int NumOfElements
Definition: mesh.hpp:57
Mesh * Extrude1D(Mesh *mesh, const int ny, const double sy, const bool closed)
Extrude a 1D mesh.
Definition: mesh.cpp:8261
void Transform(void(*f)(const Vector &, Vector &))
Definition: mesh.cpp:7939
int GetBdrElementEdgeIndex(int i) const
Definition: mesh.cpp:3648
int GetNE() const
Returns number of elements.
Definition: mesh.hpp:496
const Element * GetFace(int i) const
Definition: mesh.hpp:547
Element * GetElement(int i)
Definition: mesh.hpp:541
void GenerateBoundaryElements()
Definition: mesh.cpp:935
void GetElementVertices(int i, Array< int > &dofs) const
Returns the indices of the dofs of element i.
Definition: mesh.hpp:558
Data type for vertex.
Definition: vertex.hpp:21
void SetMeshGen()
Definition: mesh.cpp:2260
static int GetQuadOrientation(const int *base, const int *test)
Returns the orientation of &quot;test&quot; relative to &quot;base&quot;.
Definition: mesh.cpp:3212
void GetVertices(Vector &vert_coord) const
Definition: mesh.cpp:5043
void ReadNetgen3DMesh(std::istream &input)
int BaseBdrGeom
Definition: mesh.hpp:60
virtual ~Mesh()
Destroys mesh.
Definition: mesh.cpp:8202
void AddBdrSegment(const int *vi, int attr=1)
Definition: mesh.cpp:905
int GetFaceElementType(int Face) const
Definition: mesh.cpp:729
FaceElementTransformations * GetInteriorFaceTransformations(int FaceNo)
Definition: mesh.hpp:691
void CheckBdrElementOrientation(bool fix_it=true)
Check the orientation of the boundary elements.
Definition: mesh.cpp:3260
void RemoveInternalBoundaries()
Definition: mesh.cpp:8095
FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31)
Definition: mesh.cpp:603
Array< Element * > faces
Definition: mesh.hpp:74
virtual long ReduceInt(int value) const
Utility function: sum integers from all processors (Allreduce).
Definition: mesh.hpp:511
void FinalizeHexMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Definition: mesh.cpp:1627
void GetVertexToVertexTable(DSTable &) const
Definition: mesh.cpp:3759
void RedRefinement(int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle)
Definition: mesh.hpp:215
Operation last_operation
Definition: mesh.hpp:147
void MarkTriMeshForRefinement()
Definition: mesh.cpp:1259
void InitRefinementTransforms()
Definition: mesh.cpp:6492
IsoparametricTransformation FaceTransformation
Definition: mesh.hpp:111
Array< NCFaceInfo > nc_faces_info
Definition: mesh.hpp:99
Element * ReadElement(std::istream &)
Definition: mesh.cpp:2242
void KnotInsert(Array< KnotVector * > &kv)
Definition: mesh.cpp:2747
A parallel extension of the NCMesh class.
Definition: pncmesh.hpp:65
Element * NewElement(int geom)
Definition: mesh.cpp:2193
FaceElementTransformations FaceElemTr
Definition: mesh.hpp:112
Table * el_to_face
Definition: mesh.hpp:102
void GetEdgeTransformation(int i, IsoparametricTransformation *EdTr)
Definition: mesh.cpp:412
const GridFunction * GetNodes() const
Definition: mesh.hpp:772
void MarkForRefinement()
Definition: mesh.cpp:1244
ElementTransformation * GetBdrElementTransformation(int i)
Returns the transformation defining the i-th boundary element.
Definition: mesh.cpp:310
void AddVertex(const double *)
Definition: mesh.cpp:842
Mesh(int _Dim, int NVert, int NElem, int NBdrElem=0, int _spaceDim=-1)
Definition: mesh.hpp:388
void PrintTopo(std::ostream &out, const Array< int > &e_to_k) const
Definition: mesh.cpp:6811
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
Definition: mesh.cpp:3039
Geometry::Constants< Geometry::SEGMENT > seg_t
Definition: mesh.hpp:132
void AddElement(Element *elem)
Definition: mesh.hpp:407
void Load(std::istream &input, int generate_edges=0, int refine=1, bool fix_orientation=true)
Definition: mesh.cpp:2279
void GetElementJacobian(int i, DenseMatrix &J)
Definition: mesh.cpp:35
void MesquiteSmooth(const int mesquite_option=0)
Definition: mesquite.cpp:1144
long GetSequence() const
Definition: mesh.hpp:871
bool Nonconforming() const
Definition: mesh.hpp:858
Mesh(int nx, int ny, Element::Type type, int generate_edges=0, double sx=1.0, double sy=1.0)
Definition: mesh.hpp:452
void MoveNodes(const Vector &displacements)
Definition: mesh.cpp:5102
void GetEdgeOrdering(DSTable &v_to_v, Array< int > &order)
Definition: mesh.cpp:1274
int dim
Definition: ex3.cpp:47
NCFaceInfo(bool slave, int master, const DenseMatrix *pm)
Definition: mesh.hpp:94
void FinalizeTriMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Definition: mesh.cpp:989
void UpdateNURBS()
Definition: mesh.cpp:2801
Symmetric 3D Table.
Definition: stable3d.hpp:28
void FinalizeTetMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Definition: mesh.cpp:1586
void AddBdrQuadAsTriangles(const int *vi, int attr=1)
Definition: mesh.cpp:920
void AddSegmentFaceElement(int lf, int gf, int el, int v0, int v1)
Definition: mesh.cpp:3888
void SetAttributes()
Definition: mesh.cpp:768
void MarkTetMeshForRefinement()
Definition: mesh.cpp:1300
int FindCoarseElement(int i)
Definition: mesh.cpp:6504
void GetFaceTransformation(int i, IsoparametricTransformation *FTr)
Definition: mesh.cpp:344
void GetLocalSegToTriTransformation(IsoparametricTransformation &loc, int i)
Definition: mesh.cpp:488
void AddQuadFaceElement(int lf, int gf, int el, int v0, int v1, int v2, int v3)
Definition: mesh.cpp:3939
named_ifstream(const char *mesh_name)
Definition: mesh.hpp:979
static FiniteElement * GetTransformationFEforElementType(int)
Definition: mesh.cpp:221
void LoadPatchTopo(std::istream &input, Array< int > &edge_to_knot)
Read NURBS patch/macro-element mesh.
Definition: mesh.cpp:2864
STable3D * GetElementToFaceTable(int ret_ftbl=0)
Definition: mesh.cpp:4111
void SetCurvature(int order, bool discont=false, int space_dim=-1, int ordering=1)
Definition: mesh.cpp:3020
static void Rotate3(int &, int &, int &)
Definition: mesh.hpp:991
void Make2D(int nx, int ny, Element::Type type, int generate_edges, double sx, double sy)
Definition: mesh.cpp:1847
int MeshGenerator()
Definition: mesh.hpp:489
Type
Constants for the classes derived from Element.
Definition: element.hpp:37
void GetBdrPointMatrix(int i, DenseMatrix &pointmat) const
Definition: mesh.cpp:3706
void InitTables()
Definition: mesh.cpp:745
void CheckDisplacements(const Vector &displacements, double &tmax)
Definition: mesh.cpp:4957
void CheckElementOrientation(bool fix_it=true)
Check the orientation of the elements.
Definition: mesh.cpp:3054
void ReadInlineMesh(std::istream &input, int generate_edges=0)
Geometry::Constants< Geometry::TETRAHEDRON > tet_t
Definition: mesh.hpp:135
void ReadLineMesh(std::istream &input)
void SetLayer(const int l)
Definition: mesh.hpp:960
int GetElementToEdgeTable(Table &, Array< int > &)
Definition: mesh.cpp:3784
void GetBdrElementAdjacentElement(int bdr_el, int &el, int &info) const
For the given boundary element, bdr_el, return its adjacent element and its info, i...
Definition: mesh.cpp:3660
void RandomRefinement(double prob, bool aniso=false, int nonconforming=-1, int nc_limit=0)
Refine each element with given probability. Uses GeneralRefinement.
Definition: mesh.cpp:6085
int GetElementType(int i) const
Returns the type of element i.
Definition: mesh.cpp:3680
const Element * GetElement(int i) const
Definition: mesh.hpp:539
Mesh(int n, double sx=1.0)
Definition: mesh.hpp:459
void GetLocalQuadToHexTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
Definition: mesh.cpp:549
IsoparametricTransformation Transformation2
Definition: mesh.hpp:110
void Init()
Definition: mesh.cpp:734
void SetNodalFESpace(FiniteElementSpace *nfes)
Definition: mesh.cpp:3003
Element * GetBdrElement(int i)
Definition: mesh.hpp:545
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes...
Definition: ncmesh.hpp:79
FaceElementTransformations * GetBdrFaceTransformations(int BdrElemNo)
Definition: mesh.cpp:686
int Dimension() const
Definition: mesh.hpp:523
virtual void ReorientTetMesh()
Definition: mesh.cpp:4184
int NumOfBdrElements
Definition: mesh.hpp:57
Table * el_to_edge
Definition: mesh.hpp:101
void InitBaseGeom()
Definition: mesh.cpp:819
static void ShiftL2R(int &, int &, int &)
Definition: mesh.hpp:985
virtual void LocalRefinement(const Array< int > &marked_el, int type=3)
This function is not public anymore. Use GeneralRefinement instead.
Definition: mesh.cpp:5459
int GetBdrElementType(int i) const
Returns the type of boundary element i.
Definition: mesh.cpp:3685
void GetGeckoElementReordering(Array< int > &ordering)
Definition: mesh.cpp:1052
Data type tetrahedron element.
Definition: tetrahedron.hpp:22
double GetElementSize(int i, int type=0)
Definition: mesh.cpp:43
int SpaceDimension() const
Definition: mesh.hpp:524
void GetBdrElementFace(int i, int *, int *) const
Return the index and the orientation of the face of bdr element i. (3D)
Definition: mesh.cpp:3603
void CheckPartitioning(int *partitioning)
Definition: mesh.cpp:4639
virtual void Print(std::ostream &out=std::cout) const
Print the mesh to the given stream using the default MFEM mesh format.
Definition: mesh.cpp:6736
void PrintElementsWithPartitioning(int *partitioning, std::ostream &out, int interior_faces=0)
Definition: mesh.cpp:7360
bool FaceIsInterior(int FaceNo) const
Return true if the given face is interior.
Definition: mesh.hpp:700
void ReadMFEMMesh(std::istream &input, bool mfem_v11, int &curved)
void AddPointFaceElement(int lf, int gf, int el)
Used in GenerateFaces()
Definition: mesh.cpp:3871
void Make1D(int n, double sx=1.0)
Creates a 1D mesh for the interval [0,sx] divided into n equal intervals.
Definition: mesh.cpp:2008
const Element *const * GetElementsArray() const
Definition: mesh.hpp:536
Array< int > bdr_attributes
Definition: mesh.hpp:141
virtual void NonconformingRefinement(const Array< Refinement > &refinements, int nc_limit=0)
This function is not public anymore. Use GeneralRefinement instead.
Definition: mesh.cpp:5716
void PrintVTK(std::ostream &out)
Print the mesh in VTK format (linear and quadratic meshes only).
Definition: mesh.cpp:6853
Table * el_to_el
Definition: mesh.hpp:103
Geometry::Constants< Geometry::CUBE > hex_t
Definition: mesh.hpp:136
void RemoveUnusedVertices()
Remove unused vertices and rebuild mesh connectivity.
Definition: mesh.cpp:7988
void ApplyLocalSlaveTransformation(IsoparametricTransformation &transf, const FaceInfo &fi)
Definition: mesh.cpp:673
static void PrintElement(const Element *, std::ostream &)
Definition: mesh.cpp:2254
const char * filename
Definition: mesh.hpp:978
virtual void NURBSUniformRefinement()
Refine NURBS mesh.
Definition: mesh.cpp:2766
static void GetElementArrayEdgeTable(const Array< Element * > &elem_array, const DSTable &v_to_v, Table &el_to_edge)
Definition: mesh.cpp:3737
void PrintCharacteristics(Vector *Vh=NULL, Vector *Vk=NULL, std::ostream &out=std::cout)
Definition: mesh.cpp:150
GridFunction * GetNodes()
Return a pointer to the internal node GridFunction (may be NULL).
Definition: mesh.hpp:771
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Definition: array.hpp:331
void PrepareNodeReorder(DSTable **old_v_to_v, Table **old_elem_vert)
Definition: mesh.cpp:1326
bool IsSlaveFace(const FaceInfo &fi) const
Definition: mesh.cpp:668
void AddQuad(const int *vi, int attr=1)
Definition: mesh.cpp:863
void ReadGmshMesh(std::istream &input)
Array< Vertex > vertices
Definition: mesh.hpp:72
virtual void QuadUniformRefinement()
Refine quadrilateral mesh.
Definition: mesh.cpp:5192
virtual void HexUniformRefinement()
Refine hexahedral mesh.
Definition: mesh.cpp:5294
void RefineAtVertex(const Vertex &vert, double eps=0.0, int nonconforming=-1)
Refine elements sharing the specified vertex. Uses GeneralRefinement.
Definition: mesh.cpp:6104
void Swap(Mesh &other, bool non_geometry=false)
Definition: mesh.cpp:5922
Array< Element * > elements
Definition: mesh.hpp:69
const Table & ElementToElementTable()
Definition: mesh.cpp:3823
double GetLength(int i, int j) const
Return the length of the segment from node i to node j.
Definition: mesh.cpp:3722
int meshgen
Definition: mesh.hpp:62
const CoarseFineTransformations & GetRefinementTransforms()
Definition: mesh.cpp:6514
bool RefineByError(const Array< double > &elem_error, double threshold, int nonconforming=-1, int nc_limit=0)
Definition: mesh.cpp:6130
Table * bel_to_edge
Definition: mesh.hpp:105
Operation GetLastOperation() const
Return type of last modification of the mesh.
Definition: mesh.hpp:865
int GetElementBaseGeometry(int i=0) const
Definition: mesh.hpp:551
void AddBdrTriangle(const int *vi, int attr=1)
Definition: mesh.cpp:910
Table * GetFaceToElementTable() const
Definition: mesh.cpp:3531
void GetLocalTriToTetTransformation(IsoparametricTransformation &loc, int i)
Used in GetFaceElementTransformations (...)
Definition: mesh.cpp:526
int EulerNumber() const
Equals 1 + num_holes - num_loops.
Definition: mesh.hpp:517
NURBSExtension * NURBSext
Definition: mesh.hpp:143
int GetNV() const
Definition: mesh.hpp:493
void AddBdrQuad(const int *vi, int attr=1)
Definition: mesh.cpp:915
Array< int > be_to_edge
Definition: mesh.hpp:104
const Table & ElementToFaceTable() const
Definition: mesh.cpp:3853
Class for integration point with weight.
Definition: intrules.hpp:25
void UniformRefinement()
Definition: mesh.cpp:5964
void ReadCubit(named_ifstream &input, int &curved, int &read_gf)
Element * ReadElementWithoutAttr(std::istream &)
Definition: mesh.cpp:2213
void GetElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of element i.
Definition: mesh.cpp:3350
void AddTriangle(const int *vi, int attr=1)
Definition: mesh.cpp:858
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
Definition: mesh.cpp:237
void GetLocalSegToQuadTransformation(IsoparametricTransformation &loc, int i)
Definition: mesh.cpp:507
const FiniteElementSpace * GetNodalFESpace() const
Definition: mesh.cpp:3015
Table * face_edge
Definition: mesh.hpp:107
void FinalizeQuadMesh(int generate_edges=0, int refine=0, bool fix_orientation=true)
Definition: mesh.cpp:1020
bool DerefineByError(Array< double > &elem_error, double threshold, int nc_limit=0, int op=1)
Definition: mesh.cpp:5835
NodeExtrudeCoefficient(const int dim, const int _n, const double _s)
Definition: mesh.cpp:8237
void ReorderElements(const Array< int > &ordering, bool reorder_vertices=true)
Definition: mesh.cpp:1097
Table * edge_vertex
Definition: mesh.hpp:108
void ReadVTKMesh(std::istream &input, int &curved, int &read_gf)
static void skip_comment_lines(std::istream &is, const char comment_char)
Definition: mesh.hpp:177
void GetBdrElementVertices(int i, Array< int > &dofs) const
Returns the indices of the dofs of boundary element i.
Definition: mesh.hpp:562
long sequence
Definition: mesh.hpp:67
virtual ~NodeExtrudeCoefficient()
Definition: mesh.hpp:964
Array< FaceInfo > faces_info
Definition: mesh.hpp:98
STable3D * GetFacesTable()
Definition: mesh.cpp:4076
void Make3D(int nx, int ny, int nz, Element::Type type, int generate_edges, double sx, double sy, double sz)
Definition: mesh.cpp:1659
void EnsureNCMesh(bool triangles_nonconforming=false)
Definition: mesh.cpp:6068
NCMesh * ncmesh
Definition: mesh.hpp:144
static void PrintElementWithoutAttr(const Element *, std::ostream &)
Definition: mesh.cpp:2230
virtual bool NonconformingDerefinement(Array< double > &elem_error, double threshold, int nc_limit=0, int op=1)
NC version of GeneralDerefinement.
Definition: mesh.cpp:5790
int Dim
Definition: mesh.hpp:54
int GetNEdges() const
Return the number of edges.
Definition: mesh.hpp:502
Geometry::Constants< Geometry::TRIANGLE > tri_t
Definition: mesh.hpp:133
double * GetVertex(int i)
Return pointer to vertex i&#39;s coordinates.
Definition: mesh.hpp:534
int GetNFaces() const
Return the number of faces in a 3D mesh.
Definition: mesh.hpp:505
Vector data type.
Definition: vector.hpp:33
void ReadTrueGridMesh(std::istream &input)
int GetFaceBaseGeometry(int i) const
Definition: mesh.cpp:3626
void AverageVertices(int *indexes, int n, int result)
Definition: mesh.cpp:5162
Mesh(int nx, int ny, int nz, Element::Type type, int generate_edges=0, double sx=1.0, double sy=1.0, double sz=1.0)
Definition: mesh.hpp:442
static int GetTriOrientation(const int *base, const int *test)
Returns the orientation of &quot;test&quot; relative to &quot;base&quot;.
Definition: mesh.cpp:3164
void SetNode(int i, const double *coord)
Definition: mesh.cpp:5082
void GetNode(int i, double *coord)
Definition: mesh.cpp:5063
void GenerateFaces()
Definition: mesh.cpp:3960
void GetElementColoring(Array< int > &colors, int el0=0)
Definition: mesh.cpp:7174
int spaceDim
Definition: mesh.hpp:55
IsoparametricTransformation EdgeTransformation
Definition: mesh.hpp:111
Defines the coarse-fine transformations of all fine elements.
Definition: ncmesh.hpp:51
void AddTet(const int *vi, int attr=1)
Definition: mesh.cpp:868
MemAlloc< Tetrahedron, 1024 > TetMemory
Definition: mesh.hpp:128
Table * GetFaceEdgeTable() const
Returns the face-to-edge Table (3D)
Definition: mesh.cpp:3442
void DoNodeReorder(DSTable *old_v_to_v, Table *old_elem_vert)
Definition: mesh.cpp:1368
void SetNodes(const Vector &node_coord)
Definition: mesh.cpp:5126
void SetNodalGridFunction(GridFunction *nodes, bool make_owner=false)
Definition: mesh.cpp:3009
void ReadNURBSMesh(std::istream &input, int &curved, int &read_gf)
int NumOfVertices
Definition: mesh.hpp:57
void ScaleSubdomains(double sf)
Definition: mesh.cpp:7799
Array< int > be_to_face
Definition: mesh.hpp:106
virtual void PrintXG(std::ostream &out=std::cout) const
Print the mesh to the given stream using Netgen/Truegrid format.
Definition: mesh.cpp:6572
void InitFromNCMesh(const NCMesh &ncmesh)
Initialize vertices/elements/boundary/tables from a nonconforming mesh.
Definition: mesh.cpp:5864
void Bisection(int i, const DSTable &, int *, int *, int *)
Definition: mesh.cpp:6159
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
Definition: mesh.cpp:6003
static void filter_dos(std::string &line)
Definition: mesh.hpp:187
Class for parallel meshes.
Definition: pmesh.hpp:28
Abstract data type element.
Definition: element.hpp:27
int GetAttribute(int i) const
Return the attribute of element i.
Definition: mesh.hpp:716
void AddTriangleFaceElement(int lf, int gf, int el, int v0, int v1, int v2)
Definition: mesh.cpp:3918
const Table & ElementToEdgeTable() const
Definition: mesh.cpp:3862
void GenerateNCFaceInfo()
Definition: mesh.cpp:4029
int GetBdrElementBaseGeometry(int i=0) const
Definition: mesh.hpp:554
double GetElementVolume(int i)
Definition: mesh.cpp:70
Array< int > attributes
Definition: mesh.hpp:140
void InitMesh(int _Dim, int _spaceDim, int NVert, int NElem, int NBdrElem)
Begin construction of a mesh.
Definition: mesh.cpp:799
Table * GetVertexToElementTable()
The returned Table must be destroyed by the caller.
Definition: mesh.cpp:3496
const Element * GetBdrElement(int i) const
Definition: mesh.hpp:543
void UpdateNodes()
Update the nodes of a curved mesh after refinement.
Definition: mesh.cpp:5183
void GreenRefinement(int i, const DSTable &v_to_v, int *edge1, int *edge2, int *middle)
Definition: mesh.hpp:221
Class used to extrude the nodes of a mesh.
Definition: mesh.hpp:952
int NumOfFaces
Definition: mesh.hpp:58