www.mooseframework.org
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
ParsedAddSideset Class Reference

MeshModifier for defining a Sideset by a parsed expression and optionally by looking at the subdomain a side's element belongs to and the side's normal vector. More...

#include <ParsedAddSideset.h>

Inheritance diagram for ParsedAddSideset:
[legend]

Public Types

typedef FunctionParserADBase< Real > ADFunction
 Shorthand for an autodiff function parser object. More...
 
typedef std::shared_ptr< ADFunctionADFunctionPtr
 Shorthand for an smart pointer to an autodiff function parser object. More...
 

Public Member Functions

 ParsedAddSideset (const InputParameters &parameters)
 
virtual void modify () override
 Pure virtual modify function MUST be overridden by children classes. More...
 
void modifyMesh (MooseMesh *mesh, MooseMesh *displaced_mesh)
 The base method called to trigger modification to the Mesh. More...
 
std::vector< std::string > & getDependencies ()
 Return the MeshModifiers that must run before this MeshModifier. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
void setParserFeatureFlags (ADFunctionPtr &)
 apply input paramters to internal feature flags of the parser object More...
 

Public Attributes

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

Protected Member Functions

void setup ()
 This method is used to construct the FE object so we can compute normals of faces. More...
 
void finalize ()
 This method finalizes the object, setting names back in the boundary_info object and releasing memory. More...
 
void flood (const Elem *elem, Point normal, BoundaryID side_id)
 This method implements a recursive flood routine to paint a sideset of mesh to neighboring faces given a starting element and normal. More...
 
BoundaryID getNextBoundaryID () const
 
virtual void initialize ()
 This method is called immediatly before modify to perform any necessary initialization on the modififer before it runs. More...
 
void modifyMeshHelper (MooseMesh *mesh)
 Utility for performing the same operation on both undiplaced and displaced meshes. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 
Real evaluate (ADFunctionPtr &)
 Evaluate FParser object and check EvalError. More...
 
void addFParserConstants (ADFunctionPtr &parser, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions)
 add constants (which can be complex expressions) to the parser object More...
 

Protected Attributes

Real _variance
 
bool _fixed_normal
 
std::unique_ptr< FEBase > _fe_face
 
std::unique_ptr< QGauss > _qface
 
std::map< BoundaryID, std::set< const Elem * > > _visited
 
MooseMesh_mesh_ptr
 Pointer to the mesh. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
const Real _nan
 appropriate not a number value to return More...
 
std::vector< Real > _func_params
 Array to stage the parameters passed to the functions when calling Eval. More...
 
bool _enable_jit
 
bool _enable_ad_cache
 
bool _disable_fpoptimizer
 
bool _enable_auto_optimize
 
bool _fail_on_evalerror
 

Static Protected Attributes

static const char * _eval_error_msg []
 table of FParser eval error codes More...
 

Private Attributes

std::string _function
 function expression More...
 
BoundaryName _sideset_name
 name of the new sideset More...
 
bool _check_subdomains
 whether to check subdomain ids when adding sides or not More...
 
bool _check_normal
 whether to check normals when adding sides or not More...
 
std::vector< SubdomainID_included_ids
 A list of included subdomain ids that the side has to be part of. More...
 
Point _normal
 A normal vector that (if provided) is compared against side's normals. More...
 
ADFunctionPtr _func_F
 function parser object describing the combinatorial geometry More...
 

Detailed Description

MeshModifier for defining a Sideset by a parsed expression and optionally by looking at the subdomain a side's element belongs to and the side's normal vector.

Definition at line 33 of file ParsedAddSideset.h.

Member Typedef Documentation

typedef FunctionParserADBase<Real> FunctionParserUtils::ADFunction
inherited

Shorthand for an autodiff function parser object.

Definition at line 41 of file FunctionParserUtils.h.

typedef std::shared_ptr<ADFunction> FunctionParserUtils::ADFunctionPtr
inherited

Shorthand for an smart pointer to an autodiff function parser object.

