Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
importer.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2004-11-06
7 
8  Copyright (C) 2004 EPFL
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 3.0 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __importer_H
30 #define __importer_H 1
31 
34 
35 namespace Feel
36 {
37 
41 enum MeshFormat
42 {
43  MESHPP,
44  INRIA,
45  GMSH,
46  NETGEN,
47  GAMBIT
48 };
49 
58 template<typename MeshType>
59 class Importer
60  :
61 public VisitorBase,
62 public Visitor<MeshType>
63 {
64 public:
65 
66  typedef MeshType mesh_type;
67  typedef typename mesh_type::point_type point_type;
68  typedef typename point_type::node_type node_type;
69  typedef typename mesh_type::edge_type edge_type;
70  typedef typename mesh_type::face_type face_type;
71  typedef typename mesh_type::element_type element_type;
72 
76  Importer( MeshFormat const& _format = GMSH, WorldComm const& _worldcomm = Environment::worldComm() )
77  :
78  M_worldComm( _worldcomm ),
79  M_filename(),
80  M_format( _format )
81  {}
82 
88  Importer( std::string const& _filename, MeshFormat const& _format = GMSH, WorldComm const& _worldcomm = Environment::worldComm() )
89  :
90  M_worldComm( _worldcomm ),
91  M_filename( _filename ),
92  M_format( _format )
93  {}
94 
95  virtual ~Importer()
96  {}
97 
102  void setFilename( std::string const& __filename )
103  {
104  M_filename = __filename;
105  }
106 
111  void setFormat( MeshFormat const& __format )
112  {
113  M_format = __format;
114  }
115 
119  std::string const& filename() const
120  {
121  return M_filename;
122  }
123 
124 
128  MeshFormat format() const
129  {
130  return M_format;
131  }
132 
136  WorldComm const& worldComm() const
137  {
138  return M_worldComm;
139  }
140 
141 private:
142 
144  WorldComm M_worldComm;
145 
147  std::string M_filename;
148 
150  MeshFormat M_format;
151 };
152 }
153 
154 #endif /* __Importer_H */
The base class of any Acyclic Visitor.
Definition: visitor.hpp:52
MeshFormat format() const
Definition: importer.hpp:128
Definition: visitor.hpp:89
WorldComm const & worldComm() const
Definition: importer.hpp:136
void setFormat(MeshFormat const &__format)
Definition: importer.hpp:111
void setFilename(std::string const &__filename)
Definition: importer.hpp:102
Definition: importer.hpp:59
std::string const & filename() const
Definition: importer.hpp:119

Generated on Sun Dec 22 2013 13:11:05 for Feel++ by doxygen 1.8.5