https://mooseframework.inl.gov
PatchSidesetGenerator.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 #include "libmesh/replicated_mesh.h"
14 
15 // Forward declarations
16 
22 {
23 public:
25 
27 
28  std::unique_ptr<MeshBase> generate() override;
29 
30  unsigned int nPatches() const { return _n_patches; }
31 
32 protected:
34  std::vector<BoundaryName> sidesetNameHelper(const std::string & base_name) const;
35 
36  Elem * boundaryElementHelper(MeshBase & mesh, libMesh::ElemType type) const;
37 
39  void partition(MeshBase & mesh);
40 
45  void checkPartitionAndCompress(MeshBase & mesh);
46 
47  std::unique_ptr<MeshBase> & _input;
48 
50  unsigned int _dim;
51 
53  unsigned int _n_patches;
54 
56  const BoundaryName & _sideset_name;
57 
60 
63 
66 };
unsigned int _dim
dimensionality of the sidesets to partition
std::vector< BoundaryName > sidesetNameHelper(const std::string &base_name) const
returns the name of the _n_patches subdivisions derived from _sideset
Subdivides a sidesets into smaller patches each of which is going to be a new patch.
static InputParameters validParams()
dof_id_type _n_boundary_mesh_elems
number of elements of the boundary mesh
Elem * boundaryElementHelper(MeshBase &mesh, libMesh::ElemType type) const
std::unique_ptr< MeshBase > & _input
MooseEnum _partitioner_name
the name of the partitioner being used
const std::string & type() const
PatchSidesetGenerator(const InputParameters &parameters)
const BoundaryName & _sideset_name
The sideset that will be subdivided.
subdomain_id_type _sideset
The sideset that will be subdivided.
unsigned int _n_patches
the number of patches that this sideset generator divides _sideset into
void checkPartitionAndCompress(MeshBase &mesh)
Checks partitions and makes sure every partition has at least one elem.
const InputParameters & parameters() const
void partition(MeshBase &mesh)
a function for implementing custom partitioning
std::unique_ptr< MeshBase > generate() override
unsigned int nPatches() const
uint8_t dof_id_type