Line data Source code
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 "GenericConstant2DArray.h" 11 : 12 : registerMooseObject("MooseApp", GenericConstant2DArray); 13 : 14 : InputParameters 15 14849 : GenericConstant2DArray::validParams() 16 : { 17 : 18 14849 : InputParameters params = Material::validParams(); 19 14849 : params.addRequiredParam<std::string>("prop_name", 20 : "The names of the properties this material will have"); 21 14849 : params.addRequiredParam<RealEigenMatrix>("prop_value", 22 : "The values associated with the named properties"); 23 14849 : params.declareControllable("prop_value"); 24 14849 : params.addClassDescription( 25 : "A material evaluating one material property in type of RealEigenMatrix"); 26 14849 : params.set<MooseEnum>("constant_on") = "SUBDOMAIN"; 27 14849 : return params; 28 0 : } 29 : 30 447 : GenericConstant2DArray::GenericConstant2DArray(const InputParameters & parameters) 31 : : Material(parameters), 32 447 : _prop_name(getParam<std::string>("prop_name")), 33 447 : _prop_value(getParam<RealEigenMatrix>("prop_value")), 34 894 : _property(declareProperty<RealEigenMatrix>(_prop_name)) 35 : { 36 447 : } 37 : 38 : void 39 0 : GenericConstant2DArray::initQpStatefulProperties() 40 : { 41 0 : computeQpProperties(); 42 0 : } 43 : 44 : void 45 14928 : GenericConstant2DArray::computeQpProperties() 46 : { 47 14928 : _property[_qp] = _prop_value; 48 14928 : }