meshDAT.hh

Go to the documentation of this file.
1 
6 #ifndef graphMeshDAT_hh
7 #define graphMeshDAT_hh
8 
9 #include <string>
10 #include <fstream>
11 #include <memory>
12 #include "basics/typedefs.hh"
14 #include "basics/exceptions.hh"
15 #include "toolbox/dynArray.hh"
16 #include "space/postProcess.hh"
17 
18 namespace concepts {
19  // forward declartions
20  class Mesh2;
21  class Mesh3;
22 } // namespace concepts
23 
24 namespace graphics {
25 
26  using concepts::Real;
27 
28  // *************************************************************** MeshDAT **
29 
34  template<typename F>
35  class MeshDAT {
36  public:
38  MeshDAT(concepts::Mesh& msh, const std::string& filename);
40  MeshDAT(concepts::Space<F>& spc, const std::string& filename);
41  private:
43  void createFilenames_(const std::string& filename);
44  };
45 
49  void drawMeshDAT(concepts::Mesh& msh, const std::string& filename);
50 
54  template<typename F>
55  void drawMeshDAT(concepts::Space<F>& spc, const std::string& filename);
56 
57  // *********************************************************** MeshDATCell **
58 
62  template<typename F>
64  public:
66  MeshDATCell(const std::string& coordFilename,
67  const std::string& boundFilename,
68  const std::string& elmFilename);
69  virtual ~MeshDATCell();
70  virtual void operator() (const concepts::Element<F>& elm)
72  virtual void operator() (const concepts::Cell& cell)
74  private:
75  std::ofstream coordFile_, boundFile_, elmFile_;
76 
78  std::map<uint, uint> vtxList_;
79  std::map<uint, concepts::Real3d> vtxCoord_;
81 
84 
85  uint getVertexNumber_(const uint key, const concepts::Real3d* coord = 0);
86  };
87 
88 } // namespace graphics
89 
90 #endif // graphMeshDAT_hh
An abstract class for an element of a space.
Definition: exceptions.hh:15
void createFilenames_(const std::string &filename)
Creates files which are suitable for mesh input using Import2dMesh or Import3dMesh.
Definition: meshDAT.hh:35
std::string coordFilename_
Definition: meshDAT.hh:42
Abstract class for a space.
A cell in a mesh consist of topological information (neighbours, connectivity, orientation) and geome...
Definition: cell.hh:39
concepts::DynArray< bool > vtxBndNotDone_
Definition: meshDAT.hh:80
concepts::DynArray< bool > edgBndNotDone_
Definition: meshDAT.hh:80
std::string elmFilename_
Definition: meshDAT.hh:42
MeshDATCell(const std::string &coordFilename, const std::string &boundFilename, const std::string &elmFilename)
Constructor.
std::map< uint, uint > vtxList_
Vertex lists.
Definition: meshDAT.hh:78
void drawMeshDAT(concepts::Mesh &msh, const std::string &filename)
Trampoline function to create an instance of MeshDAT.
MeshDAT(concepts::Mesh &msh, const std::string &filename)
Constructor.
std::ofstream boundFile_
Definition: meshDAT.hh:75
Graphics.
Definition: basis.hh:33
std::ofstream coordFile_
Definition: meshDAT.hh:75
uint getVertexNumber_(const uint key, const concepts::Real3d *coord=0)
MeshDAT(concepts::Space< F > &spc, const std::string &filename)
Constructor.
Cell by cell output for MeshDAT.
Definition: meshDAT.hh:63
uint vtxCnt_
Counters.
Definition: meshDAT.hh:83
Exception class to express a missing feature.
Definition: exceptions.hh:206
virtual void operator()(const concepts::Element< F > &elm)
Application operator.
An abstract class for meshes.
Definition: mesh.hh:76
std::ofstream elmFile_
Definition: meshDAT.hh:75
std::string boundFilename_
Definition: meshDAT.hh:42
Abstract class for per cell postprocessing.
Definition: postProcess.hh:38
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
std::map< uint, concepts::Real3d > vtxCoord_
Definition: meshDAT.hh:79
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