t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_vtk.h
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
29 #ifndef T8_VTK_H
30 #define T8_VTK_H
31 
32 #include <t8.h>
33 
34 /* typedef and macros */
35 
36 #define T8_VTK_LOCIDX "Int32"
37 /* TODO: Paraview has troubles with Int64, so we switch to Int32 and be careful.
38  * Investigate this further. See also vtk makro VTK_USE_64BIT_IDS */
39 #define T8_VTK_GLOIDX "Int32"
40 
41 /* TODO: these macros need to be set by configure */
42 #ifndef T8_VTK_DOUBLES
43 #define T8_VTK_FLOAT_NAME "Float32"
44 #define T8_VTK_FLOAT_TYPE float
45 #else
46 #define T8_VTK_FLOAT_NAME "Float64"
47 #define T8_VTK_FLOAT_TYPE double
48 #endif
49 
50 #ifndef T8_VTK_BINARY
51 #define T8_VTK_ASCII 1
52 #define T8_VTK_FORMAT_STRING "ascii"
53 #else
54 #define T8_VTK_FORMAT_STRING "binary"
55 #endif
56 
57 #if T8_WITH_VTK
58 #define t8_vtk_locidx_array_type_t vtkTypeInt32Array
59 #define t8_vtk_gloidx_array_type_t vtkTypeInt64Array
60 #endif
61 
62 /* TODO: Add support for integer data type. */
63 typedef enum
64 {
65  T8_VTK_SCALAR, /* One double value per element */
66  T8_VTK_VECTOR /* 3 double values per element */
67 } t8_vtk_data_type_t;
68 
69 typedef struct
70 {
71  t8_vtk_data_type_t type;
72  char description[BUFSIZ];
73  double *data;
77 
78 T8_EXTERN_C_BEGIN ();
79 
80 /* function declarations */
81 /* Writes the pvtu header file that links to the processor local files.
82  * It is used by the cmesh and forest vtk routines.
83  * This function should only be called by one process.
84  * Return 0 on success. */
85 /* TODO: document */
86 int t8_write_pvtu (const char *filename, int num_procs,
87  int write_tree, int write_rank,
88  int write_level, int write_id,
89  int num_data, t8_vtk_data_field_t *data);
90 
91 T8_EXTERN_C_END ();
92 
93 #endif /* !T8_VTK_H */
Definition: t8_vtk.h:70
t8_vtk_data_type_t type
Describes of which type the data array is.
Definition: t8_vtk.h:71
double * data
An array of length n*num_local_elements doubles with n = 1 if type = T8_VTK_SCALAR,...
Definition: t8_vtk.h:73
This is the administrative header file for t8code.