https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConstantAux.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 "ConstantAux.h"
11
13
16{
18 params.addClassDescription("Creates a constant field in the domain.");
19 params.addParam<Real>("value", 0.0, "Some constant value that can be read from the input file");
20 params.declareControllable("value");
21 return params;
22}
23
25 : AuxKernel(parameters), _value(getParam<Real>("value"))
26{
27}
28
29Real
31{
32 return _value;
33}
registerMooseObject("MooseApp", ConstantAux)
static InputParameters validParams()
Definition AuxKernel.C:27
Constant auxiliary value.
Definition ConstantAux.h:18
ConstantAux(const InputParameters &parameters)
Definition ConstantAux.C:24
static InputParameters validParams()
Definition ConstantAux.C:15
virtual Real computeValue() override
Compute and return the value of the aux variable.
Definition ConstantAux.C:30
const Real & _value
The value being set for the current node/element.
Definition ConstantAux.h:28
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.