22 params.
addRequiredParam<MooseFunctorName>(
"functor",
"The initial condition functor.");
24 params.
addClassDescription(
"An initial condition that uses a normal function of x, y, z to "
25 "produce values (and optionally gradients) for a field variable.");
26 params.
addParam<Real>(
"scaling_factor", 1,
"Scaling factor to apply on the function");
34 _functor(getFunctor<Real>(
"functor")),
35 _scaling(getParam<Real>(
"scaling_factor"))
38 const auto & functor_name = getParam<MooseFunctorName>(
"functor");
43 "Initializing a variable with another variable is not supported at this time");
51 "Functor materials or postprocessors should not depend on variables if used in a "
61 const auto & functor_name = getParam<MooseFunctorName>(
"functor");
63 if (!(_fe_problem.getUserObjectBase(functor_name).isParamValid(
"force_preic") &&
64 _fe_problem.getUserObjectBase(functor_name).getParam<bool>(
"force_preic")))
66 "Functor is a postprocessor and does not have 'force_preic' set to true");
registerMooseObject("MooseApp", FunctorIC)
virtual const std::set< SubdomainID > & blockIDs() const
Return the block subdomain ids for this object Note, if this is not block restricted,...
virtual bool blockRestricted() const
Returns true if this object has been restricted to a block.
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
Defines an initial condition using a functor.
static InputParameters validParams()
virtual RealGradient gradient(const Point &p) override
The value of the gradient at a point.
FunctorIC(const InputParameters ¶meters)
const Moose::Functor< Real > & _functor
Function to evaluate to form the initial condition.
const Real _scaling
Scaling factor, to be able to use a functor with multiple ICs.
virtual Real value(const Point &p) override
The value of the variable at a point.
This is a template class that implements the workhorse compute and computeNodal methods.
FEProblemBase & _fe_problem
const Node * _current_node
The current node if the point we are evaluating at also happens to be a node.
const Elem *const & _current_elem
The current element we are on will retrieving values at specific points in the domain.
MooseVariableField< T > & _var
The variable that this initial condition is acting upon.
static InputParameters validParams()
void paramInfo(const std::string ¶m, Args... args) const
Emits an informational message prefixed with the file and line number of the given param (from the in...
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
virtual bool isNodalDefined() const =0
Is this variable defined at nodes.
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
static InputParameters validParams()
bool parsesToReal(const std::string &input, Real *parsed_real)
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
static const std::set< SubdomainID > undefined_subdomain_connection
A static member that can be used when the connection of a node to subdomains is unknown.