Definition at line 44 of file FunctionParserUtils.h.

Constructor & Destructor Documentation

ParsedAddSideset::ParsedAddSideset ( const InputParameters parameters)

Definition at line 51 of file ParsedAddSideset.C.

52  : AddSideSetsBase(parameters),
53  FunctionParserUtils(parameters),
54  _function(parameters.get<std::string>("combinatorial_geometry")),
55  _sideset_name(getParam<BoundaryName>("new_sideset_name")),
56  _check_subdomains(isParamValid("included_subdomain_ids")),
57  _check_normal(parameters.isParamSetByUser("normal")),
59  ? parameters.get<std::vector<SubdomainID>>("included_subdomain_ids")
60  : std::vector<SubdomainID>()),
61  _normal(getParam<Point>("normal"))
62 {
63  // base function object
65 
66  // set FParser internal feature flags
68 
69  // add the constant expressions
71  getParam<std::vector<std::string>>("constant_names"),
72  getParam<std::vector<std::string>>("constant_expressions"));
73 
74  // parse function
75  if (_func_F->Parse(_function, "x,y,z") >= 0)
76  mooseError("Invalid function\n",
77  _function,
78  "\nin ParsedAddSideset ",
79  name(),
80  ".\n",
81  _func_F->ErrorMsg());
82 
83  _func_params.resize(3);
84 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
ADFunctionPtr _func_F
function parser object describing the combinatorial geometry
void addFParserConstants(ADFunctionPtr &parser, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions)
add constants (which can be complex expressions) to the parser object
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
BoundaryName _sideset_name
name of the new sideset
FunctionParserADBase< Real > ADFunction
Shorthand for an autodiff function parser object.
std::shared_ptr< ADFunction > ADFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
AddSideSetsBase(const InputParameters &parameters)
FunctionParserUtils(const InputParameters &parameters)
bool _check_subdomains
whether to check subdomain ids when adding sides or not
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
std::vector< SubdomainID > _included_ids
A list of included subdomain ids that the side has to be part of.
bool _check_normal
whether to check normals when adding sides or not
Point _normal
A normal vector that (if provided) is compared against side&#39;s normals.
std::vector< Real > _func_params
Array to stage the parameters passed to the functions when calling Eval.
void setParserFeatureFlags(ADFunctionPtr &)
apply input paramters to internal feature flags of the parser object
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
std::string _function
function expression

Member Function Documentation

void FunctionParserUtils::addFParserConstants ( ADFunctionPtr parser,
const std::vector< std::string > &  constant_names,
const std::vector< std::string > &  constant_expressions 
)
protectedinherited

add constants (which can be complex expressions) to the parser object

Definition at line 102 of file FunctionParserUtils.C.

Referenced by ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), and ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier().

105 {
106  // check constant vectors
107  unsigned int nconst = constant_expressions.size();
108  if (nconst != constant_expressions.size())
109  mooseError("The parameter vectors constant_names and constant_values must have equal length.");
110 
111  // previously evaluated constant_expressions may be used in following constant_expressions
112  std::vector<Real> constant_values(nconst);
113 
114  for (unsigned int i = 0; i < nconst; ++i)
115  {
116  ADFunctionPtr expression = ADFunctionPtr(new ADFunction());
117 
118  // set FParser internal feature flags
119  setParserFeatureFlags(expression);
120 
121  // add previously evaluated constants
122  for (unsigned int j = 0; j < i; ++j)
123  if (!expression->AddConstant(constant_names[j], constant_values[j]))
124  mooseError("Invalid constant name in ParsedMaterialHelper");
125 
126  // build the temporary comnstant expression function
127  if (expression->Parse(constant_expressions[i], "") >= 0)
128  mooseError("Invalid constant expression\n",
129  constant_expressions[i],
130  "\n in parsed function object.\n",
131  expression->ErrorMsg());
132 
133  constant_values[i] = expression->Eval(NULL);
134 
135  if (!parser->AddConstant(constant_names[i], constant_values[i]))
136  mooseError("Invalid constant name in parsed function object");
137  }
138 }
FunctionParserADBase< Real > ADFunction
Shorthand for an autodiff function parser object.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::shared_ptr< ADFunction > ADFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
void setParserFeatureFlags(ADFunctionPtr &)
apply input paramters to internal feature flags of the parser object
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
Real FunctionParserUtils::evaluate ( ADFunctionPtr parser)
protectedinherited

