31 std::unique_ptr<MeshBase>
generate()
override;
83 Real
squaredDistance(
const Point & curve_point,
const Point & point)
const;
MeshGenerators are objects that can modify or add to an existing mesh.
const InputParameters & parameters() const
Get the parameters of the object.
Snaps the nodes of a boundary onto the parametric curve of a ParsedCurveGenerator.
const unsigned int _samples_per_section
Number of uniform samples of each curve section used to bracket the closest curve point.
std::unique_ptr< MeshBase > & _curve_mesh
Reference to the mesh pointer of the curve generator, which is requested for its dependency.
ParsedCurveGenerator & _curve_generator
The ParsedCurveGenerator that defines the curve to snap the nodes onto, and evaluates it.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const bool _is_closed_loop
Whether the curve is a closed loop, in which case the parameter wraps at the bounding values.
Point curvePoint(const Real t_param)
Evaluates the curve through the generator that defines it.
Real goldenSectionSearch(const Real t_lower, const Real t_upper, const Point &point)
Refines a bracket of the closest curve point with a golden-section search.
Real squaredDistance(const Real t_param, const Point &point)
Calculates the squared in-plane distance between a given point and a point of the curve.
std::vector< Point > _sample_points
Curve points at the sampled t values, evaluated once in generate() and reused for every node.
std::unique_ptr< MeshBase > & _input
Reference to the input mesh pointer, whose boundary nodes are snapped onto the curve.
ParsedCurveGenerator & curveGenerator() const
Gets the generator that defines the curve, after checking that it is a ParsedCurveGenerator.
Real boundedParameter(const Real t_param) const
Bounds a parameter t into the bounding t values of a closed loop, which is where the formulas of the ...
const BoundaryName _boundary_name
Name of the boundary whose nodes are snapped onto the curve.
Real closestParameter(const Point &point)
Finds the parameter t of the curve point that is the closest to a given point.
std::vector< Real > _t_samples
Sampled t values used to bracket the closest curve point.
static InputParameters validParams()
const std::vector< Real > _section_bounding_t_values
t values that bound the sections of the curve
his ParsedCurveGenerator object is designed to generate a mesh of a curve that consists of EDGE2,...