ViennaGrid - The Vienna Grid Library  2.1.0
Data Structures | Namespaces | Functions
viennagrid/algorithm/closest_points.hpp File Reference

Routines for computing the two points of two different objects being closest to each other. More...

#include <iostream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <limits>
#include <utility>
#include "viennagrid/forwards.hpp"
#include "viennagrid/topology/all.hpp"
#include "viennagrid/algorithm/norm.hpp"
#include "viennagrid/algorithm/inner_prod.hpp"
#include "viennagrid/algorithm/boundary.hpp"
#include "viennagrid/mesh/mesh.hpp"

Go to the source code of this file.

Data Structures

struct  ascending_topological_order< T, U, correct_order >
struct  ascending_topological_order< T, U, false >
struct  topological_id< T >
struct  topological_id< segment_handle< SegmentationT > >
struct  topological_id< spatial_point< CoordT, CoordinateSystemT > >
struct  topological_id< viennagrid::element< hypercube_tag< dim >, WrappedConfigT > >
struct  topological_id< viennagrid::element< simplex_tag< dim >, WrappedConfigT > >
struct  topological_id< viennagrid::mesh< WrappedConfigT > >
struct  topologically_sorted< T, U >

Namespaces

namespace  viennagrid
 

The main ViennaGrid namespace. Most user functionality resides directly in this namespace rather than in sub-namespaces.


namespace  viennagrid::detail
 

Namespace for implementation details. Not intended to be used directly by a library user.


Functions

template<typename PointAccessorT , typename SomethingT1 , typename SomethingT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points (PointAccessorT const accessor, SomethingT1 const &el1, SomethingT2 const &el2)
 Returns the distance between n-cells.
template<typename SomethingT1 , typename SomethingT2 >
std::pair< typename
viennagrid::result_of::point
< SomethingT1 >::type,
typename
viennagrid::result_of::point
< SomethingT1 >::type > 
closest_points (SomethingT1 const &el1, SomethingT2 const &el2)
 Returns the closest points between two elements/segments using the default accessor for geometric points on vertices.
template<typename PointT >
std::pair< PointT, PointT > closest_points_impl (PointT const &p1, PointT const &p2)
template<typename PointAccessorT , typename CoordT1 , typename CoordinateSystemT1 , typename CoordT2 , typename CoordinateSystemT2 >
std::pair< spatial_point
< CoordT1, CoordinateSystemT1 >
, spatial_point< CoordT2,
CoordinateSystemT2 > > 
closest_points_impl (PointAccessorT const, spatial_point< CoordT1, CoordinateSystemT1 > const &p1, spatial_point< CoordT2, CoordinateSystemT2 > const &p2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< PointT, typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type > 
closest_points_impl (PointAccessorT const accessor, PointT const &p1, viennagrid::element< vertex_tag, WrappedConfigT > const &v2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type, PointT > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT > const &v1, PointT const &p2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type, typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT > const &v1, viennagrid::element< vertex_tag, WrappedConfigT > const &v2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< PointT, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, PointT const &p, viennagrid::element< simplex_tag< 1 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< PointT, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, PointT const &p, viennagrid::element< hypercube_tag< 1 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< simplex_tag< 1 >, WrappedConfigT2 > const &el)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< simplex_tag< 1 >, WrappedConfigT2 > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< simplex_tag< 1 >, WrappedConfigT1 > const &line0, viennagrid::element< simplex_tag< 1 >, WrappedConfigT2 > const &line1)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< hypercube_tag< 1 >, WrappedConfigT1 > const &line0, viennagrid::element< simplex_tag< 1 >, WrappedConfigT2 > const &line1)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< simplex_tag< 1 >, WrappedConfigT1 > const &line0, viennagrid::element< hypercube_tag< 1 >, WrappedConfigT2 > const &line1)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< hypercube_tag< 1 >, WrappedConfigT1 > const &line0, viennagrid::element< hypercube_tag< 1 >, WrappedConfigT2 > const &line1)
template<typename PointAccessorT , typename CoordT , typename CoordinateSystemT , typename WrappedConfigT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, spatial_point< CoordT, CoordinateSystemT > const &p, viennagrid::element< simplex_tag< 2 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< simplex_tag< 2 >, WrappedConfigT2 > const &el)
template<typename PointAccessorT , typename CoordT , typename CoordinateSystemT , typename WrappedConfigT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, spatial_point< CoordT, CoordinateSystemT > const &p, viennagrid::element< hypercube_tag< 2 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< hypercube_tag< 2 >, WrappedConfigT2 > const &el)
template<typename PointAccessorT , typename CoordT , typename CoordinateSystemT , typename WrappedConfigT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, spatial_point< CoordT, CoordinateSystemT > const &p, viennagrid::element< simplex_tag< 3 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< simplex_tag< 3 >, WrappedConfigT2 > const &el)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< PointT, typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, PointT const &p, viennagrid::element< hypercube_tag< 3 >, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT1 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< hypercube_tag< 3 >, WrappedConfigT2 > const &el)
template<typename PointT >
std::pair< PointT, PointT > closest_points_line_line (PointT const &v0, PointT const &v1, PointT const &w0, PointT const &w1)
template<typename PointAccessorT , typename SomethingT1 , typename SomethingT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary (PointAccessorT const accessor, SomethingT1 const &el1, SomethingT2 const &el2)
 Returns the closest points between two elements/segments using the provided accessor for geometric points on vertices.