Evaluate FParser object and check EvalError.

Definition at line 77 of file FunctionParserUtils.C.

Referenced by ParsedODEKernel::computeQpJacobian(), ParsedODEKernel::computeQpOffDiagJacobian(), ParsedODEKernel::computeQpResidual(), ParsedAux::computeValue(), modify(), and ParsedSubdomainMeshModifier::modify().

78 {
79  // null pointer is a shortcut for vanishing derivatives, see functionsOptimize()
80  if (parser == NULL)
81  return 0.0;
82 
83  // evaluate expression
84  Real result = parser->Eval(_func_params.data());
85 
86  // fetch fparser evaluation error
87  int error_code = parser->EvalError();
88 
89  // no error
90  if (error_code == 0)
91  return result;
92 
93  // hard fail or return not a number
95  mooseError("DerivativeParsedMaterial function evaluation encountered an error: ",
96  _eval_error_msg[(error_code < 0 || error_code > 5) ? 0 : error_code]);
97 
98  return _nan;
99 }
static const char * _eval_error_msg[]
table of FParser eval error codes
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const Real _nan
appropriate not a number value to return
std::vector< Real > _func_params
Array to stage the parameters passed to the functions when calling Eval.
void AddSideSetsBase::finalize ( )
protectedinherited

This method finalizes the object, setting names back in the boundary_info object and releasing memory.

Definition at line 67 of file AddSideSetsBase.C.

Referenced by SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), modify(), SideSetsAroundSubdomain::modify(), and AddAllSideSetsByNormals::modify().

68 {
69  _qface.reset();
70  _fe_face.reset();
71 }
std::unique_ptr< FEBase > _fe_face
std::unique_ptr< QGauss > _qface
void AddSideSetsBase::flood ( const Elem *  elem,
Point  normal,
BoundaryID  side_id 
)
protectedinherited

This method implements a recursive flood routine to paint a sideset of mesh to neighboring faces given a starting element and normal.

Definition at line 74 of file AddSideSetsBase.C.

Referenced by SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), and AddAllSideSetsByNormals::modify().

75 {
76  if (elem == nullptr || (_visited[side_id].find(elem) != _visited[side_id].end()))
77  return;
78 
79  _visited[side_id].insert(elem);
80  for (unsigned int side = 0; side < elem->n_sides(); ++side)
81  {
82  if (elem->neighbor_ptr(side))
83  continue;
84 
85  _fe_face->reinit(elem, side);
86  const std::vector<Point> normals = _fe_face->get_normals();
87 
88  // We'll just use the normal of the first qp
89  if (std::abs(1.0 - normal * normals[0]) <= _variance)
90  {
91  _mesh_ptr->getMesh().get_boundary_info().add_side(elem, side, side_id);
92  for (unsigned int neighbor = 0; neighbor < elem->n_sides(); ++neighbor)
93  {
94  // Flood to the neighboring elements using the current matching side normal from this
95  // element.
96  // This will allow us to tolerate small changes in the normals so we can "paint" around a
97  // curve.
98  flood(elem->neighbor_ptr(neighbor), _fixed_normal ? normal : normals[0], side_id);
99  }
100  }
101  }
102 }
std::unique_ptr< FEBase > _fe_face
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
std::map< BoundaryID, std::set< const Elem * > > _visited
void flood(const Elem *elem, Point normal, BoundaryID side_id)
This method implements a recursive flood routine to paint a sideset of mesh to neighboring faces give...
std::vector<std::string>& MeshModifier::getDependencies ( )
inlineinherited

