+/**
+ * A namespace that contains concrete implementations of data
+ * postprocessors, i.e., non-abstract classes based on DataPostprocessor
+ * or on the intermediate classes DataPostprocessorScalar,
+ * DataPostprocessorVector, or DataPostprocessorTensor.
+ */
+namespace DataPostprocessors
+{
+ /**
+ * A concrete data postprocessor class that can be used to output the
+ * boundary ids of all faces. This is often useful to identify bugs in
+ * the assignment of boundary indicators when reading meshes from input
+ * files. See the usage example in the
+ * @ref GlossBoundaryIndicator "glossary entry on boundary ids"
+ * to see how this class can be used.
+ *
+ * @note This class is intended for use with DataOutFaces, not DataOut.
+ * This is because it provides information about the *faces* of a
+ * triangulation, not about cell-based information.
+ */
+ template <int dim>
+ class BoundaryIds : public DataPostprocessorScalar<dim>
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ BoundaryIds();
+
+ /**
+ * The principal function of this class. It puts the boundary id
+ * of each face into the appropriate output fields.
+ */
+ virtual void
+ evaluate_scalar_field(
+ const DataPostprocessorInputs::Scalar<dim> &inputs,
+ std::vector<Vector<double>> &computed_quantities) const override;
+ };
+} // namespace DataPostprocessors
+
+
+
#ifndef DOXYGEN
// -------------------- template functions ----------------------
+namespace DataPostprocessors
+{
+ template <int dim>
+ BoundaryIds<dim>::BoundaryIds()
+ : DataPostprocessorScalar<dim>("boundary_id", update_quadrature_points)
+ {}
+
+
+ template <int dim>
+ void
+ BoundaryIds<dim>::evaluate_scalar_field(
+ const DataPostprocessorInputs::Scalar<dim> &inputs,
+ std::vector<Vector<double>> & computed_quantities) const
+ {
+ AssertDimension(computed_quantities.size(), inputs.solution_values.size());
+
+ const typename DoFHandler<dim>::active_cell_iterator cell =
+ inputs.template get_cell<dim>();
+ const unsigned int face = inputs.get_face_number();
+
+ for (auto &output : computed_quantities)
+ {
+ AssertDimension(output.size(), 1);
+ output(0) = cell->face(face)->boundary_id();
+ }
+ }
+} // namespace DataPostprocessors
+
+
+
// explicit instantiation
#include "data_postprocessor.inst"
template class DataPostprocessorScalar<deal_II_dimension>;
template class DataPostprocessorVector<deal_II_dimension>;
template class DataPostprocessorTensor<deal_II_dimension>;
+
+ namespace DataPostprocessors
+ \{
+ template class BoundaryIds<deal_II_dimension>;
+ \}
}