16 #ifndef dealii_data_out_base_h 17 #define dealii_data_out_base_h 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> 31 #include <deal.II/base/mpi.h> 35 #ifdef DEAL_II_HAVE_TECPLOT 42 DEAL_II_NAMESPACE_OPEN
237 template <
int dim,
int spacedim=dim>
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);
386 template <
int spacedim>
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);
521 template <
typename FlagsType>
552 template <
typename FlagsType>
557 template <
typename FlagsType>
562 template <
typename FlagsType>
565 return sizeof(FlagsType);
709 "There should be at least one space dimension per spatial " 710 "dimension (extras are ignored).");
924 const double min_value,
925 const double max_value);
945 const double min_value,
946 const double max_value);
955 const double min_value,
956 const double max_value);
966 const double min_value,
967 const double max_value);
975 const unsigned int size = 300,
1127 VtkFlags (
const double time = std::numeric_limits<double>::min(),
1128 const unsigned int cycle = std::numeric_limits<unsigned int>::min(),
1165 unsigned int line_thickness;
1182 const int polar_angle = 45,
1183 const unsigned int line_thickness = 1,
1184 const bool margin =
true,
1305 const unsigned int start,
1306 const unsigned int d1,
1307 const unsigned int d2,
1308 const unsigned int d3);
1317 const unsigned int dimension,
1318 const unsigned int set_num,
1332 std::vector<unsigned int> &cell_data)
const;
1348 const double *
get_data_set(
const unsigned int set_num)
const;
1385 bool operator() (
const Point<3> &one,
1401 return (one(0) < two(0) || (!(two(0) < one(0)) && (one(1) < two(1) || (!(two(1) < one(1)) && one(2) < two(2)))));
1405 typedef std::multimap<Point<3>,
unsigned int,
Point3Comp> Map3DPoint;
1462 const unsigned int pt_index);
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,
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,
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,
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,
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,
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,
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,
1778 template <
int dim,
int spacedim>
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,
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,
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,
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,
1870 const VtkFlags &flags);
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,
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);
1989 const std::vector<std::pair<double,std::string> > ×_and_names);
2003 const std::vector<std::string> &piece_names);
2033 const std::vector<std::vector<std::string> > &piece_names);
2067 const std::vector<std::pair<
double,std::vector<std::string> > > ×_and_piece_names);
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,
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,
2145 template <
int dim,
int spacedim>
2147 const DataOutFilter &data_filter,
2148 const std::string &filename,
2158 template <
int dim,
int spacedim>
2160 const DataOutFilter &data_filter,
2161 const bool write_mesh_file,
2162 const std::string &mesh_filename,
2163 const std::string &solution_filename,
2172 template <
int dim,
int spacedim>
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);
2189 std::pair<unsigned int, unsigned 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.");
2263 <<
"There was an error opening Tecplot file " << arg1
2383 template <
int dim,
int spacedim=dim>
2402 void write_dx (std::ostream &out)
const;
2408 void write_eps (std::ostream &out)
const;
2414 void write_gmv (std::ostream &out)
const;
2445 void write_ucd (std::ostream &out)
const;
2458 void write_vtk (std::ostream &out)
const;
2474 void write_vtu (std::ostream &out)
const;
2485 MPI_Comm comm)
const;
2521 const std::vector<std::string> &piece_names)
const;
2527 void write_svg(std::ostream &out)
const;
2547 const std::string &h5_filename,
2548 const double cur_time,
2549 MPI_Comm comm)
const;
2557 const std::string &h5_mesh_filename,
2558 const std::string &h5_solution_filename,
2559 const double cur_time,
2560 MPI_Comm comm)
const;
2583 const std::string &filename,
2584 MPI_Comm comm)
const;
2600 const std::string &filename,
2601 MPI_Comm comm)
const;
2611 const bool write_mesh_file,
2612 const std::string &mesh_filename,
2613 const std::string &solution_filename,
2614 MPI_Comm comm)
const;
2633 void write (std::ostream &out,
2647 template <
typename FlagType>
2702 const std::vector<DataOutBase::Patch<dim,spacedim> > &
2710 std::vector<std::string>
2732 std::vector<std::tuple<unsigned int, unsigned int, std::string> >
2870 template <
int dim,
int spacedim=dim>
2879 void read (std::istream &in);
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 " 2924 <<
"Either the dimensions <" << arg1 <<
"> and <" 2925 << arg2 <<
"> or the space dimensions <" 2926 << arg3 <<
"> and <" << arg4
2927 <<
"> do not match!");
2938 virtual const std::vector<::DataOutBase::Patch<dim,spacedim> > &
2968 std::vector<std::tuple<unsigned int, unsigned int, std::string> >
2976 std::vector<::DataOutBase::Patch<dim,spacedim> >
patches;
2977 std::vector<std::string> dataset_names;
2983 std::vector<std::tuple<unsigned int, unsigned int, std::string> >
3012 const unsigned int nodes,
3013 const unsigned int cells,
3014 const unsigned int dim);
3020 XDMFEntry(
const std::string &mesh_filename,
3021 const std::string &solution_filename,
3023 const unsigned int nodes,
3024 const unsigned int cells,
3025 const unsigned int dim);
3030 XDMFEntry(
const std::string &mesh_filename,
3031 const std::string &solution_filename,
3033 const unsigned int nodes,
3034 const unsigned int cells,
3035 const unsigned int dim,
3036 const unsigned int spacedim);
3046 template <
class Archive>
3123 return (red == green) && (red == blue);
3137 template <
int dim,
int spacedim>
3152 template <
int dim,
int spacedim>
3159 DEAL_II_NAMESPACE_CLOSE
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
unsigned int space_dimension
Map3DPoint existing_points
unsigned int height_vector
void write_vtu_footer(std::ostream &out)
static void declare_parameters(ParameterHandler &prm)
#define DeclException2(Exception2, type1, type2, outsequence)
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)
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)
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
bool filter_duplicate_vertices
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
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)
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)
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 > > ×_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)
bool points_are_available
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
std::ostream & operator<<(std::ostream &out, const Patch< dim, spacedim > &patch)
DataOutBase::SvgFlags svg_flags
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
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
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)
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
bool points_are_available
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
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)
unsigned int vertices_per_cell
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