Newer
Older

Thomas Witkowski
committed
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
/** \file ElementFileWriter.h */
#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)

Thomas Witkowski
committed
* value, and outputs a AMDiS/VTK mesh.
class ElementFileWriter : public FileWriterInterface
{
public:
ElementFileWriter(string name,

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);
static void writeFile(map<int, double> &vec,

Thomas Witkowski
committed
Mesh *mesh,
string filename,
string postfix = ".vtu",

Thomas Witkowski
committed
int level = -1);
/// Writes element data in AMDiS format (1 file !).
void writeMeshDatValues(string filename, double time);
void writeVtkValues(string filename, string postfix,
int level = -1);

Thomas Witkowski
committed
/// 0: Don't write AMDiS files.
/// 1: Write AMDiS files.
int writeAMDiSFormat;

Thomas Witkowski
committed
/// 0: Don't write VTK files.
/// 1: Write VTK files.
int writeVtkFormat;

Thomas Witkowski
committed
/// 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 tsModulo;
int timestepNumber;
};
}
#endif // ELEMENTFILEWRITER_H