18 #include "mesh_reader_h2d_xml.h"
27 MeshReaderH2DXML::MeshReaderH2DXML()
31 MeshReaderH2DXML::~MeshReaderH2DXML()
35 void MeshReaderH2DXML::load(
const char *filename, MeshSharedPtr mesh)
41 parsing_flags = xml_schema::flags::dont_validate;
44 std::auto_ptr<XMLMesh::mesh> parsed_xml_mesh(
XMLMesh::mesh_(filename, parsing_flags));
47 load(parsed_xml_mesh, mesh);
51 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
55 void MeshReaderH2DXML::load(std::auto_ptr<XMLMesh::mesh> & parsed_xml_mesh, MeshSharedPtr mesh)
58 throw Exceptions::NullException(1);
64 std::map<unsigned int, unsigned int> vertex_is;
67 load(parsed_xml_mesh, mesh, vertex_is);
70 if (parsed_xml_mesh->refinements().present() && parsed_xml_mesh->refinements()->ref().size() > 0)
73 for (
unsigned int i = 0; i < parsed_xml_mesh->refinements()->ref().size(); i++)
75 int element_id = parsed_xml_mesh->refinements()->ref().at(i).element_id();
76 int refinement_type = parsed_xml_mesh->refinements()->ref().at(i).refinement_type();
77 if (refinement_type == -1)
78 mesh->unrefine_element_id(element_id);
80 mesh->refine_element_id(element_id, refinement_type);
83 if (HermesCommonApi.get_integral_param_value(checkMeshesOnLoad))
84 mesh->initial_single_check();
88 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
92 void MeshReaderH2DXML::save(
const char *filename, MeshSharedPtr mesh)
99 for (
int i = 0; i < mesh->ntopvert; i++)
100 vertices.
v().push_back(std::auto_ptr<XMLMesh::v>(
new XMLMesh::v(std::to_string((
long double)mesh->nodes[i].x), std::to_string((
long double)mesh->nodes[i].y), i)));
104 for (
int i = 0; i < mesh->get_num_base_elements(); i++)
106 e = mesh->get_element_fast(i);
108 if (e->is_triangle())
109 elements.
el().push_back(
XMLMesh::t_t(e->
vn[0]->
id, e->
vn[1]->
id, e->
vn[2]->
id, mesh->get_element_markers_conversion().get_user_marker(e->
marker).marker.c_str()));
111 elements.
el().push_back(
XMLMesh::q_t(e->
vn[0]->
id, e->
vn[1]->
id, e->
vn[2]->
id, mesh->get_element_markers_conversion().get_user_marker(e->
marker).marker.c_str(), e->
vn[3]->
id));
115 for_all_base_elements(e, mesh)
116 for (
unsigned char i = 0; i < e->get_nvert(); i++)
117 if (MeshUtil::get_base_edge_node(e, i)->marker)
118 edges.
ed().push_back(
XMLMesh::ed(e->
vn[i]->
id, e->
vn[e->
next_vert(i)]->
id, mesh->boundary_markers_conversion.get_user_marker(MeshUtil::get_base_edge_node(e, i)->marker).marker.c_str()));
122 for_all_base_elements(e, mesh)
124 for (
unsigned char i = 0; i < e->get_nvert(); i++)
125 if (e->
cm->curves[i] !=
nullptr)
126 if (e->
cm->curves[i]->type == ArcType)
133 for (
unsigned int refinement_i = 0; refinement_i < mesh->refinements.size(); refinement_i++)
134 refinements.
ref().push_back(
XMLMesh::ref(mesh->refinements[refinement_i].first, mesh->refinements[refinement_i].second));
137 xmlmesh.
curves().set(curves);
141 mesh_schema_location.append(
"/mesh_h2d_xml.xsd");
147 std::ofstream out(filename);
149 XMLMesh::mesh_(out, xmlmesh, namespace_info_map,
"UTF-8", parsing_flags);
153 void MeshReaderH2DXML::load(
const char *filename, std::vector<MeshSharedPtr> meshes)
159 parsing_flags = xml_schema::flags::dont_validate;
164 this->load(parsed_xml_domain, meshes);
168 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
172 void MeshReaderH2DXML::load(std::auto_ptr<XMLSubdomains::domain> & parsed_xml_domain, std::vector<MeshSharedPtr> meshes)
174 for (
unsigned int meshes_i = 0; meshes_i < meshes.size(); meshes_i++)
176 meshes.at(meshes_i)->free();
179 MeshSharedPtr global_mesh(
new Mesh);
183 std::map<int, int> vertex_is;
184 std::map<int, int> element_is;
185 std::map<int, int> edge_is;
188 load(parsed_xml_domain, global_mesh, vertex_is, element_is, edge_is);
190 int max_vertex_i = -1;
191 for (std::map<int, int>::iterator it = vertex_is.begin(); it != vertex_is.end(); ++it)
192 if (it->first > max_vertex_i)
193 max_vertex_i = it->first;
194 int max_element_i = -1;
195 for (std::map<int, int>::iterator it = element_is.begin(); it != element_is.end(); ++it)
196 if (it->first > max_element_i)
197 max_element_i = it->first;
199 for (std::map<int, int>::iterator it = edge_is.begin(); it != edge_is.end(); ++it)
200 if (it->first > max_edge_i)
201 max_edge_i = it->first;
204 unsigned int subdomains_count = parsed_xml_domain->subdomains().subdomain().size();
205 if (subdomains_count != meshes.size())
206 throw Hermes::Exceptions::MeshLoadFailureException(
"Number of subdomains( = %u) does not equal the number of provided meshes in the vector( = %u).", subdomains_count, meshes.size());
208 for (
unsigned int subdomains_i = 0; subdomains_i < subdomains_count; subdomains_i++)
210 for (
unsigned short element_i = 0; element_i < parsed_xml_domain->elements().el().size(); element_i++)
215 unsigned int begin = element->
m().find_first_not_of(
" \t\n");
216 unsigned int end = element->
m().find_last_not_of(
" \t\n");
217 element->
m().erase(end + 1, element->
m().length());
218 element->
m().erase(0, begin);
220 meshes[subdomains_i]->element_markers_conversion.insert_marker(element->
m());
222 for (
unsigned int edge_i = 0; edge_i < parsed_xml_domain->edges().ed().size(); edge_i++)
227 unsigned int begin = edge->
m().find_first_not_of(
" \t\n");
228 unsigned int end = edge->
m().find_last_not_of(
" \t\n");
229 edge->
m().erase(end + 1, edge->
m().length());
230 edge->
m().erase(0, begin);
232 meshes[subdomains_i]->boundary_markers_conversion.insert_marker(edge->
m());
236 for (
unsigned int subdomains_i = 0; subdomains_i < subdomains_count; subdomains_i++)
238 unsigned int vertex_number_count = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).vertices().present() ? parsed_xml_domain->subdomains().subdomain().at(subdomains_i).vertices()->i().size() : 0;
239 unsigned int element_number_count = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).elements().present() ? parsed_xml_domain->subdomains().subdomain().at(subdomains_i).elements()->i().size() : 0;
240 unsigned int boundary_edge_number_count = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).boundary_edges().present() ? parsed_xml_domain->subdomains().subdomain().at(subdomains_i).boundary_edges()->i().size() : 0;
241 unsigned int inner_edge_number_count = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).inner_edges().present() ? parsed_xml_domain->subdomains().subdomain().at(subdomains_i).inner_edges()->i().size() : 0;
244 if (element_number_count == 0 || element_number_count == parsed_xml_domain->elements().el().size())
246 meshes[subdomains_i]->copy(global_mesh);
248 if (parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements().present() && parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().size() > 0)
251 for (
unsigned int i = 0; i < parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().size(); i++)
253 int element_id = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().at(i).element_id();
254 int refinement_type = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().at(i).refinement_type();
255 if (refinement_type == -1)
256 meshes[subdomains_i]->unrefine_element_id(element_id);
258 meshes[subdomains_i]->refine_element_id(element_id, refinement_type);
265 unsigned int variables_count = parsed_xml_domain->variables().present() ? parsed_xml_domain->variables()->var().size() : 0;
267 std::map<std::string, double> variables;
268 for (
unsigned int variables_i = 0; variables_i < variables_count; variables_i++)
270 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_domain->variables()->var().at(variables_i).name(), (
double&&)parsed_xml_domain->variables()->var().at(variables_i).value()));
272 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_domain->variables()->var().at(variables_i).name(), parsed_xml_domain->variables()->var().at(variables_i).value()));
276 std::map<unsigned int, unsigned int> vertex_vertex_numbers;
279 int size = HashTable::H2D_DEFAULT_HASH_SIZE;
280 while (size < 8 * vertex_number_count)
282 meshes[subdomains_i]->init(size);
285 if (vertex_number_count == 0)
286 vertex_number_count = parsed_xml_domain->vertices().v().size();
287 for (
unsigned int vertex_numbers_i = 0; vertex_numbers_i < vertex_number_count; vertex_numbers_i++)
289 unsigned int vertex_number;
290 if (vertex_number_count == parsed_xml_domain->vertices().v().size())
291 vertex_number = vertex_is[vertex_numbers_i];
294 vertex_number = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).vertices()->i().at(vertex_numbers_i);
295 if (vertex_number > max_vertex_i)
296 throw Exceptions::MeshLoadFailureException(
"Wrong vertex number:%u in subdomain %u.", vertex_number, subdomains_i);
299 vertex_vertex_numbers.insert(std::pair<unsigned int, unsigned int>(vertex_number, vertex_numbers_i));
300 Node* node = meshes[subdomains_i]->nodes.add();
301 assert(node->
id == vertex_numbers_i);
302 node->
ref = TOP_LEVEL_REF;
303 node->
type = HERMES_TYPE_VERTEX;
305 node->
p1 = node->p2 = -1;
309 std::string x = parsed_xml_domain->vertices().v().at(vertex_number).x();
310 std::string y = parsed_xml_domain->vertices().v().at(vertex_number).y();
315 bool x_found =
false;
316 bool y_found =
false;
317 if (variables.find(x) != variables.end())
319 x_value = variables.find(x)->second;
322 if (variables.find(y) != variables.end())
324 y_value = variables.find(y)->second;
330 x_value = std::strtod(x.c_str(),
nullptr);
332 y_value = std::strtod(y.c_str(),
nullptr);
338 meshes[subdomains_i]->ntopvert = vertex_number_count;
341 unsigned int element_count = parsed_xml_domain->elements().el().size();
342 meshes[subdomains_i]->nbase = element_count;
343 meshes[subdomains_i]->nactive = meshes[subdomains_i]->ninitial = element_number_count;
346 int* elements_existing =
new int[element_count];
347 for (
int i = 0; i < element_count; i++)
348 elements_existing[i] = -1;
349 for (
int element_number_i = 0; element_number_i < element_number_count; element_number_i++)
351 int elementI = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).elements()->i().at(element_number_i);
352 if (elementI > max_element_i)
353 throw Exceptions::MeshLoadFailureException(
"Wrong element number:%i in subdomain %u.", elementI, subdomains_i);
355 elements_existing[element_is[parsed_xml_domain->subdomains().subdomain().at(subdomains_i).elements()->i().at(element_number_i)]] = elementI;
357 for (
int element_i = 0; element_i < element_count; element_i++)
360 if (element_number_count == 0)
363 found = elements_existing[element_i] != -1;
367 meshes[subdomains_i]->elements.skip_slot()->cm =
nullptr;
372 for (
int searched_element_i = 0; searched_element_i < element_count; searched_element_i++)
374 element = &parsed_xml_domain->elements().el().at(searched_element_i);
375 if (element->
i() == elements_existing[element_i])
380 if (element ==
nullptr)
381 throw Exceptions::MeshLoadFailureException(
"Element number wrong in the mesh file.");
386 e = meshes[subdomains_i]->create_quad(meshes[subdomains_i]->element_markers_conversion.get_internal_marker(element->
m()).marker,
387 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_q->
v1())->second],
388 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_q->
v2())->second],
389 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_q->
v3())->second],
390 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_q->
v4())->second],
393 e = meshes[subdomains_i]->create_triangle(meshes[subdomains_i]->element_markers_conversion.get_internal_marker(element->
m()).marker,
394 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_t->
v1())->second],
395 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_t->
v2())->second],
396 &meshes[subdomains_i]->nodes[vertex_vertex_numbers.find(el_t->
v3())->second],
401 if (boundary_edge_number_count == 0)
402 boundary_edge_number_count = parsed_xml_domain->edges().ed().size();
404 for (
int boundary_edge_number_i = 0; boundary_edge_number_i < boundary_edge_number_count; boundary_edge_number_i++)
407 int domain_edge_count = parsed_xml_domain->edges().
ed().size();
408 for (
unsigned int to_find_i = 0; to_find_i < domain_edge_count; to_find_i++)
410 if (boundary_edge_number_count != domain_edge_count)
412 if (parsed_xml_domain->edges().ed().at(to_find_i).i() == parsed_xml_domain->subdomains().subdomain().at(subdomains_i).boundary_edges()->i().at(boundary_edge_number_i))
414 edge = &parsed_xml_domain->edges().
ed().at(to_find_i);
420 if (parsed_xml_domain->edges().ed().at(to_find_i).i() == edge_is[boundary_edge_number_i])
422 edge = &parsed_xml_domain->edges().
ed().at(to_find_i);
429 throw Exceptions::MeshLoadFailureException(
"Wrong boundary-edge number:%i in subdomain %u.", parsed_xml_domain->subdomains().subdomain().at(subdomains_i).boundary_edges()->i().at(boundary_edge_number_i), subdomains_i);
431 Node* en = meshes[subdomains_i]->peek_edge_node(vertex_vertex_numbers.find(edge->
v1())->second, vertex_vertex_numbers.find(edge->
v2())->second);
433 throw Hermes::Exceptions::MeshLoadFailureException(
"Boundary data error (edge %i does not exist).", boundary_edge_number_i);
435 en->marker = meshes[subdomains_i]->boundary_markers_conversion.get_internal_marker(edge->
m()).marker;
439 for_all_edge_nodes(node, meshes[subdomains_i])
443 meshes[subdomains_i]->nodes[node->
p1].bnd = 1;
444 meshes[subdomains_i]->nodes[node->p2].bnd = 1;
450 for (
int inner_edge_number_i = 0; inner_edge_number_i < inner_edge_number_count; inner_edge_number_i++)
454 for (
unsigned int to_find_i = 0; to_find_i < parsed_xml_domain->edges().ed().size(); to_find_i++)
456 if (parsed_xml_domain->edges().ed().at(to_find_i).i() == parsed_xml_domain->subdomains().subdomain().at(subdomains_i).inner_edges()->i().at(inner_edge_number_i))
458 edge = &parsed_xml_domain->edges().
ed().at(to_find_i);
464 throw Exceptions::MeshLoadFailureException(
"Wrong inner-edge number:%i in subdomain %u.", parsed_xml_domain->subdomains().subdomain().at(subdomains_i).boundary_edges()->i().at(inner_edge_number_i), subdomains_i);
466 Node* en = meshes[subdomains_i]->peek_edge_node(vertex_vertex_numbers.find(edge->
v1())->second, vertex_vertex_numbers.find(edge->
v2())->second);
468 throw Hermes::Exceptions::MeshLoadFailureException(
"Inner data error (edge %i does not exist).", inner_edge_number_i);
470 en->marker = meshes[subdomains_i]->boundary_markers_conversion.get_internal_marker(edge->
m()).marker;
475 unsigned int arc_count = parsed_xml_domain->curves().present() ? parsed_xml_domain->curves()->arc().size() : 0;
476 unsigned int nurbs_count = parsed_xml_domain->curves().present() ? parsed_xml_domain->curves()->NURBS().size() : 0;
478 for (
unsigned int curves_i = 0; curves_i < arc_count + nurbs_count; curves_i++)
486 if (curves_i < arc_count)
488 if (vertex_vertex_numbers.find(parsed_xml_domain->curves()->arc().at(curves_i).v1()) == vertex_vertex_numbers.end() ||
489 vertex_vertex_numbers.find(parsed_xml_domain->curves()->arc().at(curves_i).v2()) == vertex_vertex_numbers.end())
494 p1 = vertex_vertex_numbers.find(parsed_xml_domain->curves()->arc().at(curves_i).v1())->second;
495 p2 = vertex_vertex_numbers.find(parsed_xml_domain->curves()->arc().at(curves_i).v2())->second;
497 curve = MeshUtil::load_arc(meshes[subdomains_i], curves_i, &en, p1, p2, parsed_xml_domain->curves()->arc().at(curves_i).angle(),
true);
498 if (curve ==
nullptr)
504 if (vertex_vertex_numbers.find(parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v1()) == vertex_vertex_numbers.end() ||
505 vertex_vertex_numbers.find(parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v2()) == vertex_vertex_numbers.end())
510 p1 = vertex_vertex_numbers.find(parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v1())->second;
511 p2 = vertex_vertex_numbers.find(parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v2())->second;
513 curve = load_nurbs(meshes[subdomains_i], parsed_xml_domain, curves_i - arc_count, &en, p1, p2,
true);
514 if (curve ==
nullptr)
520 MeshUtil::assign_curve(en, curve, p1, p2);
524 for_all_used_elements(e, meshes[subdomains_i])
526 if (e->
cm !=
nullptr)
528 RefMap::set_element_iro_cache(e);
532 if (parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements().present() && parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().size() > 0)
535 for (
unsigned int i = 0; i < parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().size(); i++)
537 int element_id = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().at(i).element_id();
538 int refinement_type = parsed_xml_domain->subdomains().subdomain().at(subdomains_i).refinements()->ref().at(i).refinement_type();
539 if (refinement_type == -1)
540 meshes[subdomains_i]->unrefine_element_id(element_id);
542 meshes[subdomains_i]->refine_element_id(element_id, refinement_type);
546 delete[] elements_existing;
548 meshes[subdomains_i]->seq = g_mesh_seq++;
549 if (HermesCommonApi.get_integral_param_value(checkMeshesOnLoad))
550 meshes[subdomains_i]->initial_single_check();
555 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
561 void MeshReaderH2DXML::save(
const char *filename, std::vector<MeshSharedPtr> meshes)
564 std::map<std::pair<double, double>,
unsigned int> points_to_vertices;
566 std::map<std::pair<unsigned int, unsigned int>,
unsigned int> vertices_to_boundaries;
568 std::map<std::pair<unsigned int, unsigned int>,
bool> vertices_to_curves;
573 std::vector<XMLSubdomains::el_t*> elements;
579 bool* baseElementsSaved =
new bool[meshes[0]->get_num_base_elements()];
580 memset(baseElementsSaved, 0,
sizeof(
bool)* meshes[0]->get_num_base_elements());
585 for (
unsigned int meshes_i = 0; meshes_i < meshes.size(); meshes_i++)
587 bool hasAllElements = (meshes[meshes_i]->get_num_used_base_elements() == meshes[meshes_i]->get_num_base_elements());
596 std::map<unsigned int, unsigned int> vertices_to_vertices;
603 for (
int i = 0; i < meshes[meshes_i]->ntopvert; i++)
608 std::map<std::pair<double, double>,
unsigned int>::iterator it = points_to_vertices.find(std::pair<double, double>(meshes[meshes_i]->nodes[i].x, meshes[meshes_i]->nodes[i].y));
609 if (it != points_to_vertices.end())
610 vertices_to_vertices.insert(std::pair<unsigned int, unsigned int>(i, it->second));
613 int new_i = points_to_vertices.size();
614 vertices_to_vertices.insert(std::pair<unsigned int, unsigned int>(i, new_i));
615 points_to_vertices.insert(std::pair<std::pair<double, double>,
unsigned int>(std::pair<double, double>(meshes[meshes_i]->nodes[i].x, meshes[meshes_i]->nodes[i].y), new_i));
617 vertices.
v().push_back(std::auto_ptr<XMLMesh::v>(
new XMLMesh::v(std::to_string((
long double)meshes[meshes_i]->nodes[i].x), std::to_string((
long double)meshes[meshes_i]->nodes[i].y), new_i)));
620 subdomain.
vertices()->i().push_back(vertices_to_vertices.find(i)->second);
625 for (
int i = 0; i < meshes[meshes_i]->get_num_base_elements(); i++)
627 e = &(meshes[meshes_i]->elements[i]);
630 if (!baseElementsSaved[e->
id])
634 elements.push_back(
new XMLSubdomains::t_t(vertices_to_vertices.find(e->
vn[0]->
id)->second, vertices_to_vertices.find(e->
vn[1]->
id)->second, vertices_to_vertices.find(e->
vn[2]->
id)->second, meshes[meshes_i]->get_element_markers_conversion().get_user_marker(e->
marker).marker.c_str(), e->
id));
638 elements.push_back(
new XMLSubdomains::q_t(vertices_to_vertices.find(e->
vn[0]->
id)->second, vertices_to_vertices.find(e->
vn[1]->
id)->second, vertices_to_vertices.find(e->
vn[2]->
id)->second, meshes[meshes_i]->get_element_markers_conversion().get_user_marker(e->
marker).marker.c_str(), e->
id, vertices_to_vertices.find(e->
vn[3]->
id)->second));
640 baseElementsSaved[e->
id] =
true;
649 bool has_inner_edges =
false;
650 for_all_base_elements(e, meshes[meshes_i])
652 for (
unsigned char i = 0; i < e->get_nvert(); i++)
654 if (MeshUtil::get_base_edge_node(e, i)->bnd)
656 if (vertices_to_boundaries.find(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second))) == vertices_to_boundaries.end())
658 unsigned int edge_i = edges.
ed().size();
659 vertices_to_boundaries.insert(std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second)), edge_i));
660 edges.
ed().push_back(
XMLSubdomains::ed(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second, meshes[meshes_i]->boundary_markers_conversion.get_user_marker(MeshUtil::get_base_edge_node(e, i)->marker).marker.c_str(), edge_i));
663 subdomain.
boundary_edges()->i().push_back(vertices_to_boundaries.find(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second)))->second);
666 has_inner_edges =
true;
673 for_all_base_elements(e, meshes[meshes_i])
674 for (
unsigned char i = 0; i < e->get_nvert(); i++)
676 if (!MeshUtil::get_base_edge_node(e, i)->bnd)
678 if (vertices_to_boundaries.find(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second))) == vertices_to_boundaries.end())
680 unsigned int edge_i = edges.
ed().size();
681 vertices_to_boundaries.insert(std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second)), edge_i));
682 edges.
ed().push_back(
XMLSubdomains::ed(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second, meshes[meshes_i]->boundary_markers_conversion.get_user_marker(MeshUtil::get_base_edge_node(e, i)->marker).marker.c_str(), edge_i));
685 subdomain.
inner_edges()->i().push_back(vertices_to_boundaries.find(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second)))->second);
691 for_all_base_elements(e, meshes[meshes_i])
694 for (
unsigned char i = 0; i < e->get_nvert(); i++)
695 if (e->
cm->curves[i] !=
nullptr)
696 if (vertices_to_curves.find(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second))) == vertices_to_curves.end())
698 if (e->
cm->curves[i]->type == ArcType)
699 save_arc(meshes[meshes_i], vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second, (
Arc*)e->
cm->curves[i], curves);
701 save_nurbs(meshes[meshes_i], vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second, (
Nurbs*)e->
cm->curves[i], curves);
702 vertices_to_curves.insert(std::pair<std::pair<unsigned int, unsigned int>,
bool>(std::pair<unsigned int, unsigned int>(std::min(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second), std::max(vertices_to_vertices.find(e->
vn[i]->
id)->second, vertices_to_vertices.find(e->
vn[e->
next_vert(i)]->
id)->second)),
true));
707 for (
unsigned int refinement_i = 0; refinement_i < meshes[meshes_i]->refinements.size(); refinement_i++)
708 refinements.
ref().push_back(
XMLMesh::ref(meshes[meshes_i]->refinements[refinement_i].first, meshes[meshes_i]->refinements[refinement_i].second));
711 subdomains.
subdomain().push_back(subdomain);
714 delete[] baseElementsSaved;
716 std::sort(elements.begin(), elements.end(), elementCompare);
719 for (
unsigned short i = 0; i < elements.size(); i++)
720 elementsToPass.
el().push_back(*elements[i]);
722 for (
unsigned short i = 0; i < elements.size(); i++)
725 xmldomain.
curves().set(curves);
728 mesh_schema_location.append(
"/mesh_h2d_xml.xsd");
732 domain_schema_location.append(
"/subdomains_h2d_xml.xsd");
739 std::ofstream out(filename);
745 void MeshReaderH2DXML::load(std::auto_ptr<XMLMesh::mesh> & parsed_xml_mesh, MeshSharedPtr mesh, std::map<unsigned int, unsigned int>& vertex_is)
750 unsigned int variables_count = parsed_xml_mesh->variables().present() ? parsed_xml_mesh->variables()->var().size() : 0;
751 std::map<std::string, double> variables;
752 for (
unsigned int variables_i = 0; variables_i < variables_count; variables_i++)
754 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_mesh->variables()->var().at(variables_i).name(), (
double&&)parsed_xml_mesh->variables()->var().at(variables_i).value()));
756 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_mesh->variables()->var().at(variables_i).name(), parsed_xml_mesh->variables()->var().at(variables_i).value()));
760 int vertices_count = parsed_xml_mesh->vertices().v().size();
763 int size = HashTable::H2D_DEFAULT_HASH_SIZE;
764 while (size < 8 * vertices_count)
769 for (
int vertex_i = 0; vertex_i < vertices_count; vertex_i++)
771 Node* node = mesh->nodes.add();
772 assert(node->
id == vertex_i);
773 node->
ref = TOP_LEVEL_REF;
774 node->
type = HERMES_TYPE_VERTEX;
776 node->
p1 = node->p2 = -1;
780 std::string x = parsed_xml_mesh->vertices().v().at(vertex_i).x();
781 std::string y = parsed_xml_mesh->vertices().v().at(vertex_i).y();
784 vertex_is.insert(std::pair<unsigned int, unsigned int>(parsed_xml_mesh->vertices().v().at(vertex_i).i(), vertex_i));
790 bool x_found =
false;
791 bool y_found =
false;
792 if (variables.find(x) != variables.end())
794 x_value = variables.find(x)->second;
797 if (variables.find(y) != variables.end())
799 y_value = variables.find(y)->second;
805 x_value = std::strtod(x.c_str(),
nullptr);
808 y_value = std::strtod(y.c_str(),
nullptr);
814 mesh->ntopvert = vertices_count;
817 unsigned int element_count = parsed_xml_mesh->elements().el().size();
818 mesh->nbase = mesh->nactive = mesh->ninitial = element_count;
821 for (
int element_i = 0; element_i < element_count; element_i++)
826 unsigned int begin = element->
m().find_first_not_of(
" \t\n");
827 unsigned int end = element->
m().find_last_not_of(
" \t\n");
828 element->
m().erase(end + 1, element->
m().length());
829 element->
m().erase(0, begin);
831 mesh->element_markers_conversion.insert_marker(element->
m());
836 e = mesh->create_quad(mesh->element_markers_conversion.get_internal_marker(element->
m()).marker,
837 &mesh->nodes[vertex_is.find(el_q->
v1())->second],
838 &mesh->nodes[vertex_is.find(el_q->
v2())->second],
839 &mesh->nodes[vertex_is.find(el_q->
v3())->second],
840 &mesh->nodes[vertex_is.find(el_q->
v4())->second],
843 e = mesh->create_triangle(mesh->element_markers_conversion.get_internal_marker(element->
m()).marker,
844 &mesh->nodes[vertex_is.find(el_t->
v1())->second],
845 &mesh->nodes[vertex_is.find(el_t->
v2())->second],
846 &mesh->nodes[vertex_is.find(el_t->
v3())->second],
851 unsigned int edges_count = parsed_xml_mesh->edges().ed().size();
854 for (
unsigned int edge_i = 0; edge_i < edges_count; edge_i++)
856 int v1 = vertex_is.find(parsed_xml_mesh->edges().ed().at(edge_i).v1())->second;
857 int v2 = vertex_is.find(parsed_xml_mesh->edges().ed().at(edge_i).v2())->second;
859 en = mesh->peek_edge_node(v1, v2);
861 throw Hermes::Exceptions::MeshLoadFailureException(
"Boundary data #%d: edge %d-%d does not exist.", edge_i, v1, v2);
863 std::string edge_marker = parsed_xml_mesh->edges().ed().at(edge_i).m();
866 unsigned int begin = edge_marker.find_first_not_of(
" \t\n");
867 unsigned int end = edge_marker.find_last_not_of(
" \t\n");
868 edge_marker.erase(end + 1, edge_marker.length());
869 edge_marker.erase(0, begin);
873 mesh->boundary_markers_conversion.insert_marker(edge_marker);
875 en->
marker = mesh->boundary_markers_conversion.get_internal_marker(edge_marker).marker;
879 for_all_edge_nodes(node, mesh)
883 mesh->nodes[node->
p1].bnd = 1;
884 mesh->nodes[node->p2].bnd = 1;
890 for_all_edge_nodes(en, mesh)
892 this->warn(
"Boundary edge node does not have a boundary marker.");
896 unsigned int arc_count = parsed_xml_mesh->curves().present() ? parsed_xml_mesh->curves()->arc().size() : 0;
897 unsigned int nurbs_count = parsed_xml_mesh->curves().present() ? parsed_xml_mesh->curves()->NURBS().size() : 0;
899 for (
unsigned int curves_i = 0; curves_i < arc_count + nurbs_count; curves_i++)
907 if (curves_i < arc_count)
910 p1 = vertex_is.find(parsed_xml_mesh->curves()->arc().at(curves_i).v1())->second;
911 p2 = vertex_is.find(parsed_xml_mesh->curves()->arc().at(curves_i).v2())->second;
913 curve = MeshUtil::load_arc(mesh, curves_i, &en, p1, p2, parsed_xml_mesh->curves()->arc().at(curves_i).angle());
918 p1 = vertex_is.find(parsed_xml_mesh->curves()->NURBS().at(curves_i - arc_count).v1())->second;
919 p2 = vertex_is.find(parsed_xml_mesh->curves()->NURBS().at(curves_i - arc_count).v2())->second;
920 curve = load_nurbs(mesh, parsed_xml_mesh, curves_i - arc_count, &en, p1, p2);
923 MeshUtil::assign_curve(en, curve, p1, p2);
927 for_all_used_elements(e, mesh)
929 if (e->
cm !=
nullptr)
931 RefMap::set_element_iro_cache(e);
936 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
940 void MeshReaderH2DXML::load(std::auto_ptr<XMLSubdomains::domain> & parsed_xml_domain, MeshSharedPtr mesh, std::map<int, int>& vertex_is, std::map<int, int>& element_is, std::map<int, int>& edge_is)
945 unsigned int variables_count = parsed_xml_domain->variables().present() ? parsed_xml_domain->variables()->var().size() : 0;
946 std::map<std::string, double> variables;
947 for (
unsigned int variables_i = 0; variables_i < variables_count; variables_i++)
949 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_domain->variables()->var().at(variables_i).name(), (
double&&)parsed_xml_domain->variables()->var().at(variables_i).value()));
951 variables.insert(std::pair<std::string, double>((
std::string)parsed_xml_domain->variables()->var().at(variables_i).name(), parsed_xml_domain->variables()->var().at(variables_i).value()));
955 int vertices_count = parsed_xml_domain->vertices().v().size();
958 int size = HashTable::H2D_DEFAULT_HASH_SIZE;
959 while (size < 8 * vertices_count)
996 for (
int vertex_i = 0; vertex_i < vertices_count; vertex_i++)
998 Node* node = mesh->nodes.add();
999 assert(node->
id == vertex_i);
1000 node->
ref = TOP_LEVEL_REF;
1001 node->
type = HERMES_TYPE_VERTEX;
1003 node->
p1 = node->p2 = -1;
1007 std::string x = parsed_xml_domain->vertices().v().at(vertex_i).x();
1008 std::string y = parsed_xml_domain->vertices().v().at(vertex_i).y();
1010 if (parsed_xml_domain->vertices().v().at(vertex_i).i() > H2D_MAX_NODE_ID - 1)
1011 throw Exceptions::MeshLoadFailureException(
"The index 'i' of vertex in the mesh file must be lower than %i.", H2D_MAX_NODE_ID);
1014 vertex_is.insert(std::pair<int, int>(parsed_xml_domain->vertices().v().at(vertex_i).i(), vertex_i));
1020 bool x_found =
false;
1021 bool y_found =
false;
1022 if (variables.find(x) != variables.end())
1024 x_value = variables.find(x)->second;
1027 if (variables.find(y) != variables.end())
1029 y_value = variables.find(y)->second;
1035 x_value = std::strtod(x.c_str(),
nullptr);
1038 y_value = std::strtod(y.c_str(), NULL);
1044 mesh->ntopvert = vertices_count;
1047 unsigned int element_count = parsed_xml_domain->elements().el().size();
1048 mesh->nbase = mesh->nactive = mesh->ninitial = element_count;
1051 for (
int element_i = 0; element_i < element_count; element_i++)
1056 if (parsed_xml_domain->elements().el().at(element_i).i() > H2D_MAX_NODE_ID - 1)
1057 throw Exceptions::MeshLoadFailureException(
"The index 'i' of element in the mesh file must be lower than %i.", H2D_MAX_NODE_ID);
1059 element_is.insert(std::pair<int, int>(parsed_xml_domain->elements().el().at(element_i).i(), element_i));
1062 unsigned int begin = element->
m().find_first_not_of(
" \t\n");
1063 unsigned int end = element->
m().find_last_not_of(
" \t\n");
1064 element->
m().erase(end + 1, element->
m().length());
1065 element->
m().erase(0, begin);
1067 mesh->element_markers_conversion.insert_marker(element->
m());
1071 if (el_q !=
nullptr)
1072 e = mesh->create_quad(mesh->element_markers_conversion.get_internal_marker(element->
m()).marker,
1073 &mesh->nodes[el_q->
v1()],
1074 &mesh->nodes[el_q->
v2()],
1075 &mesh->nodes[el_q->
v3()],
1076 &mesh->nodes[el_q->
v4()],
1078 if (el_t !=
nullptr)
1079 e = mesh->create_triangle(mesh->element_markers_conversion.get_internal_marker(element->
m()).marker,
1080 &mesh->nodes[el_t->
v1()],
1081 &mesh->nodes[el_t->
v2()],
1082 &mesh->nodes[el_t->
v3()],
1087 unsigned int edges_count = parsed_xml_domain->edges().ed().size();
1090 for (
unsigned int edge_i = 0; edge_i < edges_count; edge_i++)
1092 int v1 = parsed_xml_domain->edges().ed().at(edge_i).v1();
1093 int v2 = parsed_xml_domain->edges().ed().at(edge_i).v2();
1096 if (parsed_xml_domain->edges().ed().at(edge_i).i() > H2D_MAX_NODE_ID - 1)
1097 throw Exceptions::MeshLoadFailureException(
"The index 'i' of edge in the mesh file must be lower than %i.", H2D_MAX_NODE_ID);
1099 edge_is.insert(std::pair<int, int>(edge_i, parsed_xml_domain->edges().ed().at(edge_i).i()));
1101 en = mesh->peek_edge_node(v1, v2);
1103 throw Hermes::Exceptions::MeshLoadFailureException(
"Boundary data #%d: edge %d-%d does not exist.", edge_i, v1, v2);
1105 std::string edge_marker = parsed_xml_domain->edges().ed().at(edge_i).m();
1108 unsigned int begin = edge_marker.find_first_not_of(
" \t\n");
1109 unsigned int end = edge_marker.find_last_not_of(
" \t\n");
1110 edge_marker.erase(end + 1, edge_marker.length());
1111 edge_marker.erase(0, begin);
1115 mesh->boundary_markers_conversion.insert_marker(edge_marker);
1116 int marker = mesh->boundary_markers_conversion.get_internal_marker(edge_marker).marker;
1122 for_all_edge_nodes(node, mesh)
1126 mesh->nodes[node->
p1].bnd = 1;
1127 mesh->nodes[node->p2].bnd = 1;
1133 for_all_edge_nodes(en, mesh)
1135 this->warn(
"Boundary edge node does not have a boundary marker.");
1139 unsigned int arc_count = parsed_xml_domain->curves().present() ? parsed_xml_domain->curves()->arc().size() : 0;
1140 unsigned int nurbs_count = parsed_xml_domain->curves().present() ? parsed_xml_domain->curves()->NURBS().size() : 0;
1142 for (
unsigned int curves_i = 0; curves_i < arc_count + nurbs_count; curves_i++)
1150 if (curves_i < arc_count)
1153 p1 = parsed_xml_domain->curves()->arc().at(curves_i).v1();
1154 p2 = parsed_xml_domain->curves()->arc().at(curves_i).v2();
1156 curve = MeshUtil::load_arc(mesh, curves_i, &en, p1, p2, parsed_xml_domain->curves()->arc().at(curves_i).angle());
1161 p1 = parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v1();
1162 p2 = parsed_xml_domain->curves()->NURBS().at(curves_i - arc_count).v2();
1163 curve = load_nurbs(mesh, parsed_xml_domain, curves_i - arc_count, &en, p1, p2);
1167 MeshUtil::assign_curve(en, curve, p1, p2);
1171 for_all_used_elements(e, mesh)
1173 if (e->
cm !=
nullptr)
1175 RefMap::set_element_iro_cache(e);
1180 throw Hermes::Exceptions::MeshLoadFailureException(e.what());
1184 template<
typename T>
1185 Nurbs* MeshReaderH2DXML::load_nurbs(MeshSharedPtr mesh, std::auto_ptr<T> & parsed_xml_entity,
int id,
Node** en,
int p1,
int p2,
bool skip_check)
1189 *en = mesh->peek_edge_node(p1, p2);
1194 throw Hermes::Exceptions::MeshLoadFailureException(
"Curve #%d: edge %d-%d does not exist.",
id, p1, p2);
1200 nurbs->
degree = parsed_xml_entity->curves()->NURBS().at(
id).deg();
1203 int inner = parsed_xml_entity->curves()->NURBS().at(
id).inner_point().size();
1205 nurbs->
np = inner + 2;
1208 nurbs->
pt =
new double3[nurbs->
np];
1209 nurbs->
pt[0][0] = mesh->nodes[p1].x;
1210 nurbs->
pt[0][1] = mesh->nodes[p1].y;
1211 nurbs->
pt[0][2] = 1.0;
1212 nurbs->
pt[inner + 1][0] = mesh->nodes[p2].x;
1213 nurbs->
pt[inner + 1][1] = mesh->nodes[p2].y;
1214 nurbs->
pt[inner + 1][2] = 1.0;
1217 for (
int i = 0; i < inner; i++)
1219 nurbs->
pt[i + 1][0] = parsed_xml_entity->curves()->NURBS().at(
id).inner_point().at(i).x();
1220 nurbs->
pt[i + 1][1] = parsed_xml_entity->curves()->NURBS().at(
id).inner_point().at(i).y();
1221 nurbs->
pt[i + 1][2] = parsed_xml_entity->curves()->NURBS().at(
id).inner_point().at(i).weight();
1225 inner = parsed_xml_entity->curves()->NURBS().at(
id).knot().size();
1227 int outer = nurbs->
nk - inner;
1228 if ((outer & 1) == 1)
1229 throw Hermes::Exceptions::MeshLoadFailureException(
"Curve #%d: incorrect number of knot points.",
id);
1232 nurbs->
kv =
new double[nurbs->
nk];
1234 for (
int i = 0; i < outer / 2; i++)
1238 for (
int i = outer / 2; i < inner + outer / 2; i++)
1239 nurbs->
kv[i] = parsed_xml_entity->curves()->NURBS().at(
id).knot().at(i - (outer / 2)).value();
1241 for (
int i = outer / 2 + inner; i < nurbs->
nk; i++)
1256 int inner = curve->
np - 2;
1258 for (
int i = 1; i < curve->
np - 1; i++)
1261 int max = curve->
nk - (curve->
degree + 1);
1262 for (
int i = curve->
degree + 1; i < max; i++)
unsigned char np
number of control points
double x
vertex node coordinates
Class corresponding to the q_t schema type.
unsigned type
0 = vertex node; 1 = edge node
const v4_type & v4() const
Return a read-only (constant) reference to the attribute.
Class corresponding to the elements schema type.
const v3_type & v3() const
Return a read-only (constant) reference to the attribute.
Class corresponding to the t_t schema type.
unsigned char next_vert(unsigned char i) const
Helper functions to obtain the index of the next or previous vertex/edge.
Class corresponding to the elements_type schema type.
Class corresponding to the ed schema type.
Node * next_hash
next node in hash synonym list
HERMES_API Hermes::Hermes2D::Api2D Hermes2DApi
Global instance used inside Hermes which is also accessible to users.
const curves_optional & curves() const
Return a read-only (constant) reference to the element container.
::xsd::cxx::tree::flags flags
Parsing and serialization flags.
const ed_sequence & ed() const
Return a read-only (constant) reference to the element sequence.
Stores one element of a mesh.
Class corresponding to the subdomains schema type.
Class corresponding to the arc schema type.
Represents a finite element mesh. Typical usage: MeshSharedPtr mesh; Hermes::Hermes2D::MeshReaderH2DX...
Class corresponding to the v schema type.
Class corresponding to the knot schema type.
const v2_type & v2() const
Return a read-only (constant) reference to the attribute.
Class corresponding to the NURBS schema type.
ed(const v1_type &, const v2_type &, const m_type &, const i_type &)
Create an instance from the ultimate base and initializers for required elements and attributes...
Class corresponding to the q_t schema type.
const v3_type & v3() const
Return a read-only (constant) reference to the attribute.
CurvMap * cm
curved mapping, nullptr if not curvilinear
const v4_type & v4() const
Return a read-only (constant) reference to the attribute.
::xsd::cxx::tree::exception< char > exception
Root of the C++/Tree exception hierarchy.
const refinements_optional & refinements() const
Return a read-only (constant) reference to the element container.
Represents one NURBS curve.
Stores one node of a mesh.
const elements_optional & elements() const
Return a read-only (constant) reference to the element container.
bool used
array item usage flag
const ed_sequence & ed() const
Return a read-only (constant) reference to the element sequence.
Class corresponding to the vertices_type schema type.
unsigned char nvert
number of vertices (3 or 4)
const m_type & m() const
Return a read-only (constant) reference to the attribute.
const i_type & i() const
Return a read-only (constant) reference to the attribute.
Class corresponding to the domain schema type.
const el_sequence & el() const
Return a read-only (constant) reference to the element sequence.
Class corresponding to the inner_edges schema type.
Class corresponding to the mesh schema type.
Class corresponding to the vertices schema type.
const curves_optional & curves() const
Return a read-only (constant) reference to the element container.
Class corresponding to the edges_type schema type.
const m_type & m() const
Return a read-only (constant) reference to the attribute.
const subdomain_sequence & subdomain() const
Return a read-only (constant) reference to the element sequence.
::xsd::cxx::xml::dom::namespace_info< char > namespace_info
Namespace serialization information.
const v1_type & v1() const
Return a read-only (constant) reference to the attribute.
const inner_edges_optional & inner_edges() const
Return a read-only (constant) reference to the element container.
unsigned char nk
knot vector length
Class corresponding to the subdomain schema type.
const v2_type & v2() const
Return a read-only (constant) reference to the attribute.
::xsd::cxx::xml::dom::namespace_infomap< char > namespace_infomap
Namespace serialization information map.
Class corresponding to the el_t schema type.
const el_sequence & el() const
Return a read-only (constant) reference to the element sequence.
Class corresponding to the ref schema type.
Class corresponding to the elements_type schema type.
const boundary_edges_optional & boundary_edges() const
Return a read-only (constant) reference to the element container.
const v1_type & v1() const
Return a read-only (constant) reference to the attribute.
Class corresponding to the boundary_edges schema type.
unsigned bnd
1 = boundary node; 0 = inner node
unsigned char degree
curve degree (2=quadratic, etc.)
const refinements_optional & refinements() const
Return a read-only (constant) reference to the element container.
Class corresponding to the inner_point schema type.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
const v1_type & v1() const
Return a read-only (constant) reference to the attribute.
const v2_type & v2() const
Return a read-only (constant) reference to the attribute.
const inner_point_sequence & inner_point() const
Return a read-only (constant) reference to the element sequence.
unsigned ref
the number of elements using the node
void update_refmap_coeffs(Element *e)
const vertices_optional & vertices() const
Return a read-only (constant) reference to the element container.
Class corresponding to the ed schema type.
const knot_sequence & knot() const
Return a read-only (constant) reference to the element sequence.
const ref_sequence & ref() const
Return a read-only (constant) reference to the element sequence.
const m_type & m() const
Return a read-only (constant) reference to the attribute.
const arc_sequence & arc() const
Return a read-only (constant) reference to the element sequence.
Class corresponding to the edges_type schema type.
const v_sequence & v() const
Return a read-only (constant) reference to the element sequence.
::std::auto_ptr< ::XMLMesh::mesh > mesh_(const ::std::string &uri,::xml_schema::flags f=0, const ::xml_schema::properties &p=::xml_schema::properties())
Parse a URI or a local file.
::std::auto_ptr< ::XMLSubdomains::domain > domain_(const ::std::string &uri,::xml_schema::flags f=0, const ::xml_schema::properties &p=::xml_schema::properties())
Parse a URI or a local file.
Class corresponding to the t_t schema type.
Class corresponding to the refinements_type schema type.
double3 * pt
control points and their weights
Node * vn[H2D_MAX_NUMBER_VERTICES]
vertex node pointers
Class corresponding to the el_t schema type.
Class corresponding to the curves_type schema type.