https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FillBetweenPointVectorsGenerator.C
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
12
14
17{
19 params.addRequiredParam<std::vector<Point>>("positions_vector_1",
20 "Array of the node positions of the first boundary.");
21 params.addRequiredParam<std::vector<Point>>(
22 "positions_vector_2", "Array of the node positions of the second boundary.");
23 params.addRequiredRangeCheckedParam<unsigned int>(
24 "num_layers", "num_layers>0", "Layers of elements for transition.");
25 params.addParam<subdomain_id_type>("block_id", 1, "ID to be assigned to the block.");
26 params.addParam<boundary_id_type>(
27 "input_boundary_1_id",
28 10000,
29 "Boundary ID to be assigned to the boundary defined by positions_vector_1.");
30 params.addParam<boundary_id_type>(
31 "input_boundary_2_id",
32 10000,
33 "Boundary ID to be assigned to the boundary defined by positions_vector_2.");
34 params.addParam<boundary_id_type>("begin_side_boundary_id",
35 10000,
36 "Boundary ID to be assigned to the boundary connecting "
37 "starting points of the positions_vectors.");
38 params.addParam<boundary_id_type>("end_side_boundary_id",
39 10000,
40 "Boundary ID to be assigned to the boundary connecting ending "
41 "points of the positions_vectors.");
42 params.addParam<bool>(
43 "use_quad_elements",
44 false,
45 "Whether QUAD4 instead of TRI3 elements are used to construct the transition layer.");
46 params.addRangeCheckedParam<Real>(
47 "bias_parameter",
48 1.0,
49 "bias_parameter>=0",
50 "Parameter used to set up biasing of the layers: bias_parameter > 0.0 is used as the biasing "
51 "factor; bias_parameter = 0.0 activates automatic biasing based on local node density on "
52 "both input boundaries.");
53 params.addRangeCheckedParam<Real>(
54 "gaussian_sigma",
55 3.0,
56 "gaussian_sigma>0.0",
57 "Gaussian parameter used to smoothen local node density for automatic biasing; this "
58 "parameter is not used if other biasing option is selected.");
60 "This FillBetweenPointVectorsGenerator object is designed to generate a "
61 "transition layer with two sides containing different numbers of nodes.");
62 return params;
63}
64
66 const InputParameters & parameters)
67 : MeshGenerator(parameters),
68 _positions_vector_1(getParam<std::vector<Point>>("positions_vector_1")),
69 _positions_vector_2(getParam<std::vector<Point>>("positions_vector_2")),
70 _num_layers(getParam<unsigned int>("num_layers")),
71 _block_id(getParam<subdomain_id_type>("block_id")),
72 _input_boundary_1_id(getParam<boundary_id_type>("input_boundary_1_id")),
73 _input_boundary_2_id(getParam<boundary_id_type>("input_boundary_2_id")),
74 _begin_side_boundary_id(getParam<boundary_id_type>("begin_side_boundary_id")),
75 _end_side_boundary_id(getParam<boundary_id_type>("end_side_boundary_id")),
76 _use_quad_elements(getParam<bool>("use_quad_elements")),
77 _bias_parameter(getParam<Real>("bias_parameter")),
78 _sigma(getParam<Real>("gaussian_sigma"))
79{
80}
81
82std::unique_ptr<MeshBase>
registerMooseObject("MooseApp", FillBetweenPointVectorsGenerator)
void ErrorVector unsigned int
This FillBetweenPointVectorsGenerator object is designed to generate a transition layer with two side...
const std::vector< Point > _positions_vector_2
Vector of Points of the second side.
FillBetweenPointVectorsGenerator(const InputParameters &parameters)
const bool _use_quad_elements
A boolean parameter to determine whether QUAD4 elements are used instead of TRI3 elements.
const Real _sigma
Gaussian parameter used to smoothen local node density using Gaussian blurring.
const Real _bias_parameter
A parameter used to set up mesh biasing of the layers.
const boundary_id_type _input_boundary_1_id
ID to be assigned to the boundary that corresponds to positions_vector_1.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const boundary_id_type _begin_side_boundary_id
ID to be assigned to the boundary that connects the starting points of positions_vectors.
const boundary_id_type _input_boundary_2_id
ID to be assigned to the boundary that corresponds to positions_vector_2.
const boundary_id_type _end_side_boundary_id
ID to be assigned to the boundary that connects the ending points of positions_vectors.
const unsigned int _num_layers
Number of sublayers of the mesh to be generated.
const subdomain_id_type _block_id
Subdomain ID to be assigned to the generated transition layer.
const std::vector< Point > _positions_vector_1
Vector of Points of the first side.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
These methods add an range checked parameters.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
MeshGenerators are objects that can modify or add to an existing mesh.
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh(unsigned int dim=libMesh::invalid_uint)
Build a replicated mesh.
static InputParameters validParams()
const std::string & _type
The type of this class.
Definition MooseBase.h:378
const std::string & _name
The name of this class.
Definition MooseBase.h:381
MeshBase & mesh
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)