14 #include "libmesh/point.h" 15 #include "libmesh/int_range.h" 25 #ifdef MOOSE_UNIT_TEST 26 class MortarSegmentHelperTest;
45 const bool triangulate_triangles);
51 std::vector<Point> secondary_reference_points,
55 const bool triangulate_triangles);
84 std::vector<Point>
clipPoly(
const std::vector<Point> & primary_nodes)
const;
97 std::vector<std::vector<unsigned int>> & tri_map)
const;
106 std::vector<Point> & nodes,
107 std::vector<std::vector<unsigned int>> & elem_to_nodes);
115 const std::vector<Point> & primary_reference_points,
116 std::vector<Point> & nodes,
117 std::vector<std::vector<unsigned int>> & elem_to_nodes,
118 std::vector<std::array<Point, 3>> & elem_to_secondary_reference_points,
119 std::vector<std::array<Point, 3>> & elem_to_primary_reference_points,
120 Real minimum_segment_area = 0.);
125 Real area(
const std::vector<Point> & nodes)
const;
163 std::vector<Point> & nodes,
164 std::vector<std::vector<unsigned int>> & elem_to_nodes,
171 std::vector<Point>
clipProjectedPoly(
const std::vector<Point> & primary_poly)
const;
178 const std::vector<Point> &
poly,
179 const std::vector<Point> & reference_points,
180 std::string * failure_reason =
nullptr)
const;
182 #ifdef MOOSE_UNIT_TEST friend class MortarSegmentHelperTest
std::vector< Point > clipProjectedPoly(const std::vector< Point > &primary_poly) const
Clip an already projected primary polygon against the secondary polygon.
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.
Point _center
Geometric center of secondary element.
Real _area_tol
Tolerance times secondary area for dimensional consistency.
bool isInsideSecondary(const Point &pt) const
Check that a point is inside the secondary polygon (for verification only)
R poly(const C &c, const T x, const bool derivative=false)
Evaluate a polynomial with the coefficients c at x.
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.
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.
const std::vector< Point > & primary_reference_points
Real _length_tol
Tolerance times secondary area for dimensional consistency.
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...
Real remainder() const
Get area fraction remaining after clipping against primary elements.
std::vector< std::array< Point, 3 > > & elem_to_primary_reference_points
std::vector< Point > projectPrimaryPoly(const std::vector< Point > &primary_nodes) const
Project a primary polygon into the helper plane while preserving the clipping orientation.
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.
std::vector< Point > _secondary_poly
List of projected points on the linearized secondary element.
MortarSegmentTriangulationMode
Real _tolerance
Tolerance for intersection and clipping.
Point _u
Vectors orthogonal to normal that span the plane projection will be performed on. ...
Real _secondary_area
Area of projected secondary element.
std::vector< std::array< Point, 3 > > & elem_to_secondary_reference_points
Point _normal
Unit normal of the plane used to project and clip the linearized secondary subpatch.
bool isDisjoint(const std::vector< Point > &poly) const
Checks whether polygons are disjoint for an easy out.
const Point & center() const
Get center point of secondary element.
const MortarSegmentTriangulationMode _triangulation_mode
Triangulation mode used for clipped polygons.
Real area(const std::vector< Point > &nodes) const
Compute area of polygon.
Real minimum_segment_area
void getMortarSegmentsImpl(const std::vector< Point > &primary_nodes, std::vector< Point > &nodes, std::vector< std::vector< unsigned int >> &elem_to_nodes, ReferenceMappingData *reference_mapping)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _triangulate_triangles
Whether already-triangular polygons should still be centroid-subdivided.
This class supports defining mortar segment mesh elements in 3D by projecting secondary and primary e...
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...
std::vector< Point > _secondary_reference_points
Parent reference points corresponding to _secondary_poly.
Output containers and filtering data used while generating reference-coordinate mappings.
const Point & normal() const
Get the unit normal of the projection plane.
Real _remaining_area_fraction
Fraction of area remaining after overlapping primary polygons clipped.
Point point(unsigned int i) const
Get 3D position of node of linearized secondary element.