https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ArrayConstantIC.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 "ArrayConstantIC.h"
11
13
16{
18 params.addRequiredParam<RealEigenVector>("value", "The values to be set in IC");
19 params.addClassDescription("Sets constant component values for an array field variable.");
20 return params;
21}
22
24 : ArrayInitialCondition(parameters), _value(getParam<RealEigenVector>("value"))
25{
26 if (_var.count() != _value.size())
27 mooseError("'value' size is inconsistent to the number of components of the array variable");
28}
29
30RealEigenVector
31ArrayConstantIC::value(const Point & /*p*/)
32{
33 return _value;
34}
registerMooseObject("MooseApp", ArrayConstantIC)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
static InputParameters validParams()
virtual RealEigenVector value(const Point &p) override
The value of the variable at a point.
const RealEigenVector _value
ArrayConstantIC(const InputParameters &parameters)
This is a template class that implements the workhorse compute and computeNodal methods.
MooseVariableField< T > & _var
The variable that this initial condition is acting upon.
static InputParameters validParams()
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.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one.