15#ifndef dealii_bounding_box_data_out_h
16#define dealii_bounding_box_data_out_h
29#include <boost/geometry/index/rtree.hpp>
30#include <boost/geometry/strategies/strategies.hpp>
60 template <
class ConvertibleToBoundingBoxIterator>
63 const ConvertibleToBoundingBoxIterator &end);
73 template <
class Container>
93 virtual const std::vector<::DataOutBase::Patch<dim, dim>> &
97 virtual std::vector<std::string>
104 std::vector<DataOutBase::Patch<dim, dim>>
patches;
116template <
class ConvertibleToBoundingBoxIterator>
119 const ConvertibleToBoundingBoxIterator &begin,
120 const ConvertibleToBoundingBoxIterator &end)
123 typename ConvertibleToBoundingBoxIterator::value_type>;
125 constexpr unsigned int boxdim =
126 boost::geometry::dimension<typename Getter::result_type>::value;
127 const unsigned int N = std::distance(begin, end);
128 static_assert(boxdim == dim,
"Bounding boxes are of the wrong dimension!");
130 dataset_names.clear();
134 for (
const auto &value :
138 boost::geometry::convert(getter(*value), box);
139 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
141 patches[i].vertices[v] = box.
vertex(v);
142 patches[i].patch_index = i;
143 patches[i].n_subdivisions = 1;
144 patches[i].reference_cell = ReferenceCells::get_hypercube<dim>();
145 patches[i].points_are_available =
false;
154template <
class Container>
158 build_patches(boxes.begin(), boxes.end());
166 const std::vector<std::vector<double>> &datasets,
167 const std::vector<std::string> &names)
170 dataset_names = names;
171 for (
unsigned int i = 0; i < datasets.size(); ++i)
174 patches[i].data.reinit(names.size(),
176 for (
unsigned int j = 0; j < names.size(); ++j)
177 for (
unsigned int k = 0; k < GeometryInfo<dim>::vertices_per_cell; ++k)
178 patches[i].
data(j, k) = datasets[i][j];
185const std::vector<DataOutBase::Patch<dim, dim>> &
194std::vector<std::string>
197 return dataset_names;
BoundingBoxDataOut()=default
void add_datasets(const std::vector< std::vector< double > > &datasets, const std::vector< std::string > &dataset_names)
void build_patches(const ConvertibleToBoundingBoxIterator &begin, const ConvertibleToBoundingBoxIterator &end)
virtual std::vector< std::string > get_dataset_names() const override
~BoundingBoxDataOut()=default
std::vector< std::string > dataset_names
std::vector< DataOutBase::Patch< dim, dim > > patches
void build_patches(const Container &boxes)
virtual const std::vector<::DataOutBase::Patch< dim, dim > > & get_patches() const override
Point< spacedim, Number > vertex(const unsigned int index) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
std::vector< index_type > data