Class that allows to store graphical infomations in .vtk files to use them in paraview. More...

#include <vtkGraphics.hh>

Inheritance diagram for graphics::VtkGraphics:
graphics::OutputBase graphics::DenseMatrixGraphics concepts::OutputOperator

Public Member Functions

template<class F , class G >
void addFunction (const concepts::Space< G > &spc, const std::string name, const concepts::ElementFormula< F, G > &frm)
 Adds a solution vector to the current matfile. More...
 
template<class G , class F >
void addSolution (const concepts::Space< G > &spc, const std::string name, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
 Adds a solution vector to the current matfile. More...
 
 VtkGraphics ()
 
 VtkGraphics (concepts::Mesh &msh, const std::string filename, const uint points=5)
 Constructor for output of a mesh. More...
 
template<class G >
 VtkGraphics (const concepts::Space< G > &spc, const std::string filename)
 Constructor for output of solutions and functions of it. More...
 
template<class F , class G >
 VtkGraphics (const concepts::Space< G > &spc, const std::string filename, const concepts::ElementFormula< F, G > &frm)
 Constructor for output of an element formula. More...
 
template<class F , class G >
 VtkGraphics (const concepts::Space< G > &spc, const std::string filename, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
 Constructor for output of solutions and functions of it. More...
 
virtual ~VtkGraphics ()
 

Static Public Attributes

static uint noPoints
 

Protected Member Functions

template<class F , class G >
concepts::RCP< concepts::ElementMatrix< typename concepts::Datatype< F >::type > > getFunction (const concepts::Space< G > &spc, const concepts::ElementFormula< F, G > &frm)
 Returns a vector with the value of the function on the quadrature-points of a given space using the given concepts::ElementFormula. More...
 
DenseMatrixCollection< Real > getMesh (concepts::Mesh &msh, const uint points=5)
 Returns a graphics::DenseMatrixCollection<G> that contains informations for graphical output of the given mesh. More...
 
template<class F , class G >
concepts::RCP< concepts::ElementMatrix< F > > getSolution (const concepts::Space< G > &spc, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
 Returns a vector with the value of the solution on the quadrature-points of a given space using a given coefficient vector. More...
 
template<class G >
DenseMatrixCollection< G > getSpace (const concepts::Space< G > &spc)
 Returns a graphics::DenseMatrixCollection<G> that contains informations for graphical output of the given space. More...
 
virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Protected Attributes

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

Private Member Functions

template<class G >
void cellType_ (std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_)
 Adds the cellType (in the 3 d case) More...
 
template<class G , class F >
void storeData_ (bool data, std::string filename, DenseMatrixCollection< G > &dense_ptr_, concepts::RCP< concepts::ElementMatrix< F > > functionValue=concepts::RCP< concepts::ElementMatrix< F > >(0))
 Store data as vtk file. More...
 
std::string vtkEnding_ (const std::string &filename)
 Adds ".vtk" to a string if it dosn't end with ".vtk" the string itself else. More...
 
template<class G >
void writeEdgeMesh_ (std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_)
 Writes the Edgmesh in the vtk file. More...
 
template<class G >
void writeHead_ (std::string &, std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_)
 writes the header of an ASCII vtk file More...
 
template<class G >
void writeMesh_ (std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_)
 Writes the mesh/geometry in the vtk file. More...
 
template<class G , class F >
void writePoints_ (std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_, concepts::RCP< concepts::ElementMatrix< F > > functionValue=concepts::RCP< concepts::ElementMatrix< F > >(0))
 writes the points in the vtk file More...
 
template<class F >
void writeValues_ (std::ostringstream &stream, concepts::RCP< concepts::ElementMatrix< F > > functionValue=0, const std::string name="solution")
 writes function values in a vtk file More...
 
template<class G >
void writeWeightsAndAttr_ (std::ostringstream &stream, DenseMatrixCollection< G > &dense_ptr_)
 Writes attribues and integration weights as pointdata in the vtk file. More...
 

Private Attributes

uint data_
 
uint outputDimension_
 

Detailed Description

Class that allows to store graphical infomations in .vtk files to use them in paraview.

Author
Christian Heier, 2011

Definition at line 20 of file vtkGraphics.hh.

Constructor & Destructor Documentation

◆ VtkGraphics() [1/5]

graphics::VtkGraphics::VtkGraphics ( )

◆ VtkGraphics() [2/5]

template<class F , class G >
graphics::VtkGraphics::VtkGraphics ( const concepts::Space< G > &  spc,
const std::string  filename,
const concepts::Vector< F > &  sol,
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
funFunction of the FE function, e.g. itself.

Definition at line 168 of file vtkGraphics.hh.

◆ VtkGraphics() [3/5]

template<class F , class G >
graphics::VtkGraphics::VtkGraphics ( const concepts::Space< G > &  spc,
const std::string  filename,
const concepts::ElementFormula< F, G > &  frm 
)

Constructor for output of an element formula.

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

Definition at line 181 of file vtkGraphics.hh.

◆ VtkGraphics() [4/5]

template<class G >
graphics::VtkGraphics::VtkGraphics ( const concepts::Space< G > &  spc,
const std::string  filename 
)

Constructor for output of solutions and functions of it.

Parameters
spcSpace on which the data should be plotted
filenameName base for the file to be written

Definition at line 193 of file vtkGraphics.hh.

◆ VtkGraphics() [5/5]

graphics::VtkGraphics::VtkGraphics ( concepts::Mesh msh,
const std::string  filename,
const uint  points = 5 
)

Constructor for output of a mesh.

Parameters
mshThe mesh that should be plotted
filenamename of the vtk file @points graphic points in each direction

◆ ~VtkGraphics()

virtual graphics::VtkGraphics::~VtkGraphics ( )
virtual

Member Function Documentation

◆ addFunction()

template<class F , class G >
void graphics::VtkGraphics::addFunction ( const concepts::Space< G > &  spc,
const std::string  name,
const concepts::ElementFormula< F, G > &  frm 
)
inline

Adds a solution vector to the current matfile.

Parameters
Thespace from which the solution vector was generated
nameThe name of the variable, e.g. "frm"
Thefunction represented by an element formula

Definition at line 88 of file vtkGraphics.hh.

◆ addSolution()

template<class G , class F >
void graphics::VtkGraphics::addSolution ( const concepts::Space< G > &  spc,
const std::string  name,
const concepts::Vector< F > &  sol,
const concepts::ElementFunction< F, G > *  fun = 0 
)
inline

Adds a solution vector to the current matfile.

Parameters
Thespace from which the solution vector was generated
nameThe name of the variable, e.g. "u0"
Thesolution vector
Thetype of vector you need (i.e. Values, gradient, Laplacien etc.), default argument is Values

Definition at line 67 of file vtkGraphics.hh.

◆ cellType_()

template<class G >
void graphics::VtkGraphics::cellType_ ( std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_ 
)
private

Adds the cellType (in the 3 d case)

Definition at line 313 of file vtkGraphics.hh.

◆ getFunction()

template<class F , class G >
concepts::RCP< concepts::ElementMatrix< typename concepts::Datatype< F >::type > > graphics::DenseMatrixGraphics::getFunction ( const concepts::Space< G > &  spc,
const concepts::ElementFormula< F, G > &  frm 
)
protectedinherited

Returns a vector with the value of the function on the quadrature-points of a given space using the given concepts::ElementFormula.

Parameters
spcThe space on which the Element Formula is defined
frmThe ElementFormula of the function that should be plotted

Definition at line 194 of file denseMatrixGraphics.hh.

◆ getMesh()

DenseMatrixCollection<Real> graphics::DenseMatrixGraphics::getMesh ( concepts::Mesh msh,
const uint  points = 5 
)
protectedinherited

Returns a graphics::DenseMatrixCollection<G> that contains informations for graphical output of the given mesh.

Parameters
mshThe mesh
dimThe dimension of the mesh

◆ getSolution()

template<class F , class G >
concepts::RCP< concepts::ElementMatrix< F > > graphics::DenseMatrixGraphics::getSolution ( const concepts::Space< G > &  spc,
const concepts::Vector< F > &  sol,
const concepts::ElementFunction< F, G > *  fun = 0 
)
protectedinherited

Returns a vector with the value of the solution on the quadrature-points of a given space using a given coefficient vector.

Parameters
spcThe space from which the solution vector was generated
solThe solution vector
funFunction of the solution (e.g. solution itself, its gradient, it's Laplacien etc.)

Definition at line 130 of file denseMatrixGraphics.hh.

◆ getSpace()

template<class G >
DenseMatrixCollection< G > graphics::DenseMatrixGraphics::getSpace ( const concepts::Space< G > &  spc)
protectedinherited

Returns a graphics::DenseMatrixCollection<G> that contains informations for graphical output of the given space.

Parameters
spcThe space
dimThe dimension of the space

Definition at line 171 of file denseMatrixGraphics.hh.

◆ info()

virtual std::ostream& graphics::OutputBase::info ( std::ostream &  os) const
protectedvirtualinherited

Returns information in an output stream.

Reimplemented from concepts::OutputOperator.

Reimplemented in graphics::TecplotGraphics, and graphics::MatlabGraphics.

◆ storeData_()

template<class G , class F >
void graphics::VtkGraphics::storeData_ ( bool  data,
std::string  filename,
DenseMatrixCollection< G > &  dense_ptr_,
concepts::RCP< concepts::ElementMatrix< F > >  functionValue = concepts::RCP<concepts::ElementMatrix<F> >(0) 
)
private

Store data as vtk file.

Definition at line 205 of file vtkGraphics.hh.

◆ vtkEnding_()

std::string graphics::VtkGraphics::vtkEnding_ ( const std::string &  filename)
inlineprivate

Adds ".vtk" to a string if it dosn't end with ".vtk" the string itself else.

Parameters
filenameThe basic name of the file

Definition at line 152 of file vtkGraphics.hh.

◆ writeEdgeMesh_()

template<class G >
void graphics::VtkGraphics::writeEdgeMesh_ ( std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_ 
)
private

Writes the Edgmesh in the vtk file.

Definition at line 285 of file vtkGraphics.hh.

◆ writeHead_()

template<class G >
void graphics::VtkGraphics::writeHead_ ( std::string &  filename,
std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_ 
)
private

writes the header of an ASCII vtk file

Definition at line 341 of file vtkGraphics.hh.

◆ writeMesh_()

template<class G >
void graphics::VtkGraphics::writeMesh_ ( std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_ 
)
private

Writes the mesh/geometry in the vtk file.

Definition at line 238 of file vtkGraphics.hh.

◆ writePoints_()

template<class G , class F >
void graphics::VtkGraphics::writePoints_ ( std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_,
concepts::RCP< concepts::ElementMatrix< F > >  functionValue = concepts::RCP<concepts::ElementMatrix<F> >(0) 
)
private

writes the points in the vtk file

Definition at line 324 of file vtkGraphics.hh.

◆ writeValues_()

template<class F >
void graphics::VtkGraphics::writeValues_ ( std::ostringstream &  stream,
concepts::RCP< concepts::ElementMatrix< F > >  functionValue = 0,
const std::string  name = "solution" 
)
private

writes function values in a vtk file

◆ writeWeightsAndAttr_()

template<class G >
void graphics::VtkGraphics::writeWeightsAndAttr_ ( std::ostringstream &  stream,
DenseMatrixCollection< G > &  dense_ptr_ 
)
private

Writes attribues and integration weights as pointdata in the vtk file.

Definition at line 296 of file vtkGraphics.hh.

Member Data Documentation

◆ data_

uint graphics::VtkGraphics::data_
private

Definition at line 160 of file vtkGraphics.hh.

◆ noPoints

uint graphics::DenseMatrixGraphics::noPoints
staticinherited

Definition at line 78 of file denseMatrixGraphics.hh.

◆ ofs_

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

Stream for output file.

Definition at line 83 of file basis.hh.

◆ outputDimension_

uint graphics::VtkGraphics::outputDimension_
private

Definition at line 163 of file vtkGraphics.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