24 *
this <<
"MFEM mesh v1.0" << endl;
28 *
this <<
"dimension" << endl << 1 << endl
29 <<
"elements" << endl << 1 << endl
31 <<
"boundary" << endl << 2 << endl
41 *
this <<
"dimension" << endl << 2 << endl
42 <<
"elements" << endl << 1 << endl
43 <<
"1 2 0 1 2" << endl
44 <<
"boundary" << endl << 3 << endl
56 *
this <<
"dimension" << endl << 2 << endl
57 <<
"elements" << endl << 1 << endl
58 <<
"1 3 0 1 2 3" << endl
59 <<
"boundary" << endl << 4 << endl
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
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 real_t h_min, h_max, k_min, k_max;
149 real_t 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);
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 real_t x = pos(0), y = pos(1), z = dim == 3 ? pos(2) : 0;
249 real_t lambda = (x-layer/6.0)*6;
280 if (dim == 3) { V(2) = Z; }
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
Abstract data type element.
virtual void GetVertices(Array< int > &v) const =0
Get the indices defining the vertices.
Type
Constants for the classes derived from Element.
virtual int GetNVertices() const =0
Class for integration point with weight.
int EulerNumber() const
Equals 1 + num_holes - num_loops.
int EulerNumber2D() const
Equals 1 - num_holes.
const Element * GetElement(int i) const
Return pointer to the i'th element object.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
int SpaceDimension() const
Dimension of the physical space containing the mesh.
void GetCharacteristics(real_t &h_min, real_t &h_max, real_t &kappa_min, real_t &kappa_max, Vector *Vh=NULL, Vector *Vk=NULL)
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
int GetNBE() const
Returns number of boundary elements.
const real_t * GetVertex(int i) const
Return pointer to vertex i's coordinates.
void RemoveUnusedVertices()
Remove unused vertices and rebuild mesh connectivity.
real_t Norml2() const
Returns the l2 norm of the vector.
void SetSize(int s)
Resize the vector to size s.
ElementMeshStream(Element::Type e)
void MergeMeshNodes(Mesh *mesh, int logging)
Merges vertices which lie at the same location.
void AttrToMarker(int max_attr, const Array< int > &attrs, Array< int > &marker)
Convert a set of attribute numbers to a marker array.
void mfem_error(const char *msg)
void add(const Vector &v1, const Vector &v2, Vector &v)