Commit cd344056 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Nothing important

parent 41774d49
...@@ -8,7 +8,7 @@ namespace AMDiS { ...@@ -8,7 +8,7 @@ namespace AMDiS {
ElementFileWriter::ElementFileWriter(const std::string& name_, ElementFileWriter::ElementFileWriter(const std::string& name_,
const FiniteElemSpace *feSpace_, const FiniteElemSpace *feSpace_,
std::map<int, double> &vec_) std::map<int, double> &mapvec)
: name(name_), : name(name_),
tecplotExt(".plt"), tecplotExt(".plt"),
amdisMeshDatExt(".elem.mesh"), amdisMeshDatExt(".elem.mesh"),
...@@ -23,20 +23,20 @@ namespace AMDiS { ...@@ -23,20 +23,20 @@ namespace AMDiS {
timestepNumber(-1), timestepNumber(-1),
mesh(feSpace_->getMesh()), mesh(feSpace_->getMesh()),
feSpace(feSpace_), feSpace(feSpace_),
vec(vec_) vec(mapvec)
{ {
GET_PARAMETER(0, name + "->output->filename", &filename); if (name != "") {
GET_PARAMETER(0, name + "->output->TecPlot format", "%d", GET_PARAMETER(0, name + "->output->filename", &filename);
&writeTecPlotFormat); GET_PARAMETER(0, name + "->output->TecPlot format", "%d", &writeTecPlotFormat);
GET_PARAMETER(0, name + "->output->TecPlot ext", &tecplotExt); GET_PARAMETER(0, name + "->output->TecPlot ext", &tecplotExt);
GET_PARAMETER(0, name + "->output->AMDiS format", "%d", &writeAMDiSFormat); GET_PARAMETER(0, name + "->output->AMDiS format", "%d", &writeAMDiSFormat);
GET_PARAMETER(0, name + "->output->AMDiS mesh-dat ext", &amdisMeshDatExt); GET_PARAMETER(0, name + "->output->AMDiS mesh-dat ext", &amdisMeshDatExt);
GET_PARAMETER(0, name + "->output->ParaView format", "%d", &writeVtkFormat); GET_PARAMETER(0, name + "->output->ParaView format", "%d", &writeVtkFormat);
GET_PARAMETER(0, name + "->output->append index", "%d", &appendIndex); GET_PARAMETER(0, name + "->output->append index", "%d", &appendIndex);
GET_PARAMETER(0, name + "->output->index length", "%d", &indexLength); GET_PARAMETER(0, name + "->output->index length", "%d", &indexLength);
GET_PARAMETER(0, name + "->output->index decimals", "%d", &indexDecimals); GET_PARAMETER(0, name + "->output->index decimals", "%d", &indexDecimals);
GET_PARAMETER(0, name + "->output->write every i-th timestep", "%d", GET_PARAMETER(0, name + "->output->write every i-th timestep", "%d", &tsModulo);
&tsModulo); }
} }
void ElementFileWriter::writeFiles(AdaptInfo *adaptInfo, bool force, void ElementFileWriter::writeFiles(AdaptInfo *adaptInfo, bool force,
...@@ -93,6 +93,15 @@ namespace AMDiS { ...@@ -93,6 +93,15 @@ namespace AMDiS {
} }
} }
void ElementFileWriter::writeFile(std::map<int, double> &vec,
const FiniteElemSpace *feSpace,
const std::string& filename)
{
ElementFileWriter efw("", feSpace, vec);
efw.writeVtkValues(filename);
}
void ElementFileWriter::writeTecPlotValues(const std::string &filename) void ElementFileWriter::writeTecPlotValues(const std::string &filename)
{ {
FUNCNAME("ElementFileWriter::writeTecPlotValues()"); FUNCNAME("ElementFileWriter::writeTecPlotValues()");
......
...@@ -23,61 +23,46 @@ namespace AMDiS { ...@@ -23,61 +23,46 @@ namespace AMDiS {
public: public:
MEMORY_MANAGED(ElementFileWriter); MEMORY_MANAGED(ElementFileWriter);
/** /// Constructor.
* Constructor.
*/
ElementFileWriter(const std::string& name, ElementFileWriter(const std::string& name,
const FiniteElemSpace *feSpace, const FiniteElemSpace *feSpace,
std::map<int, double> &vec); std::map<int, double> &vec);
/** /// Implementation of FileWriterInterface::writeFiles().
* Implementation of FileWriterInterface::writeFiles().
*/
void writeFiles(AdaptInfo *adaptInfo, bool force, void writeFiles(AdaptInfo *adaptInfo, bool force,
int level = -1, int level = -1,
Flag traverseFlag = Mesh::CALL_LEAF_EL, Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL); bool (*writeElem)(ElInfo*) = NULL);
/// Simple writing procedure for one element map.
static void writeFile(std::map<int, double> &vec,
const FiniteElemSpace *feSpace,
const std::string& filename);
protected: protected:
/** /// Writes element data in tecplot format.
* Writes element data in tecplot format.
*/
void writeTecPlotValues(const std::string &filename); void writeTecPlotValues(const std::string &filename);
/** /// Writes element data in AMDiS format (1 file !).
* Writes element data in AMDiS format (1 file !).
*/
void writeMeshDatValues(const std::string &filename, double time); void writeMeshDatValues(const std::string &filename, double time);
/** /// Writes element data in VTK format.
* Writes element data in VTK format.
*/
void writeVtkValues(const std::string &filename); void writeVtkValues(const std::string &filename);
protected: protected:
/** \brief /// Name.
* Name.
*/
std::string name; std::string name;
/** \brief /// Used filename prefix.
* Used filename prefix.
*/
std::string filename; std::string filename;
/** \brief /// TecPlot file extension.
* TecPlot file extension.
*/
std::string tecplotExt; std::string tecplotExt;
/** \brief /// AMDiS mesh-data-file extension.
* AMDiS mesh-data-file extension.
*/
std::string amdisMeshDatExt; std::string amdisMeshDatExt;
/** \brief /// VTK file extension.
* VTK file extension.
*/
std::string vtkExt; std::string vtkExt;
/** \brief /** \brief
...@@ -104,38 +89,25 @@ namespace AMDiS { ...@@ -104,38 +89,25 @@ namespace AMDiS {
*/ */
int appendIndex; int appendIndex;
/** \brief /// Total length of appended time index.
* Total length of appended time index.
*/
int indexLength; int indexLength;
/** \brief /// Number of decimals in time index.
* Number of decimals in time index.
*/
int indexDecimals; int indexDecimals;
/** \brief /// Timestep modulo: write only every tsModulo-th timestep!
* Timestep modulo: write only every tsModulo-th timestep!
*/
int tsModulo; int tsModulo;
/** ///
*/
int timestepNumber; int timestepNumber;
/** \brief /// Mesh used for output.
* Mesh used for output.
*/
Mesh *mesh; Mesh *mesh;
/** \brief /// fespace used for output.
* fespace used for output.
*/
const FiniteElemSpace *feSpace; const FiniteElemSpace *feSpace;
/** \brief /// Vector that stores the solution.
* Vector that stores the solution.
*/
std::map<int, double> vec; std::map<int, double> vec;
}; };
......
...@@ -63,9 +63,9 @@ namespace AMDiS { ...@@ -63,9 +63,9 @@ namespace AMDiS {
traverseLevel(-1), traverseLevel(-1),
traverseFlag(Mesh::CALL_LEAF_EL), traverseFlag(Mesh::CALL_LEAF_EL),
writeElement(NULL) writeElement(NULL)
{}; {}
virtual ~FileWriterInterface() {}; virtual ~FileWriterInterface() {}
/** \brief /** \brief
* Interface. Must be overridden in subclasses. * Interface. Must be overridden in subclasses.
...@@ -84,15 +84,15 @@ namespace AMDiS { ...@@ -84,15 +84,15 @@ namespace AMDiS {
traverseLevel = level; traverseLevel = level;
traverseFlag |= flag; traverseFlag |= flag;
writeElement = writeElem; writeElement = writeElem;
}; }
std::string getFilename() { std::string getFilename() {
return filename; return filename;
}; }
void setFilename(std::string n) { void setFilename(std::string n) {
filename = n; filename = n;
}; }
protected: protected:
/** \brief /** \brief
......
...@@ -86,38 +86,26 @@ namespace AMDiS { ...@@ -86,38 +86,26 @@ namespace AMDiS {
public: public:
MEMORY_MANAGED(Mesh); MEMORY_MANAGED(Mesh);
/** \brief /// Creates a mesh with the given name of dimension dim
* Creates a mesh with the given name of dimension dim
*/
Mesh(const std::string& name, int dim); Mesh(const std::string& name, int dim);
/** \brief /// Destructor
* Destructor
*/
virtual ~Mesh(); virtual ~Mesh();
/** \brief /// Reads macro triangulation.
* Reads macro triangulation.
*/
void initialize(); void initialize();
/** \brief /// Assignment operator
* Assignment operator
*/
Mesh& operator=(const Mesh&); Mesh& operator=(const Mesh&);
/** \name static methods used while mesh traversal /** \name static methods used while mesh traversal
* \{ * \{
*/ */
/** \brief /// Used while dof compress
* Used while dof compress
*/
static int newDOFFct1(ElInfo* e); static int newDOFFct1(ElInfo* e);
/** \brief /// Used while dof compress
* Used while dof compress
*/
static int newDOFFct2(ElInfo* e); static int newDOFFct2(ElInfo* e);
/** \} */ /** \} */
...@@ -135,114 +123,82 @@ namespace AMDiS { ...@@ -135,114 +123,82 @@ namespace AMDiS {
return Global::getGeo(p, dim); return Global::getGeo(p, dim);
} }
/** \brief /// Returns \ref name of the mesh
* Returns \ref name of the mesh
*/
inline const std::string& getName() const { inline const std::string& getName() const {
return name; return name;
} }
/** \brief /// Returns \ref dim of the mesh
* Returns \ref dim of the mesh
*/
inline int getDim() const { inline int getDim() const {
return dim; return dim;
} }
/** \brief /// Returns \ref nDOFEl of the mesh
* Returns \ref nDOFEl of the mesh
*/
inline const int getNumberOfAllDOFs() const { inline const int getNumberOfAllDOFs() const {
return nDOFEl; return nDOFEl;
} }
/** \brief /// Returns \ref nNodeEl of the mesh
* Returns \ref nNodeEl of the mesh
*/
inline const int getNumberOfNodes() const { inline const int getNumberOfNodes() const {
return nNodeEl; return nNodeEl;
} }
/** \brief /// Returns \ref nVertices of the mesh
* Returns \ref nVertices of the mesh
*/
inline const int getNumberOfVertices() const { inline const int getNumberOfVertices() const {
return nVertices; return nVertices;
} }
/** \brief /// Returns \ref nEdges of the mesh
* Returns \ref nEdges of the mesh
*/
inline const int getNumberOfEdges() const { inline const int getNumberOfEdges() const {
return nEdges; return nEdges;
} }
/** \brief /// Returns \ref nFaces of the mesh
* Returns \ref nFaces of the mesh
*/
inline const int getNumberOfFaces() const { inline const int getNumberOfFaces() const {
return nFaces; return nFaces;
} }
/** \brief /// Returns \ref nLeaves of the mesh
* Returns \ref nLeaves of the mesh
*/
inline const int getNumberOfLeaves() const { inline const int getNumberOfLeaves() const {
return nLeaves; return nLeaves;
} }
/** \brief /// Returns \ref nElements of the mesh
* Returns \ref nElements of the mesh
*/
inline const int getNumberOfElements() const { inline const int getNumberOfElements() const {
return nElements; return nElements;
} }
/** \brief /// Returns \ref maxEdgeNeigh of the mesh
* Returns \ref maxEdgeNeigh of the mesh
*/
inline const int getMaxEdgeNeigh() const { inline const int getMaxEdgeNeigh() const {
return maxEdgeNeigh; return maxEdgeNeigh;
} }
/** \brief /// Returns \ref parametric of the mesh
* Returns \ref parametric of the mesh
*/
inline Parametric *getParametric() const { inline Parametric *getParametric() const {
return parametric; return parametric;
} }
/** \brief /// Returns \ref diam of the mesh
* Returns \ref diam of the mesh
*/
inline const WorldVector<double>& getDiameter() const { inline const WorldVector<double>& getDiameter() const {
return diam; return diam;
} }
/** \brief /// Returns nDOF[i] of the mesh
* Returns nDOF[i] of the mesh
*/
inline const int getNumberOfDOFs(int i) const { inline const int getNumberOfDOFs(int i) const {
return nDOF[i]; return nDOF[i];
} }
/** \brief /// Returns \ref elementPrototype of the mesh
* Returns \ref elementPrototype of the mesh
*/
inline Element* getElementPrototype() { inline Element* getElementPrototype() {
return elementPrototype; return elementPrototype;
} }
/** \brief /// Returns \ref leafDataPrototype of the mesh
* Returns \ref leafDataPrototype of the mesh
*/
inline ElementData* getElementDataPrototype() { inline ElementData* getElementDataPrototype() {
return elementDataPrototype; return elementDataPrototype;
} }
/** \brief /// Returns node[i] of the mesh
* Returns node[i] of the mesh
*/
inline int getNode(int i) const { inline int getNode(int i) const {
return node[i]; return node[i];
} }
...@@ -255,9 +211,7 @@ namespace AMDiS { ...@@ -255,9 +211,7 @@ namespace AMDiS {
*/ */
DegreeOfFreedom *getDOF(GeoIndex position); DegreeOfFreedom *getDOF(GeoIndex position);
/** \brief /// Returns *(\ref admin[i]) of the mesh
* Returns *(\ref admin[i]) of the mesh
*/
inline const DOFAdmin& getDOFAdmin(int i) const { inline const DOFAdmin& getDOFAdmin(int i) const {
return *(admin[i]); return *(admin[i]);
} }
...@@ -285,41 +239,28 @@ namespace AMDiS { ...@@ -285,41 +239,28 @@ namespace AMDiS {
return macroElements.size(); return macroElements.size();
} }
/** \brief /// Returns a DOFAdmin which at least manages vertex DOFs
* Returns a DOFAdmin which at least manages vertex DOFs
*/
const DOFAdmin* getVertexAdmin() const; const DOFAdmin* getVertexAdmin() const;
/** \brief /// Allocates a array of DOF pointers. The array holds one pointer for each node.
* Allocates a array of DOF pointers. The array holds one pointer for
* each node.
*/
DegreeOfFreedom **createDOFPtrs(); DegreeOfFreedom **createDOFPtrs();
/** \brief /// Returns \ref preserveCoarseDOFs of the mesh
* Returns \ref preserveCoarseDOFs of the mesh
*/
inline bool queryCoarseDOFs() const { inline bool queryCoarseDOFs() const {
return preserveCoarseDOFs; return preserveCoarseDOFs;
} }
/** \brief /// Returns an iterator to the begin of \ref macroElements
* Returns an iterator to the begin of \ref macroElements
*/
inline std::deque<MacroElement*>::iterator firstMacroElement() { inline std::deque<MacroElement*>::iterator firstMacroElement() {
return macroElements.begin(); return macroElements.begin();
} }
/** \brief /// Returns macroElements[i].
* Returns macroElements[i].
*/
inline MacroElement *getMacroElement(int i) { inline MacroElement *getMacroElement(int i) {
return macroElements[i]; return macroElements[i];
} }
/** \brief /// Returns an iterator to the end of \ref macroElements
* Returns an iterator to the end of \ref macroElements
*/
inline std::deque<MacroElement*>::iterator endOfMacroElements() { inline std::deque<MacroElement*>::iterator endOfMacroElements() {
return macroElements.end(); return macroElements.end();
} }
...@@ -331,132 +272,98 @@ namespace AMDiS { ...@@ -331,132 +272,98 @@ namespace AMDiS {
* \{ * \{
*/ */
/** \brief /// Sets \ref name of the mesh
* Sets \ref name of the mesh
*/
inline void setName(const std::string& aName) { inline void setName(const std::string& aName) {
name = aName; name = aName;
} }
/** \brief /// Sets \ref nVertices of the mesh
* Sets \ref nVertices of the mesh
*/
inline void setNumberOfVertices(int n) { inline void setNumberOfVertices(int n) {
nVertices = n; nVertices = n;
} }
/** \brief /// Sets \ref nFaces of the mesh
* Sets \ref nFaces of the mesh
*/
inline void setNumberOfFaces(int n) { inline void setNumberOfFaces(int n) {
nFaces = n; nFaces = n;