https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MoveBoundaryNodesToCurveGenerator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MeshGenerator.h"
13
15
25{
26public:
28
30
31 std::unique_ptr<MeshBase> generate() override;
32
33protected:
35 std::unique_ptr<MeshBase> & _input;
37 std::unique_ptr<MeshBase> & _curve_mesh;
41 const BoundaryName _boundary_name;
43 const unsigned int _samples_per_section;
45 const std::vector<Real> _section_bounding_t_values;
47 const bool _is_closed_loop;
49 std::vector<Real> _t_samples;
51 std::vector<Point> _sample_points;
52
58
66 Point curvePoint(const Real t_param);
67
74 Real squaredDistance(const Real t_param, const Point & point);
75
83 Real squaredDistance(const Point & curve_point, const Point & point) const;
84
91 Real closestParameter(const Point & point);
92
100 Real goldenSectionSearch(const Real t_lower, const Real t_upper, const Point & point);
101
108 Real boundedParameter(const Real t_param) const;
109};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
MeshGenerators are objects that can modify or add to an existing mesh.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
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.
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,...