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 "PiecewiseBase.h" 11 : #include "DelimitedFileReader.h" 12 : 13 : InputParameters 14 74959 : PiecewiseBase::validParams() 15 : { 16 74959 : return Function::validParams(); 17 : } 18 : 19 1912 : PiecewiseBase::PiecewiseBase(const InputParameters & parameters) : Function(parameters) {} 20 : 21 : Real 22 14291 : PiecewiseBase::functionSize() const 23 : { 24 14291 : return _raw_x.size(); 25 : } 26 : 27 : Real 28 77809 : PiecewiseBase::domain(const int i) const 29 : { 30 77809 : return _raw_x[i]; 31 : } 32 : 33 : Real 34 14153 : PiecewiseBase::range(const int i) const 35 : { 36 14153 : return _raw_y[i]; 37 : } 38 : 39 : void 40 13 : PiecewiseBase::setData(const std::vector<Real> & x, const std::vector<Real> & y) 41 : { 42 13 : _raw_x = x; 43 13 : _raw_y = y; 44 13 : if (_raw_x.size() != _raw_y.size()) 45 0 : mooseError("In PiecewiseBase ", _name, ": Lengths of x and y data do not match."); 46 13 : }