https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12#include "LinearInterpolation.h"
13#include "SplineInterpolation.h"
14#include "MooseException.h"
15#include "libmesh/mesh_base.h"
16#include "libmesh/mesh_modification.h"
17
19{
44 const std::vector<Point> & boundary_points_vec_1,
45 const std::vector<Point> & boundary_points_vec_2,
46 const unsigned int num_layers,
47 const subdomain_id_type transition_layer_id,
48 const boundary_id_type input_boundary_1_id,
49 const boundary_id_type input_boundary_2_id,
50 const boundary_id_type begin_side_boundary_id,
51 const boundary_id_type end_side_boundary_id,
52 const std::string type,
53 const std::string name,
54 const bool quad_elem = false,
55 const Real bias_parameter = 1.0,
56 const Real sigma = 3.0);
57
71 const std::vector<Point> & boundary_points_vec_1,
72 const std::vector<Point> & boundary_points_vec_2,
73 const unsigned int num_layers,
74 const subdomain_id_type transition_layer_id,
75 const boundary_id_type external_boundary_id,
76 const std::string type,
77 const std::string name,
78 const bool quad_elem = false);
79
97 const std::vector<std::vector<Node *>> & nodes,
98 const unsigned int num_layers,
99 const std::vector<unsigned int> & node_number_vec,
100 const subdomain_id_type transition_layer_id,
101 const boundary_id_type input_boundary_1_id,
102 const boundary_id_type input_boundary_2_id,
103 const boundary_id_type begin_side_boundary_id,
104 const boundary_id_type end_side_boundary_id);
105
123 const std::vector<std::vector<Node *>> & nodes,
124 const unsigned int num_layers,
125 const std::vector<unsigned int> & node_number_vec,
126 const subdomain_id_type transition_layer_id,
127 const boundary_id_type input_boundary_1_id,
128 const boundary_id_type input_boundary_2_id,
129 const boundary_id_type begin_side_boundary_id,
130 const boundary_id_type end_side_boundary_id);
131
144void weightedInterpolator(const unsigned int vec_node_num,
145 const std::vector<Point> & boundary_points_vec,
146 std::vector<Real> & vec_index,
147 std::vector<Real> & wt,
148 std::vector<Real> & index,
149 const Real sigma,
150 std::unique_ptr<LinearInterpolation> & linear_vec_x,
151 std::unique_ptr<LinearInterpolation> & linear_vec_y,
152 std::unique_ptr<SplineInterpolation> & spline_vec_l);
153
164void surrogateGenerator(std::vector<Real> & weighted_surrogate_index,
165 std::vector<Real> & unweighted_surrogate_index,
166 const std::vector<unsigned int> & node_number_vec,
167 const std::vector<Real> & index,
168 const std::vector<Real> & wt,
169 const unsigned int boundary_node_num,
170 const unsigned int i);
171
179bool needFlip(const std::vector<Point> & vec_pts_1, const std::vector<Point> & vec_pts_2);
180
193bool isBoundarySimpleClosedLoop(MeshBase & mesh,
194 Real & max_node_radius,
195 std::vector<dof_id_type> & boundary_ordered_node_list,
196 const Point origin_pt,
197 const boundary_id_type bid);
198
210bool isBoundarySimpleClosedLoop(MeshBase & mesh,
211 Real & max_node_radius,
212 const Point origin_pt,
213 const boundary_id_type bid);
214
224bool isBoundarySimpleClosedLoop(MeshBase & mesh, const Point origin_pt, const boundary_id_type bid);
225
236bool isBoundaryOpenSingleSegment(MeshBase & mesh,
237 Real & max_node_radius,
238 std::vector<dof_id_type> & boundary_ordered_node_list,
239 const Point origin_pt,
240 const boundary_id_type bid);
241
253bool isCurveSimpleClosedLoop(MeshBase & mesh,
254 Real & max_node_radius,
255 std::vector<dof_id_type> & ordered_node_list,
256 const Point origin_pt);
257
268bool isCurveSimpleClosedLoop(MeshBase & mesh, Real & max_node_radius, const Point origin_pt);
269
278bool isCurveSimpleClosedLoop(MeshBase & mesh, const Point origin_pt);
279
289bool isCurveOpenSingleSegment(MeshBase & mesh,
290 Real & max_node_radius,
291 std::vector<dof_id_type> & ordered_node_list,
292 const Point origin_pt);
293
309void isClosedLoop(MeshBase & mesh,
310 Real & max_node_radius,
311 std::vector<dof_id_type> & ordered_node_list,
312 std::vector<std::pair<dof_id_type, dof_id_type>> & node_assm,
313 std::vector<dof_id_type> & midpoint_node_list,
314 const Point origin_pt,
315 const std::string input_type,
316 bool & is_closed_loop,
317 const bool suppress_exception = false);
318
332void isClosedLoop(MeshBase & mesh,
333 Real & max_node_radius,
334 std::vector<dof_id_type> & ordered_node_list,
335 std::vector<std::pair<dof_id_type, dof_id_type>> & node_assm,
336 const Point origin_pt,
337 const std::string input_type,
338 bool & is_closed_loop,
339 const bool suppress_exception = false);
340
347bool isExternalBoundary(MeshBase & mesh, const boundary_id_type bid);
348
359bool buildQuadElement(Elem * elem,
360 Node * nd_0,
361 Node * nd_1,
362 Node * nd_2,
363 Node * nd_3,
364 const subdomain_id_type transition_layer_id);
365
375bool buildTriElement(Elem * elem,
376 Node * nd_0,
377 Node * nd_1,
378 Node * nd_2,
379 const subdomain_id_type transition_layer_id);
380}
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's azimuthal...
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.
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's azimuthal angles...
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.
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.
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.
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...
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.
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.
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...
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 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.