// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file GridWriter.h */

#ifndef AMDIS_GRID_WRITER_H
#define AMDIS_GRID_WRITER_H

#include "Global.h"
#include "AMDiS_fwd.h"

namespace AMDiS {

  /** \ingroup Output
   *  \brief
   * Produces a grid-based output of a dof-vector
   */
  template<typename T>
  class GridWriter {
  public:
    /** \brief
     * Produces a grid-based output of a dof-vector
     * \param p array of world coordinates. 
     * - p[0] defines origin of grid-system.
     * - p[1] defines first basis vector by p[1] - p[0].
     * - p[2] defines second basis vector by p[2] - p[0] (dim >= 2).
     * - p[3] defines third basis vector by p[3] - p[0] (dim == 3).
     * \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
     */
    static void writeGrid(const WorldVector<double> *p,
			  int               *numPoints, 
			  double            *dist,
			  DOFVector<T>      *vec,
			  char*              filename); 
  };

}

#include "GridWriter.hh"

#endif