24 *
this <<
"MFEM mesh v1.0" << endl;
27 case Element::SEGMENT:
28 *
this <<
"dimension" << endl << 1 << endl
29 <<
"elements" << endl << 1 << endl
31 <<
"boundary" << endl << 2 << endl
40 case Element::TRIANGLE:
41 *
this <<
"dimension" << endl << 2 << endl
42 <<
"elements" << endl << 1 << endl
43 <<
"1 2 0 1 2" << endl
44 <<
"boundary" << endl << 3 << endl
55 case Element::QUADRILATERAL:
56 *
this <<
"dimension" << endl << 2 << endl
57 <<
"elements" << endl << 1 << endl
58 <<
"1 3 0 1 2 3" << endl
59 <<
"boundary" << endl << 4 << endl
72 case Element::TETRAHEDRON:
73 *
this <<
"dimension" << endl << 3 << endl
74 <<
"elements" << endl << 1 << endl
75 <<
"1 4 0 1 2 3" << endl
76 <<
"boundary" << endl << 4 << endl
77 <<
"1 2 0 2 1" << endl
78 <<
"1 2 1 2 3" << endl
79 <<
"1 2 2 0 3" << endl
80 <<
"1 2 0 1 3" << endl
89 case Element::HEXAHEDRON:
90 *
this <<
"dimension" << endl << 3 << endl
91 <<
"elements" << endl << 1 << endl
92 <<
"1 5 0 1 2 3 4 5 6 7" << endl
93 <<
"boundary" << endl << 6 << endl
94 <<
"1 3 0 3 2 1" << endl
95 <<
"1 3 4 5 6 7" << endl
96 <<
"1 3 0 1 5 4" << endl
97 <<
"1 3 1 2 6 5" << endl
98 <<
"1 3 2 3 7 6" << endl
99 <<
"1 3 3 0 4 7" << endl
100 <<
"vertices" << endl
125 double h_min, h_max, k_min, k_max;
129 double tol = 1.0e-8 * h_min;
132 cout <<
"Euler Number of Initial Mesh: "
137 vector<int> v2v(mesh->
GetNV());
141 for (
int i = 0; i < mesh->
GetNV(); i++)
147 for (
int j = 0; j < i; j++)
150 add(vi, -1.0, vj, vd);
152 if ( vd.Norml2() < tol )
158 if ( v2v[i] < 0 ) { v2v[i] = i; }
162 for (
int i = 0; i < mesh->
GetNE(); i++)
167 for (
int j = 0; j < nv; j++)
173 for (
int i = 0; i < mesh->
GetNBE(); i++)
178 for (
int j = 0; j < nv; j++)
188 cout <<
"Euler Number of Final Mesh: "
const double * GetVertex(int i) const
Return pointer to vertex i's coordinates.
virtual void GetVertices(Array< int > &v) const =0
Returns element's vertices.
int GetNBE() const
Returns number of boundary elements.
void GetCharacteristics(double &h_min, double &h_max, double &kappa_min, double &kappa_max, Vector *Vh=NULL, Vector *Vk=NULL)
int EulerNumber2D() const
Equals 1 - num_holes.
int GetNE() const
Returns number of elements.
void MergeMeshNodes(Mesh *mesh, int logging)
Merges vertices which lie at the same location.
void add(const Vector &v1, const Vector &v2, Vector &v)
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
Type
Constants for the classes derived from Element.
const Element * GetElement(int i) const
int SpaceDimension() const
void RemoveUnusedVertices()
Remove unused vertices and rebuild mesh connectivity.
int EulerNumber() const
Equals 1 + num_holes - num_loops.
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
virtual int GetNVertices() const =0
Abstract data type element.
const Element * GetBdrElement(int i) const