LCOV - code coverage report
Current view: top level - src/materials - ParsedMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 909fe5 Lines: 18 19 94.7 %
Date: 2025-08-29 20:01:24 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14