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 "Sampler1DVector.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", Sampler1DVector); 13 : 14 : InputParameters 15 38 : Sampler1DVector::validParams() 16 : { 17 38 : InputParameters params = Sampler1DBase<Real>::validParams(); 18 76 : params.addRequiredParam<unsigned int>("index", 19 : "Index of the vector property component to sample"); 20 38 : params.addClassDescription("Samples a single component of array material properties at all " 21 : "quadrature points in mesh block(s)"); 22 38 : return params; 23 0 : } 24 : 25 19 : Sampler1DVector::Sampler1DVector(const InputParameters & parameters) 26 38 : : Sampler1DBase<std::vector<Real>>(parameters), _index(getParam<unsigned int>("index")) 27 : { 28 19 : } 29 : 30 : Real 31 90 : Sampler1DVector::getScalarFromProperty(const std::vector<Real> & property, 32 : const Point & /*curr_point*/) 33 : { 34 90 : return property[_index]; 35 : }