Return the MeshModifiers that must run before this MeshModifier.

Definition at line 52 of file MeshModifier.h.

52 { return _depends_on; }
std::vector< std::string > _depends_on
A list of modifiers that are required to run before this modifier may run.
Definition: MeshModifier.h:78
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
BoundaryID AddSideSetsBase::getNextBoundaryID ( ) const
protectedinherited
template<typename T >
const T & MooseObject::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 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), MeshExtruder::modify(), AddExtraNodeset::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
virtual void MeshModifier::initialize ( )
inlineprotectedvirtualinherited

This method is called immediatly before modify to perform any necessary initialization on the modififer before it runs.

Definition at line 59 of file MeshModifier.h.

Referenced by MeshModifier::modifyMesh().

59 {}
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), MultiAppNearestNodeTransfer::getLocalNodes(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
void ParsedAddSideset::modify ( )
overridevirtual

Pure virtual modify function MUST be overridden by children classes.

This is where the MeshModifier actually does it's work.

Implements MeshModifier.

Definition at line 87 of file ParsedAddSideset.C.

88 {
89  // this mesh modifier works only on replicated meshes
90  _mesh_ptr->errorIfDistributedMesh("ParsedAddSideset");
91 
92  setup();
93 
94  MeshBase & mesh = _mesh_ptr->getMesh();
95 
96  // Get a reference to our BoundaryInfo object for later use
97  BoundaryInfo & boundary_info = mesh.get_boundary_info();
98 
99  // Get the BoundaryIDs from the mesh
100  std::vector<BoundaryID> boundary_ids = _mesh_ptr->getBoundaryIDs({_sideset_name}, true);
101  mooseAssert(boundary_ids.size() == 1, "Length of boundary_ids should be one");
102 
103  for (const auto & elem : mesh.active_element_ptr_range())
104  {
105  SubdomainID curr_subdomain = elem->subdomain_id();
106 
107  // check if the element is included
108  if (_check_subdomains &&
109  std::find(_included_ids.begin(), _included_ids.end(), curr_subdomain) ==
110  _included_ids.end())
111  continue;
112 
113  for (unsigned int side = 0; side < elem->n_sides(); ++side)
114  {
115  _fe_face->reinit(elem, side);
116  const std::vector<Point> & normals = _fe_face->get_normals();
117 
118  // check normal if requested
119  if (_check_normal && std::abs(1.0 - _normal * normals[0]) > _variance)
120  continue;
121 
122  // check expression
123  std::unique_ptr<Elem> curr_side = elem->side(side);
124  _func_params[0] = curr_side->centroid()(0);
125  _func_params[1] = curr_side->centroid()(1);
126  _func_params[2] = curr_side->centroid()(2);
127  if (evaluate(_func_F))
128  boundary_info.add_side(elem, side, boundary_ids[0]);
129  }
130  }
131  finalize();
132  boundary_info.sideset_name(boundary_ids[0]) = _sideset_name;
133  boundary_info.nodeset_name(boundary_ids[0]) = _sideset_name;
134 }
ADFunctionPtr _func_F
function parser object describing the combinatorial geometry
Real evaluate(ADFunctionPtr &)
Evaluate FParser object and check EvalError.
BoundaryName _sideset_name
name of the new sideset
subdomain_id_type SubdomainID
Definition: MooseTypes.h:77
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1951
std::unique_ptr< FEBase > _fe_face
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Definition: MooseMesh.C:2473
void finalize()
This method finalizes the object, setting names back in the boundary_info object and releasing memory...
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
bool _check_subdomains
whether to check subdomain ids when adding sides or not
std::vector< SubdomainID > _included_ids
A list of included subdomain ids that the side has to be part of.
bool _check_normal
whether to check normals when adding sides or not
Point _normal
A normal vector that (if provided) is compared against side&#39;s normals.
std::vector< Real > _func_params
Array to stage the parameters passed to the functions when calling Eval.
void setup()
This method is used to construct the FE object so we can compute normals of faces.
void MeshModifier::modifyMesh ( MooseMesh mesh,
MooseMesh displaced_mesh 
)
inherited

The base method called to trigger modification to the Mesh.

This method can trigger (re-)initialiation of the Mesh if necessary, modify the mesh through the virtual override, and also force prepare the mesh if requested.

Definition at line 47 of file MeshModifier.C.

48 {
49  // Initialize or reinitialize any mesh related structures.
50  initialize();
51 
52  modifyMeshHelper(mesh);
53 
54  // Now do the same thing for the displaced mesh if it exists
55  if (displaced_mesh)
56  modifyMeshHelper(displaced_mesh);
57 }
virtual void initialize()
This method is called immediatly before modify to perform any necessary initialization on the modifif...
Definition: MeshModifier.h:59
void modifyMeshHelper(MooseMesh *mesh)
Utility for performing the same operation on both undiplaced and displaced meshes.
Definition: MeshModifier.C:60
void MeshModifier::modifyMeshHelper ( MooseMesh mesh)
protectedinherited

Utility for performing the same operation on both undiplaced and displaced meshes.

Definition at line 60 of file MeshModifier.C.

Referenced by MeshModifier::initialize(), and MeshModifier::modifyMesh().

61 {
62  // Set pointer to the mesh so that derived classes may use them
63  _mesh_ptr = mesh;
64 
65  // Modify the mesh!
66  modify();
67 
68  // Prepare the mesh if requested
69  if (_force_prepare)
70  mesh->prepare();
71 }
virtual void modify()=0
Pure virtual modify function MUST be overridden by children classes.
const bool _force_prepare
Flag to determine if the mesh should be prepared after this modifier is run.
Definition: MeshModifier.h:81
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
void prepare(bool force=false)
Calls prepare_for_use() if force=true on the underlying Mesh object, then communicates various bounda...
Definition: MooseMesh.C:311
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromPoints::modify(), SideSetsFromNormals::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), XDA::output(), VTKOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
void FunctionParserUtils::setParserFeatureFlags ( ADFunctionPtr parser)
inherited

