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"))),
35 _subdomain_ids(_mesh.getSubdomainIDs(getParam<
std::vector<SubdomainName>>(
"block")))
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.
static InputParameters validParams()
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
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.
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
virtual void snapNode(Node &node)=0
Override this method in derived classes to implement a specific geometry.
MooseMesh & _mesh
Reference to the current simulation mesh.
const std::vector< BoundaryID > _boundary_ids
List of boundaries (or node sets) from which nodes will be snapped to a geometry.
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.
static InputParameters validParams()
virtual void finalize() final
Finalize.
const std::vector< SubdomainID > _subdomain_ids
List of blocks (likely lower D blocks) from which nodes will be snapped to a geometry.
void snapNodes()
Snap all nodes from the specified block or boundary restriction to the derived-class-defined geometry...
MoveNodesToGeometryModifierBase(const InputParameters ¶meters)
virtual void execute() final
Execute method.