12 #include "libmesh/mesh_base.h" 19 "Snap refined nodes on a given boundary or block to a given geometry.");
20 params.
addParam<std::vector<BoundaryName>>(
21 "boundary", {},
"List of boundaries whose nodes are snapped to a given geometry");
22 params.
addParam<std::vector<SubdomainName>>(
23 "block", {},
"List of blocks whose nodes are snapped to a given geometry");
33 _mesh(_subproblem.
mesh()),
34 _boundary_ids(_mesh.
getBoundaryIDs(getParam<
std::vector<BoundaryName>>(
"boundary"))),
70 for (
auto & node_id : node_ids)
72 auto & node =
mesh.node_ref(node_id);
79 MeshBase::node_iterator node =
mesh.active_nodes_begin();
80 MeshBase::node_iterator node_end =
mesh.active_nodes_end();
81 for (; node != node_end; ++node)
86 if (node_blocks.count(subdomain_id))
A MultiMooseEnum object to hold "execute_on" flags.
virtual void snapNode(Node &node)=0
Override this method in derived classes to implement a specific geometry.
static InputParameters validParams()
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
std::vector< subdomain_id_type > getSubdomainIDs(const libMesh::MeshBase &mesh, const std::vector< SubdomainName > &subdomain_name)
Get the associated subdomainIDs for the subdomain names that are passed in.
void snapNodes()
Snap all nodes from the specified block or boundary restriction to the derived-class-defined geometry...
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
virtual void finalize() final
Finalize.
const std::vector< dof_id_type > & getNodeList(boundary_id_type nodeset_id) const
Return a writable reference to a vector of node IDs that belong to nodeset_id.
std::vector< BoundaryID > getBoundaryIDs(const libMesh::MeshBase &mesh, const std::vector< BoundaryName > &boundary_name, bool generate_unknown, const std::set< BoundaryID > &mesh_boundary_ids)
Gets the boundary IDs with their names.
static InputParameters validParams()
MooseMesh & _mesh
Reference to the current simulation mesh.
virtual void initialize() final
Called before execute() is ever called so that data can be cleared.
virtual void meshChanged() final
Called on this object when the mesh changes.
MoveNodesToGeometryModifierBase(const InputParameters ¶meters)
const std::vector< SubdomainID > _subdomain_ids
List of blocks (likely lower D blocks) from which nodes will be snapped to a geometry.
const std::vector< BoundaryID > _boundary_ids
List of boundaries (or node sets) from which nodes will be snapped to a geometry. ...
virtual void execute() final
Execute method.