apply input paramters to internal feature flags of the parser object

Definition at line 70 of file FunctionParserUtils.C.

Referenced by FunctionParserUtils::addFParserConstants(), ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), and ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier().

71 {
72  parser->SetADFlags(ADFunction::ADCacheDerivatives, _enable_ad_cache);
73  parser->SetADFlags(ADFunction::ADAutoOptimize, _enable_auto_optimize);
74 }
void AddSideSetsBase::setup ( )
protectedinherited

This method is used to construct the FE object so we can compute normals of faces.

Additionaly this method also grabs the sideset ids from the mesh given a list of sideset names.

Definition at line 51 of file AddSideSetsBase.C.

Referenced by SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), modify(), SideSetsAroundSubdomain::modify(), and AddAllSideSetsByNormals::modify().

52 {
53  mooseAssert(_mesh_ptr, "Mesh pointer is NULL");
54  mooseAssert(_fe_face == nullptr, "FE Face has already been initialized");
55 
56  unsigned int dim = _mesh_ptr->dimension();
57 
58  // Setup the FE Object so we can calculate normals
59  FEType fe_type(Utility::string_to_enum<Order>("CONSTANT"),
60  Utility::string_to_enum<FEFamily>("MONOMIAL"));
61  _fe_face = FEBase::build(dim, fe_type);
62  _qface = libmesh_make_unique<QGauss>(dim - 1, FIRST);
63  _fe_face->attach_quadrature_rule(_qface.get());
64 }
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:1945
std::unique_ptr< FEBase > _fe_face
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
std::unique_ptr< QGauss > _qface

Member Data Documentation

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen::NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

bool ParsedAddSideset::_check_normal
private

whether to check normals when adding sides or not

Definition at line 50 of file ParsedAddSideset.h.

