www.mooseframework.org
MeshExtruder.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MESHEXTRUDER_H
16 #define MESHEXTRUDER_H
17 
18 #include "MeshModifier.h"
19 #include "libmesh/mesh_generation.h"
20 
21 class MeshExtruder;
22 
23 template <>
25 
26 class MeshExtruder : public MeshModifier
27 {
28 public:
30 
31 protected:
32  virtual void modify() override;
33 
35  unsigned int _num_layers;
36  std::vector<SubdomainID> _existing_subdomains;
37  std::vector<unsigned int> _layers;
38  std::vector<unsigned int> _new_ids;
39 
44  class QueryElemSubdomainID : public MeshTools::Generation::QueryElemSubdomainIDBase
45  {
46  public:
47  QueryElemSubdomainID(std::vector<SubdomainID> existing_subdomains,
48  std::vector<unsigned int> layers,
49  std::vector<unsigned int> new_ids,
50  unsigned int num_layers);
51 
53  virtual subdomain_id_type get_subdomain_for_layer(const Elem * old_elem, unsigned int layer);
54 
55  private:
57  std::map<unsigned int, std::map<SubdomainID, unsigned int>> _layer_data;
58 
61 #ifndef NDEBUG
62  unsigned int _num_layers;
63 #endif
64  };
65 
66 private:
67  void changeID(const std::vector<BoundaryName> & names, BoundaryID old_id);
68 };
69 
70 #endif /* MESHEXTRUDER_H */
VectorValue< Real > RealVectorValue
Definition: Assembly.h:40
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:31
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...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void changeID(const std::vector< BoundaryName > &names, BoundaryID old_id)
Definition: MeshExtruder.C:122
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.
Definition: MeshExtruder.h:57
std::vector< SubdomainID > _existing_subdomains
Definition: MeshExtruder.h:36
const RealVectorValue _extrusion_vector
Definition: MeshExtruder.h:34
InputParameters validParams< MeshExtruder >()
Definition: MeshExtruder.C:25
std::vector< unsigned int > _layers
Definition: MeshExtruder.h:37
unsigned int _num_layers
The total number of layers in the extrusion.
Definition: MeshExtruder.h:62
This class is used during the mesh construction (extrusion) to set element ids as they are created...
Definition: MeshExtruder.h:44
virtual void modify() override
Pure virtual modify function MUST be overridden by children classes.
Definition: MeshExtruder.C:70
std::vector< unsigned int > _new_ids
Definition: MeshExtruder.h:38
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
QueryElemSubdomainID(std::vector< SubdomainID > existing_subdomains, std::vector< unsigned int > layers, std::vector< unsigned int > new_ids, unsigned int num_layers)
Definition: MeshExtruder.C:136
unsigned int _num_layers
Definition: MeshExtruder.h:35
MeshExtruder(const InputParameters &parameters)
Definition: MeshExtruder.C:54
boundary_id_type BoundaryID
Definition: MooseTypes.h:75