Class documentation of Concepts

Loading...
Searching...
No Matches

#include <matlab.hh>

Inheritance diagram for graphics::MatlabGraphics:
graphics::OutputBase concepts::OutputOperator

Public Member Functions

template<class G >
 MatlabGraphics (const concepts::Space< G > &spc, const std::string filename, const uint dim=2)
 
 MatlabGraphics (concepts::Mesh &msh, const std::string filename, const uint dim=2, const uint points=noPoints)
 
template<class F , class G >
 MatlabGraphics (const concepts::Space< G > &spc, const std::string filename, const concepts::Vector< F > &sol, const uint dim=2, const concepts::ElementFunction< F, G > *fun=0)
 
template<class F , class G >
 MatlabGraphics (const concepts::Space< G > &spc, const std::string filename, const concepts::ElementFormula< F, G > &frm, const uint dim=2)
 
template<class F >
 MatlabGraphics (concepts::Mesh &msh, const std::string filename, const concepts::PiecewiseFormulaBase< F > &frm, const uint dim=2, const uint points=noPoints)
 
template<class F , class G >
void operator() (const concepts::Space< G > &spc, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
 
template<class F , class G >
void operator() (const concepts::Space< G > &spc, const concepts::Formula< F > &frm)
 
template<class F , class G >
void operator() (concepts::Mesh &msh, const concepts::Formula< F > &frm, const uint points=5)
 

Static Public Attributes

static uint noPoints
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream.
 

Protected Attributes

std::unique_ptr< std::ofstream > ofs_
 Stream for output file.
 

Detailed Description

Draws a picture of data in Matlab format and stores the result in a single file.

The data is stored in a Matlab M-file by appending '.m'. The data can be read into Matlab by giving the file name as commands (and ommiting the ending '.m').

In general there is the FE-mesh (cells) and the output mesh, which in hp-FEM is given by the quadrature points. The data points are given in the vertices of the output mesh (x, y).

The FE-mesh of triangles or quadrilaterials is given by edgemsh, while vtxmsh consists of the vertices. For a FE-mesh with cells with only straight edges its more efficient to use vtxmsh instead of edgemesh. In each column there are the numbers of the vertices of one cell given, and can be plotted by

plot(x(edgemsh),y(edgemsh),'k');

The data values are in the variable u. For vector values spaces or repeated set of values the i.th component is U{i} (as well as in u(i,:)). In the following examples of scalar data one can replace u(msh) with U{i}(msh) for plotting one component of vector valued data.

Scalar data is plotted in the view from above with

patch(x(msh),y(msh),u(msh))

whereby in msh the output mesh is given.

Its possible to emphasize the FE-mesh in this diagramme with

patch(x(msh),y(msh),u(msh));
hold on
plot(x(edgemsh),y(edgemsh),'k');

whereby in edgemsh represents the points in the output mesh lying on the FE mesh.

As the command contour is only applicable to tensor product meshes, there is in general no contour plot possible.

Scalar data is plotted in the side view with

fill3(x(msh),y(msh),u(msh),u(msh));

Its possible to emphasize the FE-mesh in this diagramme with

fill3(x(msh),y(msh),u(msh),u(msh));
hold on
plot3(x(edgemsh),y(edgemsh),u(edgemsh),'k','linewidth',2)

The data can be shown unicoloured in side view with

fill3(x(msh),y(msh),u(msh),ones(size(msh)));

For vector valued spaces, the variables of the data values are U{1},..,U{n}.

2D Vectorial data is shown with

quiver(x,y,U{1},U{2});

Its possible to emphasize the FE-mesh in this diagramme with

quiver(x,y,U{1},U{2});
hold on
plot(x(edgemsh),y(edgemsh),'k');
Author
Kersten Schmidt, 2005
Examples
RobinBCs.cc, inhomDirichletBCs.cc, inhomDirichletBCsLagrange.cc, and inhomNeumannBCs.cc.

Definition at line 114 of file matlab.hh.

Constructor & Destructor Documentation

◆ MatlabGraphics() [1/5]

template<class G >
graphics::MatlabGraphics::MatlabGraphics ( const concepts::Space< G > &  spc,
const std::string  filename,
const uint  dim = 2 
)

Constructor for output of mesh only.

Parameters
spcSpace which holds the mesh
filenameName base for the files to be written
dimSpatial dimension of the cells

Definition at line 220 of file matlab.hh.

◆ MatlabGraphics() [2/5]

graphics::MatlabGraphics::MatlabGraphics ( concepts::Mesh msh,
const std::string  filename,
const uint  dim = 2,
const uint  points = noPoints 
)

Constructor for output of mesh only.

Parameters
mshMesh
filenameName base for the files to be written
dimSpatial dimension of the cells

◆ MatlabGraphics() [3/5]

template<class F , class G >
graphics::MatlabGraphics::MatlabGraphics ( const concepts::Space< G > &  spc,
const std::string  filename,
const concepts::Vector< F > &  sol,
const uint  dim = 2,
const concepts::ElementFunction< F, G > *  fun = 0 
)

Constructor for output of solutions and functions of it.

Parameters
spcSpace on which the data should be plotted
filenameName base for the files to be written
solThe first solution set which should be plotted
dimSpatial dimension of the cells
funFunction of the FE function, e.g. itself.

Definition at line 234 of file matlab.hh.

◆ MatlabGraphics() [4/5]

template<class F , class G >
graphics::MatlabGraphics::MatlabGraphics ( const concepts::Space< G > &  spc,
const std::string  filename,
const concepts::ElementFormula< F, G > &  frm,
const uint  dim = 2 
)

Constructor for output of a element formula

Parameters
spcSpace on which the data should be plotted
filenameName base for the files to be written
frmElement formula
dimSpatial dimension of the cells

Definition at line 251 of file matlab.hh.

◆ MatlabGraphics() [5/5]

template<class F >
graphics::MatlabGraphics::MatlabGraphics ( concepts::Mesh msh,
const std::string  filename,
const concepts::PiecewiseFormulaBase< F > &  frm,
const uint  dim = 2,
const uint  points = noPoints 
)

Constructor for output of a scalar formula

Parameters
mshMesh
filenameName base for the files to be written
frmFormula
dimSpatial dimension of the cells
pointsNumber of points inside the element (in one direction)

Definition at line 267 of file matlab.hh.

◆ ~MatlabGraphics()

virtual graphics::MatlabGraphics::~MatlabGraphics ( )
inlinevirtual

Definition at line 166 of file matlab.hh.

Member Function Documentation

◆ info()

virtual std::ostream & graphics::MatlabGraphics::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from graphics::OutputBase.

◆ operator()() [1/3]

template<class F , class G >
void graphics::MatlabGraphics::operator() ( concepts::Mesh msh,
const concepts::Formula< F > &  frm,
const uint  points = 5 
)

Application operator for output of a scalar formula

Parameters
mshMesh
frmFormula

Definition at line 296 of file matlab.hh.

◆ operator()() [2/3]

template<class F , class G >
void graphics::MatlabGraphics::operator() ( const concepts::Space< G > &  spc,
const concepts::Formula< F > &  frm 
)

Application operator for output of a scalar formula

Parameters
spcSpace on which the data should be plotted
frmFormula

Definition at line 290 of file matlab.hh.

◆ operator()() [3/3]

template<class F , class G >
void graphics::MatlabGraphics::operator() ( const concepts::Space< G > &  spc,
const concepts::Vector< F > &  sol,
const concepts::ElementFunction< F, G > *  fun = 0 
)

Application operator for output of solutions and functions of it.

Parameters
spcSpace on which the data should be plotted
solThe first solution set which should be plotted
funFunction of the FE function, e.g. itself.

Definition at line 283 of file matlab.hh.

Member Data Documentation

◆ noPoints

uint graphics::MatlabGraphics::noPoints
static

Definition at line 196 of file matlab.hh.

◆ ofs_

std::unique_ptr<std::ofstream> graphics::OutputBase::ofs_
protectedinherited

Stream for output file.

Definition at line 83 of file basis.hh.


The documentation for this class was generated from the following file: