4#include <boost/geometry.hpp>
25struct tag<Eigen::VectorXd> {
29struct coordinate_type<Eigen::VectorXd> {
33struct coordinate_system<Eigen::VectorXd> {
34 using type = cs::cartesian;
37struct dimension<Eigen::VectorXd> : boost::mpl::int_<3> {
40template <
size_t Dimension>
41struct access<Eigen::VectorXd, Dimension> {
42 static double get(Eigen::VectorXd
const &p)
44 if (Dimension >=
static_cast<size_t>(p.rows())) {
51 static void set(Eigen::VectorXd &p,
double const &value)
53 if (Dimension >=
static_cast<size_t>(p.rows())) {
54 Eigen::VectorXd tmp(Dimension);
64struct tag<
pm::Vertex::RawCoords> {
68struct coordinate_type<
pm::Vertex::RawCoords> {
72struct coordinate_system<
pm::Vertex::RawCoords> {
73 using type = cs::cartesian;
76struct dimension<
pm::Vertex::RawCoords> : boost::mpl::int_<3> {
79template <
size_t Dimension>
80struct access<
pm::Vertex::RawCoords, Dimension> {
99struct tag<
pm::Vertex> {
103struct coordinate_type<
pm::Vertex> {
107struct coordinate_system<
pm::Vertex> {
111struct dimension<
pm::Vertex> : boost::mpl::int_<3> {
114template <
size_t Dimension>
115struct access<
pm::Vertex, Dimension> {
135struct tag<
pm::Edge> {
139struct point_type<
pm::Edge> {
143template <
size_t Index,
size_t Dimension>
144struct indexed_access<
pm::Edge, Index, Dimension> {
145 static_assert((Index <= 1),
"Valid Indices are {0, 1}");
146 static_assert((Dimension <= 2),
"Valid Dimensions are {0, 1, 2}");
165struct tag<
pm::Triangle> {
169struct point_order<
pm::Triangle> {
170 static const order_selector
value = clockwise;
173struct closure<
pm::Triangle> {
174 static const closure_selector
value = open;
184using RTreeBox = boost::geometry::model::box<pm::Vertex::RawCoords>;
193 const auto size = v.size();
202 Eigen::VectorXd r(3);
217 for (
int i = 0; i < 4; ++i) {
255template <
typename Container>
257 using size_type =
typename Container::container::size_type;
258 using cref =
const typename Container::value_type &;
276template <
typename Container>
279 using cref =
const typename Container::value_type &;
296template <
typename Primitive>
301 typename boost::geometry::traits::tag<T>::type,
302 boost::geometry::point_tag>::value,
307 typename boost::geometry::traits::tag<T>::type,
308 boost::geometry::segment_tag>::value,
313 typename boost::geometry::traits::tag<T>::type,
314 boost::geometry::box_tag>::value,
318 template <
typename T>
325template <
class Primitive>
330template <
class Primitive>
343 boost::geometry::index::indexable<IndexType>>::type;
345 using RTree = boost::geometry::index::rtree<IndexType, RTreeParameters, IndexGetter>;
#define PRECICE_ASSERT(...)
#define PRECICE_UNREACHABLE(...)
An axis-aligned bounding box around a (partition of a) mesh.
Eigen::VectorXd maxCorner() const
the max corner of the bounding box
Eigen::VectorXd minCorner() const
the min corner of the bounding box
void expandBy(const BoundingBox &otherBB)
Expand bounding box using another bounding box.
Linear edge of a mesh, defined by two Vertex objects.
Vertex & vertex(int i)
Returns the edge's vertex with index 0 or 1.
std::deque< Triangle > TriangleContainer
std::deque< Tetrahedron > TetraContainer
std::deque< Edge > EdgeContainer
std::deque< Vertex > VertexContainer
Tetrahedron of a mesh, defined by 4 vertices.
Vertex & vertex(int i)
Returns tetrahedron vertex with index 0, 1, 2 or 3.
int getDimensions() const
Returns dimensionalty of space the Tetrahedron is embedded in.
Triangle of a mesh, defined by three vertices.
std::array< double, 3 > RawCoords
const RawCoords & rawCoords() const
Direct access to the coordinates.
static std::true_type test(void *)
static std::true_type test(int *)
static std::false_type test(...)
static std::true_type test(char *)
decltype(test< Primitive >(nullptr)) type
typename Container::container::size_type size_type
const typename Container::value_type & cref
PtrVectorIndexable(Container const &c)
Container const & container
result_type operator()(size_type i) const
Makes a std::vector indexable and thus be usable in boost::geometry::rtree.
VectorIndexable(Container const &c)
const typename Container::value_type & cref
result_type operator()(size_type i) const
typename Container::size_type size_type
Container const & container
BOOST_CONCEPT_ASSERT((bg::concepts::Point< pm::Vertex::RawCoords >))
provides Mesh, Data and primitives.
boost::geometry::index::rstar< 16 > RTreeParameters
The general rtree parameter type used in precice.
contains geometrical queries.
RTreeBox makeBox(const pm::Vertex::RawCoords &min, const pm::Vertex::RawCoords &max)
pm::Vertex::RawCoords eigenToRaw(const Eigen::VectorXd &v)
Eigen::VectorXd rawToEigen(const pm::Vertex::RawCoords &v)
boost::geometry::model::box< pm::Vertex::RawCoords > RTreeBox
The RTree box type.
static void set(Eigen::VectorXd &p, double const &value)
static double get(Eigen::VectorXd const &p)
static void set(pm::Vertex &p, double const &value)
static double get(pm::Vertex const &p)
static double get(pm::Vertex::RawCoords const &p)
static void set(pm::Vertex::RawCoords &p, double const &value)
static const closure_selector value
static double get(pm::Edge const &e)
static void set(pm::Edge &e, double const &value)
static const order_selector value
pm::Vertex::RawCoords type
mesh::Mesh::EdgeContainer MeshContainer
mesh::Mesh::TetraContainer MeshContainer
mesh::Mesh::TriangleContainer MeshContainer
mesh::Mesh::VertexContainer MeshContainer
Type trait to extract information based on the type of a Primitive.
The type traits of a rtree based on a Primitive.
typename PrimitiveTraits< Primitive >::MeshContainer MeshContainer
typename std::conditional< IsDirectIndexable< Primitive >::value, MeshContainerIndex, std::pair< RTreeBox, MeshContainerIndex > >::type IndexType
typename MeshContainer::size_type MeshContainerIndex
typename std::conditional< IsDirectIndexable< Primitive >::value, impl::VectorIndexable< MeshContainer >, boost::geometry::index::indexable< IndexType > >::type IndexGetter
boost::geometry::index::rtree< IndexType, RTreeParameters, IndexGetter > RTree
std::shared_ptr< RTree > Ptr