#include <deal.II/base/point.h>
#include <deal.II/base/table.h>
+#include <deal.II/numerics/data_component_interpretation.h>
+
#include <limits>
#include <string>
#include <tuple>
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const DXFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const EpsFlags &flags,
std::ostream & out);
write_eps(
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const EpsFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const GmvFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const GnuplotFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const PovrayFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const TecplotFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const TecplotFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const UcdFlags &flags,
std::ostream & out);
* data is written in the traditional VTK format as opposed to the XML-based
* format that write_vtu() produces.
*
- * The vector_data_ranges argument denotes ranges of components in the
+ * The nonscalar_data_ranges argument denotes ranges of components in the
* output that are considered a vector, rather than simply a collection of
* scalar fields. The VTK output format has special provisions that allow
* these components to be output by a single name rather than having to
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out);
* data is written in the XML-based VTK format as opposed to the traditional
* format that write_vtk() produces.
*
- * The vector_data_ranges argument denotes ranges of components in the
+ * The nonscalar_data_ranges argument denotes ranges of components in the
* output that are considered a vector, rather than simply a collection of
* scalar fields. The VTK output format has special provisions that allow
* these components to be output by a single name rather than having to
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out);
* is most easily called by calling DataOutInterfaces::write_pvtu_record(),
* which determines the last two arguments by calling
* DataOutInterface::get_dataset_names() and
- * DataOutInterface::get_vector_data_ranges() functions. The second argument
- * to this function specifies the names of the files that form the parallel
- * set.
+ * DataOutInterface::get_nonscalar_data_ranges() functions. The second
+ * argument to this function specifies the names of the files that form the
+ * parallel set.
*
* @note Use DataOutBase::write_vtu() and DataOutInterface::write_vtu()
* for writing each piece. Also note that
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);
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ &nonscalar_data_ranges);
/**
* In ParaView it is possible to visualize time-dependent data tagged with
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const SvgFlags &flags,
std::ostream & out);
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const Deal_II_IntermediateFlags &flags,
std::ostream & out);
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,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
DataOutFilter &filtered_data);
/**
* name can be obtained by <tt>default_suffix</tt> without arguments.
*
* @ingroup output
- * @author Wolfgang Bangerth, 1999
+ * @author Wolfgang Bangerth, 1999, Denis Davydov, 2018
*/
template <int dim, int spacedim = dim>
class DataOutInterface
* fields can actually be found in the individual files that comprise the set
* of parallel VTU files along with the names of these files. This function
* gets the names and types of fields through the get_dataset_names() and
- * get_vector_data_ranges() functions of this class. The second argument
+ * get_nonscalar_data_ranges() functions of this class. The second argument
* to this function specifies the names of the files that form the parallel
* set.
*
* output files that consist of more than one data set are to be
* interpreted.
*
- * It returns a list of index pairs and corresponding name indicating which
- * components of the output are to be considered vector-valued rather than
- * just a collection of scalar data. The index pairs are inclusive; for
- * example, if we have a Stokes problem in 2d with components (u,v,p), then
- * the corresponding vector data range should be (0,1), and the returned
- * list would consist of only a single element with a tuple such as
- * (0,1,"velocity").
+ * It returns a list of index pairs and corresponding name and type indicating
+ * which components of the output are to be considered non vector- or
+ * tensor-valued rather than just a collection of scalar data. The index pairs
+ * are inclusive; for example, if we have a Stokes problem in 2d with
+ * components (u,v,p), then the corresponding vector data range should be
+ * (0,1), and the returned list would consist of only a single element with a
+ * tuple such as (0,1,"velocity").
*
* Since some of the derived classes do not know about vector data, this
* function has a default implementation that simply returns an empty
* string, meaning that all data is to be considered a collection of scalar
* fields.
*/
- 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,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ get_nonscalar_data_ranges() const;
/**
* Validate that the names of the datasets returned by get_dataset_names() and
- * get_vector_data_ranges() are valid. This currently consists of checking
+ * get_nonscalar_data_ranges() are valid. This currently consists of checking
* that names are not used more than once. If an invalid state is encountered,
* an Assert() will be triggered in debug mode.
*/
* string, meaning that all data is to be considered a collection of scalar
* fields.
*/
- virtual std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- get_vector_data_ranges() const override;
+ virtual std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ get_nonscalar_data_ranges() const override;
private:
/**
* Information about whether certain components of the output field are to
* be considered vectors.
*/
- std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- vector_data_ranges;
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ nonscalar_data_ranges;
};
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const UcdFlags &flags,
std::ostream & out)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const DXFlags &flags,
std::ostream & out)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const GnuplotFlags &flags,
std::ostream & out)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const PovrayFlags &flags,
std::ostream & out)
{
write_eps(
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const EpsFlags & /*flags*/,
std::ostream & /*out*/)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const EpsFlags &flags,
std::ostream & out)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const GmvFlags &flags,
std::ostream & out)
{
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>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const TecplotFlags &flags,
std::ostream & out)
{
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const TecplotFlags &flags,
std::ostream & out)
{
#ifndef DEAL_II_HAVE_TECPLOT
// simply call the ASCII output function if the Tecplot API isn't present
- write_tecplot(patches, data_names, vector_data_ranges, flags, out);
+ write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
return;
#else
// Tecplot binary output only good for 2D & 3D
if (dim == 1)
{
- write_tecplot(patches, data_names, vector_data_ranges, flags, out);
+ write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
return;
}
Assert(false,
ExcMessage("Specify the name of the tecplot_binary"
" file through the TecplotFlags interface."));
- write_tecplot(patches, data_names, vector_data_ranges, flags, out);
+ write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
return;
}
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out)
{
// when writing, first write out all vector data, then handle the scalar
// data sets that have been left over
std::vector<bool> data_set_written(n_data_sets, false);
- for (unsigned int n_th_vector = 0; n_th_vector < vector_data_ranges.size();
+ for (unsigned int n_th_vector = 0;
+ n_th_vector < nonscalar_data_ranges.size();
++n_th_vector)
{
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) >=
- std::get<0>(vector_data_ranges[n_th_vector]),
- ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]),
- std::get<0>(
- vector_data_ranges[n_th_vector])));
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets,
- ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]),
- 0,
- n_data_sets));
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) + 1 -
- std::get<0>(vector_data_ranges[n_th_vector]) <=
+ AssertThrow(
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) >=
+ std::get<0>(nonscalar_data_ranges[n_th_vector]),
+ ExcLowerRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
+ std::get<0>(nonscalar_data_ranges[n_th_vector])));
+ AssertThrow(
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) < n_data_sets,
+ ExcIndexRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
+ 0,
+ n_data_sets));
+ AssertThrow(std::get<1>(nonscalar_data_ranges[n_th_vector]) + 1 -
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) <=
3,
ExcMessage(
"Can't declare a vector with more than 3 components "
"in VTK"));
// mark these components as already written:
- for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]);
- i <= std::get<1>(vector_data_ranges[n_th_vector]);
+ for (unsigned int i = std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i <= std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
data_set_written[i] = true;
// underscores unless a vector name has been specified
out << "VECTORS ";
- if (std::get<2>(vector_data_ranges[n_th_vector]) != "")
- out << std::get<2>(vector_data_ranges[n_th_vector]);
+ if (std::get<2>(nonscalar_data_ranges[n_th_vector]) != "")
+ out << std::get<2>(nonscalar_data_ranges[n_th_vector]);
else
{
- for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]);
- i < std::get<1>(vector_data_ranges[n_th_vector]);
+ for (unsigned int i =
+ std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i < std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
out << data_names[i] << "__";
- out << data_names[std::get<1>(vector_data_ranges[n_th_vector])];
+ out << data_names[std::get<1>(nonscalar_data_ranges[n_th_vector])];
}
out << " double" << '\n';
// now write data. pad all vectors to have three components
for (unsigned int n = 0; n < n_nodes; ++n)
{
- switch (std::get<1>(vector_data_ranges[n_th_vector]) -
- std::get<0>(vector_data_ranges[n_th_vector]))
+ switch (std::get<1>(nonscalar_data_ranges[n_th_vector]) -
+ std::get<0>(nonscalar_data_ranges[n_th_vector]))
{
case 0:
out << data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]), n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]), n)
<< " 0 0" << '\n';
break;
case 1:
out << data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]), n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]), n)
<< ' '
<< data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]) + 1, n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) + 1,
+ n)
<< " 0" << '\n';
break;
case 2:
out << data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]), n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]), n)
<< ' '
<< data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]) + 1, n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) + 1,
+ n)
<< ' '
<< data_vectors(
- std::get<0>(vector_data_ranges[n_th_vector]) + 2, n)
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) + 2,
+ n)
<< '\n';
break;
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out)
{
write_vtu_header(out, flags);
- write_vtu_main(patches, data_names, vector_data_ranges, flags, out);
+ write_vtu_main(patches, data_names, nonscalar_data_ranges, flags, out);
write_vtu_footer(out);
out << std::flush;
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out)
{
<< " <PointData Scalars=\"scalars\">\n";
std::vector<bool> data_set_written(data_names.size(), false);
for (unsigned int n_th_vector = 0;
- n_th_vector < vector_data_ranges.size();
+ n_th_vector < nonscalar_data_ranges.size();
++n_th_vector)
{
// mark these components as already written:
- for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]);
- i <= std::get<1>(vector_data_ranges[n_th_vector]);
+ for (unsigned int i =
+ std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i <= std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
data_set_written[i] = true;
// underscores unless a vector name has been specified
out << " <DataArray type=\"Float32\" Name=\"";
- if (std::get<2>(vector_data_ranges[n_th_vector]) != "")
- out << std::get<2>(vector_data_ranges[n_th_vector]);
+ if (std::get<2>(nonscalar_data_ranges[n_th_vector]) != "")
+ out << std::get<2>(nonscalar_data_ranges[n_th_vector]);
else
{
for (unsigned int i =
- std::get<0>(vector_data_ranges[n_th_vector]);
- i < std::get<1>(vector_data_ranges[n_th_vector]);
+ std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i < std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
out << data_names[i] << "__";
- out << data_names[std::get<1>(vector_data_ranges[n_th_vector])];
+ out << data_names[std::get<1>(
+ nonscalar_data_ranges[n_th_vector])];
}
out << "\" NumberOfComponents=\"3\"></DataArray>\n";
// when writing, first write out all vector data, then handle the scalar
// data sets that have been left over
std::vector<bool> data_set_written(n_data_sets, false);
- for (auto range : vector_data_ranges)
+ for (auto range : nonscalar_data_ranges)
{
const auto first_component = std::get<0>(range);
const auto last_component = std::get<1>(range);
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)
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ &nonscalar_data_ranges)
{
AssertThrow(out, ExcIO());
// We need to output in the same order as the write_vtu function does:
std::vector<bool> data_set_written(n_data_sets, false);
- for (unsigned int n_th_vector = 0; n_th_vector < vector_data_ranges.size();
+ for (unsigned int n_th_vector = 0;
+ n_th_vector < nonscalar_data_ranges.size();
++n_th_vector)
{
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) >=
- std::get<0>(vector_data_ranges[n_th_vector]),
- ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]),
- std::get<0>(
- vector_data_ranges[n_th_vector])));
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets,
- ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]),
- 0,
- n_data_sets));
- AssertThrow(std::get<1>(vector_data_ranges[n_th_vector]) + 1 -
- std::get<0>(vector_data_ranges[n_th_vector]) <=
+ AssertThrow(
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) >=
+ std::get<0>(nonscalar_data_ranges[n_th_vector]),
+ ExcLowerRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
+ std::get<0>(nonscalar_data_ranges[n_th_vector])));
+ AssertThrow(
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) < n_data_sets,
+ ExcIndexRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
+ 0,
+ n_data_sets));
+ AssertThrow(std::get<1>(nonscalar_data_ranges[n_th_vector]) + 1 -
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) <=
3,
ExcMessage(
"Can't declare a vector with more than 3 components "
"in VTK"));
// mark these components as already written:
- for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]);
- i <= std::get<1>(vector_data_ranges[n_th_vector]);
+ for (unsigned int i = std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i <= std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
data_set_written[i] = true;
// underscores unless a vector name has been specified
out << " <PDataArray type=\"Float32\" Name=\"";
- if (std::get<2>(vector_data_ranges[n_th_vector]) != "")
- out << std::get<2>(vector_data_ranges[n_th_vector]);
+ if (std::get<2>(nonscalar_data_ranges[n_th_vector]) != "")
+ out << std::get<2>(nonscalar_data_ranges[n_th_vector]);
else
{
- for (unsigned int i = std::get<0>(vector_data_ranges[n_th_vector]);
- i < std::get<1>(vector_data_ranges[n_th_vector]);
+ for (unsigned int i =
+ std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i < std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
out << data_names[i] << "__";
- out << data_names[std::get<1>(vector_data_ranges[n_th_vector])];
+ out << data_names[std::get<1>(nonscalar_data_ranges[n_th_vector])];
}
out << "\" NumberOfComponents=\"3\" format=\"ascii\"/>\n";
write_svg(
const std::vector<Patch<dim, spacedim>> &,
const std::vector<std::string> &,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>> &,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>> &,
const SvgFlags &,
std::ostream &)
{
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & /*nonscalar_data_ranges*/,
const SvgFlags &flags,
std::ostream & out)
{
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 std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ &nonscalar_data_ranges,
const Deal_II_IntermediateFlags & /*flags*/,
std::ostream &out)
{
for (unsigned int i = 0; i < patches.size(); ++i)
out << patches[i] << '\n';
- out << vector_data_ranges.size() << '\n';
- for (unsigned int i = 0; i < vector_data_ranges.size(); ++i)
- out << std::get<0>(vector_data_ranges[i]) << ' '
- << std::get<1>(vector_data_ranges[i]) << '\n'
- << std::get<2>(vector_data_ranges[i]) << '\n';
+ out << nonscalar_data_ranges.size() << '\n';
+ for (unsigned int i = 0; i < nonscalar_data_ranges.size(); ++i)
+ out << std::get<0>(nonscalar_data_ranges[i]) << ' '
+ << std::get<1>(nonscalar_data_ranges[i]) << '\n'
+ << std::get<2>(nonscalar_data_ranges[i]) << '\n';
out << '\n';
// make sure everything now gets to disk
{
DataOutBase::write_dx(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
dx_flags,
out);
}
{
DataOutBase::write_ucd(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
ucd_flags,
out);
}
{
DataOutBase::write_gnuplot(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
gnuplot_flags,
out);
}
{
DataOutBase::write_povray(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
povray_flags,
out);
}
{
DataOutBase::write_eps(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
eps_flags,
out);
}
{
DataOutBase::write_gmv(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
gmv_flags,
out);
}
{
DataOutBase::write_tecplot(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
tecplot_flags,
out);
}
{
DataOutBase::write_tecplot_binary(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
tecplot_flags,
out);
}
{
DataOutBase::write_vtk(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
vtk_flags,
out);
}
{
DataOutBase::write_vtu(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
vtk_flags,
out);
}
{
DataOutBase::write_svg(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
svg_flags,
out);
}
std::stringstream ss;
DataOutBase::write_vtu_main(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
vtk_flags,
ss);
ierr = MPI_File_write_ordered(fh,
DataOutBase::write_pvtu_record(out,
piece_names,
get_dataset_names(),
- get_vector_data_ranges());
+ get_nonscalar_data_ranges());
}
{
DataOutBase::write_deal_II_intermediate(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
deal_II_intermediate_flags,
out);
}
{
DataOutBase::write_filtered_data(get_patches(),
get_dataset_names(),
- get_vector_data_ranges(),
+ get_nonscalar_data_ranges(),
filtered_data);
}
DataOutBase::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,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
DataOutBase::DataOutFilter &filtered_data)
{
const unsigned int n_data_sets = data_names.size();
for (n_th_vector = 0, data_set = 0; data_set < n_data_sets;)
{
// Advance n_th_vector to at least the current data set we are on
- while (n_th_vector < vector_data_ranges.size() &&
- std::get<0>(vector_data_ranges[n_th_vector]) < data_set)
+ while (n_th_vector < nonscalar_data_ranges.size() &&
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) < data_set)
n_th_vector++;
// Determine the dimension of this data
- if (n_th_vector < vector_data_ranges.size() &&
- std::get<0>(vector_data_ranges[n_th_vector]) == data_set)
+ if (n_th_vector < nonscalar_data_ranges.size() &&
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) == data_set)
{
// Multiple dimensions
- pt_data_vector_dim = std::get<1>(vector_data_ranges[n_th_vector]) -
- std::get<0>(vector_data_ranges[n_th_vector]) + 1;
+ pt_data_vector_dim = std::get<1>(nonscalar_data_ranges[n_th_vector]) -
+ std::get<0>(nonscalar_data_ranges[n_th_vector]) +
+ 1;
// Ensure the dimensionality of the data is correct
AssertThrow(
- std::get<1>(vector_data_ranges[n_th_vector]) >=
- std::get<0>(vector_data_ranges[n_th_vector]),
- ExcLowerRange(std::get<1>(vector_data_ranges[n_th_vector]),
- std::get<0>(vector_data_ranges[n_th_vector])));
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) >=
+ std::get<0>(nonscalar_data_ranges[n_th_vector]),
+ ExcLowerRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
+ std::get<0>(nonscalar_data_ranges[n_th_vector])));
AssertThrow(
- std::get<1>(vector_data_ranges[n_th_vector]) < n_data_sets,
- ExcIndexRange(std::get<1>(vector_data_ranges[n_th_vector]),
+ std::get<1>(nonscalar_data_ranges[n_th_vector]) < n_data_sets,
+ ExcIndexRange(std::get<1>(nonscalar_data_ranges[n_th_vector]),
0,
n_data_sets));
// Determine the vector name. Concatenate all the component names with
// double underscores unless a vector name has been specified
- if (std::get<2>(vector_data_ranges[n_th_vector]) != "")
+ if (std::get<2>(nonscalar_data_ranges[n_th_vector]) != "")
{
- vector_name = std::get<2>(vector_data_ranges[n_th_vector]);
+ vector_name = std::get<2>(nonscalar_data_ranges[n_th_vector]);
}
else
{
vector_name = "";
- for (i = std::get<0>(vector_data_ranges[n_th_vector]);
- i < std::get<1>(vector_data_ranges[n_th_vector]);
+ for (i = std::get<0>(nonscalar_data_ranges[n_th_vector]);
+ i < std::get<1>(nonscalar_data_ranges[n_th_vector]);
++i)
vector_name += data_names[i] + "__";
vector_name +=
- data_names[std::get<1>(vector_data_ranges[n_th_vector])];
+ data_names[std::get<1>(nonscalar_data_ranges[n_th_vector])];
}
}
else
template <int dim, int spacedim>
-std::vector<std::tuple<unsigned int, unsigned int, std::string>>
-DataOutInterface<dim, spacedim>::get_vector_data_ranges() const
+std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+DataOutInterface<dim, spacedim>::get_nonscalar_data_ranges() const
{
- return std::vector<std::tuple<unsigned int, unsigned int, std::string>>();
+ return std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>();
}
// complicated, because vector ranges might have a name or not.
std::set<std::string> all_names;
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- ranges = this->get_vector_data_ranges();
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ ranges = this->get_nonscalar_data_ranges();
const std::vector<std::string> data_names = this->get_dataset_names();
const unsigned int n_data_sets = data_names.size();
std::vector<bool> data_set_written(n_data_sets, false);
tmp.swap(dataset_names);
}
{
- std::vector<std::tuple<unsigned int, unsigned int, std::string>> tmp;
- tmp.swap(vector_data_ranges);
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ tmp;
+ tmp.swap(nonscalar_data_ranges);
}
// then check that we have the correct header of this file. both the first and
for (unsigned int i = 0; i < n_patches; ++i)
in >> patches[i];
- unsigned int n_vector_data_ranges;
- in >> n_vector_data_ranges;
- vector_data_ranges.resize(n_vector_data_ranges);
- for (unsigned int i = 0; i < n_vector_data_ranges; ++i)
+ unsigned int n_nonscalar_data_ranges;
+ in >> n_nonscalar_data_ranges;
+ nonscalar_data_ranges.resize(n_nonscalar_data_ranges);
+ for (unsigned int i = 0; i < n_nonscalar_data_ranges; ++i)
{
- in >> std::get<0>(vector_data_ranges[i]) >>
- std::get<1>(vector_data_ranges[i]);
+ in >> std::get<0>(nonscalar_data_ranges[i]) >>
+ std::get<1>(nonscalar_data_ranges[i]);
// read in the name of that vector range. because it is on a separate
// line, we first need to read to the end of the previous line (nothing
std::string name;
getline(in, name);
getline(in, name);
- std::get<2>(vector_data_ranges[i]) = name;
+ std::get<2>(nonscalar_data_ranges[i]) = name;
}
AssertThrow(in, ExcIO());
ExcIncompatibleDatasetNames());
// check equality of the vector data specifications
- Assert(get_vector_data_ranges().size() ==
- source.get_vector_data_ranges().size(),
+ Assert(get_nonscalar_data_ranges().size() ==
+ source.get_nonscalar_data_ranges().size(),
ExcMessage("Both sources need to declare the same components "
"as vectors."));
- for (unsigned int i = 0; i < get_vector_data_ranges().size(); ++i)
+ for (unsigned int i = 0; i < get_nonscalar_data_ranges().size(); ++i)
{
- Assert(std::get<0>(get_vector_data_ranges()[i]) ==
- std::get<0>(source.get_vector_data_ranges()[i]),
+ Assert(std::get<0>(get_nonscalar_data_ranges()[i]) ==
+ std::get<0>(source.get_nonscalar_data_ranges()[i]),
ExcMessage("Both sources need to declare the same components "
"as vectors."));
- Assert(std::get<1>(get_vector_data_ranges()[i]) ==
- std::get<1>(source.get_vector_data_ranges()[i]),
+ Assert(std::get<1>(get_nonscalar_data_ranges()[i]) ==
+ std::get<1>(source.get_nonscalar_data_ranges()[i]),
ExcMessage("Both sources need to declare the same components "
"as vectors."));
- Assert(std::get<2>(get_vector_data_ranges()[i]) ==
- std::get<2>(source.get_vector_data_ranges()[i]),
+ Assert(std::get<2>(get_nonscalar_data_ranges()[i]) ==
+ std::get<2>(source.get_nonscalar_data_ranges()[i]),
ExcMessage("Both sources need to declare the same components "
"as vectors."));
}
template <int dim, int spacedim>
-std::vector<std::tuple<unsigned int, unsigned int, std::string>>
-DataOutReader<dim, spacedim>::get_vector_data_ranges() const
+std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+DataOutReader<dim, spacedim>::get_nonscalar_data_ranges() const
{
- return vector_data_ranges;
+ return nonscalar_data_ranges;
}
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const VtkFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const UcdFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const DXFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const GnuplotFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const PovrayFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const EpsFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const GmvFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const TecplotFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const TecplotFlags &flags,
std::ostream & out);
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const SvgFlags &flags,
std::ostream & out);
# endif
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>>
& patches,
const std::vector<std::string> &data_names,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
- & vector_data_ranges,
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ & nonscalar_data_ranges,
const Deal_II_IntermediateFlags &flags,
std::ostream & out);
write_filtered_data(
const std::vector<Patch<deal_II_dimension, deal_II_space_dimension>> &,
const std::vector<std::string> &,
- const std::vector<std::tuple<unsigned int, unsigned int, std::string>>
+ const std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
&,
DataOutBase::DataOutFilter &);