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 "ParsedMaterial.h" 11 : 12 : registerMooseObject("MooseApp", ParsedMaterial); 13 : registerMooseObject("MooseApp", ADParsedMaterial); 14 : 15 : template <bool is_ad> 16 : InputParameters 17 30399 : ParsedMaterialTempl<is_ad>::validParams() 18 : { 19 30399 : InputParameters params = ParsedMaterialHelper<is_ad>::validParams(); 20 30399 : params += ParsedMaterialBase::validParams(); 21 30399 : params.addClassDescription("Parsed expression Material."); 22 30399 : return params; 23 0 : } 24 : 25 : template <bool is_ad> 26 1431 : ParsedMaterialTempl<is_ad>::ParsedMaterialTempl(const InputParameters & parameters) 27 : : ParsedMaterialHelper<is_ad>(parameters, VariableNameMappingMode::USE_MOOSE_NAMES), 28 1431 : ParsedMaterialBase(parameters, this) 29 : { 30 : 31 : // get all reserved names 32 1431 : std::set<std::string> reserved_names; 33 1431 : ParsedMaterialHelper<is_ad>::insertReservedNames(reserved_names); 34 : 35 : // validate, reserved names are not used 36 1431 : ParsedMaterialBase::validateVectorNames(reserved_names); 37 : 38 : // Build function and optimize 39 2862 : functionParse(_function, 40 1431 : _constant_names, 41 1431 : _constant_expressions, 42 : this->template getParam<std::vector<std::string>>("material_property_names"), 43 : this->template getParam<std::vector<PostprocessorName>>("postprocessor_names"), 44 1431 : _tol_names, 45 1431 : _tol_values, 46 1431 : _functor_names, 47 1431 : _functor_symbols); 48 1431 : } 49 : 50 : // explicit instantiation 51 : template class ParsedMaterialTempl<false>; 52 : template class ParsedMaterialTempl<true>;