Hermes2D  3.0
mesh_reader_h2d_xml.h
1 // This file is part of Hermes2D
2 //
3 // Hermes2D is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D; if not, see <http://www.gnu.prg/licenses/>.
15 
16 #ifndef _MESH_READER_H2D_XML_H_
17 #define _MESH_READER_H2D_XML_H_
18 
19 #include "mesh_reader.h"
20 
21 // This is here mainly because XSD uses its own error, therefore it has to be undefined here.
22 #ifdef error
23 #undef error
24 #endif
25 
26 #include "mesh_h2d_xml.h"
27 #include "subdomains_h2d_xml.h"
28 
29 // This is here mainly because XSD uses its own error, therefore it had to be undefined previously.
30 #ifndef error
31 #define error(...) hermes_exit_if(hermes_log_message_if(true, HERMES_BUILD_LOG_INFO(HERMES_EC_ERROR), __VA_ARGS__))
32 #endif
33 
34 namespace Hermes
35 {
36  namespace Hermes2D
37  {
55  {
56  public:
58  virtual ~MeshReaderH2DXML();
59 
61  virtual void load(const char *filename, MeshSharedPtr mesh);
62 
64  virtual void load(std::auto_ptr<XMLMesh::mesh> & parsed_xml_mesh, MeshSharedPtr mesh);
65 
67  void save(const char *filename, MeshSharedPtr mesh);
68 
72  void load(const char *filename, std::vector<MeshSharedPtr> meshes);
73 
77  void load(std::auto_ptr<XMLSubdomains::domain> & parsed_xml_domain, std::vector<MeshSharedPtr> meshes);
78 
80  void save(const char *filename, std::vector<MeshSharedPtr> meshes);
81 
82  protected:
84  void load(std::auto_ptr<XMLMesh::mesh> & parsed_xml_mesh, MeshSharedPtr mesh, std::map<unsigned int, unsigned int>& vertex_is);
85 
87  void 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);
88 
92  template<typename T>
93  Nurbs* load_nurbs(MeshSharedPtr mesh, std::auto_ptr<T> & parsed_xml_entity, int id, Node** en, int p1, int p2, bool skip_check = false);
94 
96  void save_arc(MeshSharedPtr mesh, int p1, int p2, Arc* curve, XMLMesh::curves_type & curves);
97 
99  void save_nurbs(MeshSharedPtr mesh, int p1, int p2, Nurbs* curve, XMLMesh::curves_type & curves);
100  };
101  }
102 }
103 #endif
Definition: adapt.h:24
Represents one NURBS curve.
Definition: curved.h:77
Generated from subdomains_h2d_xml.xsd.
Stores one node of a mesh.
Definition: element.h:45
Generated from mesh_h2d_xml.xsd.
Class corresponding to the curves_type schema type.