https://mooseframework.inl.gov
FillBetweenPointVectorsTools.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 "LinearInterpolation.h"
12 #include "SplineInterpolation.h"
13 #include "MooseException.h"
14 #include "libmesh/mesh_base.h"
15 #include "libmesh/mesh_modification.h"
16 
18 {
43  const std::vector<Point> & boundary_points_vec_1,
44  const std::vector<Point> & boundary_points_vec_2,
45  const unsigned int num_layers,
46  const subdomain_id_type transition_layer_id,
47  const boundary_id_type input_boundary_1_id,
48  const boundary_id_type input_boundary_2_id,
49  const boundary_id_type begin_side_boundary_id,
50  const boundary_id_type end_side_boundary_id,
51  const std::string type,
52  const std::string name,
53  const bool quad_elem = false,
54  const Real bias_parameter = 1.0,
55  const Real sigma = 3.0);
56 
70  const std::vector<Point> & boundary_points_vec_1,
71  const std::vector<Point> & boundary_points_vec_2,
72  const unsigned int num_layers,
73  const subdomain_id_type transition_layer_id,
74  const boundary_id_type external_boundary_id,
75  const std::string type,
76  const std::string name,
77  const bool quad_elem = false);
78 
96  const std::vector<std::vector<Node *>> & nodes,
97  const unsigned int num_layers,
98  const std::vector<unsigned int> & node_number_vec,
99  const subdomain_id_type transition_layer_id,
100  const boundary_id_type input_boundary_1_id,
101  const boundary_id_type input_boundary_2_id,
102  const boundary_id_type begin_side_boundary_id,
103  const boundary_id_type end_side_boundary_id);
104 
121 void elementsCreationFromNodesVectors(MeshBase & mesh,
122  const std::vector<std::vector<Node *>> & nodes,
123  const unsigned int num_layers,
124  const std::vector<unsigned int> & node_number_vec,
125  const subdomain_id_type transition_layer_id,
126  const boundary_id_type input_boundary_1_id,
127  const boundary_id_type input_boundary_2_id,
128  const boundary_id_type begin_side_boundary_id,
129  const boundary_id_type end_side_boundary_id);
130 
143 void weightedInterpolator(const unsigned int vec_node_num,
144  const std::vector<Point> & boundary_points_vec,
145  std::vector<Real> & vec_index,
146  std::vector<Real> & wt,
147  std::vector<Real> & index,
148  const Real sigma,
149  std::unique_ptr<LinearInterpolation> & linear_vec_x,
150  std::unique_ptr<LinearInterpolation> & linear_vec_y,
151  std::unique_ptr<SplineInterpolation> & spline_vec_l);
152 
163 void surrogateGenerator(std::vector<Real> & weighted_surrogate_index,
164  std::vector<Real> & unweighted_surrogate_index,
165  const std::vector<unsigned int> & node_number_vec,
166  const std::vector<Real> & index,
167  const std::vector<Real> & wt,
168  const unsigned int boundary_node_num,
169  const unsigned int i);
170 
178 bool needFlip(const std::vector<Point> & vec_pts_1, const std::vector<Point> & vec_pts_2);
179 
192 bool isBoundarySimpleClosedLoop(MeshBase & mesh,
193  Real & max_node_radius,
194  std::vector<dof_id_type> & boundary_ordered_node_list,
195  const Point origin_pt,
196  const boundary_id_type bid);
197 
209 bool isBoundarySimpleClosedLoop(MeshBase & mesh,
210  Real & max_node_radius,
211  const Point origin_pt,
212  const boundary_id_type bid);
213 
223 bool isBoundarySimpleClosedLoop(MeshBase & mesh, const Point origin_pt, const boundary_id_type bid);
224 
235 bool isBoundaryOpenSingleSegment(MeshBase & mesh,
236  Real & max_node_radius,
237  std::vector<dof_id_type> & boundary_ordered_node_list,
238  const Point origin_pt,
239  const boundary_id_type bid);
240 
252 bool isCurveSimpleClosedLoop(MeshBase & mesh,
253  Real & max_node_radius,
254  std::vector<dof_id_type> & ordered_node_list,
255  const Point origin_pt);
256 
267 bool isCurveSimpleClosedLoop(MeshBase & mesh, Real & max_node_radius, const Point origin_pt);
268 
277 bool isCurveSimpleClosedLoop(MeshBase & mesh, const Point origin_pt);
278 
288 bool isCurveOpenSingleSegment(MeshBase & mesh,
289  Real & max_node_radius,
290  std::vector<dof_id_type> & ordered_node_list,
291  const Point origin_pt);
292 
308 void isClosedLoop(MeshBase & mesh,
309  Real & max_node_radius,
310  std::vector<dof_id_type> & ordered_node_list,
311  std::vector<std::pair<dof_id_type, dof_id_type>> & node_assm,
312  std::vector<dof_id_type> & midpoint_node_list,
313  const Point origin_pt,
314  const std::string input_type,
315  bool & is_closed_loop,
316  const bool suppress_exception = false);
317 
331 void isClosedLoop(MeshBase & mesh,
332  Real & max_node_radius,
333  std::vector<dof_id_type> & ordered_node_list,
334  std::vector<std::pair<dof_id_type, dof_id_type>> & node_assm,
335  const Point origin_pt,
336  const std::string input_type,
337  bool & is_closed_loop,
338  const bool suppress_exception = false);
339 
346 bool isExternalBoundary(MeshBase & mesh, const boundary_id_type bid);
347 
358 bool buildQuadElement(Elem * elem,
359  Node * nd_0,
360  Node * nd_1,
361  Node * nd_2,
362  Node * nd_3,
363  const subdomain_id_type transition_layer_id);
364 
374 bool buildTriElement(Elem * elem,
375  Node * nd_0,
376  Node * nd_1,
377  Node * nd_2,
378  const subdomain_id_type transition_layer_id);
379 }
std::string name(const ElemQuality q)
MeshBase & mesh
bool needFlip(const std::vector< Point > &vec_pts_1, const std::vector< Point > &vec_pts_2)
Decide whether one of the input vector of Points needs to be flipped to ensure correct transition lay...
bool isBoundaryOpenSingleSegment(MeshBase &mesh, Real &max_node_radius, std::vector< dof_id_type > &boundary_ordered_node_list, const Point origin_pt, const boundary_id_type bid)
Decides whether a boundary of a given mesh is an open single-segment boundary.
void elementsCreationFromNodesVectorsQuad(MeshBase &mesh, const std::vector< std::vector< Node *>> &nodes, const unsigned int num_layers, const std::vector< unsigned int > &node_number_vec, const subdomain_id_type transition_layer_id, const boundary_id_type input_boundary_1_id, const boundary_id_type input_boundary_2_id, const boundary_id_type begin_side_boundary_id, const boundary_id_type end_side_boundary_id)
Generates a 2D mesh based on a 2D vector of Nodes using QUAD4 elements in the xy-plane.
int8_t boundary_id_type
void surrogateGenerator(std::vector< Real > &weighted_surrogate_index, std::vector< Real > &unweighted_surrogate_index, const std::vector< unsigned int > &node_number_vec, const std::vector< Real > &index, const std::vector< Real > &wt, const unsigned int boundary_node_num, const unsigned int i)
Generates weighted surrogate index vectors on one side for points of a sublayer curve.
void fillBetweenPointVectorsGenerator(MeshBase &mesh, const std::vector< Point > &boundary_points_vec_1, const std::vector< Point > &boundary_points_vec_2, const unsigned int num_layers, const subdomain_id_type transition_layer_id, const boundary_id_type input_boundary_1_id, const boundary_id_type input_boundary_2_id, const boundary_id_type begin_side_boundary_id, const boundary_id_type end_side_boundary_id, const std::string type, const std::string name, const bool quad_elem=false, const Real bias_parameter=1.0, const Real sigma=3.0)
Generates a 2D mesh with triangular elements for a region defined by two curves (sets of Points) ...
bool isBoundarySimpleClosedLoop(MeshBase &mesh, Real &max_node_radius, std::vector< dof_id_type > &boundary_ordered_node_list, const Point origin_pt, const boundary_id_type bid)
Decides whether a boundary of a given mesh is a closed loop with consecutive nodes&#39;s azimuthal angles...
bool buildQuadElement(Elem *elem, Node *nd_0, Node *nd_1, Node *nd_2, Node *nd_3, const subdomain_id_type transition_layer_id)
Creates an QUAD4 element that can be extruded in (0 0 1) direction.
bool isCurveOpenSingleSegment(MeshBase &mesh, Real &max_node_radius, std::vector< dof_id_type > &ordered_node_list, const Point origin_pt)
Decides whether a curve contained in a given mesh is an open single-segment curve.
void isClosedLoop(MeshBase &mesh, Real &max_node_radius, std::vector< dof_id_type > &ordered_node_list, std::vector< std::pair< dof_id_type, dof_id_type >> &node_assm, std::vector< dof_id_type > &midpoint_node_list, const Point origin_pt, const std::string input_type, bool &is_closed_loop, const bool suppress_exception=false)
Decides whether a series of nodes contained in a given mesh forms a closed loop with consecutive node...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void weightedInterpolator(const unsigned int vec_node_num, const std::vector< Point > &boundary_points_vec, std::vector< Real > &vec_index, std::vector< Real > &wt, std::vector< Real > &index, const Real sigma, std::unique_ptr< LinearInterpolation > &linear_vec_x, std::unique_ptr< LinearInterpolation > &linear_vec_y, std::unique_ptr< SplineInterpolation > &spline_vec_l)
Generates weights, weighted indices and corresponding interpolation.
bool isCurveSimpleClosedLoop(MeshBase &mesh, Real &max_node_radius, std::vector< dof_id_type > &ordered_node_list, const Point origin_pt)
Decides whether a curve contained in a given mesh is a closed loop with consecutive nodes&#39;s azimuthal...
bool buildTriElement(Elem *elem, Node *nd_0, Node *nd_1, Node *nd_2, const subdomain_id_type transition_layer_id)
Creates an TRI3 element that can be extruded in (0 0 1) direction.
bool isExternalBoundary(MeshBase &mesh, const boundary_id_type bid)
Decides whether a boundary of a given mesh is an external boundary.
void elementsCreationFromNodesVectors(MeshBase &mesh, const std::vector< std::vector< Node *>> &nodes, const unsigned int num_layers, const std::vector< unsigned int > &node_number_vec, const subdomain_id_type transition_layer_id, const boundary_id_type input_boundary_1_id, const boundary_id_type input_boundary_2_id, const boundary_id_type begin_side_boundary_id, const boundary_id_type end_side_boundary_id)
Generates a 2D mesh based on a 2D vector of Nodes using TRI3 elements in the xy-plane.