16#ifndef dealii_bounding_box_data_out_h
17#define dealii_bounding_box_data_out_h
31#include <boost/geometry/index/rtree.hpp>
32#include <boost/geometry/strategies/strategies.hpp>
63 template <
class ConvertibleToBoundingBoxIterator>
66 const ConvertibleToBoundingBoxIterator &end);
76 template <
class Container>
96 virtual const std::vector<::DataOutBase::Patch<dim, dim>> &
100 virtual std::vector<std::string>
107 std::vector<DataOutBase::Patch<dim, dim>>
patches;
119template <
class ConvertibleToBoundingBoxIterator>
122 const ConvertibleToBoundingBoxIterator &begin,
123 const ConvertibleToBoundingBoxIterator &end)
126 typename ConvertibleToBoundingBoxIterator::value_type>;
128 constexpr unsigned int boxdim =
129 boost::geometry::dimension<typename Getter::result_type>::value;
130 const unsigned int N = std::distance(begin, end);
131 static_assert(boxdim == dim,
"Bounding boxes are of the wrong dimension!");
133 dataset_names.clear();
137 for (
const auto &value :
141 boost::geometry::convert(getter(*value), box);
142 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
144 patches[i].vertices[v] = box.
vertex(v);
145 patches[i].patch_index = i;
146 patches[i].n_subdivisions = 1;
147 patches[i].reference_cell = ReferenceCells::get_hypercube<dim>();
148 patches[i].points_are_available =
false;
157template <
class Container>
161 build_patches(boxes.begin(), boxes.end());
169 const std::vector<std::vector<double>> &datasets,
170 const std::vector<std::string> & names)
173 dataset_names = names;
174 for (
unsigned int i = 0; i < datasets.size(); ++i)
177 patches[i].data.reinit(names.size(),
179 for (
unsigned int j = 0; j < names.size(); ++j)
180 for (
unsigned int k = 0; k < GeometryInfo<dim>::vertices_per_cell; ++k)
181 patches[i].data(j, k) = datasets[i][j];
188const std::vector<DataOutBase::Patch<dim, dim>> &
197std::vector<std::string>
200 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_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
#define AssertDimension(dim1, dim2)