/* ---------------------------------------------------------------------
* $Id$
*
- * Copyright (C) 2001 - 2013 by the deal.II authors
+ * Copyright (C) 2001 - 2014 by the deal.II authors
*
* This file is part of the deal.II library.
*
// program we shall generate output (from this we will then also generate
// the suffix of the filename to which we write).
//
- // Regarding the output format, the <code>DataOutInterface</code> class
- // (which is a base class of <code>DataOut</code> through which we will
- // access its fields) provides an enumeration field
- // <code>OutputFormat</code>, which lists names for all supported output
+ // Regarding the output format, the DataOutBase namespace
+ // provides an enumeration field
+ // DataOutBase::OutputFormat which lists names for all supported output
// formats. At the time of writing of this program, the supported graphics
// formats are represented by the enum values <code>ucd</code>,
// <code>gnuplot</code>, <code>povray</code>, <code>eps</code>,
// <code>gmv</code>, <code>tecplot</code>, <code>tecplot_binary</code>,
- // <code>dx</code>, and <code>vtk</code>, but this list will certainly
+ // <code>dx</code>, <code>vtk</code>, etc, but this list will certainly
// grow over time. Now, within various functions of that base class, you
// can use values of this type to get information about these graphics
// formats (for example the default suffix used for files of each format),
class SolutionOutput : public EvaluationBase<dim>
{
public:
- SolutionOutput (const std::string &output_name_base,
- const typename DataOut<dim>::OutputFormat output_format);
+ SolutionOutput (const std::string &output_name_base,
+ const DataOutBase::OutputFormat output_format);
virtual void operator () (const DoFHandler<dim> &dof_handler,
const Vector<double> &solution) const;
private:
- const std::string output_name_base;
- const typename DataOut<dim>::OutputFormat output_format;
+ const std::string output_name_base;
+ const DataOutBase::OutputFormat output_format;
};
template <int dim>
SolutionOutput<dim>::
- SolutionOutput (const std::string &output_name_base,
- const typename DataOut<dim>::OutputFormat output_format)
+ SolutionOutput (const std::string &output_name_base,
+ const DataOutBase::OutputFormat output_format)
:
output_name_base (output_name_base),
output_format (output_format)
// After the description above, the function generating the actual output
// is now relatively straightforward. The only particularly interesting
// feature over previous example programs is the use of the
- // <code>DataOut::default_suffix</code> function, returning the usual
+ // DataOutBase::default_suffix function, returning the usual
// suffix for files of a given format (e.g. ".eps" for encapsulated
// postscript files, ".gnuplot" for Gnuplot files), and of the generic
// <code>DataOut::write</code> function with a second argument, which
// Also generate an evaluator which writes out the solution:
Evaluation::SolutionOutput<dim>
postprocessor2 (std::string("solution-")+solver_name,
- DataOut<dim>::gnuplot);
+ DataOutBase::gnuplot);
// Take these two evaluation objects and put them in a list...
std::list<Evaluation::EvaluationBase<dim> *> postprocessor_list;
/* ---------------------------------------------------------------------
* $Id$
*
- * Copyright (C) 2002 - 2013 by the deal.II authors
+ * Copyright (C) 2002 - 2014 by the deal.II authors
*
* This file is part of the deal.II library.
*
<< std::ends;
std::ofstream out (filename.str().c_str());
- data_out.write (out, DataOut<dim>::gnuplot);
+ data_out.write (out, DataOutBase::gnuplot);
}
<< std::ends;
std::ofstream out (filename.str().c_str());
- data_out.write (out, DataOut<dim>::gnuplot);
+ data_out.write (out, DataOutBase::gnuplot);
}
* to either reset the stream to its previous position, or close and
* reopen it.
*/
- static
std::pair<unsigned int, unsigned int>
determine_intermediate_format_dimensions (std::istream &input);
/* -------------------- inline functions ------------------- */
-inline
-bool
-DataOutBase::EpsFlags::RgbValues::is_grey () const
+namespace DataOutBase
{
- return (red == green) && (red == blue);
-}
+ inline
+ bool
+ EpsFlags::RgbValues::is_grey () const
+ {
+ return (red == green) && (red == blue);
+ }
-/* -------------------- template functions ------------------- */
-
-/**
- * Output operator for an object of type
- * <tt>DataOutBase::Patch</tt>. This operator dumps the intermediate
- * graphics format represented by the patch data structure. It may
- * later be converted into regular formats for a number of graphics
- * programs.
- *
- * @author Wolfgang Bangerth, 2005
- */
-template <int dim, int spacedim>
-std::ostream &
-operator << (std::ostream &out,
- const DataOutBase::Patch<dim,spacedim> &patch);
+ /* -------------------- template functions ------------------- */
+ /**
+ * Output operator for an object of type
+ * <tt>DataOutBase::Patch</tt>. This operator dumps the intermediate
+ * graphics format represented by the patch data structure. It may
+ * later be converted into regular formats for a number of graphics
+ * programs.
+ *
+ * @author Wolfgang Bangerth, 2005
+ */
+ template <int dim, int spacedim>
+ std::ostream &
+ operator << (std::ostream &out,
+ const Patch<dim,spacedim> &patch);
-/**
- * Input operator for an object of type
- * <tt>DataOutBase::Patch</tt>. This operator reads the intermediate
- * graphics format represented by the patch data structure, using the
- * format in which it was written using the operator<<.
- *
- * @author Wolfgang Bangerth, 2005
- */
-template <int dim, int spacedim>
-std::istream &
-operator >> (std::istream &in,
- DataOutBase::Patch<dim,spacedim> &patch);
+ /**
+ * Input operator for an object of type
+ * <tt>DataOutBase::Patch</tt>. This operator reads the intermediate
+ * graphics format represented by the patch data structure, using the
+ * format in which it was written using the operator<<.
+ *
+ * @author Wolfgang Bangerth, 2005
+ */
+ template <int dim, int spacedim>
+ std::istream &
+ operator >> (std::istream &in,
+ Patch<dim,spacedim> &patch);
+}
DEAL_II_NAMESPACE_CLOSE
-
-template <int dim, int spacedim>
-std::ostream &
-operator << (std::ostream &out,
- const DataOutBase::Patch<dim,spacedim> &patch)
+namespace DataOutBase
{
- // write a header line
- out << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]"
- << '\n';
-
- // then write all the data that is
- // in this patch
- for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- out << patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]] << ' ';
- out << '\n';
-
- for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
- out << patch.neighbors[i] << ' ';
- out << '\n';
+ template <int dim, int spacedim>
+ std::ostream &
+ operator << (std::ostream &out,
+ const Patch<dim,spacedim> &patch)
+ {
+ // write a header line
+ out << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]"
+ << '\n';
- out << patch.patch_index << ' ' << patch.n_subdivisions
- << '\n';
+ // then write all the data that is
+ // in this patch
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ out << patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]] << ' ';
+ out << '\n';
- out << patch.points_are_available<<'\n';
+ for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
+ out << patch.neighbors[i] << ' ';
+ out << '\n';
- out << patch.data.n_rows() << ' ' << patch.data.n_cols() << '\n';
- for (unsigned int i=0; i<patch.data.n_rows(); ++i)
- for (unsigned int j=0; j<patch.data.n_cols(); ++j)
- out << patch.data[i][j] << ' ';
- out << '\n';
- out << '\n';
+ out << patch.patch_index << ' ' << patch.n_subdivisions
+ << '\n';
- return out;
-}
+ out << patch.points_are_available<<'\n';
+ out << patch.data.n_rows() << ' ' << patch.data.n_cols() << '\n';
+ for (unsigned int i=0; i<patch.data.n_rows(); ++i)
+ for (unsigned int j=0; j<patch.data.n_cols(); ++j)
+ out << patch.data[i][j] << ' ';
+ out << '\n';
+ out << '\n';
+ return out;
+ }
-template <int dim, int spacedim>
-std::istream &
-operator >> (std::istream &in,
- DataOutBase::Patch<dim,spacedim> &patch)
-{
- Assert (in, ExcIO());
- // read a header line and compare
- // it to what we usually
- // write. skip all lines that
- // contain only blanks at the start
+ template <int dim, int spacedim>
+ std::istream &
+ operator >> (std::istream &in,
+ Patch<dim,spacedim> &patch)
{
- std::string header;
- do
- {
- getline (in, header);
- while ((header.size() != 0) &&
- (header[header.size()-1] == ' '))
- header.erase(header.size()-1);
- }
- while ((header == "") && in);
+ Assert (in, ExcIO());
- std::ostringstream s;
- s << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]";
+ // read a header line and compare
+ // it to what we usually
+ // write. skip all lines that
+ // contain only blanks at the start
+ {
+ std::string header;
+ do
+ {
+ getline (in, header);
+ while ((header.size() != 0) &&
+ (header[header.size()-1] == ' '))
+ header.erase(header.size()-1);
+ }
+ while ((header == "") && in);
- Assert (header == s.str(), ExcUnexpectedInput(s.str(),header));
- }
+ std::ostringstream s;
+ s << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]";
+ Assert (header == s.str(), ExcUnexpectedInput(s.str(),header));
+ }
- // then read all the data that is
- // in this patch
- for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- in >> patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]];
- for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
- in >> patch.neighbors[i];
+ // then read all the data that is
+ // in this patch
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ in >> patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]];
- in >> patch.patch_index >> patch.n_subdivisions;
+ for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
+ in >> patch.neighbors[i];
- in >> patch.points_are_available;
+ in >> patch.patch_index >> patch.n_subdivisions;
- unsigned int n_rows, n_cols;
- in >> n_rows >> n_cols;
- patch.data.reinit (n_rows, n_cols);
- for (unsigned int i=0; i<patch.data.n_rows(); ++i)
- for (unsigned int j=0; j<patch.data.n_cols(); ++j)
- in >> patch.data[i][j];
+ in >> patch.points_are_available;
- Assert (in, ExcIO());
+ unsigned int n_rows, n_cols;
+ in >> n_rows >> n_cols;
+ patch.data.reinit (n_rows, n_cols);
+ for (unsigned int i=0; i<patch.data.n_rows(); ++i)
+ for (unsigned int j=0; j<patch.data.n_cols(); ++j)
+ in >> patch.data[i][j];
- return in;
-}
+ Assert (in, ExcIO());
+ return in;
+ }
+}
#if deal_II_dimension <= deal_II_space_dimension
template class DataOutInterface<deal_II_dimension, deal_II_space_dimension>;
template class DataOutReader<deal_II_dimension, deal_II_space_dimension>;
- template struct DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension>;
+
+ namespace DataOutBase
+ \{
+ template struct Patch<deal_II_dimension, deal_II_space_dimension>;
template
std::ostream &
operator << (std::ostream &out,
- const DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension> &patch);
+ const Patch<deal_II_dimension, deal_II_space_dimension> &patch);
template
std::istream &
operator >> (std::istream &in,
- DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension> &patch);
+ Patch<deal_II_dimension, deal_II_space_dimension> &patch);
template
void
- DataOutBase::write_vtk (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_vtk (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const VtkFlags &flags,
template
void
- DataOutBase::write_vtu (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_vtu (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const VtkFlags &flags,
template
void
- DataOutBase::write_ucd (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_ucd (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const UcdFlags &flags,
template
void
- DataOutBase::write_dx (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_dx (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const DXFlags &flags,
template
void
- DataOutBase::write_gnuplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_gnuplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const GnuplotFlags &flags,
template
void
- DataOutBase::write_povray (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_povray (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const PovrayFlags &flags,
template
void
- DataOutBase::write_eps (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_eps (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const EpsFlags &flags,
template
void
- DataOutBase::write_gmv (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_gmv (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const GmvFlags &flags,
template
void
- DataOutBase::write_tecplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_tecplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const TecplotFlags &flags,
template
void
- DataOutBase::write_tecplot_binary (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_tecplot_binary (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const TecplotFlags &flags,
#if deal_II_space_dimension >1
template
void
- DataOutBase::write_svg (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_svg (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const SvgFlags &flags,
#endif
template
void
- DataOutBase::write_deal_II_intermediate (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ write_deal_II_intermediate (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
const std::vector<std::string> &data_names,
const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
const Deal_II_IntermediateFlags &flags,
std::ostream &out);
+ \}
#endif
}