39 void flood(Elem *
const elem,
41 const Elem & starting_elem,
65 const Point & desired_normal,
66 const Elem & base_elem,
67 const Point & face_normal)
const;
113 std::unordered_map<subdomain_id_type, std::unordered_set<Elem *>>
_visited;
void setup(MeshBase &mesh)
Sets up various data structures.
std::unordered_map< subdomain_id_type, std::unordered_set< Elem * > > _visited
Map used for the flooding algorithm to keep track of which elements have been visited for which subdo...
void flood(Elem *const elem, const Point &normal, const Elem &starting_elem, const subdomain_id_type &sub_id, MeshBase &mesh)
This method implements a recursive flood routine to paint (applying an operation) to elements on mesh...
const Real _normal_tol
Tolerance to group elements with normals such that face_normal.normal_hat <= 1 - normal_tol where nor...
bool _using_normal
true if only elements are only considered when their normal is close to either the "_normal" or a mov...
const InputParameters & parameters() const
Get the parameters of the object.
SurfaceMeshGeneratorBase(const InputParameters ¶meters)
const bool _flip_inverted_normals
Whether to flip the normal of a surface element when they meet the criterion.
std::vector< SubdomainName > _subdomain_names
The list of new subdomain names (useful for adding subdomains)
Point get2DElemNormal(const Elem *const elem) const
Get the normal of the 2D element.
virtual void actOnElem(Elem *const elem, const Point &normal, const subdomain_id_type &sub_id, MeshBase &mesh)=0
Action to perform when flooding.
unsigned int _flood_recursion_count
Current tally for the number of flood routine calls active.
const bool _check_painted_neighor_normals
Additional heuristic: check the element neighbors and if they have already been painted with the subd...
const Real _flipped_normal_tol
Tolerance but when using the flipped normal.
std::unordered_map< subdomain_id_type, Real > _max_elem_distance
Distance to use for max painting radius. This distance can be specified per subdomain.
Point _normal
if specified, then surface elements are only considered if their normal is close to this ...
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _consider_flipped_normals
Whether to also consider surface elements that have a flipped normal.
const bool _has_max_distance_criterion
Whether to painting beyond a certain radius.
const unsigned int _flood_max_recursion
Maximum amount of calls to the flood routine at once.
const bool _check_subdomains
whether to check the prior subdomain id of the element when choosing whether to change its subdomain ...
bool _flood_only_once
Only act on each element once.
std::unordered_set< Elem * > _acted_upon_once
Set used when flooding each element once. If the element pointer is in the set, it has been visited a...
const bool _fixed_flooding_normal
Whether to paint/flood using a fixed normal or a moving normal.
MeshGenerators are objects that can modify or add to an existing mesh.
std::unique_ptr< MeshBase > & _input
the mesh to add the subdomains to
std::vector< subdomain_id_type > _included_subdomain_ids
A list of included subdomain ids that the element has to be priorly a part of, extracted from the 'in...
bool elementSatisfiesRequirements(const Elem *const elem, const Point &desired_normal, const Elem &base_elem, const Point &face_normal) const
Determines whether the given element satisfies a set of criteria that are defined in this base class...