https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FunctionScalarAux.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "FunctionScalarAux.h"
11#include "Function.h"
12
14
17{
19 params.addClassDescription("Sets a value of a scalar variable based on a function.");
20 params.addRequiredParam<std::vector<FunctionName>>(
21 "function", "The functions to set the scalar variable components.");
22
23 return params;
24}
25
27 : AuxScalarKernel(parameters)
28{
29 std::vector<FunctionName> funcs = getParam<std::vector<FunctionName>>("function");
30 if (funcs.size() != _var.order())
31 mooseError("number of functions is not equal to the number of scalar variable components");
32
33 for (const auto & func : funcs)
34 _functions.push_back(&getFunctionByName(func));
35}
36
37Real
registerMooseObject("MooseApp", FunctionScalarAux)
Base class for making kernels that work on auxiliary scalar variables.
unsigned int _i
static InputParameters validParams()
MooseVariableScalar & _var
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
Sets a value of a scalar variable based on the function.
static InputParameters validParams()
std::vector< const Function * > _functions
virtual Real computeValue() override
Compute the value of this kernel.
FunctionScalarAux(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int.
const Point & _point_zero
Zero point.