/*1This file is part of t8code.2t8code is a C library to manage a collection (a forest) of multiple3connected adaptive space-trees of general element classes in parallel.45Copyright (C) 2015 the developers67t8code is free software; you can redistribute it and/or modify8it under the terms of the GNU General Public License as published by9the Free Software Foundation; either version 2 of the License, or10(at your option) any later version.1112t8code is distributed in the hope that it will be useful,13but WITHOUT ANY WARRANTY; without even the implied warranty of14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15GNU General Public License for more details.1617You should have received a copy of the GNU General Public License18along with t8code; if not, write to the Free Software Foundation, Inc.,1951 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.20*/2122/** \file t8_vtk.h23* This header file collects macros that are needed for24* the forest and cmesh vtk routines.25* \see t8_forest_vtk.h \see t8_cmesh_vtk_writer.h \see t8_cmesh_vtk_reader.hxx26*/2728#ifndef T8_VTK_H29#define T8_VTK_H3031#include <t8.h>3233/** typedef and macros */34#define T8_VTK_LOCIDX "Int32"35/** TODO: Paraview has troubles with Int64, so we switch to Int32 and be careful.36* Investigate this further. See also vtk macro VTK_USE_64BIT_IDS */37#define T8_VTK_GLOIDX "Int32"3839/** TODO: these macros need to be set by configure. */40#ifndef T8_VTK_DOUBLES41#define T8_VTK_FLOAT_NAME "Float32" /**< Name of the floats used for vtk */42#define T8_VTK_FLOAT_TYPE float /**< Float type for vtk */43#else44#define T8_VTK_FLOAT_NAME "Float64"45#define T8_VTK_FLOAT_TYPE double46#endif4748#define T8_VTK_FORMAT_STRING "ascii" /**< Format string for vtk */4950#if T8_ENABLE_VTK51#define t8_vtk_locidx_array_type_t vtkTypeInt32Array /**< VTK array type for local indices */52#define t8_vtk_gloidx_array_type_t vtkTypeInt64Array /**< VTK array type for global indices */53#endif5455/** TODO: Add support for integer data type. */56typedef enum {57T8_VTK_SCALAR, /**< One double value per element */58T8_VTK_VECTOR /**< 3 double values per element */59} t8_vtk_data_type_t;6061/** A data field for VTK output.62* This struct is used to store data that is written to the VTK files.63* It contains the type of the data, a description, and the actual data array.64*/65typedef struct66{67t8_vtk_data_type_t type; /**< Describes of which type the data array is */68char description[BUFSIZ]; /**< String that describes the data. */69double *data;70/**< An array of length n*num_local_elements doubles with71n = 1 if type = T8_VTK_SCALAR, n = 3 if type = T8_VTK_VECTOR */72} t8_vtk_data_field_t;7374T8_EXTERN_C_BEGIN ();7576/* function declarations */77/** Writes the pvtu header file that links to the processor local files.78* It is used by the cmesh and forest vtk routines.79* This function should only be called by one process.80* Return 0 on success. */81/* TODO: document */82int83t8_write_pvtu (const char *filename, int num_procs, int write_tree, int write_rank, int write_level, int write_id,84int num_data, t8_vtk_data_field_t *data);8586T8_EXTERN_C_END ();8788#endif /* !T8_VTK_H */899091