KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::NearestPointUtilities Class Reference

Tools to calculate the nearest point in different geometries. More...

#include <nearest_point_utilities.h>

Collaboration diagram for Kratos::NearestPointUtilities:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (NearestPointUtilities)
 Pointer definition of NearestPointUtilities. More...
 
Life Cycle
 NearestPointUtilities ()=delete
 Default constructor. More...
 
 NearestPointUtilities (NearestPointUtilities const &rOther)=delete
 Copy constructor. More...
 
Operators
NearestPointUtilitiesoperator= (NearestPointUtilities const &rOther)=delete
 Assignment operator. More...
 

Static Public Member Functions

Operations
template<class TPointType , class TGeometryType >
static Point LineNearestPoint (const TPointType &rPoint, const TGeometryType &rLine)
 Finds the nearest point to the given point on a line segment. More...
 
template<class TPointType , class TGeometryType >
static Point TriangleNearestPoint (const TPointType &rPoint, const TGeometryType &rTriangle)
 Finds the nearest point to the given point on a trianlge. More...
 

Detailed Description

Tools to calculate the nearest point in different geometries.

These tools are generic enough to be used in different contexts while used in the geometries

Author
Pooyan Dadvand

Constructor & Destructor Documentation

◆ NearestPointUtilities() [1/2]

Kratos::NearestPointUtilities::NearestPointUtilities ( )
delete

Default constructor.

◆ NearestPointUtilities() [2/2]

Kratos::NearestPointUtilities::NearestPointUtilities ( NearestPointUtilities const &  rOther)
delete

Copy constructor.

Member Function Documentation

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::NearestPointUtilities::KRATOS_CLASS_POINTER_DEFINITION ( NearestPointUtilities  )

Pointer definition of NearestPointUtilities.

◆ LineNearestPoint()

template<class TPointType , class TGeometryType >
static Point Kratos::NearestPointUtilities::LineNearestPoint ( const TPointType &  rPoint,
const TGeometryType &  rLine 
)
inlinestatic

Finds the nearest point to the given point on a line segment.

It first projects the point into the line. If the porjceted point is inside the segment boundary it returns the projected point. If not it returns the nearest end point of the line.

Template Parameters
Typeof the Point
TGeometryTypeThe type of the line. Assumes to have [] access and IsInside method
Parameters
rPointThe query point which we want to get nearest point to it on the line
rLineThe line in which we want to find the nearest point to rPoint
Returns
The nearest point to rPoint

◆ operator=()

NearestPointUtilities& Kratos::NearestPointUtilities::operator= ( NearestPointUtilities const &  rOther)
delete

Assignment operator.

◆ TriangleNearestPoint()

template<class TPointType , class TGeometryType >
static Point Kratos::NearestPointUtilities::TriangleNearestPoint ( const TPointType &  rPoint,
const TGeometryType &  rTriangle 
)
inlinestatic

Finds the nearest point to the given point on a trianlge.

It first projects the point into the triangle surface. If the porjceted point is inside the triangle it returns the projected point. If not it returns the nearest point on the edges of the triangle. Dividing the plane of the triangle in 7 zones and find the nearest reflecting those zones

        \       /
         \  6  /
          \   /
           \ /
            /\ 
           /  \ 
     2    /    \     3
         /   1  \ 
        /        \ 

_______ /_______________________ / \ 5 / 4 \ 7 / \ / \

Template Parameters
Typeof the Point
TGeometryTypeThe type of the triangle. Assumes to have [] access and IsInside method
Parameters
rPointThe query point which we want to get nearest point to it on the line
rTriangleThe triangle in which we want to find the nearest point to rPoint
Returns
The nearest point to rPoint

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