https://mooseframework.inl.gov
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 
12 #include "libmesh/point.h"
13 
15 
18 {
20  params.addRequiredParam<RealEigenVector>("value", "The values to be set in IC");
21  params.addClassDescription("Sets constant component values for an array field variable.");
22  return params;
23 }
24 
26  : ArrayInitialCondition(parameters), _value(getParam<RealEigenVector>("value"))
27 {
28  if (_var.count() != _value.size())
29  mooseError("'value' size is inconsistent to the number of components of the array variable");
30 }
31 
33 ArrayConstantIC::value(const Point & /*p*/)
34 {
35  return _value;
36 }
This is a template class that implements the workhorse compute and computeNodal methods.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
registerMooseObject("MooseApp", ArrayConstantIC)
MooseVariableField< T > & _var
The variable that this initial condition is acting upon.
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...
virtual RealEigenVector value(const Point &p) override
The value of the variable at a point.
const RealEigenVector _value
static InputParameters validParams()
ArrayConstantIC(const InputParameters &parameters)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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...
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146