https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AdvancedExtruderGenerator.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
14#include "libmesh/point.h"
15
20{
21public:
23
25
26 std::unique_ptr<MeshBase> generate() override;
27
28protected:
30 std::unique_ptr<MeshBase> & _input;
31
33 const std::vector<Real> & _heights;
34
36 const std::vector<Real> _biases;
37
39 const std::vector<unsigned int> & _num_layers;
40
42 const std::vector<std::vector<subdomain_id_type>> & _subdomain_swaps;
43
45 const std::vector<std::vector<boundary_id_type>> & _boundary_swaps;
46
48 const std::vector<std::string> & _elem_integer_names_to_swap;
49 std::vector<unsigned int> _elem_integer_indices_to_swap;
50
52 const std::vector<std::vector<std::vector<dof_id_type>>> & _elem_integers_swaps;
53
55 std::vector<std::unordered_map<subdomain_id_type, subdomain_id_type>> _subdomain_swap_pairs;
56
58 std::vector<std::unordered_map<boundary_id_type, boundary_id_type>> _boundary_swap_pairs;
59
61 std::vector<std::unordered_map<dof_id_type, dof_id_type>> _elem_integers_swap_pairs;
62
65
66 // Attributes for extruding along a curve mesh of edges
68 std::unique_ptr<MeshBase> & _extrusion_curve;
70 const RealVectorValue _start_extrusion_direction;
72 const RealVectorValue _end_extrusion_direction;
75
77 const BoundaryName _top_boundary;
78
80 const BoundaryName _bottom_boundary;
81
83 const std::vector<std::vector<subdomain_id_type>> _upward_boundary_source_blocks;
84
86 const std::vector<std::vector<boundary_id_type>> _upward_boundary_ids;
87
89 const std::vector<std::vector<subdomain_id_type>> _downward_boundary_source_blocks;
90
92 const std::vector<std::vector<boundary_id_type>> _downward_boundary_ids;
93
95 const Real _twist_pitch;
96
97 // Radial transformation attributes
106
110 Real radialExpansionRatio(const Real t) const;
111};
Extrudes a mesh to another dimension.
const Real _twist_pitch
Axial pitch for a full rotation.
const std::vector< Real > & _heights
Height of each elevation.
const std::vector< std::vector< subdomain_id_type > > & _subdomain_swaps
Subdomains to swap out for each elevation.
const std::vector< unsigned int > & _num_layers
Number of layers in each elevation.
const RealVectorValue _end_extrusion_direction
Extrusion direction for the final layer of the extrusion.
std::vector< std::unordered_map< subdomain_id_type, subdomain_id_type > > _subdomain_swap_pairs
Easier to work with version of _sudomain_swaps.
const std::vector< std::vector< subdomain_id_type > > _upward_boundary_source_blocks
The list of input mesh's blocks that need to be assigned upward boundary interfaces for each layer of...
const Real _start_radial_growth_rate
Derivative of the radial expansion function at the beginning of the extrusion.
const RealVectorValue _start_extrusion_direction
Extrusion direction to follow at the start (first layer) of the extrusion.
Point _direction
The direction of the extrusion.
const std::vector< std::vector< boundary_id_type > > & _boundary_swaps
Boundaries to swap out for each elevation.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const std::vector< Real > _biases
Bias growth factor of each elevation.
const std::vector< std::vector< boundary_id_type > > _upward_boundary_ids
Upward boundary interfaces for each layer of elevation.
const std::vector< std::vector< boundary_id_type > > _downward_boundary_ids
Downward boundary interfaces for each layer of elevation.
const std::vector< std::vector< std::vector< dof_id_type > > > & _elem_integers_swaps
Extra element integers to swap out for each elevation and each element interger name.
static InputParameters validParams()
std::vector< std::unordered_map< boundary_id_type, boundary_id_type > > _boundary_swap_pairs
Easier to work with version of _boundary_swaps.
const Real _end_radial_extent
Radial extent of the extruded geometry at the end of the extrusion.
const std::vector< std::string > & _elem_integer_names_to_swap
Names and indices of extra element integers to swap.
bool _extrude_along_curve
Whether we are extruding along a curve.
const Real _end_radial_growth_rate
Derivative of the radial expansion function at the end of the extrusion.
const MooseEnum _radial_expansion_method
Function type for modifying the radial extent of the extruded shape.
Real radialExpansionRatio(const Real t) const
Calculate the share of the radial expansion to apply at the local node This share goes from 0 at the ...
const std::vector< std::vector< subdomain_id_type > > _downward_boundary_source_blocks
The list of input mesh's blocks that need to be assigned downward boundary interfaces for each layer ...
std::vector< unsigned int > _elem_integer_indices_to_swap
std::vector< std::unordered_map< dof_id_type, dof_id_type > > _elem_integers_swap_pairs
Easier to work with version of _elem_integers_swaps.
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
std::unique_ptr< MeshBase > & _extrusion_curve
Curve mesh to extrude along.
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
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55