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< DataMatlabCellmtlb_
 
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
spcSpace on which the data should be plotted
filenameName base for the files to be written
dimSpatial dimension of the data (only dim=2 supported)
sclData scaling factor

◆ ~DataMatlab()

graphics::DataMatlab::~DataMatlab ( )
inline

Definition at line 141 of file dataMatlab.hh.

Member Function Documentation

◆ closeStreams_()

void graphics::DataMatlab::closeStreams_ ( )
private

Closes the streams.

◆ createStreams_()

void graphics::DataMatlab::createStreams_ ( std::string  filename)
private

Create the streams.

◆ operator()()

void graphics::DataMatlab::operator() ( const concepts::Vector< Real > &  sol)

Application operator.

Parameters
solThe solution which should be plotted

Member Data Documentation

◆ cnt_

uint graphics::DataMatlab::cnt_
private

Number of vectors written to the files.

Definition at line 157 of file dataMatlab.hh.

◆ dim_

uint graphics::DataMatlab::dim_
private

Spatial dimension of the space.

Definition at line 155 of file dataMatlab.hh.

◆ mtlb_

std::unique_ptr<DataMatlabCell> graphics::DataMatlab::mtlb_
private

Definition at line 165 of file dataMatlab.hh.

◆ ofs1_

std::unique_ptr<std::ofstream> graphics::DataMatlab::ofs1_
private

Streams for coordinates.

Definition at line 161 of file dataMatlab.hh.

◆ ofs2_

std::unique_ptr<std::ofstream> graphics::DataMatlab::ofs2_
private

Definition at line 161 of file dataMatlab.hh.

◆ ofs3_

std::unique_ptr<std::ofstream> graphics::DataMatlab::ofs3_
private

Definition at line 161 of file dataMatlab.hh.

◆ ofsmsh_

std::unique_ptr<std::ofstream> graphics::DataMatlab::ofsmsh_
private

Stream for connections.

Definition at line 159 of file dataMatlab.hh.

◆ postProcess_

concepts::GlobalPostprocess<Real> graphics::DataMatlab::postProcess_
private

Post processor.

Definition at line 164 of file dataMatlab.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