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>
Classes | |
| struct | ReferenceMappingData |
| Output containers and filtering data used while generating reference-coordinate mappings. More... | |
Public Member Functions | |
| MortarSegmentHelper (std::vector< Point > secondary_nodes, const Point ¢er, const Point &normal, const MortarSegmentTriangulationMode triangulation_mode, const bool triangulate_triangles) | |
| Construct a helper that generates mortar segment geometry only. More... | |
| MortarSegmentHelper (std::vector< Point > secondary_nodes, std::vector< Point > secondary_reference_points, const Point ¢er, const Point &normal, const MortarSegmentTriangulationMode triangulation_mode, const bool triangulate_triangles) | |
| Construct a helper that also tracks secondary parent-reference coordinates. More... | |
| 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... | |
| void | getMortarSegments (const std::vector< Point > &primary_nodes, const std::vector< Point > &primary_reference_points, std::vector< Point > &nodes, std::vector< std::vector< unsigned int >> &elem_to_nodes, std::vector< std::array< Point, 3 >> &elem_to_secondary_reference_points, std::vector< std::array< Point, 3 >> &elem_to_primary_reference_points, Real minimum_segment_area=0.) |
| Get mortar segments and aligned parent-reference coordinates by appending to the output containers. 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... | |
| const Point & | normal () const |
| Get the unit normal of the projection plane. 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 Member Functions | |
| void | getMortarSegmentsImpl (const std::vector< Point > &primary_nodes, std::vector< Point > &nodes, std::vector< std::vector< unsigned int >> &elem_to_nodes, ReferenceMappingData *reference_mapping) |
| std::vector< Point > | clipProjectedPoly (const std::vector< Point > &primary_poly) const |
| Clip an already projected primary polygon against the secondary polygon. More... | |
| std::optional< Point > | referencePoint (const Point &point, const std::vector< Point > &poly, const std::vector< Point > &reference_points, std::string *failure_reason=nullptr) const |
| Recover a parent-reference point from a projected sub-element map. More... | |
Private Attributes | |
| Point | _center |
| Geometric center of secondary element. More... | |
| Point | _normal |
| Unit normal of the plane used to project and clip the linearized secondary subpatch. 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... | |
| std::vector< Point > | _secondary_reference_points |
| Parent reference points corresponding to _secondary_poly. More... | |
Friends | |
| class | MortarSegmentHelperTest |
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 35 of file MortarSegmentHelper.h.
| MortarSegmentHelper::MortarSegmentHelper | ( | std::vector< Point > | secondary_nodes, |
| const Point & | center, | ||
| const Point & | normal, | ||
| const MortarSegmentTriangulationMode | triangulation_mode, | ||
| const bool | triangulate_triangles | ||
| ) |
Construct a helper that generates mortar segment geometry only.
Definition at line 291 of file MortarSegmentHelper.C.
| MortarSegmentHelper::MortarSegmentHelper | ( | std::vector< Point > | secondary_nodes, |
| std::vector< Point > | secondary_reference_points, | ||
| const Point & | center, | ||
| const Point & | normal, | ||
| const MortarSegmentTriangulationMode | triangulation_mode, | ||
| const bool | triangulate_triangles | ||
| ) |
Construct a helper that also tracks secondary parent-reference coordinates.
Definition at line 301 of file MortarSegmentHelper.C.
Compute area of polygon.
Definition at line 1283 of file MortarSegmentHelper.C.
Referenced by getMortarSegmentsImpl(), MortarSegmentHelper(), and triangulatePoly().
|
inline |
Get center point of secondary element.
Definition at line 130 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 443 of file MortarSegmentHelper.C.
Referenced by getMortarSegmentsImpl().
|
private |
Clip an already projected primary polygon against the secondary polygon.
Keeping projection separate preserves the ordering shared with primary reference points.
Definition at line 449 of file MortarSegmentHelper.C.
Referenced by clipPoly(), and getMortarSegmentsImpl().
| 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 351 of file MortarSegmentHelper.C.
Referenced by clipProjectedPoly().
| 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 930 of file MortarSegmentHelper.C.
| void MortarSegmentHelper::getMortarSegments | ( | const std::vector< Point > & | primary_nodes, |
| const std::vector< Point > & | primary_reference_points, | ||
| std::vector< Point > & | nodes, | ||
| std::vector< std::vector< unsigned int >> & | elem_to_nodes, | ||
| std::vector< std::array< Point, 3 >> & | elem_to_secondary_reference_points, | ||
| std::vector< std::array< Point, 3 >> & | elem_to_primary_reference_points, | ||
| Real | minimum_segment_area = 0. |
||
| ) |
Get mortar segments and aligned parent-reference coordinates by appending to the output containers.
Segments below minimum_segment_area are removed before mapping; retained vertices must map uniquely.
Definition at line 938 of file MortarSegmentHelper.C.
|
private |
Definition at line 955 of file MortarSegmentHelper.C.
Referenced by getMortarSegments().
| bool MortarSegmentHelper::isDisjoint | ( | const std::vector< Point > & | poly | ) | const |
Checks whether polygons are disjoint for an easy out.
Definition at line 392 of file MortarSegmentHelper.C.
Referenced by clipProjectedPoly().
| bool MortarSegmentHelper::isInsideSecondary | ( | const Point & | pt | ) | const |
Check that a point is inside the secondary polygon (for verification only)
Definition at line 370 of file MortarSegmentHelper.C.
Referenced by getMortarSegmentsImpl().
|
inline |
Get the unit normal of the projection plane.
Definition at line 135 of file MortarSegmentHelper.h.
Get 3D position of node of linearized secondary element.
Definition at line 145 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), and referencePoint().
| 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 419 of file MortarSegmentHelper.C.
Referenced by clipPoly(), and getMortarSegmentsImpl().
|
private |
Recover a parent-reference point from a projected sub-element map.
Definition at line 1101 of file MortarSegmentHelper.C.
Referenced by getMortarSegmentsImpl().
|
inline |
Get area fraction remaining after clipping against primary elements.
Definition at line 140 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 560 of file MortarSegmentHelper.C.
Referenced by getMortarSegmentsImpl().
|
friend |
Definition at line 183 of file MortarSegmentHelper.h.
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 233 of file MortarSegmentHelper.h.
Referenced by clipProjectedPoly(), isDisjoint(), isInsideSecondary(), MortarSegmentHelper(), referencePoint(), and triangulatePoly().
|
private |
Geometric center of secondary element.
Definition at line 189 of file MortarSegmentHelper.h.
Referenced by center(), getMortarSegmentsImpl(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
|
private |
Definition at line 213 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl().
|
private |
Tolerance times secondary area for dimensional consistency.
Definition at line 238 of file MortarSegmentHelper.h.
Referenced by clipProjectedPoly(), MortarSegmentHelper(), and triangulatePoly().
|
private |
Unit normal of the plane used to project and clip the linearized secondary subpatch.
Definition at line 194 of file MortarSegmentHelper.h.
Referenced by MortarSegmentHelper(), and normal().
|
private |
Fraction of area remaining after overlapping primary polygons clipped.
Definition at line 211 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), MortarSegmentHelper(), and remainder().
|
private |
Area of projected secondary element.
Definition at line 206 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), and MortarSegmentHelper().
|
private |
List of projected points on the linearized secondary element.
Definition at line 243 of file MortarSegmentHelper.h.
Referenced by clipProjectedPoly(), getMortarSegmentsImpl(), isDisjoint(), isInsideSecondary(), MortarSegmentHelper(), and point().
|
private |
Parent reference points corresponding to _secondary_poly.
Definition at line 246 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), and MortarSegmentHelper().
|
private |
Tolerance for intersection and clipping.
Definition at line 218 of file MortarSegmentHelper.h.
Referenced by clipProjectedPoly(), isInsideSecondary(), and MortarSegmentHelper().
|
private |
Whether already-triangular polygons should still be centroid-subdivided.
Definition at line 228 of file MortarSegmentHelper.h.
Referenced by triangulatePoly().
|
private |
Triangulation mode used for clipped polygons.
Definition at line 223 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 201 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
|
private |
Definition at line 201 of file MortarSegmentHelper.h.
Referenced by getMortarSegmentsImpl(), MortarSegmentHelper(), point(), and projectPrimaryPoly().
1.8.14