16#ifndef dealii_bounding_box_data_out_h
17#define dealii_bounding_box_data_out_h
31#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
32# define BOOST_ALLOW_DEPRECATED_HEADERS
34#include <boost/geometry/index/rtree.hpp>
35#include <boost/geometry/strategies/strategies.hpp>
36#ifdef DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS
37# undef BOOST_ALLOW_DEPRECATED_HEADERS
69 template <
class ConvertibleToBoundingBoxIterator>
72 const ConvertibleToBoundingBoxIterator &
end);
82 template <
class Container>
102 virtual const std::vector<::DataOutBase::Patch<dim, dim>> &
106 virtual std::vector<std::string>
113 std::vector<DataOutBase::Patch<dim, dim>>
patches;
125template <
class ConvertibleToBoundingBoxIterator>
128 const ConvertibleToBoundingBoxIterator &
begin,
129 const ConvertibleToBoundingBoxIterator &
end)
132 typename ConvertibleToBoundingBoxIterator::value_type>;
134 constexpr unsigned int boxdim =
135 boost::geometry::dimension<typename Getter::result_type>::value;
136 const unsigned int N = std::distance(
begin,
end);
137 static_assert(boxdim == dim,
"Bounding boxes are of the wrong dimension!");
139 dataset_names.clear();
143 for (
const auto &value :
147 boost::geometry::convert(getter(*value), box);
148 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
150 patches[i].vertices[v] = box.
vertex(v);
151 patches[i].patch_index = i;
152 patches[i].n_subdivisions = 1;
153 patches[i].points_are_available =
false;
162template <
class Container>
166 build_patches(boxes.begin(), boxes.end());
174 const std::vector<std::vector<double>> &datasets,
175 const std::vector<std::string> & names)
178 dataset_names = names;
179 for (
unsigned int i = 0; i < datasets.size(); ++i)
182 patches[i].data.reinit(names.size(),
184 for (
unsigned int j = 0; j < names.size(); ++j)
185 for (
unsigned int k = 0; k < GeometryInfo<dim>::vertices_per_cell; ++k)
186 patches[i].data(j, k) = datasets[i][j];
193const std::vector<DataOutBase::Patch<dim, dim>> &
202std::vector<std::string>
205 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)
VectorType::value_type * end(VectorType &V)
VectorType::value_type * begin(VectorType &V)