14#include "libmesh/fe.h"
15#include "libmesh/string_to_enum.h"
27 params.
addClassDescription(
"Creates Auxiliary variables and objects for computing the outward "
28 "facing normal from a node.");
31 params.
addParam<std::vector<BoundaryName>>(
34 "The boundary ID or name where the normals will be computed");
35 params.
addParam<BoundaryName>(
"corner_boundary",
"boundary ID or name with nodes at 'corners'");
36 MooseEnum orders(
"FIRST SECOND",
"FIRST");
39 "Specifies the order of variables that hold the "
40 "nodal normals. Needs to match the order of the "
48 _boundary(getParam<
std::vector<BoundaryName>>(
"boundary")),
49 _has_corners(isParamValid(
"corner_boundary")),
50 _corner_boundary(_has_corners ? getParam<BoundaryName>(
"corner_boundary") : BoundaryName())
58 auto enum_order = getParam<MooseEnum>(
"order");
59 Order order = Utility::string_to_enum<Order>(enum_order);
62 auto var_params =
_factory.getValidParams(
"MooseVariable");
63 var_params.set<
MooseEnum>(
"family") =
"LAGRANGE";
64 var_params.set<
MooseEnum>(
"order") = enum_order;
69 _problem->addAuxVariable(
"MooseVariable",
"nodal_normal_x", var_params);
70 _problem->addAuxVariable(
"MooseVariable",
"nodal_normal_y", var_params);
71 _problem->addAuxVariable(
"MooseVariable",
"nodal_normal_z", var_params);
85 pars.
set<std::vector<BoundaryName>>(
"surface_boundary") =
_boundary;
90 _problem->addUserObject(
"NodalNormalsPreprocessor",
"nodal_normals_preprocessor", pars);
100 pars.
set<std::vector<BoundaryName>>(
"boundary") =
_boundary;
102 _problem->addUserObject(
"NodalNormalsCorner",
"nodal_normals_corner", pars);
109 pars.
set<std::vector<BoundaryName>>(
"boundary") =
_boundary;
110 _problem->addUserObject(
"NodalNormalsEvaluator",
"nodal_normals_evaluator", pars);
registerMooseAction("MooseApp", AddNodalNormalsAction, "add_aux_variable")
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_INITIAL
static InputParameters validParams()
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const std::string & _current_task
The current action (even though we have separate instances for each action)
Action to setup computation of nodal normals.
bool _has_corners
Flag for testing the existance of the corner boundary input.
AddNodalNormalsAction(const InputParameters ¶meters)
static InputParameters validParams()
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
std::vector< BoundaryName > _boundary
The supplied boundary name from the user.
BoundaryName _corner_boundary
The supplied boundary name for the corner boundary.
A MultiMooseEnum object to hold "execute_on" flags.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Factory & _factory
The Factory associated with the MooseApp.
ExecFlagEnum getDefaultExecFlagEnum()
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...