meshImport2Dez4u.hh

Go to the documentation of this file.
1 
7 #ifndef meshImport2Dez4u_hh
8 #define meshImport2Dez4u_hh
9 
10 #include "basics.hh"
11 #include "toolbox.hh"
12 #include "geometry.hh"
13 
14 namespace concepts {
15 
16  // ********************************************************* Import2dMeshEz4u **
17 
33  class Import2dMeshEz4u : public Mesh2 {
34  public:
40  Import2dMeshEz4u(const std::string filename);
41  virtual ~Import2dMeshEz4u();
42 
43  inline uint ncell() const {return cell_.size(); }
44  inline Scan2* scan() {
45  return new PStlVectorScan<Cell2>(cell_.begin(), cell_.end());
46  }
47 
48  virtual std::ostream& info(std::ostream& os) const;
49  private:
50  // sequence of the coordinates
52  // sequence of the topological vertices
54  // multi-array, used for identify unique nodes
56  // sequence of the topological edges
58  // multi-array, used for identify unique edges, commutable
60  // sequence of the topological quads
62  // sequence of the cells
64  // multi-array for the element attribute
66  // multi-array for the edge attribute, non-commutable
68  // multi-array for the vtx attribute
70  };
71 
72 
73  // ********************************************************** Ez4uException **
74 
82  class Ez4uException : public ExceptionBase {
83  public:
91  Ez4uException(const std::string& error, const std::string& filename,
92  const uint lineNr, const std::string& line) throw();
93 
94  virtual ~Ez4uException() throw();
95  protected:
96  virtual std::ostream& info(std::ostream& os) const throw();
97  private:
99  std::string error_;
101  std::string filename_;
103  uint lineNr_;
105  std::string line_;
106  };
107 
108 } // namespace concepts
109 
110 #endif //meshImport2Dez4u_hh
MultiArray< 2, int > Attrib_edg_
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
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.
MultiArray< 2, Edge * > Edg_
Sequence< Cell2 * > cell_
Exception class to express a problem in a ez4u input file.
std::string line_
Line of error in the file.
Container typename for multidimensional Array which is based on std::map.
Definition: multiArray.hh:33
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
MultiArray< 1, Vertex * > Vtx_
Sequence< Vertex * > vtx_
Import2dMeshEz4u(const std::string filename)
Constructor The ez4u file (.dcm or .DCM) is needed.
std::string error_
Error message.
MultiArray< 1, int > Attrib_vtx_
Ez4uException(const std::string &error, const std::string &filename, const uint lineNr, const std::string &line)
Constructor.
Imports 2D mesh with triangles(currently not supported) and quadrilaterals (possibly mixed) from mesh...
uint ncell() const
Returns the number of cells in the mesh.
Scan2 * scan()
Returns a scanner over the cells of the mesh.
uint lineNr_
Line number of the ez4u file.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
MultiArray< 1, int > Attrib_elm_
std::string filename_
File name of the ez4u file.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich