Reference documentation for deal.II version 9.0.0
data_out_base.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_data_out_base_h
17 #define dealii_data_out_base_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/point.h>
22 #include <deal.II/base/table.h>
23 #include <deal.II/base/geometry_info.h>
24 
25 #include <vector>
26 #include <string>
27 #include <limits>
28 #include <typeinfo>
29 #include <tuple>
30 
31 #include <deal.II/base/mpi.h>
32 
33 // Only include the Tecplot API header if the appropriate files
34 // were detected by configure
35 #ifdef DEAL_II_HAVE_TECPLOT
36 # include "TECIO.h"
37 # include <string.h>
38 #endif
39 
40 #include <ostream>
41 
42 DEAL_II_NAMESPACE_OPEN
43 
44 
45 class ParameterHandler;
46 class XDMFEntry;
47 
211 namespace DataOutBase
212 {
237  template <int dim, int spacedim=dim>
238  struct Patch
239  {
243  static const unsigned int space_dim=spacedim;
244 
258 
265  unsigned int neighbors[dim > 0
266  ?
268  :
269  1];
270 
275  unsigned int patch_index;
276 
282  unsigned int n_subdivisions;
283 
306 
320 
325  Patch ();
326 
331  bool operator == (const Patch &patch) const;
332 
339  std::size_t memory_consumption () const;
340 
344  void swap (Patch<dim,spacedim> &other_patch);
345 
349  static const unsigned int no_neighbor = numbers::invalid_unsigned_int;
350 
360  int, int,
361  << "It is not possible to have a structural dimension of " << arg1
362  << " to be larger than the space dimension of the surrounding"
363  << " space " << arg2);
365  };
366 
367 
368 
386  template <int spacedim>
387  struct Patch<0,spacedim>
388  {
392  static const unsigned int space_dim=spacedim;
393 
403 
408  static unsigned int neighbors[1];
409 
414  unsigned int patch_index;
415 
425  static unsigned int n_subdivisions;
426 
448 
462 
467  Patch ();
468 
473  bool operator == (const Patch &patch) const;
474 
481  std::size_t memory_consumption () const;
482 
486  void swap (Patch<0,spacedim> &other_patch);
487 
491  static const unsigned int no_neighbor = numbers::invalid_unsigned_int;
492 
502  int, int,
503  << "It is not possible to have a structural dimension of " << arg1
504  << " to be larger than the space dimension of the surrounding"
505  << " space " << arg2);
507  };
508 
509 
521  template <typename FlagsType>
523  {
531  static void declare_parameters (ParameterHandler &prm);
532 
540  void parse_parameters (const ParameterHandler &prm);
541 
548  std::size_t memory_consumption () const;
549  };
550 
551 
552  template <typename FlagsType>
554  {}
555 
556 
557  template <typename FlagsType>
559  {}
560 
561 
562  template <typename FlagsType>
564  {
565  return sizeof(FlagsType);
566  }
567 
568 
574  struct DXFlags : public OutputFlagsBase<DXFlags>
575  {
590 
595 
601 
605  DXFlags (const bool write_neighbors = false,
606  const bool int_binary = false,
607  const bool coordinates_binary = false,
608  const bool data_binary = false);
609 
614  static void declare_parameters (ParameterHandler &prm);
615 
622  void parse_parameters (const ParameterHandler &prm);
623  };
624 
630  struct UcdFlags : public OutputFlagsBase<UcdFlags>
631  {
642 
646  UcdFlags (const bool write_preamble = false);
647 
652  static void declare_parameters (ParameterHandler &prm);
653 
660  void parse_parameters (const ParameterHandler &prm);
661  };
662 
668  struct GnuplotFlags : public OutputFlagsBase<GnuplotFlags>
669  {
674  GnuplotFlags();
675 
679  GnuplotFlags(const std::vector<std::string> &space_dimension_labels);
680 
696  std::vector<std::string> space_dimension_labels;
697 
702  std::size_t memory_consumption () const;
703 
709  "There should be at least one space dimension per spatial "
710  "dimension (extras are ignored).");
711  };
712 
719  struct PovrayFlags : public OutputFlagsBase<PovrayFlags>
720  {
726  bool smooth;
727 
734 
742 
746  PovrayFlags (const bool smooth = false,
747  const bool bicubic_patch = false,
748  const bool external_data = false);
749 
754  static void declare_parameters (ParameterHandler &prm);
755 
762  void parse_parameters (const ParameterHandler &prm);
763  };
764 
765 
772  struct EpsFlags : public OutputFlagsBase<EpsFlags>
773  {
780  unsigned int height_vector;
781 
786  unsigned int color_vector;
787 
793  enum SizeType
794  {
799  };
800 
805 
813  unsigned int size;
814 
818  double line_width;
819 
825  double azimut_angle;
826 
850  double turn_angle;
851 
862  double z_scaling;
863 
870  bool draw_mesh;
871 
889 
899 
903  struct RgbValues
904  {
905  float red;
906  float green;
907  float blue;
908 
913  bool is_grey () const;
914  };
915 
923  typedef RgbValues (*ColorFunction) (const double value,
924  const double min_value,
925  const double max_value);
926 
933 
934 
943  static RgbValues
944  default_color_function (const double value,
945  const double min_value,
946  const double max_value);
947 
953  static RgbValues
954  grey_scale_color_function (const double value,
955  const double min_value,
956  const double max_value);
957 
964  static RgbValues
965  reverse_grey_scale_color_function (const double value,
966  const double min_value,
967  const double max_value);
968 
972  EpsFlags (const unsigned int height_vector = 0,
973  const unsigned int color_vector = 0,
974  const SizeType size_type = width,
975  const unsigned int size = 300,
976  const double line_width = 0.5,
977  const double azimut_angle = 60,
978  const double turn_angle = 30,
979  const double z_scaling = 1.0,
980  const bool draw_mesh = true,
981  const bool draw_cells = true,
982  const bool shade_cells = true,
984 
992  static void declare_parameters (ParameterHandler &prm);
993 
1000  void parse_parameters (const ParameterHandler &prm);
1001  };
1002 
1009  struct GmvFlags : public OutputFlagsBase<GmvFlags>
1010  {};
1011 
1017  struct TecplotFlags : public OutputFlagsBase<TecplotFlags>
1018  {
1025 
1030  const char *zone_name;
1031 
1038 
1042  TecplotFlags (const char *tecplot_binary_file_name = nullptr,
1043  const char *zone_name = nullptr,
1044  const double solution_time = -1.0);
1045 
1050  std::size_t memory_consumption () const;
1051  };
1052 
1058  struct VtkFlags : public OutputFlagsBase<VtkFlags>
1059  {
1070  double time;
1071 
1082  unsigned int cycle;
1083 
1091 
1097  {
1116  };
1117 
1123 
1127  VtkFlags (const double time = std::numeric_limits<double>::min(),
1128  const unsigned int cycle = std::numeric_limits<unsigned int>::min(),
1129  const bool print_date_and_time = true,
1131  };
1132 
1133 
1139  struct SvgFlags : public OutputFlagsBase<SvgFlags>
1140  {
1144  unsigned int height;
1145 
1150  unsigned int width;
1151 
1158  unsigned int height_vector;
1159 
1163  int azimuth_angle, polar_angle;
1164 
1165  unsigned int line_thickness;
1166 
1170  bool margin;
1171 
1176 
1180  SvgFlags(const unsigned int height_vector = 0,
1181  const int azimuth_angle = 37,
1182  const int polar_angle = 45,
1183  const unsigned int line_thickness = 1,
1184  const bool margin = true,
1185  const bool draw_colorbar = true);
1186  };
1187 
1188 
1195  struct Deal_II_IntermediateFlags : public OutputFlagsBase<Deal_II_IntermediateFlags>
1196  {
1203  static const unsigned int format_version;
1204  };
1205 
1212  {
1222 
1228 
1232  DataOutFilterFlags (const bool filter_duplicate_vertices = false,
1233  const bool xdmf_hdf5_output = false);
1234 
1239  static void declare_parameters (ParameterHandler &prm);
1240 
1247  void parse_parameters (const ParameterHandler &prm);
1248 
1253  std::size_t memory_consumption () const;
1254  };
1255 
1278  {
1279  public:
1283  DataOutFilter();
1284 
1290 
1296  template <int dim>
1297  void write_point(const unsigned int index,
1298  const Point<dim> &p);
1299 
1303  template <int dim>
1304  void write_cell(const unsigned int index,
1305  const unsigned int start,
1306  const unsigned int d1,
1307  const unsigned int d2,
1308  const unsigned int d3);
1309 
1316  void write_data_set(const std::string &name,
1317  const unsigned int dimension,
1318  const unsigned int set_num,
1319  const Table<2,double> &data_vectors);
1320 
1325  void fill_node_data(std::vector<double> &node_data) const;
1326 
1331  void fill_cell_data(const unsigned int local_node_offset,
1332  std::vector<unsigned int> &cell_data) const;
1333 
1337  std::string get_data_set_name(const unsigned int set_num) const;
1338 
1342  unsigned int get_data_set_dim(const unsigned int set_num) const;
1343 
1348  const double *get_data_set(const unsigned int set_num) const;
1349 
1354  unsigned int n_nodes() const;
1355 
1360  unsigned int n_cells() const;
1361 
1366  unsigned int n_data_sets() const;
1367 
1371  void flush_points ();
1372 
1376  void flush_cells ();
1377 
1378 
1379  private:
1383  struct Point3Comp
1384  {
1385  bool operator() (const Point<3> &one,
1386  const Point<3> &two) const
1387  {
1388  /*
1389  * The return statement below is an optimized version of the following code:
1390  *
1391  * for (unsigned int d=0; d<3; ++d)
1392  * {
1393  * if (one(d) < two(d))
1394  * return true;
1395  * else if (one(d) > two(d))
1396  * return false;
1397  * }
1398  * return false;
1399  */
1400 
1401  return (one(0) < two(0) || (!(two(0) < one(0)) && (one(1) < two(1) || (!(two(1) < one(1)) && one(2) < two(2)))));
1402  }
1403  };
1404 
1405  typedef std::multimap<Point<3>, unsigned int, Point3Comp> Map3DPoint;
1406 
1411 
1418  unsigned int node_dim;
1419 
1426  unsigned int vertices_per_cell;
1427 
1431  Map3DPoint existing_points;
1432 
1436  std::map<unsigned int, unsigned int> filtered_points;
1437 
1441  std::map<unsigned int, unsigned int> filtered_cells;
1442 
1446  std::vector<std::string> data_set_names;
1447 
1451  std::vector<unsigned int> data_set_dims;
1452 
1456  std::vector<std::vector<double> > data_sets;
1457 
1461  void internal_add_cell(const unsigned int cell_index,
1462  const unsigned int pt_index);
1463  };
1464 
1465 
1470  {
1513 
1518 
1523 
1528 
1533 
1538  };
1539 
1540 
1544  template <int dim, int spacedim>
1545  void write_dx (const std::vector<Patch<dim,spacedim> > &patches,
1546  const std::vector<std::string> &data_names,
1547  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1548  const DXFlags &flags,
1549  std::ostream &out);
1550 
1595  template <int spacedim>
1596  void write_eps (const std::vector<Patch<2,spacedim> > &patches,
1597  const std::vector<std::string> &data_names,
1598  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1599  const EpsFlags &flags,
1600  std::ostream &out);
1601 
1607  template <int dim, int spacedim>
1608  void write_eps (const std::vector<Patch<dim,spacedim> > &patches,
1609  const std::vector<std::string> &data_names,
1610  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1611  const EpsFlags &flags,
1612  std::ostream &out);
1613 
1614 
1624  template <int dim, int spacedim>
1625  void write_gmv (const std::vector<Patch<dim,spacedim> > &patches,
1626  const std::vector<std::string> &data_names,
1627  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1628  const GmvFlags &flags,
1629  std::ostream &out);
1630 
1687  template <int dim, int spacedim>
1688  void write_gnuplot (const std::vector<Patch<dim,spacedim> > &patches,
1689  const std::vector<std::string> &data_names,
1690  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1691  const GnuplotFlags &flags,
1692  std::ostream &out);
1693 
1739  template <int dim, int spacedim>
1740  void write_povray (const std::vector<Patch<dim,spacedim> > &patches,
1741  const std::vector<std::string> &data_names,
1742  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1743  const PovrayFlags &flags,
1744  std::ostream &out);
1745 
1752  template <int dim, int spacedim>
1753  void write_tecplot (const std::vector<Patch<dim,spacedim> > &patches,
1754  const std::vector<std::string> &data_names,
1755  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1756  const TecplotFlags &flags,
1757  std::ostream &out);
1758 
1778  template <int dim, int spacedim>
1779  void write_tecplot_binary (
1780  const std::vector<Patch<dim,spacedim> > &patches,
1781  const std::vector<std::string> &data_names,
1782  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1783  const TecplotFlags &flags,
1784  std::ostream &out);
1785 
1800  template <int dim, int spacedim>
1801  void write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
1802  const std::vector<std::string> &data_names,
1803  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1804  const UcdFlags &flags,
1805  std::ostream &out);
1806 
1826  template <int dim, int spacedim>
1827  void write_vtk (const std::vector<Patch<dim,spacedim> > &patches,
1828  const std::vector<std::string> &data_names,
1829  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1830  const VtkFlags &flags,
1831  std::ostream &out);
1832 
1833 
1857  template <int dim, int spacedim>
1858  void write_vtu (const std::vector<Patch<dim,spacedim> > &patches,
1859  const std::vector<std::string> &data_names,
1860  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1861  const VtkFlags &flags,
1862  std::ostream &out);
1863 
1869  void write_vtu_header (std::ostream &out,
1870  const VtkFlags &flags);
1871 
1877  void write_vtu_footer (std::ostream &out);
1878 
1884  template <int dim, int spacedim>
1885  void write_vtu_main (const std::vector<Patch<dim,spacedim> > &patches,
1886  const std::vector<std::string> &data_names,
1887  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
1888  const VtkFlags &flags,
1889  std::ostream &out);
1890 
1932  void
1933  write_pvtu_record (std::ostream &out,
1934  const std::vector<std::string> &piece_names,
1935  const std::vector<std::string> &data_names,
1936  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges);
1937 
1988  void write_pvd_record (std::ostream &out,
1989  const std::vector<std::pair<double,std::string> > &times_and_names);
1990 
2002  void write_visit_record (std::ostream &out,
2003  const std::vector<std::string> &piece_names);
2004 
2032  void write_visit_record (std::ostream &out,
2033  const std::vector<std::vector<std::string> > &piece_names);
2034 
2066  void write_visit_record (std::ostream &out,
2067  const std::vector<std::pair<double,std::vector<std::string> > > &times_and_piece_names);
2068 
2089  template <int spacedim>
2090  void write_svg (const std::vector<Patch<2,spacedim> > &patches,
2091  const std::vector<std::string> &data_names,
2092  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
2093  const SvgFlags &flags,
2094  std::ostream &out);
2095 
2133  template <int dim, int spacedim>
2135  const std::vector<Patch<dim,spacedim> > &patches,
2136  const std::vector<std::string> &data_names,
2137  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
2138  const Deal_II_IntermediateFlags &flags,
2139  std::ostream &out);
2140 
2145  template <int dim, int spacedim>
2146  void write_hdf5_parallel (const std::vector<Patch<dim,spacedim> > &patches,
2147  const DataOutFilter &data_filter,
2148  const std::string &filename,
2149  MPI_Comm comm);
2150 
2158  template <int dim, int spacedim>
2159  void write_hdf5_parallel (const std::vector<Patch<dim,spacedim> > &patches,
2160  const DataOutFilter &data_filter,
2161  const bool write_mesh_file,
2162  const std::string &mesh_filename,
2163  const std::string &solution_filename,
2164  MPI_Comm comm);
2165 
2172  template <int dim, int spacedim>
2173  void write_filtered_data (const std::vector<Patch<dim,spacedim> > &patches,
2174  const std::vector<std::string> &data_names,
2175  const std::vector<std::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
2176  DataOutFilter &filtered_data);
2177 
2189  std::pair<unsigned int, unsigned int>
2190  determine_intermediate_format_dimensions (std::istream &input);
2191 
2203  OutputFormat parse_output_format (const std::string &format_name);
2204 
2210  std::string get_output_format_names ();
2211 
2230  std::string default_suffix (const OutputFormat output_format);
2231 
2241  int, int,
2242  << "The number of points in this data set is " << arg1
2243  << ", but we expected " << arg2 << " in each space direction.");
2248  "You are trying to write graphical data into a file, but "
2249  "no data is available in the intermediate format that "
2250  "the DataOutBase functions require. Did you forget to "
2251  "call a function such as DataOut::build_patches()?");
2256  "The error code of one of the Tecplot functions was "
2257  "not zero as expected.");
2262  char *,
2263  << "There was an error opening Tecplot file " << arg1
2264  << " for output.");
2265 
2267 }
2268 
2269 
2270 
2271 
2383 template <int dim, int spacedim=dim>
2385 {
2386 public:
2390  DataOutInterface ();
2391 
2396  virtual ~DataOutInterface () = default;
2397 
2402  void write_dx (std::ostream &out) const;
2403 
2408  void write_eps (std::ostream &out) const;
2409 
2414  void write_gmv (std::ostream &out) const;
2415 
2420  void write_gnuplot (std::ostream &out) const;
2421 
2426  void write_povray (std::ostream &out) const;
2427 
2432  void write_tecplot (std::ostream &out) const;
2433 
2439  void write_tecplot_binary (std::ostream &out) const;
2440 
2445  void write_ucd (std::ostream &out) const;
2446 
2458  void write_vtk (std::ostream &out) const;
2459 
2474  void write_vtu (std::ostream &out) const;
2475 
2484  void write_vtu_in_parallel (const char *filename,
2485  MPI_Comm comm) const;
2486 
2520  void write_pvtu_record (std::ostream &out,
2521  const std::vector<std::string> &piece_names) const;
2522 
2527  void write_svg(std::ostream &out) const;
2528 
2539  void write_deal_II_intermediate (std::ostream &out) const;
2540 
2547  const std::string &h5_filename,
2548  const double cur_time,
2549  MPI_Comm comm) const;
2550 
2557  const std::string &h5_mesh_filename,
2558  const std::string &h5_solution_filename,
2559  const double cur_time,
2560  MPI_Comm comm) const;
2561 
2582  void write_xdmf_file (const std::vector<XDMFEntry> &entries,
2583  const std::string &filename,
2584  MPI_Comm comm) const;
2585 
2599  void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter,
2600  const std::string &filename,
2601  MPI_Comm comm) const;
2602 
2610  void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter,
2611  const bool write_mesh_file,
2612  const std::string &mesh_filename,
2613  const std::string &solution_filename,
2614  MPI_Comm comm) const;
2615 
2622  void write_filtered_data (DataOutBase::DataOutFilter &filtered_data) const;
2623 
2624 
2633  void write (std::ostream &out,
2634  const DataOutBase::OutputFormat output_format = DataOutBase::default_format) const;
2635 
2640  void set_default_format (const DataOutBase::OutputFormat default_format);
2641 
2642 
2647  template <typename FlagType>
2648  void set_flags (const FlagType &flags);
2649 
2650 
2658  std::string
2660 
2675  static void declare_parameters (ParameterHandler &prm);
2676 
2684  void parse_parameters (ParameterHandler &prm);
2685 
2691  std::size_t memory_consumption () const;
2692 
2693 protected:
2701  virtual
2702  const std::vector<DataOutBase::Patch<dim,spacedim> > &
2703  get_patches () const = 0;
2704 
2709  virtual
2710  std::vector<std::string>
2711  get_dataset_names () const = 0;
2712 
2731  virtual
2732  std::vector<std::tuple<unsigned int, unsigned int, std::string> >
2733  get_vector_data_ranges () const;
2734 
2741  void validate_dataset_names () const;
2742 
2743 
2749  unsigned int default_subdivisions;
2750 
2751 private:
2758 
2764 
2770 
2776 
2782 
2788 
2794 
2800 
2806 
2812 
2818 };
2819 
2820 
2821 
2870 template <int dim, int spacedim=dim>
2871 class DataOutReader : public DataOutInterface<dim,spacedim>
2872 {
2873 public:
2879  void read (std::istream &in);
2880 
2904  void merge (const DataOutReader<dim,spacedim> &other);
2905 
2910  "You are trying to merge two sets of patches for which the "
2911  "declared names of the variables do not match.");
2916  "You are trying to merge two sets of patches for which the "
2917  "number of subdivisions or the number of vector components "
2918  "do not match.");
2923  int, int, int, int,
2924  << "Either the dimensions <" << arg1 << "> and <"
2925  << arg2 << "> or the space dimensions <"
2926  << arg3 << "> and <" << arg4
2927  << "> do not match!");
2928 
2929 protected:
2938  virtual const std::vector<::DataOutBase::Patch<dim,spacedim> > &
2939  get_patches () const;
2940 
2947  virtual std::vector<std::string> get_dataset_names () const;
2948 
2967  virtual
2968  std::vector<std::tuple<unsigned int, unsigned int, std::string> >
2969  get_vector_data_ranges () const;
2970 
2971 private:
2976  std::vector<::DataOutBase::Patch<dim,spacedim> > patches;
2977  std::vector<std::string> dataset_names;
2978 
2983  std::vector<std::tuple<unsigned int, unsigned int, std::string> >
2985 };
2986 
2987 
2988 
2989 
2998 {
2999 public:
3003  XDMFEntry();
3004 
3010  XDMFEntry(const std::string &filename,
3011  const double time,
3012  const unsigned int nodes,
3013  const unsigned int cells,
3014  const unsigned int dim);
3015 
3020  XDMFEntry(const std::string &mesh_filename,
3021  const std::string &solution_filename,
3022  const double time,
3023  const unsigned int nodes,
3024  const unsigned int cells,
3025  const unsigned int dim);
3026 
3030  XDMFEntry(const std::string &mesh_filename,
3031  const std::string &solution_filename,
3032  const double time,
3033  const unsigned int nodes,
3034  const unsigned int cells,
3035  const unsigned int dim,
3036  const unsigned int spacedim);
3037 
3041  void add_attribute(const std::string &attr_name, const unsigned int dimension);
3042 
3046  template <class Archive>
3047  void serialize(Archive &ar, const unsigned int /*version*/)
3048  {
3049  ar &valid
3052  &entry_time
3053  &num_nodes
3054  &num_cells
3055  &dimension
3056  &attribute_dims;
3057  }
3058 
3063  std::string get_xdmf_content(const unsigned int indent_level) const;
3064 
3065 private:
3069  bool valid;
3070 
3074  std::string h5_sol_filename;
3075 
3079  std::string h5_mesh_filename;
3080 
3084  double entry_time;
3085 
3089  unsigned int num_nodes;
3090 
3094  unsigned int num_cells;
3095 
3099  unsigned int dimension;
3100 
3105  unsigned int space_dimension;
3106 
3110  std::map<std::string, unsigned int> attribute_dims;
3111 };
3112 
3113 
3114 
3115 /* -------------------- inline functions ------------------- */
3116 
3117 namespace DataOutBase
3118 {
3119  inline
3120  bool
3122  {
3123  return (red == green) && (red == blue);
3124  }
3125 
3126 
3127  /* -------------------- template functions ------------------- */
3128 
3137  template <int dim, int spacedim>
3138  std::ostream &
3139  operator << (std::ostream &out,
3140  const Patch<dim,spacedim> &patch);
3141 
3142 
3143 
3152  template <int dim, int spacedim>
3153  std::istream &
3154  operator >> (std::istream &in,
3155  Patch<dim,spacedim> &patch);
3156 }
3157 
3158 
3159 DEAL_II_NAMESPACE_CLOSE
3160 
3161 #endif
static void declare_parameters(ParameterHandler &prm)
void write_pvtu_record(std::ostream &out, const std::vector< std::string > &piece_names) const
static const unsigned int invalid_unsigned_int
Definition: types.h:173
unsigned int space_dimension
unsigned int height_vector
void write_vtu_footer(std::ostream &out)
static void declare_parameters(ParameterHandler &prm)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:358
void write_vtk(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const VtkFlags &flags, std::ostream &out)
void parse_parameters(const ParameterHandler &prm)
void write_hdf5_parallel(const DataOutBase::DataOutFilter &data_filter, const std::string &filename, MPI_Comm comm) const
void write_tecplot_binary(std::ostream &out) const
std::size_t memory_consumption() const
void set_flags(const FlagType &flags)
virtual std::vector< std::string > get_dataset_names() const =0
virtual const std::vector<::DataOutBase::Patch< dim, spacedim > > & get_patches() const
void write_data_set(const std::string &name, const unsigned int dimension, const unsigned int set_num, const Table< 2, double > &data_vectors)
static ::ExceptionBase & ExcIncompatibleDatasetNames()
std::map< unsigned int, unsigned int > filtered_cells
void write_visit_record(std::ostream &out, const std::vector< std::string > &piece_names)
unsigned int num_cells
std::pair< unsigned int, unsigned int > determine_intermediate_format_dimensions(std::istream &input)
void parse_parameters(const ParameterHandler &prm)
void swap(Patch< dim, spacedim > &other_patch)
void merge(const DataOutReader< dim, spacedim > &other)
unsigned int neighbors[dim > 0 ? GeometryInfo< dim >::faces_per_cell :1]
void write_vtu_header(std::ostream &out, const VtkFlags &flags)
unsigned int n_nodes() const
static RgbValues default_color_function(const double value, const double min_value, const double max_value)
double entry_time
ZlibCompressionLevel compression_level
void write_svg(const std::vector< Patch< 2, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const SvgFlags &flags, std::ostream &out)
void write_dx(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const DXFlags &flags, std::ostream &out)
void write_deal_II_intermediate(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const Deal_II_IntermediateFlags &flags, std::ostream &out)
VtkFlags(const double time=std::numeric_limits< double >::min(), const unsigned int cycle=std::numeric_limits< unsigned int >::min(), const bool print_date_and_time=true, const ZlibCompressionLevel compression_level=best_compression)
void write_vtk(std::ostream &out) const
unsigned int get_data_set_dim(const unsigned int set_num) const
unsigned int default_subdivisions
std::vector< unsigned int > data_set_dims
Point< spacedim > vertices[GeometryInfo< dim >::vertices_per_cell]
std::string get_xdmf_content(const unsigned int indent_level) const
std::vector< std::vector< double > > data_sets
static void declare_parameters(ParameterHandler &prm)
void fill_cell_data(const unsigned int local_node_offset, std::vector< unsigned int > &cell_data) const
virtual const std::vector< DataOutBase::Patch< dim, spacedim > > & get_patches() const =0
std::map< std::string, unsigned int > attribute_dims
void write(std::ostream &out, const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
void parse_parameters(ParameterHandler &prm)
void write_ucd(std::ostream &out) const
std::string default_suffix(const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
Scale to given height.
const char * tecplot_binary_file_name
void write_tecplot(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const TecplotFlags &flags, std::ostream &out)
static ::ExceptionBase & ExcNoPatches()
DataOutBase::PovrayFlags povray_flags
DataOutBase::DataOutFilterFlags flags
SvgFlags(const unsigned int height_vector=0, const int azimuth_angle=37, const int polar_angle=45, const unsigned int line_thickness=1, const bool margin=true, const bool draw_colorbar=true)
unsigned int n_data_sets() const
std::string default_suffix(const OutputFormat output_format)
EpsFlags(const unsigned int height_vector=0, const unsigned int color_vector=0, const SizeType size_type=width, const unsigned int size=300, const double line_width=0.5, const double azimut_angle=60, const double turn_angle=30, const double z_scaling=1.0, const bool draw_mesh=true, const bool draw_cells=true, const bool shade_cells=true, const ColorFunction color_function=&default_color_function)
unsigned int patch_index
static ::ExceptionBase & ExcNotEnoughSpaceDimensionLabels()
std::istream & operator>>(std::istream &in, Patch< dim, spacedim > &patch)
std::vector< std::string > space_dimension_labels
static RgbValues reverse_grey_scale_color_function(const double value, const double min_value, const double max_value)
void write_tecplot_binary(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const TecplotFlags &flags, std::ostream &out)
void write_point(const unsigned int index, const Point< dim > &p)
unsigned int n_cells() const
std::size_t memory_consumption() const
void serialize(Archive &ar, const unsigned int)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:346
TecplotFlags(const char *tecplot_binary_file_name=nullptr, const char *zone_name=nullptr, const double solution_time=-1.0)
std::vector< std::string > data_set_names
void add_attribute(const std::string &attr_name, const unsigned int dimension)
void write_tecplot(std::ostream &out) const
void write_gnuplot(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const GnuplotFlags &flags, std::ostream &out)
DXFlags(const bool write_neighbors=false, const bool int_binary=false, const bool coordinates_binary=false, const bool data_binary=false)
void parse_parameters(const ParameterHandler &prm)
void write_pvd_record(std::ostream &out, const std::vector< std::pair< double, std::string > > &times_and_names)
std::size_t memory_consumption() const
void write_cell(const unsigned int index, const unsigned int start, const unsigned int d1, const unsigned int d2, const unsigned int d3)
void write_ucd(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const UcdFlags &flags, std::ostream &out)
DataOutBase::Deal_II_IntermediateFlags deal_II_intermediate_flags
void read(std::istream &in)
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:335
OutputFormat parse_output_format(const std::string &format_name)
void write_xdmf_file(const std::vector< XDMFEntry > &entries, const std::string &filename, MPI_Comm comm) const
ColorFunction color_function
static RgbValues grey_scale_color_function(const double value, const double min_value, const double max_value)
DataOutFilterFlags(const bool filter_duplicate_vertices=false, const bool xdmf_hdf5_output=false)
void write_svg(std::ostream &out) const
unsigned int n_subdivisions
std::vector< std::tuple< unsigned int, unsigned int, std::string > > vector_data_ranges
DataOutBase::TecplotFlags tecplot_flags
void parse_parameters(const ParameterHandler &prm)
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string > > get_vector_data_ranges() const
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string > > get_vector_data_ranges() const
Scale to given width.
std::ostream & operator<<(std::ostream &out, const Patch< dim, spacedim > &patch)
DataOutBase::SvgFlags svg_flags
unsigned int dimension
std::string h5_sol_filename
static ::ExceptionBase & ExcIncompatiblePatchLists()
void parse_parameters(const ParameterHandler &prm)
std::string h5_mesh_filename
void fill_node_data(std::vector< double > &node_data) const
void write_gmv(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const GmvFlags &flags, std::ostream &out)
static ::ExceptionBase & ExcInvalidDatasetSize(int arg1, int arg2)
static void declare_parameters(ParameterHandler &prm)
static void declare_parameters(ParameterHandler &prm)
bool operator==(const Patch &patch) const
void write_eps(std::ostream &out) const
void write_deal_II_intermediate(std::ostream &out) const
static void declare_parameters(ParameterHandler &prm)
void write_povray(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const PovrayFlags &flags, std::ostream &out)
static const unsigned int no_neighbor
DataOutBase::GmvFlags gmv_flags
DataOutBase::VtkFlags vtk_flags
std::size_t memory_consumption() const
void write_filtered_data(DataOutBase::DataOutFilter &filtered_data) const
static const unsigned int format_version
const double * get_data_set(const unsigned int set_num) const
std::vector<::DataOutBase::Patch< dim, spacedim > > patches
void write_povray(std::ostream &out) const
static const unsigned int space_dim
DataOutBase::GnuplotFlags gnuplot_flags
void set_default_format(const DataOutBase::OutputFormat default_format)
void write_gmv(std::ostream &out) const
unsigned int num_nodes
PovrayFlags(const bool smooth=false, const bool bicubic_patch=false, const bool external_data=false)
void internal_add_cell(const unsigned int cell_index, const unsigned int pt_index)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
Definition: exceptions.h:382
unsigned int color_vector
static ::ExceptionBase & ExcInvalidCombinationOfDimensions(int arg1, int arg2)
DataOutBase::OutputFormat default_fmt
void write_pvtu_record(std::ostream &out, const std::vector< std::string > &piece_names, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges)
std::size_t memory_consumption() const
RgbValues(* ColorFunction)(const double value, const double min_value, const double max_value)
void validate_dataset_names() const
void write_hdf5_parallel(const std::vector< Patch< dim, spacedim > > &patches, const DataOutFilter &data_filter, const std::string &filename, MPI_Comm comm)
static void declare_parameters(ParameterHandler &prm)
void write_vtu_in_parallel(const char *filename, MPI_Comm comm) const
DataOutBase::EpsFlags eps_flags
void write_dx(std::ostream &out) const
void write_eps(const std::vector< Patch< 2, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const EpsFlags &flags, std::ostream &out)
std::string get_data_set_name(const unsigned int set_num) const
static ::ExceptionBase & ExcIncompatibleDimensions(int arg1, int arg2, int arg3, int arg4)
void write_vtu(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const VtkFlags &flags, std::ostream &out)
virtual std::vector< std::string > get_dataset_names() const
std::size_t memory_consumption() const
void write_filtered_data(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, DataOutFilter &filtered_data)
std::map< unsigned int, unsigned int > filtered_points
void write_gnuplot(std::ostream &out) const
static unsigned int n_subdivisions
void write_vtu(std::ostream &out) const
UcdFlags(const bool write_preamble=false)
void parse_parameters(const ParameterHandler &prm)
std::string get_output_format_names()
DataOutBase::UcdFlags ucd_flags
virtual ~DataOutInterface()=default
Table< 2, float > data
unsigned int height_vector
void write_vtu_main(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string > > &vector_data_ranges, const VtkFlags &flags, std::ostream &out)
static ::ExceptionBase & ExcErrorOpeningTecplotFile(char *arg1)
DataOutBase::DXFlags dx_flags
static ::ExceptionBase & ExcTecplotAPIError()
XDMFEntry create_xdmf_entry(const DataOutBase::DataOutFilter &data_filter, const std::string &h5_filename, const double cur_time, MPI_Comm comm) const