16#ifndef dealii_bounding_box_data_out_h
17#define dealii_bounding_box_data_out_h
30#include <boost/geometry/index/rtree.hpp>
31#include <boost/geometry/strategies/strategies.hpp>
61 template <
class ConvertibleToBoundingBoxIterator>
64 const ConvertibleToBoundingBoxIterator &end);
74 template <
class Container>
94 virtual const std::vector<::DataOutBase::Patch<dim, dim>> &
98 virtual std::vector<std::string>
105 std::vector<DataOutBase::Patch<dim, dim>>
patches;
117template <
class ConvertibleToBoundingBoxIterator>
120 const ConvertibleToBoundingBoxIterator &begin,
121 const ConvertibleToBoundingBoxIterator &end)
124 typename ConvertibleToBoundingBoxIterator::value_type>;
126 constexpr unsigned int boxdim =
127 boost::geometry::dimension<typename Getter::result_type>::value;
128 const unsigned int N = std::distance(begin, end);
129 static_assert(boxdim == dim,
"Bounding boxes are of the wrong dimension!");
131 dataset_names.clear();
135 for (
const auto &value :
139 boost::geometry::convert(getter(*value), box);
140 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
142 patches[i].vertices[v] = box.
vertex(v);
143 patches[i].patch_index = i;
144 patches[i].n_subdivisions = 1;
145 patches[i].reference_cell = ReferenceCells::get_hypercube<dim>();
146 patches[i].points_are_available =
false;
155template <
class Container>
159 build_patches(boxes.begin(), boxes.end());
167 const std::vector<std::vector<double>> &datasets,
168 const std::vector<std::string> & names)
171 dataset_names = names;
172 for (
unsigned int i = 0; i < datasets.size(); ++i)
175 patches[i].data.reinit(names.size(),
177 for (
unsigned int j = 0; j < names.size(); ++j)
178 for (
unsigned int k = 0; k < GeometryInfo<dim>::vertices_per_cell; ++k)
179 patches[i].data(j, k) = datasets[i][j];
186const std::vector<DataOutBase::Patch<dim, dim>> &
195std::vector<std::string>
198 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)