Referenced by modify().

bool ParsedAddSideset::_check_subdomains
private

whether to check subdomain ids when adding sides or not

Definition at line 47 of file ParsedAddSideset.h.

Referenced by modify().

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().

bool FunctionParserUtils::_disable_fpoptimizer
protectedinherited

Definition at line 61 of file FunctionParserUtils.h.

Referenced by ParsedAux::ParsedAux(), and ParsedODEKernel::ParsedODEKernel().

bool FunctionParserUtils::_enable_ad_cache
protectedinherited

Definition at line 60 of file FunctionParserUtils.h.

Referenced by FunctionParserUtils::setParserFeatureFlags().

bool FunctionParserUtils::_enable_auto_optimize
protectedinherited

Definition at line 62 of file FunctionParserUtils.h.

Referenced by FunctionParserUtils::setParserFeatureFlags().

bool FunctionParserUtils::_enable_jit
protectedinherited

Definition at line 59 of file FunctionParserUtils.h.

Referenced by ParsedAux::ParsedAux(), and ParsedODEKernel::ParsedODEKernel().

const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

const char * FunctionParserUtils::_eval_error_msg
staticprotectedinherited
Initial value:
= {
"Unknown",
"Division by zero",
"Square root of a negative value",
"Logarithm of negative value",
"Trigonometric error (asin or acos of illegal value)",
"Maximum recursion level reached"}

table of FParser eval error codes

Definition at line 70 of file FunctionParserUtils.h.

Referenced by FunctionParserUtils::evaluate(), and validParams< FunctionParserUtils >().

bool FunctionParserUtils::_fail_on_evalerror
protectedinherited

Definition at line 63 of file FunctionParserUtils.h.

Referenced by FunctionParserUtils::evaluate().

std::unique_ptr<FEBase> AddSideSetsBase::_fe_face
protectedinherited
bool AddSideSetsBase::_fixed_normal
protectedinherited

Definition at line 63 of file AddSideSetsBase.h.

Referenced by AddSideSetsBase::flood().

ADFunctionPtr ParsedAddSideset::_func_F
private

function parser object describing the combinatorial geometry

Definition at line 59 of file ParsedAddSideset.h.

Referenced by modify(), and ParsedAddSideset().

std::vector<Real> FunctionParserUtils::_func_params
protectedinherited
std::string ParsedAddSideset::_function
private

function expression

Definition at line 41 of file ParsedAddSideset.h.

Referenced by ParsedAddSideset().

std::vector<SubdomainID> ParsedAddSideset::_included_ids
private

A list of included subdomain ids that the side has to be part of.

Definition at line 53 of file ParsedAddSideset.h.

Referenced by modify().

MooseMesh* MeshModifier::_mesh_ptr
protectedinherited
const std::string& MooseObject::_name
protectedinherited
const Real FunctionParserUtils::_nan
protectedinherited

appropriate not a number value to return

Definition at line 67 of file FunctionParserUtils.h.

Referenced by FunctionParserUtils::evaluate().

Point ParsedAddSideset::_normal
private

A normal vector that (if provided) is compared against side's normals.

Definition at line 56 of file ParsedAddSideset.h.

Referenced by modify().

const InputParameters& MooseObject::_pars
protectedinherited
std::unique_ptr<QGauss> AddSideSetsBase::_qface
protectedinherited

Definition at line 66 of file AddSideSetsBase.h.

Referenced by AddSideSetsBase::finalize(), and AddSideSetsBase::setup().

BoundaryName ParsedAddSideset::_sideset_name
private

name of the new sideset

Definition at line 44 of file ParsedAddSideset.h.

Referenced by modify().

Real AddSideSetsBase::_variance
protectedinherited

Definition at line 62 of file AddSideSetsBase.h.

Referenced by AddSideSetsBase::flood(), and modify().

std::map<BoundaryID, std::set<const Elem *> > AddSideSetsBase::_visited
protectedinherited

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