This class supports defining mortar segment mesh elements in 3D by projecting secondary and primary elements onto a linearized plane, computing the overlapping polygon formed by their projections, and triangulating the resulting nodes. More...
#include <MortarSegmentHelper.h>
Public Member Functions | |
MortarSegmentHelper (const std::vector< Point > secondary_nodes, const Point ¢er, const Point &normal) | |
Point | getIntersection (const Point &p1, const Point &p2, const Point &q1, const Point &q2, Real &s) const |
Computes the intersection between line segments defined by point pairs (p1,p2) and (q1,q2) Also computes s, the ratio of distance between (p1,p2) that the intersection falls, quantity s is useful in avoiding adding nearly degenerate nodes. More... | |
bool | isInsideSecondary (const Point &pt) const |
Check that a point is inside the secondary polygon (for verification only) More... | |
bool | isDisjoint (const std::vector< Point > &poly) const |
Checks whether polygons are disjoint for an easy out. More... | |
std::vector< Point > | clipPoly (const std::vector< Point > &primary_nodes) const |
Clip secondary element (defined in instantiation) against given primary polygon result is a set of 2D nodes defining clipped polygon. More... | |
void | triangulatePoly (std::vector< Point > &poly_nodes, const unsigned int offset, std::vector< std::vector< unsigned int >> &tri_map) const |
Triangulate a polygon (currently uses center of polygon to define triangulation) More... | |
void | getMortarSegments (const std::vector< Point > &primary_nodes, std::vector< Point > &nodes, std::vector< std::vector< unsigned int >> &elem_to_nodes) |
Get mortar segments generated by a secondary and primary element pair. More... | |
Real | area (const std::vector< Point > &nodes) const |
Compute area of polygon. More... | |
const Point & | center () const |
Get center point of secondary element. More... | |
Real | remainder () const |
Get area fraction remaining after clipping against primary elements. More... | |
Point | point (unsigned int i) const |
Get 3D position of node of linearized secondary element. More... | |
Private Attributes | |
Point | _center |
Geometric center of secondary element. More... | |
Point | _normal |
Normal at geometric center of secondary element. More... | |
Point | _u |
Vectors orthogonal to normal that span the plane projection will be performed on. More... | |
Point | _v |
Real | _secondary_area |
Area of projected secondary element. More... | |
Real | _remaining_area_fraction |
Fraction of area remaining after overlapping primary polygons clipped. More... | |
bool | _debug |
Real | _tolerance = 1e-8 |
Tolerance for intersection and clipping. More... | |
Real | _area_tol |
Tolerance times secondary area for dimensional consistency. More... | |
Real | _length_tol |
Tolerance times secondary area for dimensional consistency. More... | |
std::vector< Point > | _secondary_poly |
List of projected points on the linearized secondary element. More... | |
This class supports defining mortar segment mesh elements in 3D by projecting secondary and primary elements onto a linearized plane, computing the overlapping polygon formed by their projections, and triangulating the resulting nodes.
Definition at line 26 of file MortarSegmentHelper.h.
MortarSegmentHelper::MortarSegmentHelper | ( | const std::vector< Point > | secondary_nodes, |
const Point & | center, | ||
const Point & | normal | ||
) |
Definition at line 16 of file MortarSegmentHelper.C.
Compute area of polygon.
Definition at line 320 of file MortarSegmentHelper.C.
Referenced by getMortarSegments(), and MortarSegmentHelper().
|
inline |
Get center point of secondary element.
Definition at line 85 of file MortarSegmentHelper.h.
Referenced by MortarSegmentHelper().
std::vector< Point > MortarSegmentHelper::clipPoly | ( | const std::vector< Point > & | primary_nodes | ) | const |
Clip secondary element (defined in instantiation) against given primary polygon result is a set of 2D nodes defining clipped polygon.
Definition at line 122 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
Point MortarSegmentHelper::getIntersection | ( | const Point & | p1, |
const Point & | p2, | ||
const Point & | q1, | ||
const Point & | q2, | ||
Real & | s | ||
) | const |
Computes the intersection between line segments defined by point pairs (p1,p2) and (q1,q2) Also computes s, the ratio of distance between (p1,p2) that the intersection falls, quantity s is useful in avoiding adding nearly degenerate nodes.
Definition at line 54 of file MortarSegmentHelper.C.
Referenced by clipPoly().
void MortarSegmentHelper::getMortarSegments | ( | const std::vector< Point > & | primary_nodes, |
std::vector< Point > & | nodes, | ||
std::vector< std::vector< unsigned int >> & | elem_to_nodes | ||
) |
Get mortar segments generated by a secondary and primary element pair.
primary_nodes | List of primary element 3D nodes |
Definition at line 294 of file MortarSegmentHelper.C.
bool MortarSegmentHelper::isDisjoint | ( | const std::vector< Point > & | poly | ) | const |
Checks whether polygons are disjoint for an easy out.
Definition at line 95 of file MortarSegmentHelper.C.
Referenced by clipPoly().
bool MortarSegmentHelper::isInsideSecondary | ( | const Point & | pt | ) | const |
Check that a point is inside the secondary polygon (for verification only)
Definition at line 73 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
Get 3D position of node of linearized secondary element.
Definition at line 95 of file MortarSegmentHelper.h.
|
inline |
Get area fraction remaining after clipping against primary elements.
Definition at line 90 of file MortarSegmentHelper.h.
void MortarSegmentHelper::triangulatePoly | ( | std::vector< Point > & | poly_nodes, |
const unsigned int | offset, | ||
std::vector< std::vector< unsigned int >> & | tri_map | ||
) | const |
Triangulate a polygon (currently uses center of polygon to define triangulation)
poly_nodes | List of 2D nodes defining polygon |
offset | Current size of 3D nodes array (not poly_nodes) |
Definition at line 251 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 138 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isDisjoint(), isInsideSecondary(), and MortarSegmentHelper().
|
private |
Geometric center of secondary element.
Definition at line 104 of file MortarSegmentHelper.h.
Referenced by center(), clipPoly(), getMortarSegments(), MortarSegmentHelper(), and point().
|
private |
Definition at line 128 of file MortarSegmentHelper.h.
Referenced by getMortarSegments().
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 143 of file MortarSegmentHelper.h.
Referenced by clipPoly(), and MortarSegmentHelper().
|
private |
Normal at geometric center of secondary element.
Definition at line 109 of file MortarSegmentHelper.h.
Referenced by MortarSegmentHelper().
|
private |
Fraction of area remaining after overlapping primary polygons clipped.
Definition at line 126 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), MortarSegmentHelper(), and remainder().
|
private |
Area of projected secondary element.
Definition at line 121 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), and MortarSegmentHelper().
|
private |
List of projected points on the linearized secondary element.
Definition at line 148 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isDisjoint(), isInsideSecondary(), MortarSegmentHelper(), and point().
|
private |
Tolerance for intersection and clipping.
Definition at line 133 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isInsideSecondary(), and MortarSegmentHelper().
|
private |
Vectors orthogonal to normal that span the plane projection will be performed on.
These vectors are used to project the polygon clipping problem on a 2D plane, they are defined so the nodes of the projected polygon are listed with positive orientation
Definition at line 116 of file MortarSegmentHelper.h.
Referenced by clipPoly(), getMortarSegments(), MortarSegmentHelper(), and point().
|
private |
Definition at line 116 of file MortarSegmentHelper.h.
Referenced by clipPoly(), getMortarSegments(), MortarSegmentHelper(), and point().