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 : #ifdef MOOSE_LIBTORCH_ENABLED 10 : 11 : #include "CovarianceInterface.h" 12 : #include "CovarianceFunctionBase.h" 13 : 14 : InputParameters 15 0 : CovarianceInterface::validParams() 16 : { 17 0 : return emptyInputParameters(); 18 : } 19 : 20 724 : CovarianceInterface::CovarianceInterface(const InputParameters & parameters) 21 724 : : _covar_feproblem(*parameters.get<FEProblemBase *>("_fe_problem_base")) 22 : { 23 724 : } 24 : 25 : CovarianceFunctionBase * 26 264 : CovarianceInterface::getCovarianceFunctionByName(const UserObjectName & name) const 27 : { 28 : std::vector<CovarianceFunctionBase *> models; 29 264 : _covar_feproblem.theWarehouse() 30 264 : .query() 31 264 : .condition<AttribName>(name) 32 264 : .condition<AttribSystem>("CovarianceFunction") 33 : .queryInto(models); 34 264 : if (models.empty()) 35 0 : mooseError("Unable to find a CovarianceFunction object with the name '" + name + "'"); 36 264 : return models[0]; 37 264 : } 38 : 39 : #endif