graphics::DataMatlab Class Reference
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. More... | |
void | operator() (const concepts::Vector< Real > &sol) |
Application operator. More... | |
~DataMatlab () | |
Private Member Functions | |
void | closeStreams_ () |
Closes the streams. More... | |
void | createStreams_ (std::string filename) |
Create the streams. More... | |
Private Attributes | |
uint | cnt_ |
Number of vectors written to the files. More... | |
uint | dim_ |
Spatial dimension of the space. More... | |
std::unique_ptr< DataMatlabCell > | mtlb_ |
std::unique_ptr< std::ofstream > | ofs1_ |
Streams for coordinates. More... | |
std::unique_ptr< std::ofstream > | ofs2_ |
std::unique_ptr< std::ofstream > | ofs3_ |
std::unique_ptr< std::ofstream > | ofsmsh_ |
Stream for connections. More... | |
concepts::GlobalPostprocess< Real > | postProcess_ |
Post processor. More... | |
Detailed Description
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 131 of file dataMatlab.hh.
Constructor & Destructor Documentation
◆ DataMatlab()
graphics::DataMatlab::DataMatlab | ( | concepts::Space< Real > & | spc, |
const std::string | filename, | ||
uint | dim = 2 , |
||
Real | scl = 1.0 |
||
) |
Constructor.
- Parameters
-
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
◆ ~DataMatlab()
|
inline |
Definition at line 141 of file dataMatlab.hh.
Member Function Documentation
◆ closeStreams_()
|
private |
Closes the streams.
◆ createStreams_()
|
private |
Create the streams.
◆ operator()()
void graphics::DataMatlab::operator() | ( | const concepts::Vector< Real > & | sol | ) |
Application operator.
- Parameters
-
sol The solution which should be plotted
Member Data Documentation
◆ cnt_
|
private |
Number of vectors written to the files.
Definition at line 157 of file dataMatlab.hh.
◆ dim_
|
private |
Spatial dimension of the space.
Definition at line 155 of file dataMatlab.hh.
◆ mtlb_
|
private |
Definition at line 165 of file dataMatlab.hh.
◆ ofs1_
|
private |
Streams for coordinates.
Definition at line 161 of file dataMatlab.hh.
◆ ofs2_
|
private |
Definition at line 161 of file dataMatlab.hh.
◆ ofs3_
|
private |
Definition at line 161 of file dataMatlab.hh.
◆ ofsmsh_
|
private |
Stream for connections.
Definition at line 159 of file dataMatlab.hh.
◆ postProcess_
|
private |
Post processor.
Definition at line 164 of file dataMatlab.hh.
The documentation for this class was generated from the following file:
- graphics/dataMatlab.hh