Liebe Gitlab-Nutzerin, lieber Gitlab-Nutzer,
es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konten der externen Nutzer:innen sind über den Reiter "Standard" erreichbar.
Die Administratoren


Dear Gitlab user,
it is now possible to log in to our service using the ZIH login/LDAP. The accounts of external users can be accessed via the "Standard" tab.
The administrators

ElementFileWriter.h 2.76 KB
Newer Older
1 2 3 4 5 6 7 8
#ifndef ELEMENTFILEWRITER_H
#define ELEMENTFILEWRITER_H

#include "FileWriter.h"
#include "FiniteElemSpace.h"
#include "MatrixVector.h"
#include "Mesh.h"

9 10
namespace AMDiS {

Thomas Witkowski's avatar
Thomas Witkowski committed
11 12 13 14 15 16 17 18 19
  /** \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.
   */
20 21 22
  class ElementFileWriter : public FileWriterInterface
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
23
    /// Constructor.
24
    ElementFileWriter(std::string name, 
Thomas Witkowski's avatar
Thomas Witkowski committed
25 26
		      const FiniteElemSpace *feSpace,
		      std::map<int, double> &vec);
27

Thomas Witkowski's avatar
Thomas Witkowski committed
28
    /// Implementation of FileWriterInterface::writeFiles().
29 30 31 32 33
    void writeFiles(AdaptInfo *adaptInfo, bool force,
		    int level = -1,
		    Flag traverseFlag = Mesh::CALL_LEAF_EL,
		    bool (*writeElem)(ElInfo*) = NULL);

Thomas Witkowski's avatar
Thomas Witkowski committed
34 35 36
    /// Simple writing procedure for one element map.
    static void writeFile(std::map<int, double> &vec,
			  const FiniteElemSpace *feSpace,
37
			  std::string filename);
Thomas Witkowski's avatar
Thomas Witkowski committed
38

39
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
40
    /// Writes element data in tecplot format.
41
    void writeTecPlotValues(std::string filename);
42

Thomas Witkowski's avatar
Thomas Witkowski committed
43
    /// Writes element data in AMDiS format (1 file !).
44
    void writeMeshDatValues(std::string filename, double time);
45

Thomas Witkowski's avatar
Thomas Witkowski committed
46
    /// Writes element data in VTK format.
47
    void writeVtkValues(std::string filename);
48 49

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
50
    /// Name.
51 52
    std::string name;

Thomas Witkowski's avatar
Thomas Witkowski committed
53
    /// Used filename prefix.
54 55
    std::string filename;

Thomas Witkowski's avatar
Thomas Witkowski committed
56
    /// TecPlot file extension.
57 58
    std::string tecplotExt;

Thomas Witkowski's avatar
Thomas Witkowski committed
59
    /// AMDiS mesh-data-file extension.
60 61
    std::string amdisMeshDatExt;

Thomas Witkowski's avatar
Thomas Witkowski committed
62
    /// VTK file extension.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
    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;

Thomas Witkowski's avatar
Thomas Witkowski committed
89
    /// Total length of appended time index.
90 91
    int indexLength;

Thomas Witkowski's avatar
Thomas Witkowski committed
92
    /// Number of decimals in time index.
93 94
    int indexDecimals;

Thomas Witkowski's avatar
Thomas Witkowski committed
95
    /// Timestep modulo: write only every tsModulo-th timestep! 
96 97
    int tsModulo;

Thomas Witkowski's avatar
Thomas Witkowski committed
98
    ///
99 100
    int timestepNumber;

Thomas Witkowski's avatar
Thomas Witkowski committed
101
    /// Mesh used for output.
102 103
    Mesh *mesh;

Thomas Witkowski's avatar
Thomas Witkowski committed
104
    /// fespace used for output.
105 106
    const FiniteElemSpace *feSpace;

Thomas Witkowski's avatar
Thomas Witkowski committed
107
    /// Vector that stores the solution.
108 109 110 111 112
    std::map<int, double> vec;
  };

}

113 114

#endif  // ELEMENTFILEWRITER_H