www.mooseframework.org
Public Member Functions | Public Attributes | Protected Attributes | List of all members
AddNodalNormalsAction Class Reference

Action to setup computation of nodal normals. More...

#include <AddNodalNormalsAction.h>

Inheritance diagram for AddNodalNormalsAction:
[legend]

Public Member Functions

 AddNodalNormalsAction (InputParameters parameters)
 
virtual void act () override
 
const std::string & name () const
 The name of the action. More...
 
const std::string & type () const
 
InputParametersparameters ()
 
const InputParametersparameters () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
bool isParamValid (const std::string &name) const
 
void appendTask (const std::string &task)
 
std::string getBaseName () const
 Deprecated name methods, use name() More...
 
std::string getShortName () const
 DEPRECATED METHODS. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Attributes

std::vector< BoundaryName > _boundary
 The supplied boundary name from the user. More...
 
bool _has_corners
 Flag for testing the existance of the corner boundary input. More...
 
BoundaryName _corner_boundary
 The supplied boundary name for the corner boundary. More...
 
InputParameters _pars
 Input parameters for the action. More...
 
std::string _registered_identifier
 
std::string _name
 The name of the action. More...
 
std::string _action_type
 
MooseApp_app
 The MOOSE application this is associated with. More...
 
Factory_factory
 The Factory associated with the MooseApp. More...
 
ActionFactory_action_factory
 Builds Actions. More...
 
std::string _specific_task_name
 This member will only be populated if this Action instance is only designed to handle one task. More...
 
std::set< std::string > _all_tasks
 A list of all the tasks that this Action will satisfy. More...
 
ActionWarehouse_awh
 Reference to ActionWarehouse where we store object build by actions. More...
 
const std::string & _current_task
 The current action (even though we have seperate instances for each action) More...
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 Convenience reference to a problem this action works on. More...
 
std::shared_ptr< Executioner > & _executioner
 Convenience reference to an executioner. More...
 

Detailed Description

Action to setup computation of nodal normals.

The machinery behind the normal computation is the following:

NOTE: the auxiliary system has to have at least one variable on it, so that the vectors for nx, ny and nz have non-zero length.

Definition at line 38 of file AddNodalNormalsAction.h.

Constructor & Destructor Documentation

AddNodalNormalsAction::AddNodalNormalsAction ( InputParameters  parameters)

Definition at line 43 of file AddNodalNormalsAction.C.

44  : Action(parameters),
45  _boundary(getParam<std::vector<BoundaryName>>("boundary")),
46  _has_corners(isParamValid("corner_boundary")),
47  _corner_boundary(_has_corners ? getParam<BoundaryName>("corner_boundary") : BoundaryName())
48 {
49 }
std::vector< BoundaryName > _boundary
The supplied boundary name from the user.
bool _has_corners
Flag for testing the existance of the corner boundary input.
Action(InputParameters parameters)
Definition: Action.C:51
bool isParamValid(const std::string &name) const
Definition: Action.h:80
BoundaryName _corner_boundary
The supplied boundary name for the corner boundary.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: Action.h:139

Member Function Documentation

void AddNodalNormalsAction::act ( )
overridevirtual

Create the NodalNormalsCorner UserObject (only if corner boundary is given)

Create the NodalNormalsEvaluator UserObject

Implements Action.

Definition at line 52 of file AddNodalNormalsAction.C.

53 {
54  // Set the order from the input
55  Order order = Utility::string_to_enum<Order>(getParam<MooseEnum>("order"));
56  FEFamily family = LAGRANGE;
57  FEType fe_type(order, family);
58 
59  // Add 3 aux variables for each component of the normal
60  if (_current_task == "add_aux_variable")
61  {
62  _problem->addAuxVariable("nodal_normal_x", fe_type);
63  _problem->addAuxVariable("nodal_normal_y", fe_type);
64  _problem->addAuxVariable("nodal_normal_z", fe_type);
65  }
66 
67  // Set the execute options
69  execute_options = "initial timestep_begin";
70 
71  // Create the NodalNormalsPreprocessor UserObject
72  if (_current_task == "add_postprocessor")
73  {
74  InputParameters pars = _factory.getValidParams("NodalNormalsPreprocessor");
75  pars.set<Order>("fe_order") = order;
76  pars.set<FEFamily>("fe_family") = family;
77  pars.set<MultiMooseEnum>("execute_on") = execute_options;
78  pars.set<std::vector<BoundaryName>>("surface_boundary") = _boundary;
79 
80  if (_has_corners)
81  pars.set<BoundaryName>("corner_boundary") = _corner_boundary;
82 
83  _problem->addUserObject("NodalNormalsPreprocessor", "nodal_normals_preprocessor", pars);
84  }
85 
86  if (_current_task == "add_user_object")
87  {
89  if (_has_corners)
90  {
91  InputParameters pars = _factory.getValidParams("NodalNormalsCorner");
92  pars.set<MultiMooseEnum>("execute_on") = execute_options;
93  pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
94  pars.set<BoundaryName>("corner_boundary") = _corner_boundary;
95  _problem->addUserObject("NodalNormalsCorner", "nodal_normals_corner", pars);
96  }
97 
99  {
100  InputParameters pars = _factory.getValidParams("NodalNormalsEvaluator");
101  pars.set<MultiMooseEnum>("execute_on") = execute_options;
102  pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
103  _problem->addUserObject("NodalNormalsEvaluator", "nodal_normals_evaluator", pars);
104  }
105  }
106 }
std::vector< BoundaryName > _boundary
The supplied boundary name from the user.
bool _has_corners
Flag for testing the existance of the corner boundary input.
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
Definition: Factory.C:26
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Factory & _factory
The Factory associated with the MooseApp.
Definition: Action.h:101
const std::string & _current_task
The current action (even though we have seperate instances for each action)
Definition: Action.h:125
BoundaryName _corner_boundary
The supplied boundary name for the corner boundary.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
Definition: Action.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static MultiMooseEnum getExecuteOptions()
Returns the available options for the &#39;execute_on&#39; input parameters.
void Action::appendTask ( const std::string &  task)
inlineinherited

