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 "SpecifiedViewFactor.h" 11 : 12 : registerMooseObject("HeatTransferApp", SpecifiedViewFactor); 13 : 14 : InputParameters 15 43 : SpecifiedViewFactor::validParams() 16 : { 17 43 : InputParameters params = ViewFactorBase::validParams(); 18 86 : params.addRequiredParam<std::vector<std::vector<Real>>>( 19 : "view_factors", "The view factors from sideset i to sideset j."); 20 43 : params.addClassDescription("View factors specified directly in the input file"); 21 43 : return params; 22 0 : } 23 : 24 26 : SpecifiedViewFactor::SpecifiedViewFactor(const InputParameters & parameters) 25 26 : : ViewFactorBase(parameters) 26 : { 27 52 : _view_factors = getParam<std::vector<std::vector<Real>>>("view_factors"); 28 : 29 26 : checkViewFactors(); 30 22 : } 31 : 32 : void 33 26 : SpecifiedViewFactor::checkViewFactors() const 34 : { 35 : // check that the input has the right format 36 26 : if (_view_factors.size() != _n_sides) 37 2 : paramError("view_factors", 38 : "Leading dimension of view_factors must be equal to number of side sets."); 39 : 40 108 : for (unsigned int i = 0; i < _n_sides; ++i) 41 86 : if (_view_factors[i].size() != _n_sides) 42 2 : paramError("view_factors", 43 : "view_factors must be provided as square array. Row ", 44 : i, 45 : " has ", 46 : _view_factors[i].size(), 47 : " entries."); 48 22 : }