Newer
Older
#ifndef ELEMENTFILEWRITER_H
#define ELEMENTFILEWRITER_H
#include "FileWriter.h"
#include "FiniteElemSpace.h"
#include "MatrixVector.h"
#include "Mesh.h"
namespace AMDiS {
/** \brief
* Filewriter that make it possible to create mesh files, where the values
* are not defined on DOFs, but instead are defined on the elements.
*
* It can be necessary to visualize data defined on elements, e.g. residual
* error that is defined on elements and not on DOFs. This class takes as
* input a mesh and a map, which defines for each element index a (double)
* value, and outputs a TecPlot/AMDiS/VTK mesh.
*/
class ElementFileWriter : public FileWriterInterface
{
public:

Thomas Witkowski
committed
Mesh *mesh,
/// Implementation of FileWriterInterface::writeFiles().
void writeFiles(AdaptInfo *adaptInfo, bool force,
int level = -1,
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL);
/// Simple writing procedure for one element map.
static void writeFile(std::map<int, double> &vec,

Thomas Witkowski
committed
Mesh *mesh,
void writeTecPlotValues(std::string filename);
/// Writes element data in AMDiS format (1 file !).
void writeMeshDatValues(std::string filename, double time);
void writeVtkValues(std::string filename);
std::string name;
std::string filename;
std::string tecplotExt;
std::string amdisMeshDatExt;
std::string vtkExt;
/** \brief
* 0: Don't write TecPlot files.
* 1: Write TecPlot files.
*/
int writeTecPlotFormat;
/** \brief
* 0: Don't write AMDiS files.
* 1: Write AMDiS files.
*/
int writeAMDiSFormat;
/** \brief
* 0: Don't write VTK files.
* 1: Write VTK files.
*/
int writeVtkFormat;
/** \brief
* 0: Don't append time index to filename prefix.
* 1: Append time index to filename prefix.
*/
int appendIndex;
int indexLength;
int indexDecimals;
/// Timestep modulo: write only every tsModulo-th timestep!
int timestepNumber;
std::map<int, double> vec;
};
}
#endif // ELEMENTFILEWRITER_H