https://mooseframework.inl.gov
ParsedCurveGenerator.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 #include "MeshGenerator.h"
12 
13 #include "FunctionParserUtils.h"
14 
20 {
21 public:
23 
25 
26  std::unique_ptr<MeshBase> generate() override;
27 
40  void tSectionSpaceDefiner(const Real t_start,
41  const Real t_end,
42  std::vector<Real> & t_sect_space,
43  std::vector<Real> & dis_sect_space,
44  unsigned int num_segments,
45  const bool is_closed_loop,
46  const Real oversample_factor);
47 
48 protected:
50  const std::string _function_x;
52  const std::string _function_y;
54  const std::string _function_z;
56  const std::vector<unsigned int> _nums_segments;
58  const std::vector<Real> _section_bounding_t_values;
60  const bool _is_closed_loop;
64  const unsigned int _forced_closing_num_segments;
68  const unsigned int _max_oversample_number_factor;
70  std::vector<BoundaryName> _node_set_boundaries;
72  const unsigned int _order;
74  std::vector<Real> _t_space;
76  std::vector<Real> _dis_space;
83 
89  Point pointCalculator(const Real t_param);
90 
97  Real euclideanDistance(const Point p1, const Point p2);
98 
100 };
Real euclideanDistance(const Point p1, const Point p2)
Calculates the Euclidean distance between two given points.
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
SymFunctionPtr _func_Fy
function parser object describing the y(t)
const std::string _function_x
function expression for x(t)
const bool _is_closed_loop
whether the curve is a closed loop or not
ParsedCurveGenerator(const InputParameters &parameters)
const Real _oversample_factor
Oversampling factor to help make node distance nearly uniform.
usingFunctionParserUtilsMembers(false)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
SymFunctionPtr _func_Fz
function parser object describing the z(t)
const Real _point_overlapping_tolerance
the point-to-point distance tolerance that is used to determine whether the two points are overlapped...
const unsigned int _order
order of the EDGE elements to be generated
static InputParameters validParams()
const std::string _function_z
function expression for z(t)
const std::vector< Real > _section_bounding_t_values
critical t values that define the sections of the curve
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
std::vector< Real > _t_space
t values that are sampled for curve points
const unsigned int _forced_closing_num_segments
Number of segments of the curve section that is generated to forcefully close the loop...
his ParsedCurveGenerator object is designed to generate a mesh of a curve that consists of EDGE2...
Point pointCalculator(const Real t_param)
Calculates the point coordinates {x(t), y(t), 0.0} based on parameter t.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_oversample_number_factor
A factor used to calculate the maximum oversampling points number in each section.
const std::vector< unsigned int > _nums_segments
numbers of side segments of each section defined by section_bounding_t_values
SymFunctionPtr _func_Fx
function parser object describing the x(t)
std::vector< Real > _dis_space
cumulative distances of the curve points from the starting ppint
const InputParameters & parameters() const
Get the parameters of the object.
void tSectionSpaceDefiner(const Real t_start, const Real t_end, std::vector< Real > &t_sect_space, std::vector< Real > &dis_sect_space, unsigned int num_segments, const bool is_closed_loop, const Real oversample_factor)
Calculates the oversampled parameter t series and corresponding cumulative distances from the startin...
const std::string _function_y
function expression for y(t)
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
std::vector< BoundaryName > _node_set_boundaries
vector of the names of the boundaries at the ends of the parsed curve