16 #ifndef dealii_data_out_base_h 17 #define dealii_data_out_base_h 30 #include <boost/serialization/map.hpp> 40 #ifdef DEAL_II_HAVE_TECPLOT 247 template <
int dim,
int spacedim = dim>
274 std::array<unsigned int, GeometryInfo<dim>::faces_per_cell>
neighbors;
371 <<
"It is not possible to have a structural dimension of " << arg1
372 <<
" to be larger than the space dimension of the surrounding" 373 <<
" space " << arg2);
396 template <
int spacedim>
517 <<
"It is not possible to have a structural dimension of " << arg1
518 <<
" to be larger than the space dimension of the surrounding" 519 <<
" space " << arg2);
535 template <
typename FlagsType>
569 template <
typename FlagsType>
575 template <
typename FlagsType>
581 template <
typename FlagsType>
585 return sizeof(FlagsType);
625 DXFlags(
const bool write_neighbors =
false,
626 const bool int_binary =
false,
627 const bool coordinates_binary =
false,
628 const bool data_binary =
false);
668 UcdFlags(
const bool write_preamble =
false);
703 GnuplotFlags(
const std::vector<std::string> &space_dimension_labels);
734 "There should be at least one space dimension per spatial " 735 "dimension (extras are ignored).");
772 const bool bicubic_patch =
false,
773 const bool external_data =
false);
952 const double min_value,
953 const double max_value);
972 default_color_function(
const double value,
973 const double min_value,
974 const double max_value);
982 grey_scale_color_function(
const double value,
983 const double min_value,
984 const double max_value);
993 reverse_grey_scale_color_function(
const double value,
994 const double min_value,
995 const double max_value);
1000 EpsFlags(
const unsigned int height_vector = 0,
1001 const unsigned int color_vector = 0,
1003 const unsigned int size = 300,
1004 const double line_width = 0.5,
1005 const double azimut_angle = 60,
1006 const double turn_angle = 30,
1007 const double z_scaling = 1.0,
1008 const bool draw_mesh =
true,
1009 const bool draw_cells =
true,
1010 const bool shade_cells =
true,
1011 const ColorFunction color_function = &default_color_function);
1078 TecplotFlags(
const char * tecplot_binary_file_name =
nullptr,
1079 const char * zone_name =
nullptr,
1080 const double solution_time = -1.0);
1186 const bool print_date_and_time =
true,
1188 const bool write_higher_order_cells =
false);
1238 SvgFlags(
const unsigned int height_vector = 0,
1239 const int azimuth_angle = 37,
1240 const int polar_angle = 45,
1241 const unsigned int line_thickness = 1,
1242 const bool margin =
true,
1243 const bool draw_colorbar =
true);
1292 const bool xdmf_hdf5_output =
false);
1360 write_point(
const unsigned int index,
const Point<dim> &p);
1367 write_cell(
const unsigned int index,
1368 const unsigned int start,
1369 const unsigned int d1,
1370 const unsigned int d2,
1371 const unsigned int d3);
1380 write_data_set(
const std::string & name,
1381 const unsigned int dimension,
1382 const unsigned int set_num,
1390 fill_node_data(std::vector<double> &node_data)
const;
1397 fill_cell_data(
const unsigned int local_node_offset,
1398 std::vector<unsigned int> &cell_data)
const;
1404 get_data_set_name(
const unsigned int set_num)
const;
1410 get_data_set_dim(
const unsigned int set_num)
const;
1417 get_data_set(
const unsigned int set_num)
const;
1438 n_data_sets()
const;
1476 return (
one(0) < two(0) ||
1477 (!(two(0) <
one(0)) &&
1478 (
one(1) < two(1) || (!(two(1) <
one(1)) &&
one(2) < two(2)))));
1539 internal_add_cell(
const unsigned int cell_index,
1540 const unsigned int pt_index);
1632 template <
int dim,
int spacedim>
1636 const std::vector<std::string> & data_names,
1638 std::tuple<
unsigned int,
1642 & nonscalar_data_ranges,
1644 std::ostream & out);
1690 template <
int spacedim>
1694 const std::vector<std::string> & data_names,
1696 std::tuple<
unsigned int,
1700 & nonscalar_data_ranges,
1702 std::ostream & out);
1709 template <
int dim,
int spacedim>
1713 const std::vector<std::string> & data_names,
1715 std::tuple<
unsigned int,
1719 & nonscalar_data_ranges,
1721 std::ostream & out);
1733 template <
int dim,
int spacedim>
1737 const std::vector<std::string> & data_names,
1739 std::tuple<
unsigned int,
1743 & nonscalar_data_ranges,
1745 std::ostream & out);
1803 template <
int dim,
int spacedim>
1807 const std::vector<std::string> & data_names,
1809 std::tuple<
unsigned int,
1813 & nonscalar_data_ranges,
1815 std::ostream & out);
1862 template <
int dim,
int spacedim>
1866 const std::vector<std::string> & data_names,
1868 std::tuple<
unsigned int,
1872 & nonscalar_data_ranges,
1874 std::ostream & out);
1882 template <
int dim,
int spacedim>
1886 const std::vector<std::string> & data_names,
1888 std::tuple<
unsigned int,
1892 & nonscalar_data_ranges,
1894 std::ostream & out);
1917 template <
int dim,
int spacedim>
1921 const std::vector<std::string> & data_names,
1923 std::tuple<
unsigned int,
1927 & nonscalar_data_ranges,
1929 std::ostream & out);
1945 template <
int dim,
int spacedim>
1949 const std::vector<std::string> & data_names,
1951 std::tuple<
unsigned int,
1955 & nonscalar_data_ranges,
1957 std::ostream & out);
1978 template <
int dim,
int spacedim>
1982 const std::vector<std::string> & data_names,
1984 std::tuple<
unsigned int,
1988 & nonscalar_data_ranges,
1990 std::ostream & out);
2016 template <
int dim,
int spacedim>
2020 const std::vector<std::string> & data_names,
2022 std::tuple<
unsigned int,
2026 & nonscalar_data_ranges,
2028 std::ostream & out);
2053 template <
int dim,
int spacedim>
2057 const std::vector<std::string> & data_names,
2059 std::tuple<
unsigned int,
2063 & nonscalar_data_ranges,
2065 std::ostream & out);
2111 const std::vector<std::string> &piece_names,
2112 const std::vector<std::string> &data_names,
2114 std::tuple<
unsigned int,
2118 &nonscalar_data_ranges);
2173 const std::vector<std::pair<double, std::string>> ×_and_names);
2188 const std::vector<std::string> &piece_names);
2219 const std::vector<std::vector<std::string>> &piece_names);
2256 const std::vector<std::pair<
double, std::vector<std::string>>>
2257 ×_and_piece_names);
2279 template <
int spacedim>
2283 const std::vector<std::string> & data_names,
2285 std::tuple<
unsigned int,
2289 & nonscalar_data_ranges,
2291 std::ostream & out);
2330 template <
int dim,
int spacedim>
2334 const std::vector<std::string> & data_names,
2336 std::tuple<
unsigned int,
2340 & nonscalar_data_ranges,
2342 std::ostream & out);
2348 template <
int dim,
int spacedim>
2352 const std::string & filename,
2362 template <
int dim,
int spacedim>
2366 const bool write_mesh_file,
2367 const std::string & mesh_filename,
2368 const std::string &solution_filename,
2377 template <
int dim,
int spacedim>
2381 const std::vector<std::string> & data_names,
2383 std::tuple<
unsigned int,
2387 & nonscalar_data_ranges,
2401 std::pair<unsigned int, unsigned int>
2460 <<
"The number of points in this data set is " << arg1
2461 <<
", but we expected " << arg2
2462 <<
" in each space direction.");
2467 "You are trying to write graphical data into a file, but " 2468 "no data is available in the intermediate format that " 2469 "the DataOutBase functions require. Did you forget to " 2470 "call a function such as DataOut::build_patches()?");
2475 "The error code of one of the Tecplot functions was " 2476 "not zero as expected.");
2482 <<
"There was an error opening Tecplot file " << arg1
2597 template <
int dim,
int spacedim = dim>
2712 write_vtu_in_parallel(
const std::string &filename, MPI_Comm comm)
const;
2749 const std::vector<std::string> &piece_names)
const;
2811 write_vtu_with_pvtu_record(
2812 const std::string &directory,
2813 const std::string &filename_without_extension,
2814 const unsigned int counter,
2815 const MPI_Comm & mpi_communicator,
2817 const unsigned int n_groups = 0)
const;
2846 const std::string & h5_filename,
2847 const double cur_time,
2848 MPI_Comm comm)
const;
2857 const std::string & h5_mesh_filename,
2858 const std::string & h5_solution_filename,
2859 const double cur_time,
2860 MPI_Comm comm)
const;
2887 write_xdmf_file(
const std::vector<XDMFEntry> &entries,
2888 const std::string & filename,
2889 MPI_Comm comm)
const;
2907 const std::string & filename,
2908 MPI_Comm comm)
const;
2919 const bool write_mesh_file,
2920 const std::string & mesh_filename,
2921 const std::string & solution_filename,
2922 MPI_Comm comm)
const;
2943 write(std::ostream & out,
2959 template <
typename FlagType>
2961 set_flags(
const FlagType &flags);
3018 virtual const std::vector<DataOutBase::Patch<dim, spacedim>> &
3019 get_patches()
const = 0;
3025 virtual std::vector<std::string>
3026 get_dataset_names()
const = 0;
3046 virtual std::vector<
3047 std::tuple<
unsigned int,
3051 get_nonscalar_data_ranges()
const;
3060 validate_dataset_names()
const;
3187 template <
int dim,
int spacedim = dim>
3197 read(std::istream &in);
3227 "You are trying to merge two sets of patches for which the " 3228 "declared names of the variables do not match.");
3233 "You are trying to merge two sets of patches for which the " 3234 "number of subdivisions or the number of vector components " 3244 <<
"Either the dimensions <" << arg1 <<
"> and <" << arg2
3245 <<
"> or the space dimensions <" << arg3 <<
"> and <" << arg4
3246 <<
"> do not match!");
3257 virtual const std::vector<::DataOutBase::Patch<dim, spacedim>> &
3258 get_patches()
const override;
3266 virtual std::vector<std::string>
3267 get_dataset_names()
const override;
3287 virtual std::vector<
3288 std::tuple<
unsigned int,
3292 get_nonscalar_data_ranges()
const override;
3299 std::vector<::DataOutBase::Patch<dim, spacedim>>
patches;
3307 std::tuple<
unsigned int,
3338 const unsigned int nodes,
3339 const unsigned int cells,
3340 const unsigned int dim);
3346 XDMFEntry(
const std::string &mesh_filename,
3347 const std::string &solution_filename,
3349 const unsigned int nodes,
3350 const unsigned int cells,
3351 const unsigned int dim);
3356 XDMFEntry(
const std::string &mesh_filename,
3357 const std::string &solution_filename,
3359 const unsigned int nodes,
3360 const unsigned int cells,
3361 const unsigned int dim,
3362 const unsigned int spacedim);
3368 add_attribute(
const std::string &attr_name,
const unsigned int dimension);
3373 template <
class Archive>
3377 ar &
valid &h5_sol_filename &h5_mesh_filename &entry_time &num_nodes
3378 &num_cells &dimension &space_dimension &attribute_dims;
3386 get_xdmf_content(
const unsigned int indent_level)
const;
3445 return (red == green) && (red == blue);
3459 template <
int dim,
int spacedim>
3461 operator<<(std::ostream &out, const Patch<dim, spacedim> &patch);
3473 template <
int dim,
int spacedim>
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const Deal_II_IntermediateFlags &flags, std::ostream &out)
RgbValues(*)(const double value, const double min_value, const double max_value) ColorFunction
static const unsigned int invalid_unsigned_int
unsigned int space_dimension
Map3DPoint existing_points
static ::ExceptionBase & ExcIncompatiblePatchLists()
unsigned int height_vector
void write_vtu_footer(std::ostream &out)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const UcdFlags &flags, std::ostream &out)
static void declare_parameters(ParameterHandler &prm)
#define DeclException2(Exception2, type1, type2, outsequence)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const TecplotFlags &flags, std::ostream &out)
std::size_t memory_consumption() const
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges)
std::map< unsigned int, unsigned int > filtered_cells
void write_visit_record(std::ostream &out, const std::vector< std::string > &piece_names)
std::pair< unsigned int, unsigned int > determine_intermediate_format_dimensions(std::istream &input)
bool operator()(const Point< 3 > &one, const Point< 3 > &two) const
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, DataOutFilter &filtered_data)
void swap(Patch< dim, spacedim > &other_patch)
void write_vtu_header(std::ostream &out, const VtkFlags &flags)
std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > nonscalar_data_ranges
void write_pvd_record(std::ostream &out, const std::vector< std::pair< double, std::string >> ×_and_names)
ZlibCompressionLevel compression_level
static const types::blas_int one
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const GmvFlags &flags, std::ostream &out)
unsigned int default_subdivisions
std::vector< unsigned int > data_set_dims
Point< spacedim > vertices[GeometryInfo< dim >::vertices_per_cell]
bool filter_duplicate_vertices
std::vector< std::vector< double > > data_sets
std::map< std::string, unsigned int > attribute_dims
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const EpsFlags &flags, std::ostream &out)
std::multimap< Point< 3 >, unsigned int, Point3Comp > Map3DPoint
void write_hdf5_parallel(const std::vector< Patch< dim, spacedim >> &patches, const DataOutFilter &data_filter, const std::string &filename, MPI_Comm comm)
const char * tecplot_binary_file_name
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const GnuplotFlags &flags, std::ostream &out)
static ::ExceptionBase & ExcNoPatches()
DataOutBase::PovrayFlags povray_flags
static ::ExceptionBase & ExcIncompatibleDatasetNames()
DataOutBase::DataOutFilterFlags flags
std::string default_suffix(const OutputFormat output_format)
std::istream & operator>>(std::istream &in, Patch< dim, spacedim > &patch)
std::vector< std::string > space_dimension_labels
void serialize(Archive &ar, const unsigned int)
#define DeclException1(Exception1, type1, outsequence)
std::vector< std::string > data_set_names
void parse_parameters(const ParameterHandler &prm)
DataOutBase::Deal_II_IntermediateFlags deal_II_intermediate_flags
#define DeclExceptionMsg(Exception, defaulttext)
bool points_are_available
#define DEAL_II_NAMESPACE_CLOSE
std::vector<::DataOutBase::Patch< dim, spacedim > > patches
OutputFormat parse_output_format(const std::string &format_name)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const PovrayFlags &flags, std::ostream &out)
ColorFunction color_function
constexpr TableIndices< 2 > merge(const TableIndices< 2 > &previous_indices, const unsigned int new_index, const unsigned int position)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const DXFlags &flags, std::ostream &out)
unsigned int n_subdivisions
DataOutBase::TecplotFlags tecplot_flags
DataOutBase::SvgFlags svg_flags
std::string h5_sol_filename
std::string h5_mesh_filename
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
static ::ExceptionBase & ExcInvalidDatasetSize(int arg1, int arg2)
bool operator==(const Patch &patch) const
DataComponentInterpretation
static const unsigned int no_neighbor
DataOutBase::GmvFlags gmv_flags
DataOutBase::VtkFlags vtk_flags
static const unsigned int space_dim
DataOutBase::GnuplotFlags gnuplot_flags
#define DEAL_II_NAMESPACE_OPEN
T min(const T &t, const MPI_Comm &mpi_communicator)
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const TecplotFlags &flags, std::ostream &out)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
unsigned int color_vector
static ::ExceptionBase & ExcInvalidCombinationOfDimensions(int arg1, int arg2)
DataOutBase::OutputFormat default_fmt
std::array< unsigned int, GeometryInfo< dim >::faces_per_cell > neighbors
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
Iterator points to a valid object.
DataOutBase::EpsFlags eps_flags
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, DataComponentInterpretation::DataComponentInterpretation >> &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
std::size_t memory_consumption() const
std::map< unsigned int, unsigned int > filtered_points
bool points_are_available
bool write_higher_order_cells
static unsigned int n_subdivisions
unsigned int line_thickness
std::string get_output_format_names()
#define DEAL_II_DEPRECATED
std::vector< std::string > dataset_names
DataOutBase::UcdFlags ucd_flags
unsigned int height_vector
unsigned int vertices_per_cell
static ::ExceptionBase & ExcErrorOpeningTecplotFile(char *arg1)
DataOutBase::DXFlags dx_flags
static ::ExceptionBase & ExcTecplotAPIError()