graphics::MeshMatlab< F > Class Template Reference

Creates data for Matlab to draw the mesh. More...

#include <meshMatlab.hh>

Public Member Functions

 MeshMatlab (concepts::Mesh &msh, std::string filename)
 Constructor. More...
 
 MeshMatlab (concepts::Space< F > &spc, std::string filename)
 Constructor. More...
 
 ~MeshMatlab ()
 

Private Member Functions

void closeStreams_ ()
 Prints the footer and closes the streams. More...
 
void createStreams_ (std::string filename)
 Creates the streams and prints the header. More...
 

Private Attributes

std::unique_ptr< std::ofstream > ofs1_
 The streams. More...
 
std::unique_ptr< std::ofstream > ofs2_
 
std::unique_ptr< std::ofstream > ofs3_
 

Detailed Description

template<typename F>
class graphics::MeshMatlab< F >

Creates data for Matlab to draw the mesh.

This class is just an executor class for MeshMatlabCell, the real work is done there.

The data is stored in three file by appending '_1.m', '_2.m' and '_3.m' to the filename. The data can be read into Matlab by giving the three filenames as commands (and ommmiting the '.m'). Depending on the element type the mesh is either plotted by

plot3(a, b, c)

(if you want black lines in the plot, use

plot3(a, b, c, 'k')

) or

trimesh(b', a(1,:), a(2,:), a(3,:), ones(size(a,2),1))

This class opens and closes the three files and hands the streams to MeshMatlabCell.

See also
drawMeshMatlab the trampoline function of this class
Author
Philipp Frauenfelder, 2002

Definition at line 51 of file meshMatlab.hh.

Constructor & Destructor Documentation

◆ MeshMatlab() [1/2]

template<typename F >
graphics::MeshMatlab< F >::MeshMatlab ( concepts::Mesh msh,
std::string  filename 
)

Constructor.

Creates a picture of the coarsest mesh.

◆ MeshMatlab() [2/2]

template<typename F >
graphics::MeshMatlab< F >::MeshMatlab ( concepts::Space< F > &  spc,
std::string  filename 
)

Constructor.

Creates a picture of the current mesh of the space.

◆ ~MeshMatlab()

template<typename F >
graphics::MeshMatlab< F >::~MeshMatlab ( )

Member Function Documentation

◆ closeStreams_()

template<typename F >
void graphics::MeshMatlab< F >::closeStreams_ ( )
private

Prints the footer and closes the streams.

◆ createStreams_()

template<typename F >
void graphics::MeshMatlab< F >::createStreams_ ( std::string  filename)
private

Creates the streams and prints the header.

Member Data Documentation

◆ ofs1_

template<typename F >
std::unique_ptr<std::ofstream> graphics::MeshMatlab< F >::ofs1_
private

The streams.

Definition at line 66 of file meshMatlab.hh.

◆ ofs2_

template<typename F >
std::unique_ptr<std::ofstream> graphics::MeshMatlab< F >::ofs2_
private

Definition at line 66 of file meshMatlab.hh.

◆ ofs3_

template<typename F >
std::unique_ptr<std::ofstream> graphics::MeshMatlab< F >::ofs3_
private

Definition at line 66 of file meshMatlab.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich