meshGnuplot.hh

Go to the documentation of this file.
1 
6 #ifndef graphMeshGnuplot_hh
7 #define graphMeshGnuplot_hh
8 
9 #include <string>
10 #include <fstream>
11 #include <memory>
12 #include "basics/typedefs.hh"
14 #include "basics/exceptions.hh"
15 #include "space/postProcess.hh"
16 
17 namespace graphics {
18  using concepts::Real;
19 
20  // ******************************************************* MeshGnuplotCell **
21 
25  template<typename F>
27  public:
28  MeshGnuplotCell(std::ofstream* ofs) : ofs_(ofs) {}
29  virtual ~MeshGnuplotCell();
30  virtual void operator() (const concepts::Element<F>& elm)
32  virtual void operator() (const concepts::Cell& cell)
34  std::ofstream* write() { return ofs_; }
35  private:
36  std::ofstream* ofs_;
37  };
38 
39  // *********************************************************** MeshGnuplot **
40 
45  template<typename T>
46  void drawMeshGnuplot(T& msh_spc, std::string filename) {
47  std::ofstream ofs(filename.c_str());
48  concepts::GlobalPostprocess<Real> postProcess(msh_spc);
49  MeshGnuplotCell<Real> gnu(&ofs);
50  postProcess(gnu);
51  }
52 
53 } // namespace graphics
54 
55 #endif // graphMeshGnuplot_hh
An abstract class for an element of a space.
Definition: exceptions.hh:15
Writes the data which describe the elements to the given streams.
Definition: meshGnuplot.hh:26
A cell in a mesh consist of topological information (neighbours, connectivity, orientation) and geome...
Definition: cell.hh:39
std::ofstream * ofs_
Definition: meshGnuplot.hh:36
virtual void operator()(const concepts::Element< F > &elm)
Application operator.
Graphics.
Definition: basis.hh:33
void drawMeshGnuplot(T &msh_spc, std::string filename)
Creates a data file for viewing the mesh with Gnuplot using MeshGnuplotCell.
Definition: meshGnuplot.hh:46
MeshGnuplotCell(std::ofstream *ofs)
Definition: meshGnuplot.hh:28
Exception class to express a missing feature.
Definition: exceptions.hh:206
std::ofstream * write()
Definition: meshGnuplot.hh:34
Abstract class for per cell postprocessing.
Definition: postProcess.hh:38
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich