KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::BoundaryLocator< GridView, Function, dimw > Class Template Reference

More...

#include <boundaryLocator.hh>

Public Types

using ctype = typename GridView::ctype
using Position = Dune::FieldVector<ctype,dimension_world>
using LocalPosition = Dune::FieldVector<ctype,dimension_world-1>
using Face
using DisplacedFace = BoundaryFace<Grid,Face,Function,dimw>
 the type of boundary faces in the (optionally displaced) grid, used for returning found intersections.

Public Member Functions

 BoundaryLocator (GridView const &gridView)
 Constructs a locator, optionally providing a displacement.
 BoundaryLocator (GridView const &gridView, std::vector< bool > const &boundarySegments)
 Constructor.
template<class... Args>
 BoundaryLocator (GridView const &gridView, Args &&... args)
 Constructs a locator, constructing the displacement function with the given argument.
 ~BoundaryLocator ()
template<class Update>
void updateDisplacement (Update const &update)
 Creates or updates the displacement function.
std::optional< std::tuple< typename BoundaryLocator< GridView, Function, dimw >::DisplacedFace, typename BoundaryLocator< GridView, Function, dimw >::LocalPosition, typename GridView::ctype > > byLineSegment (Position const &from, Position const &to, ctype minAngle=-0.5) const
 Finds the first boundary face that is intersected by the given line segment from outside towards inside.
std::optional< std::tuple< typename BoundaryLocator< GridView, Function, dimw >::DisplacedFace, typename BoundaryLocator< GridView, Function, dimw >::LocalPosition, typename GridView::ctype > > byRay (Position const &from, Position const &direction, ctype minAngle=-0.5) const
 Finds the first boundary face that is intersected by the given ray from outside towards inside.
ctype diameter () const
 The diagonal length of the grid's cartesian bounding box.
Position global (Face const &face, LocalPosition const &xi) const
 Returns the global position of a boundary point.
Position unitOuterNormal (Face const &face, LocalPosition const &xi) const
 DEPRECATED use BoundaryFace::unitOuterNormal() instead.
Function const * displacement () const
 Returns the current displacement of the mesh.
std::vector< Face > faces () const
 Returns a sequence of all faces.
std::vector< DisplacedFace > displacedFaces () const
 Returns a sequence of all deformed faces.

Static Public Attributes

static int const dimension = GridView::Grid::dimension
static int const dimension_world = dimw

Detailed Description

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
class Kaskade::BoundaryLocator< GridView, Function, dimw >

Supports finding boundary intersections by geometric queries.

Template Parameters
GridView
Functiona vector valued function defined on the grid view. It has to support a subset of the FunctionSpaceElement interface, namely the methods order(cell), value(cell,xi), and derivative(cell,pos).

A displacement function defined on the given grid view can be provided. In that case, instead of the original grid the deformed grid, defined by the displacement, is considered.

Design rationale: Dune::GeometryGrid provides similar functionality, but incurs the (small) overhead of defining a complete grid structe and is restricted to piecewise linear deformations.

Explicit instantiations for Dune::UGGrid<2> and Dune::UGGrid<3> leaf grid views are provided in the file boundaryLocator.cpp, and are compiled into the library. For other grids views, include boundaryLocator.hpp, which contains the implementations.

Definition at line 79 of file boundaryLocator.hh.

Member Typedef Documentation

◆ ctype

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
using Kaskade::BoundaryLocator< GridView, Function, dimw >::ctype = typename GridView::ctype

Definition at line 87 of file boundaryLocator.hh.

◆ DisplacedFace

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
using Kaskade::BoundaryLocator< GridView, Function, dimw >::DisplacedFace = BoundaryFace<Grid,Face,Function,dimw>

the type of boundary faces in the (optionally displaced) grid, used for returning found intersections.

Definition at line 98 of file boundaryLocator.hh.

◆ Face

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
using Kaskade::BoundaryLocator< GridView, Function, dimw >::Face
Initial value:
std::conditional_t<dimension==dimension_world,
typename GridView::Intersection,
typename GridView::template Codim<0>::Entity>
static int const dimension_world

Definition at line 90 of file boundaryLocator.hh.

◆ LocalPosition

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
using Kaskade::BoundaryLocator< GridView, Function, dimw >::LocalPosition = Dune::FieldVector<ctype,dimension_world-1>

Definition at line 89 of file boundaryLocator.hh.

◆ Position

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
using Kaskade::BoundaryLocator< GridView, Function, dimw >::Position = Dune::FieldVector<ctype,dimension_world>

Definition at line 88 of file boundaryLocator.hh.

Constructor & Destructor Documentation

◆ BoundaryLocator() [1/3]

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Kaskade::BoundaryLocator< GridView, Function, dimw >::BoundaryLocator ( GridView const & gridView)

Constructs a locator, optionally providing a displacement.

Referenced by BoundaryLocator().

◆ BoundaryLocator() [2/3]

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Kaskade::BoundaryLocator< GridView, Function, dimw >::BoundaryLocator ( GridView const & gridView,
std::vector< bool > const & boundarySegments )

Constructor.

Parameters
boundarySegmentsstates which boundary faces (by their boundary segment index) are to be considered; if empty all are considered

◆ BoundaryLocator() [3/3]

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
template<class... Args>
Kaskade::BoundaryLocator< GridView, Function, dimw >::BoundaryLocator ( GridView const & gridView,
Args &&... args )
inline

Constructs a locator, constructing the displacement function with the given argument.

Template Parameters
Argsthe argument type for the displacement function. A constructor Function(Args) must exist.

Definition at line 121 of file boundaryLocator.hh.

◆ ~BoundaryLocator()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Kaskade::BoundaryLocator< GridView, Function, dimw >::~BoundaryLocator ( )

Member Function Documentation

◆ byLineSegment()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
std::optional< std::tuple< typename BoundaryLocator< GridView, Function, dimw >::DisplacedFace, typename BoundaryLocator< GridView, Function, dimw >::LocalPosition, typename GridView::ctype > > Kaskade::BoundaryLocator< GridView, Function, dimw >::byLineSegment ( Position const & from,
Position const & to,
ctype minAngle = -0.5 ) const

Finds the first boundary face that is intersected by the given line segment from outside towards inside.

"First" means that the intersection is closest to the start point of the line.

Parameters
fromthe origin of the line segment
tothe end point of the line segment (shall not coincide with from)
minAnglethe minimum angle for which an intersection is accepted. Only faces with unit outer normal \( n \) and \( n^T (\mathrm{to}-\mathrm{from}) / \| \mathrm{to}-\mathrm{from} \| \le \mathrm{minAngle} \) are considered.

An (optional) triple (i,c,q) is returned. If valid, i contains the boundary face and c is the face-local coordinate of the intersection point. q is the scalar product between normalized ray direction and intersecting face unit outer normal.

Referenced by byRay().

◆ byRay()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
std::optional< std::tuple< typename BoundaryLocator< GridView, Function, dimw >::DisplacedFace, typename BoundaryLocator< GridView, Function, dimw >::LocalPosition, typename GridView::ctype > > Kaskade::BoundaryLocator< GridView, Function, dimw >::byRay ( Position const & from,
Position const & direction,
ctype minAngle = -0.5 ) const
inline

Finds the first boundary face that is intersected by the given ray from outside towards inside.

"First" means that the intersection is closest to the start point of the ray.

Parameters
fromthe origin of the line segment
directionthe direction of the ray (shall not be zero)
minAnglethe minimum angle for which an intersection is accepted. Only faces with unit outer normal \( n \) and \( n^T \mathrm{dir} / \| \mathrm{dir} \| \le \mathrm{minAngle} \) are considered.

An (optional) triple (i,c,q) is returned. If valid, i contains the boundary face and c is the face-local coordinate of the intersection point. q is the scalar product between normalized ray direction and intersecting face unit outer normal.

Definition at line 202 of file boundaryLocator.hh.

Referenced by Kaskade::getContactConstraint(), and Kaskade::getContactConstraint().

◆ diameter()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
ctype Kaskade::BoundaryLocator< GridView, Function, dimw >::diameter ( ) const
inline

The diagonal length of the grid's cartesian bounding box.

The diameter of the geometry comes handy if intersections with a ray instead of a line segment is desired. Taking an end point on the ray in diameter distance to the origin defines a line segment with all possible intersections.

Definition at line 214 of file boundaryLocator.hh.

◆ displacedFaces()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
std::vector< DisplacedFace > Kaskade::BoundaryLocator< GridView, Function, dimw >::displacedFaces ( ) const

Returns a sequence of all deformed faces.

The sequence of faces is extracted and returned by value, which is a considerable computational effort. The order of faces is unspecified, and subject to change on calling updateDisplacement().

Referenced by Kaskade::getContactArea(), Kaskade::getContactConstraints(), and Kaskade::getContactConstraints().

◆ displacement()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Function const * Kaskade::BoundaryLocator< GridView, Function, dimw >::displacement ( ) const
inline

Returns the current displacement of the mesh.

The returned pointer can be null, which signals a trivial zero displacement.

Definition at line 236 of file boundaryLocator.hh.

Referenced by Kaskade::contactLinesearch(), Kaskade::contactLinesearch(), and Kaskade::getContactArea().

◆ faces()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
std::vector< Face > Kaskade::BoundaryLocator< GridView, Function, dimw >::faces ( ) const

Returns a sequence of all faces.

The sequence of faces is extracted and returned by value, which is a considerable computational effort. The order of faces is unspecified, and subject to change on calling updateDisplacement().

Referenced by updateDisplacement().

◆ global()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Position Kaskade::BoundaryLocator< GridView, Function, dimw >::global ( Face const & face,
LocalPosition const & xi ) const

Returns the global position of a boundary point.

This respects a potentially given nontrivial displacement of the boundary.

◆ unitOuterNormal()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
Position Kaskade::BoundaryLocator< GridView, Function, dimw >::unitOuterNormal ( Face const & face,
LocalPosition const & xi ) const

DEPRECATED use BoundaryFace::unitOuterNormal() instead.

◆ updateDisplacement()

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
template<class Update>
void Kaskade::BoundaryLocator< GridView, Function, dimw >::updateDisplacement ( Update const & update)
inline

Creates or updates the displacement function.

Template Parameters
Updatethe argument type for constructing or updating the displacement. Function must have both a constructor Function(Update) and an assignment operator operator=(Update).

Calling this method recreates the spatial search tree, which can lead to a new tree structure. This affects the order of faces in the sequence returned by faces().

Definition at line 142 of file boundaryLocator.hh.

Referenced by Kaskade::contactLinesearch(), and Kaskade::contactLinesearch().

Member Data Documentation

◆ dimension

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
int const Kaskade::BoundaryLocator< GridView, Function, dimw >::dimension = GridView::Grid::dimension
static

Definition at line 85 of file boundaryLocator.hh.

◆ dimension_world

template<class GridView, class Function = BoundaryLocatorDetail::ZeroDisplacement, int dimw = GridView::Grid::dimension>
int const Kaskade::BoundaryLocator< GridView, Function, dimw >::dimension_world = dimw
static

Definition at line 86 of file boundaryLocator.hh.


The documentation for this class was generated from the following file: