Hermes2D  3.0
mesh_reader_h2d.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_H_
17 #define _MESH_READER_H2D_H_
18 
19 #include "mesh_reader.h"
20 #include "mesh_data.h"
21 
22 namespace Hermes
23 {
24  namespace Hermes2D
25  {
40  class HERMES_API MeshReaderH2D : public MeshReader
41  {
42  public:
43  MeshReaderH2D();
44  virtual ~MeshReaderH2D();
45 
46  virtual void load(const char *filename, MeshSharedPtr mesh);
47  virtual void load(std::string filename, MeshSharedPtr mesh)
48  {
49  return this->load(filename.c_str(), mesh);
50  }
51  virtual void save(const char *filename, MeshSharedPtr mesh);
52  virtual void save(std::string filename, MeshSharedPtr mesh)
53  {
54  return this->save(filename.c_str(), mesh);
55  }
56 
57  protected:
58  Curve* load_curve(MeshSharedPtr mesh, MeshData *m, int id, Node** en, int &p1, int &p2);
59  Arc* load_arc(MeshSharedPtr mesh, MeshData *m, int id, Node** en, int &p1, int &p2, Arc* arc);
60  Nurbs* load_nurbs(MeshSharedPtr mesh, MeshData *m, int id, Node** en, int &p1, int &p2, Nurbs* nurbs);
61 
62  void save_refinements(MeshSharedPtr mesh, FILE* f, Element* e, int id, bool& first);
63  void save_curve(MeshSharedPtr mesh, FILE* f, int p1, int p2, Curve* curve);
64  };
65  }
66 }
67 #endif
Definition: adapt.h:24
Stores one element of a mesh.
Definition: element.h:107
Represents one NURBS curve.
Definition: curved.h:77
Class to stored 2d mesh parameters. The MeshData class organizes all the necessary data structures re...
Definition: mesh_data.h:40
Stores one node of a mesh.
Definition: element.h:45
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.