20 params.
addClassDescription(
"Creates fields by using information from a SolutionUserObject.");
21 params.
addRequiredParam<UserObjectName>(
"solution",
"The name of the SolutionUserObject");
22 params.
addParam<std::string>(
"from_variable",
23 "The name of the variable to extract from the file");
28 "If true the meshes must be the same and then the values are simply copied over.");
32 "Scale factor (a) to be applied to the solution (x): ax+b, where b is the 'add_factor'");
36 "Add this value (b) to the solution (x): ax+b, where a is the 'scale_factor'");
43 _direct(getParam<bool>(
"direct")),
44 _scale_factor(getParam<
Real>(
"scale_factor")),
45 _add_factor(getParam<
Real>(
"add_factor"))
54 _var_name = getParam<std::string>(
"from_variable");
64 mooseError(
"The SolutionUserObject contains multiple variables, please specify the desired " 65 "variables in the input file with 'from_variable' parameter.");
registerMooseObject("MooseApp", SolutionAux)
static InputParameters validParams()
const std::vector< std::string > & variableNames() const
const Node *const & _current_node
Current node (valid only for nodal kernels)
virtual Real computeValue() override
Computes a value for a node or element depending on the type of kernel, it also uses the 'direct' fla...
const SolutionUserObject & _solution_object
Reference to the SolutionUserObject storing the solution.
SolutionAux(const InputParameters ¶meters)
Real directValue(const Node *node, const std::string &var_name) const
Return a value directly from a Node.
virtual void initialSetup() override
Sets up the variable name for extraction from the SolutionUserObject.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const Real _add_factor
Additional factor added to the solution, the b of ax+b.
std::string _var_name
The variable name of interest.
const Real _scale_factor
Multiplier for the solution, the a of ax+b.
bool _direct
Flag for directly grabbing the data based on the dof.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
AuxKernel for reading a solution from file.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
static InputParameters validParams()
Real pointValue(Real t, const Point &p, const unsigned int local_var_index, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns a value at a specific location and variable (see SolutionFunction)
User object that reads an existing solution from an input file and uses it in the current simulation...
bool isNodal() const
Nodal or elemental kernel?