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, const MortarSegmentTriangulationMode triangulation_mode, const bool triangulate_triangles) | |
| 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 > | projectPrimaryPoly (const std::vector< Point > &primary_nodes) const |
| Project a primary polygon into the helper plane while preserving the clipping orientation. 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, std::vector< std::vector< unsigned int >> &tri_map) const |
| Triangulate a polygon according to the configured mortar-segment triangulation mode. 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... | |
| const MortarSegmentTriangulationMode | _triangulation_mode |
| Triangulation mode used for clipped polygons. More... | |
| const bool | _triangulate_triangles |
| Whether already-triangular polygons should still be centroid-subdivided. 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 28 of file MortarSegmentHelper.h.
| MortarSegmentHelper::MortarSegmentHelper | ( | const std::vector< Point > | secondary_nodes, |
| const Point & | center, | ||
| const Point & | normal, | ||
| const MortarSegmentTriangulationMode | triangulation_mode, | ||
| const bool | triangulate_triangles | ||
| ) |
Definition at line 270 of file MortarSegmentHelper.C.
Compute area of polygon.
Definition at line 932 of file MortarSegmentHelper.C.
Referenced by getMortarSegments(), MortarSegmentHelper(), and triangulatePoly().
|
inline |
Get center point of secondary element.
Definition at line 97 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 406 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 314 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 892 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 355 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 333 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
Get 3D position of node of linearized secondary element.
Definition at line 107 of file MortarSegmentHelper.h.
| std::vector< Point > MortarSegmentHelper::projectPrimaryPoly | ( | const std::vector< Point > & | primary_nodes | ) | const |
Project a primary polygon into the helper plane while preserving the clipping orientation.
Definition at line 382 of file MortarSegmentHelper.C.
Referenced by clipPoly().
|
inline |
Get area fraction remaining after clipping against primary elements.
Definition at line 102 of file MortarSegmentHelper.h.
| void MortarSegmentHelper::triangulatePoly | ( | std::vector< Point > & | poly_nodes, |
| std::vector< std::vector< unsigned int >> & | tri_map | ||
| ) | const |
Triangulate a polygon according to the configured mortar-segment triangulation mode.
| poly_nodes | List of 2D nodes defining polygon. May be augmented with extra interior nodes (e.g. centroid) by triangulation modes that require them; callers should append the result to their nodes list before applying the offset to tri_map. |
| tri_map | Output triangle list expressed in indices local to poly_nodes (i.e. starting at 0). Callers are responsible for shifting these indices into the global node numbering. |
Definition at line 522 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 160 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isDisjoint(), isInsideSecondary(), MortarSegmentHelper(), and triangulatePoly().
|
private |
Geometric center of secondary element.
Definition at line 116 of file MortarSegmentHelper.h.
Referenced by center(), getMortarSegments(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
|
private |
Definition at line 140 of file MortarSegmentHelper.h.
Referenced by getMortarSegments().
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 165 of file MortarSegmentHelper.h.
Referenced by clipPoly(), MortarSegmentHelper(), and triangulatePoly().
|
private |
Normal at geometric center of secondary element.
Definition at line 121 of file MortarSegmentHelper.h.
Referenced by MortarSegmentHelper().
|
private |
Fraction of area remaining after overlapping primary polygons clipped.
Definition at line 138 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), MortarSegmentHelper(), and remainder().
|
private |
Area of projected secondary element.
Definition at line 133 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), and MortarSegmentHelper().
|
private |
List of projected points on the linearized secondary element.
Definition at line 170 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isDisjoint(), isInsideSecondary(), MortarSegmentHelper(), and point().
|
private |
Tolerance for intersection and clipping.
Definition at line 145 of file MortarSegmentHelper.h.
Referenced by clipPoly(), isInsideSecondary(), and MortarSegmentHelper().
|
private |
Whether already-triangular polygons should still be centroid-subdivided.
Definition at line 155 of file MortarSegmentHelper.h.
Referenced by triangulatePoly().
|
private |
Triangulation mode used for clipped polygons.
Definition at line 150 of file MortarSegmentHelper.h.
Referenced by triangulatePoly().
|
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 128 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
|
private |
Definition at line 128 of file MortarSegmentHelper.h.
Referenced by getMortarSegments(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
1.8.14