template<typename SomethingT1 , typename SomethingT2 >
std::pair< typename
viennagrid::result_of::point
< SomethingT1 >::type,
typename
viennagrid::result_of::point
< SomethingT1 >::type > 
closest_points_on_boundary (SomethingT1 const &el1, SomethingT2 const &el2)
 Returns the distance between n-cells.
template<typename PointAccessorT , typename SomethingT1 , typename SomethingT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_generic (PointAccessorT const accessor, SomethingT1 const &el1, SomethingT2 const &el2)
template<typename PointT >
std::pair< PointT, PointT > closest_points_on_boundary_impl (PointT const &p1, PointT const &p2)
template<typename PointAccessorT , typename CoordT1 , typename CoordinateSystemT1 , typename CoordT2 , typename CoordinateSystemT2 >
std::pair< spatial_point
< CoordT1, CoordinateSystemT1 >
, spatial_point< CoordT1,
CoordinateSystemT1 > > 
closest_points_on_boundary_impl (PointAccessorT const, spatial_point< CoordT1, CoordinateSystemT1 > const &p1, spatial_point< CoordT2, CoordinateSystemT2 > const &p2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< PointT, typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, PointT const &p1, viennagrid::element< vertex_tag, WrappedConfigT > const &v2)
template<typename PointAccessorT , typename PointT , typename WrappedConfigT >
std::pair< typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type, typename
viennagrid::result_of::point
< viennagrid::element
< vertex_tag, WrappedConfigT >
>::type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT > const &v1, viennagrid::element< vertex_tag, WrappedConfigT > const &v2)
template<typename PointAccessorT , typename PointT , typename ElementTag , typename WrappedConfigT >
std::pair< PointT, typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const &mesh_obj, PointT const &v, viennagrid::element< ElementTag, WrappedConfigT > const &el)
template<typename PointAccessorT , typename WrappedConfigT , typename PointT >
std::pair< PointT, typename
viennagrid::result_of::point
< viennagrid::mesh
< WrappedConfigT > >::type > 
closest_points_on_boundary_impl (PointAccessorT const point_accessor, PointT const &p, mesh< WrappedConfigT > const &mesh_obj)
template<typename PointAccessorT , typename SegmentationT , typename PointT >
std::pair< PointT, typename
viennagrid::result_of::point
< segment_handle
< SegmentationT > >::type > 
closest_points_on_boundary_impl (PointAccessorT const point_accessor, PointT const &p, segment_handle< SegmentationT > const &segment)
template<typename PointAccessorT , typename WrappedConfigT1 , typename EA2 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, viennagrid::element< vertex_tag, WrappedConfigT1 > const &v, viennagrid::element< EA2, WrappedConfigT2 > const &el)
template<typename WrappedMeshConfigType , typename WrappedConfigT >
std::pair< typename
viennagrid::result_of::point
< mesh< WrappedMeshConfigType >
>::type, typename
viennagrid::result_of::point
< mesh< WrappedMeshConfigType >
>::type > 
closest_points_on_boundary_impl (viennagrid::element< vertex_tag, WrappedConfigT > const &v, mesh< WrappedMeshConfigType > const &mesh_obj)
template<typename PointAccessorT , typename ElementTag1 , typename WrappedConfigT1 , typename ElementTag2 , typename WrappedConfigT2 >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, viennagrid::element< ElementTag1, WrappedConfigT1 > const &el1, viennagrid::element< ElementTag2, WrappedConfigT2 > const &el2)
template<typename PointAccessorT , typename WrappedMeshConfigType , typename ElementTag , typename WrappedConfigT >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, viennagrid::element< ElementTag, WrappedConfigT > const &el1, mesh< WrappedMeshConfigType > const &mesh_obj)
template<typename PointAccessorT , typename SegmentationT , typename ElementTag , typename WrappedConfigT >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, viennagrid::element< ElementTag, WrappedConfigT > const &el1, segment_handle< SegmentationT > const &segment)
template<typename PointAccessorT , typename Segmentation1T , typename Segmentation2T >
std::pair< typename
PointAccessorT::value_type,
typename
PointAccessorT::value_type > 
closest_points_on_boundary_impl (PointAccessorT const accessor, segment_handle< Segmentation1T > const &segment1, segment_handle< Segmentation2T > const &segment2)
template<typename FacetTypeOrTag , typename PointAccessorT , typename PointT , typename SomethingT >
std::pair< PointT, typename
PointAccessorT::value_type > 
closest_points_on_boundary_point_to_any (PointAccessorT const accessor, PointT const &p, SomethingT const &cont)
template<typename PointT , typename LinePointT >
std::pair< PointT, LinePointT > closest_points_point_line (PointT const &p, LinePointT const &line_p1, LinePointT const &line_p2)
template<typename PointT >
std::pair< PointT, PointT > closest_points_point_tetrahedron (PointT const &p, PointT const &v0, PointT const &v1, PointT const &v2, PointT const &v3)
template<typename PointT >
std::pair< PointT, PointT > closest_points_point_triangle (PointT const &p, PointT const &v0, PointT const &v1, PointT const &v2)
template<typename CoordT , typename CoordinateSystemT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, spatial_point< CoordT,
CoordinateSystemT > > const & 
point_pair_with_shortest_distance (std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_1, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_2)
template<typename CoordT , typename CoordinateSystemT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, spatial_point< CoordT,
CoordinateSystemT > > const & 
point_pair_with_shortest_distance (std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_1, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_2, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_3)
template<typename CoordT , typename CoordinateSystemT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, spatial_point< CoordT,
CoordinateSystemT > > const & 
point_pair_with_shortest_distance (std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_1, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_2, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_3, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_4)
template<typename CoordT , typename CoordinateSystemT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, spatial_point< CoordT,
CoordinateSystemT > > const & 
point_pair_with_shortest_distance (std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_1, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_2, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_3, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_4, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_5)
template<typename CoordT , typename CoordinateSystemT >
std::pair< spatial_point
< CoordT, CoordinateSystemT >
, spatial_point< CoordT,
CoordinateSystemT > > const & 
point_pair_with_shortest_distance (std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_1, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_2, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_3, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_4, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_5, std::pair< spatial_point< CoordT, CoordinateSystemT >, spatial_point< CoordT, CoordinateSystemT > > const &pair_6)

Detailed Description

Routines for computing the two points of two different objects being closest to each other.