meshImport2Dgmsh.hh

Go to the documentation of this file.
1 
8 #ifndef MESHIMPORT2DGMSH_HH
9 #define MESHIMPORT2DGMSH_HH
10 
11 #include "basics.hh"
12 #include "geometry.hh"
13 
14 namespace concepts {
15 
39  class Import2DMeshGmsh : public Mesh2 {
40  public:
46  Import2DMeshGmsh(const std::string& filename);
47 
48  virtual ~Import2DMeshGmsh();
49 
50  unsigned int ncell() const {
51  return cell_.size();
52  }
53 
55  return new concepts::PStlVectorScan<concepts::Cell2 > (cell_.begin(), cell_.end());
56  }
57  virtual std::ostream& info(std::ostream& os) const;
58 
59  private:
60  bool isOrderedCounterClockwise(int idx1, int idx2, int idx3, int idx4) const;
61 
67 
68  };
69 
78  public:
85  GmshInputException(const std::string& error, const std::string& filename,
86  const uint& lineNr, const std::string& line) throw ();
87 
88  virtual const char* what() const throw();
89 
90  virtual ~GmshInputException() throw ();
91  protected:
92  virtual std::ostream& info(std::ostream& os) const throw ();
93  private:
95  std::string error_;
97  std::string filename_;
99  uint lineNr_;
101  std::string line_;
102 
103  mutable std::string outputMessage_ ;
104  };
105 
106 
107 
108 } // namespace concepts
109 
110 #endif /* MESHIMPORT2DGMSH_HH */
111 
std::string line_
Line of error in the file.
Imports a 2D quadrilateral mesh from mesh generator gmsh.
GmshInputException(const std::string &error, const std::string &filename, const uint &lineNr, const std::string &line)
Constructor.
virtual const char * what() const
Base class for exceptions.
Definition: exceptions.hh:86
A scanner for a 2D mesh.
Definition: mesh.hh:44
Scanner for a STL container std::vector of pointers.
Exception class to express a problem in a gmsh (.msh) input file.
concepts::Sequence< concepts::Real2d > coord_
uint lineNr_
Number of the line with the error.
Import2DMeshGmsh(const std::string &filename)
Constructor.
concepts::Scan2 * scan()
Returns a scanner over the cells of the mesh.
concepts::Sequence< concepts::Vertex * > vtx_
An abstract class for 2D meshes.
Definition: mesh.hh:103
Sequence with operations, output operator, and method of the particular element types.
Definition: sequence.hh:39
unsigned int ncell() const
Returns the number of cells in the mesh.
std::string filename_
File name of the .msh file.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool isOrderedCounterClockwise(int idx1, int idx2, int idx3, int idx4) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Sequence< concepts::Edge * > edg_
concepts::Sequence< concepts::Quad * > quad_
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
concepts::Sequence< concepts::Cell2 * > cell_
std::string error_
Error message.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich