16 params.
addClassDescription(
"This Auxkernel solves a least squares problem at each node to fit a " 17 "value from quantities defined on quadrature points.");
19 "nodal_patch_recovery_uo",
20 "The name of the userobject that sets up the least squares problem of the nodal patch.");
36 auto node_to_elem_pair = node_to_elem_map.find(
_current_node->id());
37 mooseAssert(node_to_elem_pair != node_to_elem_map.end(),
"Missing entry in node to elem map");
46 for (
auto & n :
_mesh.
elemPtr(elem_id)->node_ref_range())
48 node_to_elem_pair = node_to_elem_map.find(n.id());
49 std::vector<dof_id_type> elem_ids_candidate = node_to_elem_pair->second;
50 if (elem_ids_candidate.size() >
_elem_ids.size())
52 std::vector<dof_id_type> elem_ids_candidate_restricted;
55 if (elem_ids_candidate_restricted.size() >
_elem_ids.size())
56 _elem_ids = elem_ids_candidate_restricted;
67 std::vector<dof_id_type> & elem_ids,
68 const std::vector<dof_id_type> & node_to_elem_pair_elems)
const 71 for (
auto elem_id : node_to_elem_pair_elems)
73 for (
const auto block_id :
blockIDs())
75 elem_ids.push_back(elem_id);
78 elem_ids = node_to_elem_pair_elems;
void blockRestrictElements(std::vector< dof_id_type > &elem_ids, const std::vector< dof_id_type > &node_to_elem_pair_elems) const
Block restrict elements on which to perform the variable/property nodal recovery. ...
virtual Elem * elemPtr(const dof_id_type i)
MooseMesh & _mesh
Mesh this kernel is active on.
const Node *const & _current_node
Current node (valid only for nodal kernels)
virtual const std::set< SubdomainID > & blockIDs() const
Return the block subdomain ids for this object Note, if this is not block restricted, this function returns all mesh subdomain ids.
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
std::vector< dof_id_type > _elem_ids
local patch of elements used for recovery
static InputParameters validParams()
const std::string & name() const
Get the name of the class.
NodalPatchRecoveryAuxBase(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue() override
Compute and return the value of the aux variable.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
static InputParameters validParams()
virtual Real nodalPatchRecovery()=0
Override this to get the fitted value from a Nodal Patch Recovery User Object.
bool isNodal() const
Nodal or elemental kernel?
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()
If not already created, creates a map from every node to all elements to which they are connected...