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
113 *
this <<
"dimension" << endl << 3 << endl
114 <<
"elements" << endl << 1 << endl
115 <<
"1 6 0 1 2 3 4 5" << endl
116 <<
"boundary" << endl << 5 << endl
117 <<
"1 2 2 1 0" << endl
118 <<
"1 2 3 4 5" << endl
119 <<
"1 3 0 1 4 3" << endl
120 <<
"1 3 1 2 5 4" << endl
121 <<
"1 3 2 0 3 5" << endl
122 <<
"vertices" << endl
145 double h_min, h_max, k_min, k_max;
149 double tol = 1.0e-8 * h_min;
152 cout <<
"Euler Number of Initial Mesh: "
157 vector<int> v2v(mesh->
GetNV());
161 for (
int i = 0; i < mesh->
GetNV(); i++)
167 for (
int j = 0; j < i; j++)
170 add(vi, -1.0, vj, vd);
172 if ( vd.Norml2() < tol )
178 if ( v2v[i] < 0 ) { v2v[i] = i; }
182 for (
int i = 0; i < mesh->
GetNE(); i++)
187 for (
int j = 0; j < nv; j++)
193 for (
int i = 0; i < mesh->
GetNBE(); i++)
198 for (
int j = 0; j < nv; j++)
208 cout <<
"Euler Number of Final Mesh: "
218 MFEM_ASSERT(attrs.
Max() <= max_attr,
"Invalid attribute number present.");
221 if (attrs.
Size() == 1 && attrs[0] == -1)
228 for (
int j=0; j<attrs.
Size(); j++)
231 MFEM_VERIFY(attr > 0,
"Attribute number less than one!");
243 double x = pos(0), y = pos(1), z =
dim == 3 ? pos(2) : 0;
249 double lambda = (x-layer/6.0)*6;
261 Y = step(left(epsy, y), right(epsy, y), lambda);
262 Z = step(left(epsz, z), right(epsz, z), lambda);
265 Y = step(right(epsy, y), left(epsy, y), lambda/2);
266 Z = step(right(epsz, z), left(epsz, z), lambda/2);
269 Y = step(right(epsy, y), left(epsy, y), (1+lambda)/2);
270 Z = step(right(epsz, z), left(epsz, z), (1+lambda)/2);
280 if (
dim == 3) { V(2) = Z; }
int Size() const
Return the logical size of the array.
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.
void AttrToMarker(int max_attr, const Array< int > &attrs, Array< int > &marker)
Convert a set of attribute numbers to a marker array.
void SetSize(int s)
Resize the vector to size s.
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.
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
const Element * GetElement(int i) const
int SpaceDimension() const
void RemoveUnusedVertices()
Remove unused vertices and rebuild mesh connectivity.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
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...
Class for integration point with weight.
virtual int GetNVertices() const =0
Abstract data type element.
const Element * GetBdrElement(int i) const