3#ifndef DUNE_GRID_MMESHPOINTFIELDVECTOR_HH
4#define DUNE_GRID_MMESHPOINTFIELDVECTOR_HH
7#include <dune/common/fvector.hh>
19template <
class Kernel>
21 const CGAL::Point_2<Kernel>& p) {
22 return FieldVector<typename Kernel::RT, 2>({p.x(), p.y()});
29template <
class Kernel>
31 const CGAL::Vector_2<Kernel>& p) {
32 return FieldVector<typename Kernel::RT, 2>({p.x(), p.y()});
39template <
class Kernel>
41 const CGAL::Point_3<Kernel>& p) {
42 return FieldVector<typename Kernel::RT, 3>({p.x(), p.y(), p.z()});
49template <
class Kernel>
51 const CGAL::Vector_3<Kernel>& p) {
52 return FieldVector<typename Kernel::RT, 3>({p.x(), p.y(), p.z()});
57typedef CGAL::Exact_predicates_inexact_constructions_kernel
PointKernel;
62template <
typename ctype>
63static inline auto makePoint(
const Dune::FieldVector<ctype, 2>& v) {
64 return CGAL::Point_2<PointKernel>(v[0], v[1]);
70template <
typename ctype>
71static inline auto makePoint(
const Dune::FieldVector<ctype, 3>& v) {
72 return CGAL::Point_3<PointKernel>(v[0], v[1], v[2]);
77template <
class Geometry>
79 static constexpr int mydim = Geometry::mydim;
81 if constexpr (mydim == 3) {
88 if constexpr (mydim == 2) {
95 if constexpr (mydim == 1)
return 0.5 * (geo.corner(0) + geo.corner(1));
97 if constexpr (mydim == 0)
return geo.corner(0);
static FieldVector< typename Kernel::RT, 2 > makeFieldVector(const CGAL::Point_2< Kernel > &p)
Helper function to create DUNE::FieldVector from CGAL::Point_2.
Definition: pointfieldvector.hh:20
static auto makePoint(const Dune::FieldVector< ctype, 2 > &v)
Convert FieldVector to CGAL Point 2.
Definition: pointfieldvector.hh:63
CGAL::Exact_predicates_inexact_constructions_kernel PointKernel
Convert FieldVector to CGAL Point.
Definition: pointfieldvector.hh:57
auto computeCircumcenter(const Geometry &geo)
Compute circumcenter.
Definition: pointfieldvector.hh:78