GridWriter.h 3.29 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut für Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
20
21
22
23
24
25
// ==                                                                        ==
// ============================================================================

/** \file GridWriter.h */

#ifndef AMDIS_GRID_WRITER_H
#define AMDIS_GRID_WRITER_H

#include "Global.h"
26
#include "AMDiS_fwd.h"
27
28
29
30
31
32
33
34
35
36
37

namespace AMDiS {

  /** \ingroup Output
   *  \brief
   * Produces a grid-based output of a dof-vector
   */
  template<typename T>
  class GridWriter {
  public:
    /** \brief
38
     * Produces a grid-based output of a dof-vector or vector of dof-vectors 
39
40
     * \param p array of world coordinates. 
     * - p[0] defines origin of grid-system.
41
42
43
     * - p[1] defines first basis vector by p[1] relatively to p[0].
     * - p[2] defines second basis vector by p[2] relatively to p[0]. (dim >= 2).
     * - p[3] defines third basis vector by p[3] relatively to p[0]. (dim == 3).
44
45
46
47
48
49
50
51
52
53
     * \param numPoints number of grid points for the different dirctions
     * - numPoints[0] number of grid points in the first direction
     * - numPoints[1] number of grid points in the second direction
     * - numPoints[2] number of grid points in the third direction
     * \param dist distance between two points in the different directions
     * - dist[0] distance in the first direction
     * - dist[1] distance in the second direction
     * - dist[2] distance in the third direction
     * \param vec DOFVector which is interpolated to the grid.
     * \param filename file to which the grid will be written
54
     * \param outFilePrecision precision used to write file
55
56
57
58
59
     */
    static void writeGrid(const WorldVector<double> *p,
			  int               *numPoints, 
			  double            *dist,
			  DOFVector<T>      *vec,
60
61
62
63
64
65
66
67
68
			  const char*              filename,
	                  int outFilePrecision=6); 

    static void writeGrid(const WorldVector<double> *p,
			  int               *numPoints, 
			  double            *dist,
			  std::vector< DOFVector<T> * >     vec,
			  const char*              filename,
	                  int outFilePrecision=6); 
69
70
71
72
73
74
75
  };

}

#include "GridWriter.hh"

#endif