Definition at line 82 of file Action.h.

82 { _all_tasks.insert(task); }
std::set< std::string > _all_tasks
A list of all the tasks that this Action will satisfy.
Definition: Action.h:119
const std::set<std::string>& Action::getAllTasks ( ) const
inlineinherited

Definition at line 68 of file Action.h.

Referenced by AddKernelAction::act().

68 { return _all_tasks; }
std::set< std::string > _all_tasks
A list of all the tasks that this Action will satisfy.
Definition: Action.h:119
std::string Action::getBaseName ( ) const
inherited

Deprecated name methods, use name()

Definition at line 82 of file Action.C.

Referenced by Action::name().

83 {
84  mooseDeprecated("getBaseName() is deprecated.");
86 }
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
std::string _name
The name of the action.
Definition: Action.h:92
std::string baseName(const std::string &name)
Function for string the information before the final / in a parser block.
Definition: MooseUtils.C:331
template<typename T >
const T & Action::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 139 of file Action.h.

Referenced by CreateDisplacedProblemAction::act(), AddPeriodicBCAction::act(), AddPeriodicBCAction::autoTranslationBoundaries(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), Action::getAllTasks(), and MooseApp::getCheckpointFiles().

140 {
141  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
142 }
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
InputParameters _pars
Input parameters for the action.
Definition: Action.h:86
const std::string & name() const
The name of the action.
Definition: Action.h:51
std::string Action::getShortName ( ) const
inherited

DEPRECATED METHODS.

Definition at line 75 of file Action.C.

Referenced by Action::name().

76 {
77  mooseDeprecated("getShortName() is deprecated.");
79 }
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
std::string shortName(const std::string &name)
Function for stripping name after the file / in parser block.
Definition: MooseUtils.C:325
std::string _name
The name of the action.
Definition: Action.h:92
bool Action::isParamValid ( const std::string &  name) const
inlineinherited

Definition at line 80 of file Action.h.

Referenced by CopyNodalVarsAction::act(), SetAdaptivityOptionsAction::act(), CreateProblemAction::act(), SetupMeshAction::act(), CreateDisplacedProblemAction::act(), AddAuxVariableAction::act(), AddVariableAction::act(), AddVariableAction::addVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), DynamicObjectRegistrationAction::DynamicObjectRegistrationAction(), and SetupMeshAction::setupMesh().

80 { return _pars.isParamValid(name); }
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
InputParameters _pars
Input parameters for the action.
Definition: Action.h:86
const std::string & name() const
The name of the action.
Definition: Action.h:51
const std::string& Action::name ( ) const
inlineinherited
InputParameters& Action::parameters ( )
inlineinherited

Definition at line 63 of file Action.h.

Referenced by GlobalParamsAction::remove(), GlobalParamsAction::setDoubleIndexParam(), GlobalParamsAction::setScalarParam(), and GlobalParamsAction::setVectorParam().

63 { return _pars; }
InputParameters _pars
Input parameters for the action.
Definition: Action.h:86
const InputParameters& Action::parameters ( ) const
inlineinherited

Definition at line 64 of file Action.h.

64 { return _pars; }
InputParameters _pars
Input parameters for the action.
Definition: Action.h:86
const std::string& Action::specificTaskName ( ) const
inlineinherited

Definition at line 66 of file Action.h.

66 { return _specific_task_name; }
std::string _specific_task_name
This member will only be populated if this Action instance is only designed to handle one task...
Definition: Action.h:112
const std::string& Action::type ( ) const
inlineinherited

