https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshExtruderGenerator.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/mesh_generation.h"
15
20{
21public:
23
25
26 std::unique_ptr<MeshBase> generate() override;
27
28protected:
30 std::unique_ptr<MeshBase> & _input;
31
32 const RealVectorValue _extrusion_vector;
33 unsigned int _num_layers;
34 std::vector<SubdomainID> _existing_subdomains;
35 std::vector<unsigned int> _layers;
36 std::vector<unsigned int> _new_ids;
37
42 class QueryElemSubdomainID : public MeshTools::Generation::QueryElemSubdomainIDBase
43 {
44 public:
45 QueryElemSubdomainID(const std::vector<SubdomainID> & existing_subdomains,
46 std::vector<unsigned int> layers,
47 const std::vector<unsigned int> & new_ids,
48 unsigned int num_layers);
49
51 virtual subdomain_id_type get_subdomain_for_layer(const Elem * old_elem, unsigned int layer);
52
53 private:
55 std::map<unsigned int, std::map<SubdomainID, unsigned int>> _layer_data;
56
58 unsigned int _num_layers;
59 };
60
61private:
62 void changeID(MeshBase & mesh, const std::vector<BoundaryName> & names, BoundaryID old_id);
63};
boundary_id_type BoundaryID
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
This class is used during the mesh construction (extrusion) to set element ids as they are created.
virtual subdomain_id_type get_subdomain_for_layer(const Elem *old_elem, unsigned int layer)
The override from the base class for obtaining a new id based on the old (original) element and the s...
std::map< unsigned int, std::map< SubdomainID, unsigned int > > _layer_data
Data structure for holding the old -> new id mapping based on the layer number.
unsigned int _num_layers
The total number of layers in the extrusion.
Extrude a 1D or 2D mesh to a 2D or 3D mesh respectively.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
std::vector< unsigned int > _new_ids
const RealVectorValue _extrusion_vector
static InputParameters validParams()
std::vector< SubdomainID > _existing_subdomains
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
void changeID(MeshBase &mesh, const std::vector< BoundaryName > &names, BoundaryID old_id)
std::vector< unsigned int > _layers
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