Draws a picture of data in Matlab format and stores the result in a single file.
More...
|
template<class F > |
| 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. More...
|
|
| MatlabGraphics (concepts::Mesh &msh, const std::string filename, const uint dim=2, const uint points=noPoints) |
| Constructor for output of mesh only. More...
|
|
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) |
| Constructor for output of a element formula. More...
|
|
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) |
| Constructor for output of solutions and functions of it. More...
|
|
template<class G > |
| MatlabGraphics (const concepts::Space< G > &spc, const std::string filename, const uint dim=2) |
| Constructor for output of mesh only. More...
|
|
template<class F , class G > |
void | operator() (concepts::Mesh &msh, const concepts::Formula< F > &frm, const uint points=5) |
| Application operator for output of a scalar formula. More...
|
|
template<class F , class G > |
void | operator() (const concepts::Space< G > &spc, const concepts::Formula< F > &frm) |
| Application operator for output of a scalar formula. More...
|
|
template<class F , class G > |
void | 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. More...
|
|
virtual | ~MatlabGraphics () |
|
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
- inhomDirichletBCs.cc, inhomDirichletBCsLagrange.cc, inhomNeumannBCs.cc, and RobinBCs.cc.
Definition at line 114 of file matlab.hh.