Definition at line 61 of file Action.h.

Referenced by CommonOutputAction::hasConsole().

61 { return _action_type; }
std::string _action_type
Definition: Action.h:95

Member Data Documentation

ActionFactory& Action::_action_factory
protectedinherited
std::string Action::_action_type
protectedinherited

Definition at line 95 of file Action.h.

Referenced by Action::type().

std::set<std::string> Action::_all_tasks
protectedinherited

A list of all the tasks that this Action will satisfy.

Note: That this is not populated at construction time. However, all tasks will be added prior to act().

Definition at line 119 of file Action.h.

Referenced by Action::appendTask(), and Action::getAllTasks().

MooseApp& Action::_app
protectedinherited
ActionWarehouse& Action::_awh
protectedinherited
std::vector<BoundaryName> AddNodalNormalsAction::_boundary
protected

The supplied boundary name from the user.

Definition at line 47 of file AddNodalNormalsAction.h.

Referenced by act().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), DT2::rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), DT2::step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

BoundaryName AddNodalNormalsAction::_corner_boundary
protected

The supplied boundary name for the corner boundary.

Definition at line 53 of file AddNodalNormalsAction.h.

Referenced by act().

const std::string& Action::_current_task
protectedinherited

The current action (even though we have seperate instances for each action)

Definition at line 125 of file Action.h.

Referenced by AddKernelAction::act(), CopyNodalVarsAction::act(), AddScalarKernelAction::act(), SetupMeshAction::act(), SetupMeshCompleteAction::act(), MaterialDerivativeTestAction::act(), and act().

std::shared_ptr<MooseMesh>& Action::_displaced_mesh
protectedinherited
std::shared_ptr<Executioner>& Action::_executioner
protectedinherited

Convenience reference to an executioner.

Definition at line 134 of file Action.h.

Referenced by SetupPredictorAction::act(), and SetupTimeStepperAction::act().

Factory& Action::_factory
protectedinherited
bool AddNodalNormalsAction::_has_corners
protected

Flag for testing the existance of the corner boundary input.

Definition at line 50 of file AddNodalNormalsAction.h.

Referenced by act().

std::shared_ptr<MooseMesh>& Action::_mesh
protectedinherited
std::string Action::_name
protectedinherited
InputParameters Action::_pars
protectedinherited
std::shared_ptr<FEProblemBase>& Action::_problem
protectedinherited

Convenience reference to a problem this action works on.

Definition at line 131 of file Action.h.

Referenced by AddBCAction::act(), AddBoundsVectorsAction::act(), AddInitialConditionAction::act(), AddDiracKernelAction::act(), CopyNodalVarsAction::act(), CreateExecutionerAction::act(), AddKernelAction::act(), AddMultiAppAction::act(), AddElementalFieldAction::act(), AddIndicatorAction::act(), AddICAction::act(), AddNodalKernelAction::act(), SetupDampersAction::act(), AddMaterialAction::act(), AddDamperAction::act(), CheckIntegrityAction::act(), AddDGKernelAction::act(), AddInterfaceKernelAction::act(), AddMarkerAction::act(), AddTransferAction::act(), AddPostprocessorAction::act(), InitProblemAction::act(), SetAdaptivityOptionsAction::act(), AddScalarKernelAction::act(), AddVectorPostprocessorAction::act(), AddUserObjectAction::act(), AddConstraintAction::act(), AddFieldSplitAction::act(), CreateProblemAction::act(), AdaptivityAction::act(), SetupPreconditionerAction::act(), SetupPredictorAction::act(), AddFunctionAction::act(), SetupTimeIntegratorAction::act(), SetupTimeStepperAction::act(), CreateDisplacedProblemAction::act(), AddDistributionAction::act(), SetupResidualDebugAction::act(), MaterialDerivativeTestAction::act(), SetupQuadratureAction::act(), AddSamplerAction::act(), AddAuxVariableAction::act(), AddOutputAction::act(), AddPeriodicBCAction::act(), AddControlAction::act(), MaterialOutputAction::act(), SetupPostprocessorDataAction::act(), act(), AddVariableAction::addVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), CheckOutputAction::checkMaterialOutput(), AddVariableAction::getSubdomainIDs(), and AddPeriodicBCAction::setPeriodicVars().

std::string Action::_registered_identifier
protectedinherited

Definition at line 89 of file Action.h.

std::string Action::_specific_task_name
protectedinherited

This member will only be populated if this Action instance is only designed to handle one task.

This happens when an Action is registered with several pieces of syntax in which case separate instances are built to handle the different incoming parameter values.

Definition at line 112 of file Action.h.

Referenced by Action::specificTaskName().


The documentation for this class was generated from the following files: