Draws a picture of data in Matlab format and stores the result in files. More...
#include <dataMatlab.hh>

Public Member Functions | |
| DataMatlab (concepts::Space< Real > &spc, const std::string filename, uint dim=2, Real scl=1.0) | |
| Constructor. | |
| void | operator() (const concepts::Vector< Real > &sol) |
| Application operator. | |
| ~DataMatlab () | |
Private Member Functions | |
| void | closeStreams_ () |
| Closes the streams. | |
| void | createStreams_ (std::string filename) |
| Create the streams. | |
Private Attributes | |
| uint | cnt_ |
| Number of vectors written to the files. | |
| uint | dim_ |
| Spatial dimension of the space. | |
| std::auto_ptr< DataMatlabCell > | mtlb_ |
| std::auto_ptr< std::ofstream > | ofs1_ |
| Streams for coordinates. | |
| std::auto_ptr< std::ofstream > | ofs2_ |
| std::auto_ptr< std::ofstream > | ofs3_ |
| std::auto_ptr< std::ofstream > | ofsmsh_ |
| Stream for connections. | |
| concepts::GlobalPostprocess< Real > | postProcess_ |
| Post processor. | |
| concepts::Space< Real > * | spc_ |
| The space. | |
Draws a picture of data in Matlab format and stores the result in files.
The data is stored in four files by appending '_1.m', '_2.m', '_3.m' and '_msh.m'. The data can be read into Matlab by giving the three four file names as commands (and ommiting the ending '_*.m'). The data is plotted by
trimesh(msh, x, y, z0)
or
trimesh(msh, x, y, z0, ones(size(x,1),1))
or in 3D
Msh = msh(:,[1:3 1])';
fill3(x(Msh),y(Msh),z(Msh),z0(Msh))
This class opens and closes the four files and hands the streams to DataMatlabCell.
Definition at line 129 of file dataMatlab.hh.
| graphics::DataMatlab::DataMatlab | ( | concepts::Space< Real > & | spc, |
| const std::string | filename, | ||
| uint | dim = 2, |
||
| Real | scl = 1.0 |
||
| ) |
Constructor.
| spc | Space on which the data should be plotted |
| filename | Name base for the files to be written |
| dim | Spatial dimension of the data (only dim=2 supported) |
| scl | Data scaling factor |
| graphics::DataMatlab::~DataMatlab | ( | ) | [inline] |
| void graphics::DataMatlab::closeStreams_ | ( | ) | [private] |
Closes the streams.
| void graphics::DataMatlab::createStreams_ | ( | std::string | filename | ) | [private] |
Create the streams.
| void graphics::DataMatlab::operator() | ( | const concepts::Vector< Real > & | sol | ) |
Application operator.
| sol | The solution which should be plotted |
uint graphics::DataMatlab::cnt_ [private] |
Number of vectors written to the files.
Definition at line 157 of file dataMatlab.hh.
uint graphics::DataMatlab::dim_ [private] |
Spatial dimension of the space.
Definition at line 155 of file dataMatlab.hh.
std::auto_ptr<DataMatlabCell> graphics::DataMatlab::mtlb_ [private] |
Definition at line 165 of file dataMatlab.hh.
std::auto_ptr<std::ofstream> graphics::DataMatlab::ofs1_ [private] |
Streams for coordinates.
Definition at line 161 of file dataMatlab.hh.
std::auto_ptr<std::ofstream> graphics::DataMatlab::ofs2_ [private] |
Definition at line 161 of file dataMatlab.hh.
std::auto_ptr<std::ofstream> graphics::DataMatlab::ofs3_ [private] |
Definition at line 161 of file dataMatlab.hh.
std::auto_ptr<std::ofstream> graphics::DataMatlab::ofsmsh_ [private] |
Stream for connections.
Definition at line 159 of file dataMatlab.hh.
concepts::GlobalPostprocess<Real> graphics::DataMatlab::postProcess_ [private] |
Post processor.
Definition at line 164 of file dataMatlab.hh.
concepts::Space<Real>* graphics::DataMatlab::spc_ [private] |
The space.
Definition at line 153 of file dataMatlab.hh.