18#include "libmesh/numeric_vector.h"
19#include "libmesh/quadrature.h"
30 "An object that prepares MOOSE for computing nodal normal vectors. This object is "
31 "automatically created via the \\[NodalNormals\\] input block.");
33 "surface_boundary",
"The list of boundary IDs where nodal normals are computed");
34 params.
addParam<BoundaryName>(
"corner_boundary",
35 "Node set ID which contains the nodes that are in 'corners'.");
49 const std::vector<BoundaryID> & boundary_ids2)
51 for (
auto id1 : boundary_ids1)
56 for (
auto id2 : boundary_ids2)
65 _aux(_fe_problem.getAuxiliarySystem()),
66 _fe_type(getParam<Order>(
"fe_order"), getParam<FEFamily>(
"fe_family")),
67 _has_corners(isParamValid(
"corner_boundary")),
68 _boundaries(_mesh.getBoundaryIDs(getParam<
std::vector<BoundaryName>>(
"surface_boundary"))),
69 _corner_boundary_id(_has_corners
70 ? _mesh.getBoundaryID(getParam<BoundaryName>(
"corner_boundary"))
72 _grad_phi(_assembly.feGradPhi<Real>(_fe_type))
93 BoundaryInfo & boundary_info =
_mesh.
getMesh().get_boundary_info();
96 std::vector<BoundaryID> node_boundary_ids;
108 boundary_info.boundary_ids(node, node_boundary_ids);
154 for (
unsigned int qp = 0; qp <
_qrule->n_points(); qp++)
boundary_id_type BoundaryID
bool hasBoundary(const std::vector< BoundaryID > &boundary_ids1, const std::vector< BoundaryID > &boundary_ids2)
Local function to check to see if any intersection occurs between two vectors.
registerMooseObject("MooseApp", NodalNormalsPreprocessor)
virtual libMesh::System & system() override
Get the reference to the libMesh system.
static InputParameters validParams()
const QBase *const & _qrule
const Elem *const & _current_elem
The current element pointer (available during execute())
const MooseArray< Real > & _JxW
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
bool isBoundaryNode(dof_id_type node_id) const
Returns true if the requested node is in the list of boundary nodes, false otherwise.
unsigned int number() const
Get variable number coming from libMesh.
An ElementUserObject that prepares MOOSE for computing nodal normals.
NodalNormalsPreprocessor(const InputParameters ¶meters)
virtual void execute() override
Execute method.
AuxiliarySystem & _aux
Forces object to be stored as a block object.
BoundaryID _corner_boundary_id
static InputParameters validParams()
static std::mutex _nodal_normals_mutex
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void finalize() override
Finalize.
const VariablePhiGradient & _grad_phi
std::vector< BoundaryID > _boundaries
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
unsigned int number() const
Gets the number of this system.
NumericVector< Number > & solution()
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
const THREAD_ID _tid
Thread ID of this postprocessor.
void zero_variable(NumericVector< Number > &v, unsigned int var_num) const
const BoundaryID ANY_BOUNDARY_ID