Go to the documentation of this file.
15 #include "libmesh/mesh_generation.h"
16 #include "libmesh/mesh.h"
17 #include "libmesh/string_to_enum.h"
18 #include "libmesh/quadrature_gauss.h"
19 #include "libmesh/point_locator_base.h"
20 #include "libmesh/elem.h"
21 #include "libmesh/fe_base.h"
34 "Adds a new named sideset to the mesh for all faces matching the specified normal.");
36 "The name of the boundary to create");
38 "normals",
"A list of normals for which to start painting sidesets");
50 mooseError(
"normal list and boundary list are not the same length");
55 mooseAssert(normal.norm() >= 1e-5,
"Normal is zero");
56 normal /= normal.norm();
64 mooseError(
"_mesh_ptr must be initialized before calling SideSetsFromNormals::modify()!");
78 for (
unsigned int side = 0; side < elem->n_sides(); ++side)
80 if (elem->neighbor_ptr(side))
84 const std::vector<Point> & normals =
_fe_face->get_normals();
86 for (
unsigned int i = 0; i < boundary_ids.size(); ++i)
96 for (
unsigned int i = 0; i < boundary_ids.size(); ++i)
registerMooseObjectReplaced("MooseApp", SideSetsFromNormals, "11/30/2019 00:00", SideSetsFromNormalsGenerator)
void finalize()
This method finalizes the object, setting names back in the boundary_info object and releasing memory...
void mooseError(Args &&... args) const
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
void setup()
This method is used to construct the FE object so we can compute normals of faces.
SideSetsFromNormals(const InputParameters ¶meters)
std::map< BoundaryID, std::set< const Elem * > > _visited
InputParameters validParams< AddSideSetsBase >()
MooseMesh * _mesh_ptr
Pointer to the mesh.
void flood(const Elem *elem, Point normal, BoundaryID side_id)
This method implements a recursive flood routine to paint a sideset of mesh to neighboring faces give...
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
virtual void modify() override
Pure virtual modify function MUST be overridden by children classes.
std::vector< Point > _normals
InputParameters validParams< SideSetsFromNormals >()
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side.
std::vector< BoundaryName > _boundary_names
std::unique_ptr< FEBase > _fe_face
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.