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>
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>
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);
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;
175 patches[i].data.reinit(names.size(),
177 for (
unsigned int j = 0;
j < names.
size(); ++
j)
186const std::vector<DataOutBase::Patch<dim, dim>> &
195std::vector<std::string>
198 return dataset_names;
value_type * data() const noexcept
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
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)